| | |
| | | for (int i=0; i<t_result->count; i++) |
| | | { |
| | | cout << "confidence:" << t_result->targets[i].confidence << endl; |
| | | draw_SDK_result(frame, t_result->targets[i]); |
| | | // draw_SDK_result(frame, t_result->targets[i]); |
| | | } |
| | | }else{ |
| | | cout << "------------over--" << endl; |
| | |
| | | AriManager::AriManager()
|
| | | {
|
| | | Config config;
|
| | | // config.net_type = COMMON;
|
| | | config.net_type = COMMON;
|
| | |
|
| | | if(m_staticStruct::type==2)
|
| | | config.net_type = SMALL;
|
| | | else
|
| | |
| | |
|
| | | // cv::imshow("img",image0);
|
| | | // cv::waitKey(0);
|
| | | Timer timer;
|
| | | timer.reset();
|
| | | this->detector->detect(batch_img, batch_res);
|
| | | timer.out("detect");
|
| | |
|
| | | t_result.targets = (Target*)malloc(sizeof(Target)*batch_res[0].size());
|
| | | // 将算法结果转化为标准的格式(以目标检测为例)
|
| | | // 将算法结果转化为标准的格式(以目标检测为例)""
|
| | | int w_count = 0;
|
| | | for (const auto &result_box:batch_res[0])
|
| | | {
|
| | | // if(result_box.id == 0)
|
| | | // {
|
| | | if(result_box.id == 1)
|
| | | {
|
| | | Target target;
|
| | | init_target(&target);
|
| | |
|
| | |
| | |
|
| | | t_result.targets[w_count] = target;
|
| | | w_count ++;
|
| | | // }
|
| | | }
|
| | | }
|
| | | std::cout << "eve batch_res size:: "<< batch_res[0].size() << " w_count: " << w_count <<std::endl;
|
| | | t_result.count = w_count;
|
| | | draw_SDK_result(cam_id, frame, t_result); //多线程无法调用绘图
|
| | | draw_SDK_result(cam_id, frame, t_result); //多线程无法调用绘图
|
| | | }
|
| | |
|
| | | void AriManager::init_target(Target *t){
|
| | |
| | | #include "std_target.h"
|
| | | #include "config.h"
|
| | | #include "detector.h"
|
| | | #include "../utils/draw_util.h"
|
| | |
|
| | | using namespace std;
|
| | | using namespace cv;
|
| | |
| | | cv::waitKey(0);
|
| | | }
|
| | |
|
| | | cv::VideoWriter writer("/opt/vasystem/valog/01_Scheanve/01_baseDetector.avi", cv::VideoWriter::fourcc('M','J','P','G'),24, cv::Size(800,500), true);
|
| | | cv::VideoWriter writer("./01_baseDetector.avi", cv::VideoWriter::fourcc('M','J','P','G'),24, cv::Size(800,500), true);
|
| | | // cv::VideoWriter writer("/opt/vasystem/valog/01_Scheanve/01_baseDetector.avi", cv::VideoWriter::fourcc('M','J','P','G'),24, cv::Size(800,500), true);
|
| | |
|
| | | void draw_SDK_result(const int cam_id, cv::Mat mat_img, TResult& t_result)
|
| | | {
|
| | |
| | | void create_foldert(const char *path);
|
| | |
|
| | | void draw_SDK_result(cv::Mat mat_img, Target& target);
|
| | | void draw_SDK_result(const int cam_id, cv::Mat mat_img, TResult& t_result);
|
| | |
|
| | |
|
| | |
|
| | | #endif //DRAW_UTIL_H
|