1、修复侧面相机自动旋转的bug。2、修复建数量模板卡死的问题。3、调节创建数量模板的窗口尺寸

LanXin3D
QuShuailong 2 years ago
parent 59b0afb7b9
commit 8240030e09

@ -112,10 +112,10 @@ bool CameraControl::readCameraConfig(QString filePath)
} }
QJsonObject devicesObj = jsonObj.value("devices").toObject(); QJsonObject devicesObj = jsonObj.value("devices").toObject();
if (!devicesObj.isEmpty()) { if (!devicesObj.isEmpty()) {
CameraInfo cameraInfo;
QStringList devicesLabelList = devicesObj.keys(); QStringList devicesLabelList = devicesObj.keys();
for each (QString deviceLabel in devicesLabelList) for each (QString deviceLabel in devicesLabelList)
{ {
CameraInfo cameraInfo;
cameraInfo.cameraLabel = deviceLabel; cameraInfo.cameraLabel = deviceLabel;
QStringList strList = deviceLabel.split(' '); QStringList strList = deviceLabel.split(' ');
if (strList.length() != 2) if (strList.length() != 2)
@ -133,11 +133,11 @@ bool CameraControl::readCameraConfig(QString filePath)
cameraInfo.imageHeight = deviceObj.value("height").toInt(); cameraInfo.imageHeight = deviceObj.value("height").toInt();
cameraInfo.imageWidth = deviceObj.value("width").toInt(); cameraInfo.imageWidth = deviceObj.value("width").toInt();
cameraInfo.saveImgSuffix = deviceObj.value("save_img_suffix").toString(); cameraInfo.saveImgSuffix = deviceObj.value("save_img_suffix").toString();
int id = deviceObj.value("id").toInt();
if (deviceObj.contains("rotation_angle")) if (deviceObj.contains("rotation_angle"))
{ {
cameraInfo.rotationAngle = deviceObj.value("rotation_angle").toInt(); cameraInfo.rotationAngle = deviceObj.value("rotation_angle").toInt();
} }
int id = deviceObj.value("id").toInt();
if (id >= topStartId && id <= topEndId) if (id >= topStartId && id <= topEndId)
{ {
m_mapIdCameraInfoTop[id] = cameraInfo; m_mapIdCameraInfoTop[id] = cameraInfo;
@ -445,7 +445,7 @@ void CameraControl::capture(const QStringList& serialNumberList)
QString serialNumber = serialNumberList.at(i); QString serialNumber = serialNumberList.at(i);
getSaveImgNameInfo(serialNumber, vecImageInfo[i].saveImgInfo); getSaveImgNameInfo(serialNumber, vecImageInfo[i].saveImgInfo);
int id = vecImageInfo.at(i).saveImgInfo.strId.toInt(); int id = vecImageInfo.at(i).saveImgInfo.strId.toInt();
int rotationAngle; int rotationAngle = 0;
if (m_mapIdCameraInfoTop.contains(id)) if (m_mapIdCameraInfoTop.contains(id))
{ {
rotationAngle = m_mapIdCameraInfoTop.value(id).rotationAngle; rotationAngle = m_mapIdCameraInfoTop.value(id).rotationAngle;
@ -468,16 +468,20 @@ void CameraControl::flipImg(const cv::Mat& imgSrc, cv::Mat& imgDst, int rotation
case 90: case 90:
cv::transpose(imgSrc, imgDst); cv::transpose(imgSrc, imgDst);
cv::flip(imgDst, imgDst, 1); cv::flip(imgDst, imgDst, 1);
qDebug() << " 旋转90度";
break; break;
case 180: case 180:
cv::flip(imgSrc, imgDst, 0); cv::flip(imgSrc, imgDst, 0);
qDebug() << " 旋转180度";
break; break;
case 270: case 270:
cv::transpose(imgSrc, imgDst); cv::transpose(imgSrc, imgDst);
cv::flip(imgDst, imgDst, 0); cv::flip(imgDst, imgDst, 0);
qDebug() << " 旋转270度";
break; break;
default: default:
imgDst = imgSrc; imgDst = imgSrc;
qDebug() << " 不旋转";
break; break;
} }
} }

@ -26,7 +26,6 @@ SmokeBoxIdentification::SmokeBoxIdentification(QWidget *parent)
//m_bCamerasInit = initCamera(); //m_bCamerasInit = initCamera();
if (decodeSmokeInfoCsv(applicationDirPath + SMOKEINFO_XLSX_CONFIG)) if (decodeSmokeInfoCsv(applicationDirPath + SMOKEINFO_XLSX_CONFIG))
matchSmokeNameAndTemplateFolderName(applicationDirPath + NUM_TEMPLATE_PATH); matchSmokeNameAndTemplateFolderName(applicationDirPath + NUM_TEMPLATE_PATH);
m_pNumTemplateBuild = new QNumTemplateBuild();
m_pDataProcess = std::make_shared<dataPreProcessing>(); m_pDataProcess = std::make_shared<dataPreProcessing>();
if (m_pDataProcess) if (m_pDataProcess)
{ {
@ -35,10 +34,14 @@ SmokeBoxIdentification::SmokeBoxIdentification(QWidget *parent)
m_pDataProcess->transmitFilePathForSampleWithItsCorresLabel(); m_pDataProcess->transmitFilePathForSampleWithItsCorresLabel();
m_pDataProcess->setWinSize(170); m_pDataProcess->setWinSize(170);
ADModule::instance()->setDataProcessObj(m_pDataProcess); ADModule::instance()->setDataProcessObj(m_pDataProcess);
m_pNumTemplateBuild->setDataProcessObj(m_pDataProcess);
} }
}); });
m_pNumTemplateBuild = new QNumTemplateBuild();
if (m_pDataProcess)
{
m_pNumTemplateBuild->setDataProcessObj(m_pDataProcess);
}
QString filePath = applicationDirPath + NET_CONFIG; QString filePath = applicationDirPath + NET_CONFIG;
m_pNetControl = new NetControl(filePath, true); m_pNetControl = new NetControl(filePath, true);
connect(m_pNetControl, &NetControl::sgReceiveData, this, &SmokeBoxIdentification::onDecodeMsg); connect(m_pNetControl, &NetControl::sgReceiveData, this, &SmokeBoxIdentification::onDecodeMsg);

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>887</width> <width>645</width>
<height>601</height> <height>450</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">

Loading…
Cancel
Save