From ecb47d89dcb2b1d8e4be9b6cb0a84d8b49e2e3cc Mon Sep 17 00:00:00 2001
From: pansen <pansen626@sina.com>
Date: 星期三, 10 四月 2019 12:20:00 +0800
Subject: [PATCH] 添加iceServer

---
 QiaoJiaSystem/VptServer/VptDetectWrapper.h |   86 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 71 insertions(+), 15 deletions(-)

diff --git a/QiaoJiaSystem/VptServer/VptDetectWrapper.h b/QiaoJiaSystem/VptServer/VptDetectWrapper.h
index a36ea73..b0b65a8 100644
--- a/QiaoJiaSystem/VptServer/VptDetectWrapper.h
+++ b/QiaoJiaSystem/VptServer/VptDetectWrapper.h
@@ -63,12 +63,53 @@
 };
 
 struct CarDetectRes {
+    CarDetectRes() :
+        vehicle_brand(""),
+        vehicle_subbrand(""),
+        vehicle_issue_year(""),
+        vehicle_type(""), freight_ton(""),
+        vehicle_score(0), colorLabel(static_cast<ColorLabel>(-1)),
+        colorLabelProb(0), carPlateRect(0, 0, 0, 0),
+        carPlateRectScore(0), carPlate(""),
+        carPlateScore(0), carPlatetype(-1) {}
+
+    virtual ~CarDetectRes() {
+
+    }
+
+    CarDetectRes(const CarDetectRes &rhs) {
+        this->vehicle_brand = rhs.vehicle_brand;              //杞﹁締鍝佺墝
+        this->vehicle_subbrand = rhs.vehicle_subbrand;           //杞﹁締瀛愬搧鐗�
+        this->vehicle_issue_year = rhs.vehicle_issue_year;         //杞﹁締骞存
+        this->vehicle_type = rhs.vehicle_type;               //杞﹁締绫诲瀷
+        this->freight_ton = rhs.freight_ton;                //璐ц溅鍚ㄧ骇
+        this->vehicle_score = rhs.vehicle_score;                    //杞﹀瀷璇嗗埆缃俊搴�
+
+        //杞﹂鑹茶瘑鍒粨鏋�
+        this->colorLabel = rhs.colorLabel;                  //杞﹂鑹�
+        this->colorLabelProb = rhs.colorLabelProb;                   //杞﹂鑹茬疆淇″害
+
+        //杞︾墝妫�娴嬬粨鏋�
+        this->carPlateRect = rhs.carPlateRect;                   //杞︾墝鍖哄煙
+        this->carPlateRectScore = rhs.carPlateRectScore;                //杞︾墝鍖哄煙缃俊搴�
+        this->carPlate = rhs.carPlate;                   //杞︾墝
+        this->carPlateScore = rhs.carPlateScore;                    //杞︾墝缃俊搴�
+        this->carPlatetype = rhs.carPlatetype;
+    }
+
+
+//    //杞﹀瀷璇嗗埆缁撴灉
+//    std::string vehicle_brand;              //杞﹁締鍝佺墝
+//    std::string vehicle_subbrand;           //杞﹁締瀛愬搧鐗�
+//    std::string vehicle_issue_year;         //杞﹁締骞存
+//    std::string vehicle_type;               //杞﹁締绫诲瀷
+//    std::string freight_ton;                //璐ц溅鍚ㄧ骇
     //杞﹀瀷璇嗗埆缁撴灉
-    std::string vehicle_brand;              //杞﹁締鍝佺墝
-    std::string vehicle_subbrand;           //杞﹁締瀛愬搧鐗�
-    std::string vehicle_issue_year;         //杞﹁締骞存
-    std::string vehicle_type;               //杞﹁締绫诲瀷
-    std::string freight_ton;                //璐ц溅鍚ㄧ骇
+    char *vehicle_brand;              //杞﹁締鍝佺墝
+    char *vehicle_subbrand;           //杞﹁締瀛愬搧鐗�
+    char *vehicle_issue_year;         //杞﹁締骞存
+    char *vehicle_type;               //杞﹁締绫诲瀷
+    char *freight_ton;                //璐ц溅鍚ㄧ骇
     float vehicle_score;                    //杞﹀瀷璇嗗埆缃俊搴�
 
     //杞﹂鑹茶瘑鍒粨鏋�
@@ -78,29 +119,43 @@
     //杞︾墝妫�娴嬬粨鏋�
     BskRect carPlateRect;                   //杞︾墝鍖哄煙
     float carPlateRectScore;                //杞︾墝鍖哄煙缃俊搴�
-    std::string carPlate;                   //杞︾墝
+//    std::string carPlate;                   //杞︾墝
+    char *carPlate;                   //杞︾墝
     float carPlateScore;                    //杞︾墝缃俊搴�
     int carPlatetype;
 };
 
 union VPTDetectRes {
 
-    struct TestVPTDetectRes {
-        int i;
-    };
+    VPTDetectRes() {
 
-    VPTDetectRes() : testVPTDetectRes(TestVPTDetectRes()) {
+    }
 
+    VPTDetectRes(int i) {
+        switch (i) {
+            case 0 :
+                personDetectRes.res_objs;
+                break;
+            case 1:
+            case 2 :
+                perRideCarDetectRes.res_objs;
+                break;
+            case 4 :
+            case 5 :
+            case 6 :
+            case 8 :
+                carDetectRes.carPlatetype = -1;
+                break;
+        }
     }
 
     ~VPTDetectRes() {
 
     }
 
-    TestVPTDetectRes testVPTDetectRes;
+    CarDetectRes carDetectRes;
     PersonDetectRes personDetectRes;
     PerRideCarDetectRes perRideCarDetectRes;
-    CarDetectRes carDetectRes;
 };
 
 enum class SDKDetectType {
@@ -119,6 +174,8 @@
 struct VptDetectResults {
 public:
     VptDetectResults() {}
+
+    VptDetectResults(int _idx) : vptDetectRes(_idx) {}
 
     virtual ~VptDetectResults() {}
 
@@ -144,8 +201,8 @@
         }
     }
 
-    SDKDetectType sdkDetectType;
     VPTDetectRes vptDetectRes;
+    SDKDetectType sdkDetectType;
     BskRect bskRect;
 };
 
@@ -157,8 +214,7 @@
 
     virtual ~VptDetectWrapper();
 
-
-    void process_image(cv::Mat &_img);
+    list<VptDetectResults> process_image(cv::Mat &_img);
 
 private:
 

--
Gitblit v1.8.0