From 59fdbeb8f1be899f712c9a507cbc8425aff8f39d Mon Sep 17 00:00:00 2001 From: suntianyu <xuepengqiang@aiotlink.com> Date: 星期三, 28 七月 2021 10:43:10 +0800 Subject: [PATCH] Merge branch '3090' of ssh://192.168.5.5:29418/Algorithm/baseDetector into 3090 --- src/utils/draw_util.cpp | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/utils/draw_util.cpp b/src/utils/draw_util.cpp index 5fe9c73..5e2c5a7 100644 --- a/src/utils/draw_util.cpp +++ b/src/utils/draw_util.cpp @@ -31,12 +31,12 @@ // DEBUG( ":::::::::create folder! error!::::::"); // } // } - DEBUG("=2==create_path:") + DEBUG("=2==create_path:"); char DirName[256]; strcpy(DirName,path); int i,len = strlen(DirName); if(DirName[len-1]!='/') - strcat(DirName,"/"); + strcat(DirName,"/"); len = strlen(DirName); for(i=1;i<len;i++) { @@ -50,7 +50,7 @@ // perror("mkdir error"); // } // } - DEBUG("=1==create_path:") + DEBUG("=1==create_path:"); int a = access(DirName, F_OK); if(a ==-1) { @@ -79,3 +79,25 @@ cv::imshow(to_string(1), mat_img); cv::waitKey(0); } + +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) +{ + cv::Rect tmp_rect; + + for (int i = 0; i < t_result.count; ++i) + { + auto &result = t_result.targets[i]; + tmp_rect = cv::Rect(result.rect.left,result.rect.top,result.rect.right-result.rect.left,result.rect.bottom-result.rect.top); + cv::rectangle(mat_img, tmp_rect , cv::Scalar(50, 200, 50), 2); +// cv::putText(mat_img, std::to_string(result.id), Point((result.rect.left+result.rect.right)/2,result.rect.top+150), CV_FONT_HERSHEY_SIMPLEX, 0.8, Scalar(255,255,0), 2); + } +// delete tmp_rect; + cv::resize(mat_img, mat_img, cv::Size(800,500)); +// cv::imwrite("1111.jpg", mat_img); + // cv::imshow("RESULT", mat_img); + writer<< mat_img; + // cv::waitKey(0); +} -- Gitblit v1.8.0