mirror of http://192.168.1.51:8099/lmh188/twain3.0
修复多流输出 单页扫描时 图像出图数量不一致问题
This commit is contained in:
parent
1c14c43896
commit
4fa56d51f0
|
@ -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();
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
BIN
huagao/stdafx.h
BIN
huagao/stdafx.h
Binary file not shown.
Loading…
Reference in New Issue