From 080afae264fe7ff89a54886f28dff208fe5a06c4 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期二, 16 四月 2019 22:01:35 +0800
Subject: [PATCH] 整合代码
---
QiaoJiaSystem/VptServer/VptDetectWrapper.h | 88 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 73 insertions(+), 15 deletions(-)
diff --git a/QiaoJiaSystem/VptServer/VptDetectWrapper.h b/QiaoJiaSystem/VptServer/VptDetectWrapper.h
index a36ea73..0667476 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 {
@@ -120,12 +175,15 @@
public:
VptDetectResults() {}
+ VptDetectResults(int _idx) : vptDetectRes(_idx) {}
+
virtual ~VptDetectResults() {}
VptDetectResults(const VptDetectResults &src) {
this->sdkDetectType = src.sdkDetectType;
this->bskRect = src.bskRect;
+ this->obj_score = src.obj_score;
switch (src.sdkDetectType) {
case SDKDetectType::person :
@@ -144,8 +202,9 @@
}
}
- SDKDetectType sdkDetectType;
+ float obj_score;
VPTDetectRes vptDetectRes;
+ SDKDetectType sdkDetectType;
BskRect bskRect;
};
@@ -157,8 +216,7 @@
virtual ~VptDetectWrapper();
-
- void process_image(cv::Mat &_img);
+ list<VptDetectResults> process_image(cv::Mat &_img);
private:
--
Gitblit v1.8.0