diff --git a/include/global.h b/include/global.h index 34c6a27..874c535 100644 --- a/include/global.h +++ b/include/global.h @@ -8,7 +8,7 @@ #include #include #pragma execution_character_set("utf-8") -const std::string softwareVersion = "20251031-2.1.4"; +const std::string softwareVersion = "20251101-2.1.5"; const std::string euiJsonVersion = "1.0.6"; #define globalDatabasePth "./sqlDatabase/eui_db.db" //全局数据库路径 #define saveImgEnable 1 diff --git a/src/launcher/GUI/uiModule/uiModule_imageView.h b/src/launcher/GUI/uiModule/uiModule_imageView.h index d33cf4b..982786b 100644 --- a/src/launcher/GUI/uiModule/uiModule_imageView.h +++ b/src/launcher/GUI/uiModule/uiModule_imageView.h @@ -97,8 +97,8 @@ public: setInteractive(false); setEnabled(false); setObjectName("SonGraphicsView"); - // 缩放以视图中心为锚点 - setTransformationAnchor(QGraphicsView::AnchorViewCenter); + // 缩放以鼠标位置为锚点 + setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setResizeAnchor(QGraphicsView::AnchorViewCenter); //scene->addItem(rectGroup); @@ -148,8 +148,6 @@ protected: steps = static_cast(angle.y()) / 120.0; // 120 == one step } if (steps != 0.0) { - // 以图像中心为缩放中心 - centerOnImageCenter(); zoom(steps); event->accept(); return; @@ -446,8 +444,8 @@ public: layout->addWidget(viewer); viewer->setDragMode(QGraphicsView::ScrollHandDrag); - // 以视图中心为缩放锚点 - viewer->setTransformationAnchor(QGraphicsView::AnchorViewCenter); + // 以鼠标为缩放锚点 + viewer->setTransformationAnchor(QGraphicsView::AnchorUnderMouse); viewer->setRenderHint(QPainter::Antialiasing); viewer->setRenderHint(QPainter::SmoothPixmapTransform); viewer->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); diff --git a/subModule/Hd_CameraModule_3DKeyence/Hd_CameraModule_3DKeyence.cpp b/subModule/Hd_CameraModule_3DKeyence/Hd_CameraModule_3DKeyence.cpp index 312c97b..12900e1 100644 --- a/subModule/Hd_CameraModule_3DKeyence/Hd_CameraModule_3DKeyence.cpp +++ b/subModule/Hd_CameraModule_3DKeyence/Hd_CameraModule_3DKeyence.cpp @@ -277,8 +277,8 @@ bool Hd_CameraModule_3DKeyence::readData(std::vector &mats,QByteArray & mats.push_back(heightMatS.dequeue()); } else { - mats.push_back(cv::Mat(G_xImageSize, G_yImageSize, CV_8UC1, cv::Scalar(0))); - mats.push_back(cv::Mat(G_xImageSize, G_yImageSize, CV_8UC1, cv::Scalar(0))); + mats.push_back(cv::Mat(G_xImageSize, G_yImageSize, CV_8UC1, cv::Scalar(0, 0, 0))); + mats.push_back(cv::Mat(G_xImageSize, G_yImageSize, CV_8UC1, cv::Scalar(0, 0, 0))); } } imgTakeNum = 0; @@ -528,12 +528,12 @@ bool Hd_CameraModule_3DKeyence::run() while (imgTakeNum != imgTarget) { int timeOutCnt = 0; - while (_imageAvailable[deviceId] != 1 && timeOutCnt < 1200) + while (_imageAvailable[deviceId] != 1 && timeOutCnt < 120) { timeOutCnt++; QThread::msleep(10); } - if (timeOutCnt >= 1200) + if (timeOutCnt >= 120) { heightMatS.push_back(cv::Mat(G_yImageSize, G_xImageSize, CV_8UC1, cv::Scalar(0, 0, 0))); luminanceMatS.push_back(cv::Mat(G_yImageSize, G_xImageSize, CV_8UC1, cv::Scalar(0, 0, 0))); @@ -580,13 +580,21 @@ bool Hd_CameraModule_3DKeyence::run() qDebug() << __FUNCTION__ << " line:" << __LINE__ << " Free memory Finished: "; m_mutex->lock(); - cv::Mat luminanceMat(yImageSize, xImageSize, CV_16UC1, luminanceImage); + cv::Mat luminanceMat; + if(_lastImageSizeHeight[deviceId] != 0) + luminanceMat = cv::Mat(_lastImageSizeHeight[deviceId], xImageSize, CV_16UC1, luminanceImage); + else + luminanceMat = cv::Mat(yImageSize, xImageSize, CV_16UC1, luminanceImage); cv::normalize(luminanceMat, luminanceMat, 0, 255, cv::NORM_MINMAX); cv::convertScaleAbs(luminanceMat, luminanceMat); + luminanceMatS.enqueue(luminanceMat); cv::Mat heightImg; - cv::Mat(yImageSize, xImageSize, CV_16UC1, heightImage).copyTo(heightImg); + if (_lastImageSizeHeight[deviceId] != 0) + cv::Mat(_lastImageSizeHeight[deviceId], xImageSize, CV_16UC1, heightImage).copyTo(heightImg); + else + cv::Mat(yImageSize, xImageSize, CV_16UC1, heightImage).copyTo(heightImg); heightMatS.enqueue(heightImg); m_mutex->unlock(); qDebug() << __FUNCTION__ << " line:" << __LINE__ << " success to acquire 3d image! camera_name: " << camera_name; diff --git a/subModule/Hd_CameraModule_HIK_hard_PCIE/Hd_CameraModule_HIK_hard_PCIE.cpp b/subModule/Hd_CameraModule_HIK_hard_PCIE/Hd_CameraModule_HIK_hard_PCIE.cpp index d4fb21a..4f30253 100644 --- a/subModule/Hd_CameraModule_HIK_hard_PCIE/Hd_CameraModule_HIK_hard_PCIE.cpp +++ b/subModule/Hd_CameraModule_HIK_hard_PCIE/Hd_CameraModule_HIK_hard_PCIE.cpp @@ -158,8 +158,8 @@ bool connectDevice() MV_CC_CreateHandleByGenTL(&handle, m_stDevList.pDeviceInfo[index]); int nRet = MV_CC_OpenDevice(handle); ////触发模式 - MV_CC_SetEnumValue(handle, "TriggerSource", MV_TRIGGER_SOURCE_LINE0); - MV_CC_SetEnumValue(handle, "TriggerMode", MV_TRIGGER_MODE_ON); + //MV_CC_SetEnumValue(handle, "TriggerSource", MV_TRIGGER_SOURCE_LINE0); + //MV_CC_SetEnumValue(handle, "TriggerMode", MV_TRIGGER_MODE_ON); // //加载用户集,相机设置应当UserSet1 nRet = MV_CC_SetEnumValueByString(handle, "UserSetSelector", "UserSet1"); if (MV_OK != nRet)