Commit af92429f by “liusq”

车牌大于最大匹配度进场

parent 38d74e8b
...@@ -20,8 +20,8 @@ CameraHandle::CameraHandle(QString &url, QString &httpUrl, QString &sSn, int &ch ...@@ -20,8 +20,8 @@ CameraHandle::CameraHandle(QString &url, QString &httpUrl, QString &sSn, int &ch
connect(this, SIGNAL(afterDownloadFile(int,int,QString)), this, SLOT(pushRecordToCloud(int,int,QString)),Qt::QueuedConnection); connect(this, SIGNAL(afterDownloadFile(int,int,QString)), this, SLOT(pushRecordToCloud(int,int,QString)),Qt::QueuedConnection);
detector = TCV_CreateHumanDetector(); detector = TCV_CreateHumanDetector();
// 设置检测得分阈值 默认0.5 // 设置检测得分阈值 默认0.5
TCV_HumanDetectorSetHumanThreshold(detector,0.5f); //TCV_HumanDetectorSetHumanThreshold(detector,0.5f);
TCV_HumanDetectorSetCarThreshold(detector,0.2f); //TCV_HumanDetectorSetCarThreshold(detector,0.2f);
HLPR_ContextConfiguration configuration = {0}; HLPR_ContextConfiguration configuration = {0};
QByteArray && by_mpath=modelPaths.toUtf8(); QByteArray && by_mpath=modelPaths.toUtf8();
...@@ -558,7 +558,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){ ...@@ -558,7 +558,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
std::map<int,RecognizedInfo>exitMoMap; std::map<int,RecognizedInfo>exitMoMap;
vides_data::requestLicensePlate newPlate; vides_data::requestLicensePlate newPlate;
newPlate.sn=sSn; newPlate.sn=sSn;
qDebug()<<QString("sn==>%1,识别的车牌是:%2").arg(sSn).arg(lpNumber); qDebug()<<QString("sn==>%1,识别的车牌信息是:%2").arg(sSn).arg(lpNumber);
std::list<vides_data::LicensePlate>ps=plate.plates; std::list<vides_data::LicensePlate>ps=plate.plates;
int res =-1; int res =-1;
this->matToBase64(frame, imgs); this->matToBase64(frame, imgs);
...@@ -588,7 +588,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){ ...@@ -588,7 +588,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
ParkingSpaceInfo newcurrentPlate; ParkingSpaceInfo newcurrentPlate;
newcurrentPlate.setArea(currentPlate.recognition); newcurrentPlate.setArea(currentPlate.recognition);
int index = this->findPointRegion(newcurrentPlate); int index = this->findPointRegion(newcurrentPlate);
qDebug()<<"识别的区域:"<<index; qDebug()<<sSn<<"==>识别的区域:"<<index;
indexToLicensePlate[index] = currentPlate; indexToLicensePlate[index] = currentPlate;
} }
for (auto it = parkMap.begin(); it != parkMap.end(); ++it) { for (auto it = parkMap.begin(); it != parkMap.end(); ++it) {
...@@ -612,17 +612,14 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){ ...@@ -612,17 +612,14 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
value->removeQueue(); value->removeQueue();
} }
for (int var = 0; var < 3; ++var) {
RecognizedInfo info(recognition.new_plate,recognition.time,recognition.new_color);
value->addQueue(info);
recognizedInfo=std::move(info);
}
this->checkAndUpdateCurrentPlate(value,frame,recognizedInfo,res,exitMoMap);
} }
for (int var = 0; var < 3; ++var) {
RecognizedInfo info(recognition.new_plate,recognition.time,recognition.new_color);
value->addQueue(info);
recognizedInfo=std::move(info);
}
this->checkAndUpdateCurrentPlate(value,frame,recognizedInfo,res,exitMoMap);
} }
qDebug()<<sSn<<"==>识别的车牌置信度"<<recognition.text_confidence;
qDebug()<<sSn<<"==>最小车牌置信度"<<instace.getCarConfidenceMin();
if(recognition.text_confidence<=instace.getCarConfidenceMin()){ if(recognition.text_confidence<=instace.getCarConfidenceMin()){
qDebug()<<sSn<<"==>recognition.text_confidence<=instace.getCarConfidenceMin"<<instace.getCarConfidenceMin(); qDebug()<<sSn<<"==>recognition.text_confidence<=instace.getCarConfidenceMin"<<instace.getCarConfidenceMin();
continue; continue;
...@@ -638,6 +635,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){ ...@@ -638,6 +635,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
recognizedInfo=std::move(info); recognizedInfo=std::move(info);
this->checkAndUpdateCurrentPlate(value,frame,recognizedInfo,res,exitMoMap); this->checkAndUpdateCurrentPlate(value,frame,recognizedInfo,res,exitMoMap);
} }
qDebug()<<sSn<<"==>checkAndUpdateCurrentPlate结果是"<<res;
if (res == Exit || res == Mobilization) { if (res == Exit || res == Mobilization) {
recognition.areaLocation=value->getArea(); recognition.areaLocation=value->getArea();
......
...@@ -15,7 +15,7 @@ int HumanDetection::findHuManCar(const cv::Mat &source,int res,TCV_HumanDetector ...@@ -15,7 +15,7 @@ int HumanDetection::findHuManCar(const cv::Mat &source,int res,TCV_HumanDetector
// 执行一帧目标检测 // 执行一帧目标检测
TCV_HumanDetectorProcessFrame(detector, stream); TCV_HumanDetectorProcessFrame(detector, stream);
int num = (res == 0) ? TCV_HumanDetectorGetNumOfHuman(detector) :TCV_HumanDetectorGetNumOfCar(detector); int num = (res == 0) ? TCV_HumanDetectorGetNumOfHuman(detector) :0;//TCV_HumanDetectorGetNumOfCar(detector);
qDebug() << (res == 0 ? "Number of people detected:" : "Number of cars detected:") << num; qDebug() << (res == 0 ? "Number of people detected:" : "Number of cars detected:") << num;
TCV_ReleaseCameraStream(stream); TCV_ReleaseCameraStream(stream);
......
...@@ -13,43 +13,43 @@ TEMPLATE = app ...@@ -13,43 +13,43 @@ TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS DEFINES += QT_DEPRECATED_WARNINGS
QMAKE_LIBDIR += /usr/local/lib #QMAKE_LIBDIR += /usr/local/lib
INCLUDEPATH+=/usr/local/include/opencv4 #INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH+=/usr/local/include/hyperface #INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH+=/usr/local/include/hyper #INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH+=/usr/local/include/XNetSDK #INCLUDEPATH+=/usr/local/include/XNetSDK
INCLUDEPATH+=/usr/local/include/human #INCLUDEPATH+=/usr/local/include/human
#unix:contains(QMAKE_HOST.arch, x86_64) { unix:contains(QMAKE_HOST.arch, x86_64) {
# QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib
#} }
#unix:contains(QMAKE_HOST.arch, arm) { unix:contains(QMAKE_HOST.arch, arm) {
# QMAKE_LIBDIR += /usr/local/lib QMAKE_LIBDIR += /usr/local/lib
#} }
## 根据编译器类型选择库路径和头文件路径 # 根据编译器类型选择库路径和头文件路径
#unix: { unix: {
# # x86 架构 # x86 架构
# contains(QMAKE_HOST.arch, x86_64) { contains(QMAKE_HOST.arch, x86_64) {
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4 INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human
# } }
# # ARM 架构 # ARM 架构
# contains(QMAKE_HOST.arch, arm) { contains(QMAKE_HOST.arch, arm) {
# INCLUDEPATH+=/usr/local/include/opencv4 INCLUDEPATH+=/usr/local/include/opencv4
# INCLUDEPATH+=/usr/local/include/hyperface INCLUDEPATH+=/usr/local/include/hyperface
# INCLUDEPATH+=/usr/local/include/hyper INCLUDEPATH+=/usr/local/include/hyper
# INCLUDEPATH+=/usr/local/include/XNetSDK INCLUDEPATH+=/usr/local/include/XNetSDK
# INCLUDEPATH+=/usr/local/include/human INCLUDEPATH+=/usr/local/include/human
# } }
#} }
# You can also make your code fail to compile if it uses deprecated APIs. # You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line. # In order to do so, uncomment the following line.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment