Commit b31cf23d by “liusq”

优化车牌逻辑

parent 4b67a9ac
......@@ -365,6 +365,7 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
}
updateImage(image, currentTime);
}
void CameraHandle::sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel){
if(hDevice<=0){
qInfo() << "相机断线";
......@@ -593,37 +594,40 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
int key = it->first;
ParkingSpaceInfo* value = it->second; // 获取值
if (indexToLicensePlate.count(key) > 0) {
if(value->getQueue().size()>=10) {
value->removeQueue();
}
vides_data::LicensePlate recognition= indexToLicensePlate.at(key);
RecognizedInfo recognizedInfo;
if (recognition.new_color=="蓝牌" && recognition.new_plate.length() != 7) {
return;
qDebug()<<"蓝牌车牌号:"<<recognition.new_plate<<"===>recognition.new_plate.length():"<<recognition.new_plate.length();
continue;
} else if (recognition.new_color=="绿牌新能源" && recognition.new_plate.length() != 8) {
return;
} else if (recognition.new_plate.length() != 7) {
return;
qDebug()<<"绿牌车牌号:"<<recognition.new_plate<<"===>recognition.new_plate.length():"<<recognition.new_plate.length();
continue;
} else if (recognition.new_plate.length() < 7) {
qDebug()<<"非绿牌蓝牌车牌号:"<<recognition.new_plate<<"===>recognition.new_plate.length():"<<recognition.new_plate.length();
continue;
}
if(recognition.text_confidence>=instace.getCarConfidenceMax()){
if(value->getQueue().size()>=7 && value->getQueue().size()<=10) {
for (int i = 0; i < 3; ++i) {
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);
}
if(recognition.text_confidence<=instace.getCarConfidenceMin()){
return;
continue;
}
if(recognition.text_confidence>instace.getCarConfidenceMin()
&& recognition.text_confidence<instace.getCarConfidenceMax())
{
if(value->getQueue().size()>=10) {
value->removeQueue();
}
RecognizedInfo info(recognition.new_plate,recognition.time,recognition.new_color);
value->addQueue(info);
recognizedInfo=std::move(info);
......@@ -700,6 +704,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
}
}
}
void CameraHandle::pushRecordToCloud(int id, int recognitionType, QString ossUrl){
HttpService httpService(ossUrl);
Common & instace= Common::getInstance();
......@@ -769,7 +774,6 @@ void CameraHandle::licensePlateRecognitionResults(vides_data::requestLicensePlat
}
}
void CameraHandle::sdkDevSystemTimeZoneSyn(QString &time){
QByteArray bTime =time.toUtf8();
const char* cTime=bTime.data();
......
......@@ -62,8 +62,8 @@ private:
QString videoOut;
QString videoDownload;
QString images;
float carConfidenceMax;
float carConfidenceMin;
double carConfidenceMax;
double carConfidenceMin;
Common();
~Common();
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -13,43 +13,43 @@ TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
#QMAKE_LIBDIR += /usr/local/lib
#INCLUDEPATH+=/usr/local/include/opencv4
#INCLUDEPATH+=/usr/local/include/hyperface
#INCLUDEPATH+=/usr/local/include/hyper
#INCLUDEPATH+=/usr/local/include/XNetSDK
#INCLUDEPATH+=/usr/local/include/human
unix:contains(QMAKE_HOST.arch, x86_64) {
QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib
}
unix:contains(QMAKE_HOST.arch, arm) {
QMAKE_LIBDIR += /usr/local/lib
}
# 根据编译器类型选择库路径和头文件路径
unix: {
# x86 架构
contains(QMAKE_HOST.arch, x86_64) {
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human
}
# ARM 架构
contains(QMAKE_HOST.arch, arm) {
INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH+=/usr/local/include/XNetSDK
#INCLUDEPATH+=/usr/local/include/human
}
}
QMAKE_LIBDIR += /usr/local/lib
INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH+=/usr/local/include/XNetSDK
INCLUDEPATH+=/usr/local/include/human
#unix:contains(QMAKE_HOST.arch, x86_64) {
# QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib
#}
#unix:contains(QMAKE_HOST.arch, arm) {
# QMAKE_LIBDIR += /usr/local/lib
#}
## 根据编译器类型选择库路径和头文件路径
#unix: {
# # x86 架构
# contains(QMAKE_HOST.arch, x86_64) {
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human
# }
# # ARM 架构
# contains(QMAKE_HOST.arch, arm) {
# INCLUDEPATH+=/usr/local/include/opencv4
# INCLUDEPATH+=/usr/local/include/hyperface
# INCLUDEPATH+=/usr/local/include/hyper
# INCLUDEPATH+=/usr/local/include/XNetSDK
# #INCLUDEPATH+=/usr/local/include/human
# }
#}
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
......
......@@ -779,7 +779,7 @@ void MainWindow::initCommon(){
createDirectory(0x01,"frame_images", "目录创建成功", "目录创建失败");
createDirectory(0x00,"frame_video", "创建视频目录成功", "视频目录创建失败");
createDirectory(0x02,"images", "图片目录创建成功", "图片目录创建失败");
float carConfidenceMax=qSetting->value("devices/carConfidenceMax").toFloat();
float carConfidenceMax=qSetting->value("devices/carConfidenceMax").toDouble();
float carConfidenceMin=qSetting->value("devices/carConfidenceMin").toFloat();
Common& instance = Common::getInstance();
instance.setCarConfidenceMax(carConfidenceMax);
......
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