diff --git a/huagao/Device/ImageMatQueue.cpp b/huagao/Device/ImageMatQueue.cpp index be3e02ca..bccfffa3 100644 --- a/huagao/Device/ImageMatQueue.cpp +++ b/huagao/Device/ImageMatQueue.cpp @@ -805,10 +805,10 @@ void ImageMatQueue::duplex_process(CacheInfo info) Mat ret = m_mlt.GetMultiFilterMat(mats[i], 2); mats[i].release(); if (!ret.empty()) { - if (!scanParam.is_duplex && i == 1) { - ret.release(); - break; - } + //if (!scanParam.is_duplex && i == 1) { + // ret.release(); + // break; + //} Mat2Bmp mb(ret, scanParam.resolution_dst); auto data = mb.getBmpDataBuffer(); ret.release(); diff --git a/huagao/ImageProcess/ImageApplyOutHole.cpp b/huagao/ImageProcess/ImageApplyOutHole.cpp index e34a8f8d..888fa962 100644 --- a/huagao/ImageProcess/ImageApplyOutHole.cpp +++ b/huagao/ImageProcess/ImageApplyOutHole.cpp @@ -76,10 +76,14 @@ void CImageApplyOutHole::apply(std::vector& mats, bool isTwoSide) cv::Mat front_thre, back_thre; hg::threshold_Mat(front, front_thre, m_threshold); hg::threshold_Mat(back, back_thre, m_threshold); + //cv::imwrite("front_thre.jpg", front_thre); + //cv::imwrite("back_thre.jpg", back_thre); cv::Mat element = getStructuringElement(cv::MORPH_RECT, cv::Size(5 * resize_scale, 1)); cv::morphologyEx(front_thre, front_thre, cv::MORPH_OPEN, element, cv::Point(-1, -1), 1, cv::BORDER_CONSTANT, cv::Scalar::all(0)); cv::morphologyEx(back_thre, back_thre, cv::MORPH_OPEN, element, cv::Point(-1, -1), 1, cv::BORDER_CONSTANT, cv::Scalar::all(0)); + //cv::imwrite("front_thre2.jpg", front_thre); + //cv::imwrite("back_thre2.jpg", back_thre); //反面二值化图像水平翻转 cv::flip(back_thre, back_thre, 1); //1:Horizontal @@ -87,8 +91,8 @@ void CImageApplyOutHole::apply(std::vector& mats, bool isTwoSide) //正反面图像寻边 std::vector> contours_front, contours_back; std::vector b1_front, b1_back; - hg::findContours(front_thre.clone(), contours_front, b1_front, cv::RETR_EXTERNAL); - hg::findContours(back_thre.clone(), contours_back, b1_back, cv::RETR_EXTERNAL); + hg::findContours(front_thre.clone(), contours_front, b1_front, cv::RETR_CCOMP); + hg::findContours(back_thre.clone(), contours_back, b1_back, cv::RETR_CCOMP); //提取正反面图像最大轮廓 for (size_t i = 0; i < contours_front.size(); i++) diff --git a/huagao/ImageProcess/ImageApplyOutHole.h b/huagao/ImageProcess/ImageApplyOutHole.h index 2763c153..77779d9e 100644 --- a/huagao/ImageProcess/ImageApplyOutHole.h +++ b/huagao/ImageProcess/ImageApplyOutHole.h @@ -24,7 +24,8 @@ * 2022/09/15 v1.8.4 修复导致崩溃的BUG * 2022/09/16 v1.9 优化内存消耗 * 2022/09/16 v1.9.1 修复缩放比例的逻辑错误。 - * 版本号:v1.9.1 + * 2022/11/17 v1.9.2 修复寻找孔洞轮廓BUG。 + * 版本号:v1.9.2 * ==================================================== */ @@ -86,4 +87,3 @@ private: }; #endif // !IMAGE_APPLY_OUT_HOLE_H - diff --git a/huagao/huagaods.cpp b/huagao/huagaods.cpp index db6823ec..8cdfa3fd 100644 --- a/huagao/huagaods.cpp +++ b/huagao/huagaods.cpp @@ -1006,7 +1006,7 @@ Result HuagaoDs::identityOpenDs(const Identity&) { scanner.reset(new GScanO1003399()); else { #ifdef ANDROIDSERIAL - if (pid == 0x402 || pid == 0x302) + if (pid == 0x402 || pid == 0x302 || pid == 0x7002) scanner.reset(new GScan439Android()); else scanner.reset(new GScanO400Android()); diff --git a/huagao/stdafx.h b/huagao/stdafx.h index 5253b718..09645252 100644 Binary files a/huagao/stdafx.h and b/huagao/stdafx.h differ