#ifndef __REGION_LEAVE_H__ #define __REGION_LEAVE_H__ #include #include #include #include "opencv2/highgui/highgui.hpp" #include "ai_engine_header.h" #include "../ai_platform/task_param_manager.h" #include "../decoder/interface/DeviceMemory.hpp" #include "../reprocessing_module/save_snapshot_reprocessing.h" namespace ai_engine_module { class RegionLeave { public: RegionLeave(); ~RegionLeave(); void init(int devId, algorithm_type_t eType); void process(std::vector& vec_gpuMem, const std::vector &det_result, const vector> &delete_objs); #ifdef POST_USE_RABBITMQ typedef std::function callback_t; void set_callback(callback_t cb); #endif private: bool is_valid_box(string task_id, const box_t &box, const algorithm_type_t &algor_type); private: task_param_manager *m_task_param_manager{nullptr}; std::map obj_to_position_; // 保存物体上一帧的位置,基于非法闯入判断逻辑,上一帧在框外,下一帧闯入禁区 std::map region_map; int m_devId{0}; algorithm_type_t m_eType; save_snapshot_reprocessing *m_save_util{nullptr}; }; } // namespace ai_engine_module #endif // __REGION_LEAVE_H__