#pragma once #include #include #include "../vp_node.h" #include "../../objects/shapes/vp_point.h" #include "../../objects/shapes/vp_line.h" #include "../../objects/vp_image_record_control_meta.h" #include "../../objects/vp_video_record_control_meta.h" namespace vp_nodes { // behaviour analysis node for stop (support multi channels) class vp_ba_person_falldown_node: public vp_node { private: // channel -> status of targets (id -> num of hit frames) std::map> all_person_falldown_checking_status; // channel -> jam status of channel (jam or not) std::map all_person_falldown_results; // channel -> last frame index to notify jam std::map all_last_notifys; // record params bool need_record_image; bool need_record_video; bool isPersonFallen(int person_width, int person_height,float fallThreshold) ; float person_fall_down_threshold = 1.5f; // jam checking logic parameters which may be configed by constructor passed in by user const int check_interval_frames = 1; const int check_min_hit_frames = 2 * 1; // 25 fps * 2 seconds const int check_notify_interval = 10; // interval time (seconds) to notify (ensure not frequently) protected: virtual std::shared_ptr handle_frame_meta(std::shared_ptr meta) override; public: vp_ba_person_falldown_node(std::string node_name, bool need_record_image = true, bool need_record_video = true); ~vp_ba_person_falldown_node(); std::string to_string() override; }; }