From 4fa56d51f0fc12663cb05b64a0c6902c1d9637f3 Mon Sep 17 00:00:00 2001 From: masayume <1936714878@qq.com> Date: Mon, 28 Nov 2022 15:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E6=B5=81=E8=BE=93?= =?UTF-8?q?=E5=87=BA=20=E5=8D=95=E9=A1=B5=E6=89=AB=E6=8F=8F=E6=97=B6=20?= =?UTF-8?q?=E5=9B=BE=E5=83=8F=E5=87=BA=E5=9B=BE=E6=95=B0=E9=87=8F=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huagao/Device/ImageMatQueue.cpp | 8 ++++---- huagao/ImageProcess/ImageApplyOutHole.cpp | 8 ++++++-- huagao/ImageProcess/ImageApplyOutHole.h | 4 ++-- huagao/huagaods.cpp | 2 +- huagao/stdafx.h | Bin 25582 -> 25538 bytes 5 files changed, 13 insertions(+), 9 deletions(-) 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 5253b718e7a49a83045a09484c098263416f4b8c..096452526ef1540758be8976fba7072d06c048f5 100644 GIT binary patch delta 33 pcmaENobk|c#tkhTti}um3