修复多流输出 单页扫描时 图像出图数量不一致问题

This commit is contained in:
masayume 2022-11-28 15:43:46 +08:00
parent 1c14c43896
commit 4fa56d51f0
5 changed files with 13 additions and 9 deletions

View File

@ -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();

View File

@ -76,10 +76,14 @@ void CImageApplyOutHole::apply(std::vector<cv::Mat>& 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<cv::Mat>& mats, bool isTwoSide)
//正反面图像寻边
std::vector<std::vector<cv::Point>> contours_front, contours_back;
std::vector<cv::Vec4i> 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++)

View File

@ -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

View File

@ -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());

Binary file not shown.