/* * @Author: yangzilong * @Date: 2021-12-14 17:51:04 * @Last Modified by: yangzilong * @Email: yangzilong@objecteye.com * @Description: */ #pragma once #include "opencv2/opencv.hpp" #include "opencv2/highgui/highgui.hpp" #include #include "base_reprocessing_unit.h" #include #include #ifdef POST_USE_RABBITMQ #include "post_reprocessing.hpp" #include #endif // #ifdef POST_USE_RABBITMQ using namespace std; // using namespace std; using std::string; using std::queue; #include struct SNAPSHOT_IMAGE_UNIT { cv::Mat image; cv::Mat ori_image; string file_name; string ori_file_name; OBJ_KEY obj_key; algorithm_type_t _algor; sy_rect obj_rect; #ifdef POST_USE_RABBITMQ string json_str; #endif SNAPSHOT_IMAGE_UNIT(int height, int width, int type, float* data) :image(height, width, type, data) {} SNAPSHOT_IMAGE_UNIT(int height, int width, int type, unsigned char* data) :image(height, width, type, data) {} SNAPSHOT_IMAGE_UNIT(int height, int width, int type, unsigned char* data, int ori_height, int ori_width, int ori_type, unsigned char* ori_data, algorithm_type_t algor) : image(height, width, type, data) , ori_image(ori_height, ori_width, ori_type, ori_data) , _algor(algor) {} SNAPSHOT_IMAGE_UNIT() : _algor(algorithm_type_t::UNKNOWN) {} }; class save_snapshot_reprocessing : public base_reprocessing_unit { public: save_snapshot_reprocessing(); void save_snapshot_reprocessing_release(); void add_newtask(const string taskid); void delete_finishtask(const string taskid); #ifdef POST_USE_RABBITMQ void set_callback(callback_t cb); #endif void reprocessing_process(const OBJ_KEY &obj_key); void reprocessing_process_face(const OBJ_KEY &obj_key); //人脸快照后处理函数 void reprocessing_process_wo_locus(const OBJ_KEY &obj_key, const multi_image_t &m_image, bool enable_async #ifdef POST_USE_RABBITMQ , const std::string &json_str #endif ); public: queue waitforsave_image_queue; mutable std::mutex waitforsave_image_queue_mutex; set task_on_play; // map save_snapshot_info_count; // debug by zsh mutable std::mutex waitforchange_taskid_mutex; #ifdef POST_USE_RABBITMQ callback_t callback_; std::shared_ptr rbmq_handler_; #endif };