Commit 35632caf by 郭峰

Merge branch 'feature-1007464' into 'release'

人形检测关闭算法

See merge request !23
parents e34d4445 e2bbbbe3
...@@ -599,6 +599,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){ ...@@ -599,6 +599,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
int uniforms=0x00; int uniforms=0x00;
std::map<int,int>resMap; std::map<int,int>resMap;
if ((algorithmPermissions & 0x01<<3) != 0) {
//穿工服算法 //穿工服算法
if ((algorithmPermissions & 0x01<<2) != 0) { if ((algorithmPermissions & 0x01<<2) != 0) {
uniforms=algorithmTaskManage.executeFindHuManCar(frame,0x02,currentPlates,resMap,sSn,heightReference); uniforms=algorithmTaskManage.executeFindHuManCar(frame,0x02,currentPlates,resMap,sSn,heightReference);
...@@ -712,6 +713,9 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){ ...@@ -712,6 +713,9 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
} }
} }
}else{
qInfo()<<"人形识别算法关闭,只有车牌算法了";
}
//关闭车牌识别 //关闭车牌识别
if ((algorithmPermissions & 0x01) == 0) { if ((algorithmPermissions & 0x01) == 0) {
return ; return ;
......
...@@ -538,7 +538,10 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber, ...@@ -538,7 +538,10 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
config.uniformConfig.humanDetectionLen = uniformConfigObj["humanDetectionLen"].toInt(); config.uniformConfig.humanDetectionLen = uniformConfigObj["humanDetectionLen"].toInt();
config.uniformConfig.updateAt = uniformConfigObj["updateAt"].toVariant().toULongLong(); config.uniformConfig.updateAt = uniformConfigObj["updateAt"].toVariant().toULongLong();
config.uniformConfig.carShapeConfidence = uniformConfigObj["carShapeConfidence"].toVariant().toFloat(); config.uniformConfig.carShapeConfidence = uniformConfigObj["carShapeConfidence"].toVariant().toFloat();
//解析 humanConfig
QJsonObject humanConfigObj = dataObj["humanConfig"].toObject();
config.humanConfig.isOn=humanConfigObj["isOn"].toBool();
config.humanConfig.updateAt = humanConfigObj["updateAt"].toVariant().toULongLong();
// 解析 devicesConfig // 解析 devicesConfig
QJsonObject devicesConfigObj = dataObj["camera"].toObject(); QJsonObject devicesConfigObj = dataObj["camera"].toObject();
......
...@@ -279,6 +279,12 @@ struct UniformConfig { ...@@ -279,6 +279,12 @@ struct UniformConfig {
quint64 updateAt; quint64 updateAt;
}; };
struct HumanConfig{
bool isOn;
int humanDetectionLen;
quint64 updateAt;
};
struct MqttConfig { struct MqttConfig {
QString address; QString address;
QString clientId; QString clientId;
...@@ -299,6 +305,8 @@ struct responseConfig { ...@@ -299,6 +305,8 @@ struct responseConfig {
UniformConfig uniformConfig; UniformConfig uniformConfig;
Camera camera; Camera camera;
MqttConfig mqttConfig; MqttConfig mqttConfig;
HumanConfig humanConfig;
}; };
struct responseMqttData{ struct responseMqttData{
......
...@@ -170,7 +170,7 @@ void MainWindow::divParameterUpdate(vides_data::responseConfig &cloudConfig,QStr ...@@ -170,7 +170,7 @@ void MainWindow::divParameterUpdate(vides_data::responseConfig &cloudConfig,QStr
cloudConfig.mqttConfig.topic=config.mqttConfig.topic; cloudConfig.mqttConfig.topic=config.mqttConfig.topic;
runOrRebootMqtt(cloudConfig.mqttConfig,httpUrl,serialNumber); runOrRebootMqtt(cloudConfig.mqttConfig,httpUrl,serialNumber);
} }
__uint8_t alg= this->intToUint8t(faceAlgorithm,licensePlateAlgorithm,uniformAlgorithm) ; __uint8_t alg= this->intToUint8t(faceAlgorithm,licensePlateAlgorithm,uniformAlgorithm,false) ;
vides_data::DetectionParams params; vides_data::DetectionParams params;
...@@ -556,7 +556,7 @@ void MainWindow::startCamera(const QString &httpurl){ ...@@ -556,7 +556,7 @@ void MainWindow::startCamera(const QString &httpurl){
reStatus.camera_info_list.push_front(camera_info); reStatus.camera_info_list.push_front(camera_info);
__uint8_t new_algorithm= intToUint8t(devConfig.faceConfig.isOn,devConfig.licensePlateConfig.isOn,devConfig.uniformConfig.isOn); __uint8_t new_algorithm= intToUint8t(devConfig.faceConfig.isOn,devConfig.licensePlateConfig.isOn,devConfig.uniformConfig.isOn,devConfig.humanConfig.isOn);
offlineCameraHandle->cameraParameterUpdate(devConfig); offlineCameraHandle->cameraParameterUpdate(devConfig);
offlineCameraHandle->initAlgorithmPermissions(new_algorithm); offlineCameraHandle->initAlgorithmPermissions(new_algorithm);
...@@ -961,9 +961,10 @@ void MainWindow::initRecordingToString(QString &recorJson){ ...@@ -961,9 +961,10 @@ void MainWindow::initRecordingToString(QString &recorJson){
recorJson = QString::fromUtf8(jsonDocument.toJson()); recorJson = QString::fromUtf8(jsonDocument.toJson());
} }
__uint8_t MainWindow::intToUint8t(bool faceAlgorithm, bool licensePlateAlgorithm, bool uniformAlgorithm) { __uint8_t MainWindow::intToUint8t(bool faceAlgorithm, bool licensePlateAlgorithm, bool uniformAlgorithm,bool humanAlgorithm) {
__uint8_t result = 0; __uint8_t result = 0;
//人形识别对应最高高位(第3位)
result |=(humanAlgorithm?1:0)<<3;
// 工服识别对应最高位(第2位) // 工服识别对应最高位(第2位)
result |= (uniformAlgorithm ? 1 : 0) << 2; result |= (uniformAlgorithm ? 1 : 0) << 2;
...@@ -1013,7 +1014,7 @@ void MainWindow::initCameras(vides_data::cameraParameters &parameter,vides_data: ...@@ -1013,7 +1014,7 @@ void MainWindow::initCameras(vides_data::cameraParameters &parameter,vides_data:
cameraHandle->findFirmwareVersion(camera_info.firmware_version); cameraHandle->findFirmwareVersion(camera_info.firmware_version);
camera_info_list.push_front(camera_info); camera_info_list.push_front(camera_info);
__uint8_t new_algorithm= intToUint8t(devConfig.faceConfig.isOn,devConfig.licensePlateConfig.isOn,devConfig.uniformConfig.isOn); __uint8_t new_algorithm= intToUint8t(devConfig.faceConfig.isOn,devConfig.licensePlateConfig.isOn,devConfig.uniformConfig.isOn,devConfig.humanConfig.isOn);
cameraHandle->initAlgorithmPermissions(new_algorithm); cameraHandle->initAlgorithmPermissions(new_algorithm);
cameraHandle->initParkingSpaceInfo(areas); cameraHandle->initParkingSpaceInfo(areas);
......
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
void initCameras(vides_data::cameraParameters &parameter, vides_data::responseConfig &devConfig, const std::list<vides_data::responseArea>&areas,std::list<vides_data::requestCameraInfo>&camera_info_list); void initCameras(vides_data::cameraParameters &parameter, vides_data::responseConfig &devConfig, const std::list<vides_data::responseArea>&areas,std::list<vides_data::requestCameraInfo>&camera_info_list);
__uint8_t intToUint8t(bool faceAlgorithm,bool licensePlateAlgorithm,bool uniformAlgorithm); __uint8_t intToUint8t(bool faceAlgorithm,bool licensePlateAlgorithm,bool uniformAlgorithm,bool humanAlgorithm);
//盒子参数更新 //盒子参数更新
void divParameterUpdate(vides_data::responseConfig &cloudConfig,QString &httpUrl,QString &serialNumber ); void divParameterUpdate(vides_data::responseConfig &cloudConfig,QString &httpUrl,QString &serialNumber );
......
File mode changed from 100644 to 100755
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