From 828d98a058038e953603ffebc25d029830a75d80 Mon Sep 17 00:00:00 2001
From: Scheaven <xuepengqiang>
Date: 星期三, 28 七月 2021 10:06:24 +0800
Subject: [PATCH] mo

---
 src/utils/draw_util.cpp |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/utils/draw_util.cpp b/src/utils/draw_util.cpp
index 5fe9c73..4268f9f 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,24 @@
     cv::imshow(to_string(1), mat_img);
     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);
+
+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