/* * @Author: yangzilong * @Date: 2021-12-17 20:27:57 * @Last Modified by: yangzilong * @Email: yangzilong@objecteye.com * @Description: */ #pragma once #include "utools.h" #include "stl_aiplatform_header.h" #include #include #include #include #include #include "task_param_manager.h" #include "mvpt_process_assist.h" #include "../helpers/cuda_helper.h" // #define EXPANSION_PROPORTION 0.1 #define EXPANSION_PROPORTION 0.25 #define FACE_EXPANSION_PROPORTION 0.5 #define IMG_CHANNELS 3 // using namespace std; using std::vector; using std::map; using std::set; class snapshot_reprocessing { public: //更新最优快照 static snapshot_reprocessing* getInstance() { static snapshot_reprocessing snapshot_reprocessing_instance; return &snapshot_reprocessing_instance; } /** * @brief * * @param taskin_play_id [in]: * @param images [in]: * @param ol_det_result [in]: * @param delete_object_id [in]: nothing ??? * @return int */ int update_bestsnapshot(set& task_in_play_id, sy_img* images, vector &ol_det_result, vector>& delete_object_id); int update_face_bestsnapshot(set& task_in_play_id, sy_img* images, vector &ol_det_result, vector>& delete_object_id); int update_bestsnapshot2(vector& task_in_play_id, sy_img* images, vector &ol_det_result, vector>& delete_object_id); int update_face_bestsnapshot2(vector& task_in_play_id, sy_img* images, vector &ol_det_result, vector>& delete_object_id); void snapshot_reprocessing_release(); private: snapshot_reprocessing(); // 用于记录每张大图抠小图需要的信息 unsigned char* snapshot_image_data[MAX_OBJ_COUNT]{}; int snapshot_left[MAX_OBJ_COUNT]{}; int snapshot_right[MAX_OBJ_COUNT]{}; int snapshot_top[MAX_OBJ_COUNT]{}; int snapshot_bottom[MAX_OBJ_COUNT]{}; int snapshot_dst_width[MAX_OBJ_COUNT]{}; int snapshot_dst_height[MAX_OBJ_COUNT]{}; map total_snapshot_info; map total_face_snapshot_info; //保存的人脸快照map map> algor_index_table; task_param_manager *m_task_param_manager; public: map *get_total_snapshot_info(); map *get_total_face_snapshot_info(); //返回保存的人脸快照map void screen_effective_snapshot(const set &taskid_inplay, vector &_onelevel_det_result); void screen_effective_snapshot2(const vector &taskid_inplay, vector &_onelevel_det_result); bool snapshot_judge_algor(int index, int width, int height); bool best_snapshot_judge_algor(const OBJ_KEY& obj_key, const OBJ_VALUE& obj_value, int left, int top, int width, int height, int image_width, int image_height); bool best_face_snapshot_judge_algor(const OBJ_KEY& obj_key, const OBJ_VALUE& obj_value, int left, int top, int width, int height, int image_width, int image_height); bool best_face_snapshot_judge_algor_v2(const OBJ_KEY& obj_key, const OBJ_VALUE& obj_value, int left, int top, int width, int height, int image_width, int image_height, float roll, float yaw, float pitch); //added by zsh 220719 void delete_finishtask_snapshot(const string taskid, const int objid = -1); //-1为删除该路所有任务的快照图 /* bool snapshot_legal_inarea(int width, int height); bool snapshot_legal_minarea(int index, int width, int height); bool snapshot_algor_open_config(const OBJ_KEY& obj_key); bool snapshot_legal_pos(bitset flags, int left, int top, int right, int bottom, int image_width, int image_height); bool snapshot_legal_area(int max_area, int last_area, int left, int top, int right, int bottom);*/ };