From 89b2fc4777318c8b384d82c4575a8e2ab3adfe4c Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Fri, 24 Nov 2023 13:53:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B33288-400=E5=92=8Cdsp=E8=AE=BE?= =?UTF-8?q?=E5=A4=87600dpi=E9=99=A4=E7=A9=BF=E5=AD=94=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 3 +++ hgdriver/hgdev/image_process.cpp | 17 ++++++++++++++++- hgdriver/hgdev/image_process.h | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 3087102..1f222ce 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -3136,6 +3136,9 @@ hg_imgproc::IMGPRCPARAM hg_scanner::get_image_process_object(int model) param.width = mat_width; param.height = mat_height; } + param.is_sup_real_300dpi_ = firmware_sup_dpi_300; + param.is_sup_real_600dpi_ = firmware_sup_dpi_600; + param.device_7010 = firmware_sup_device_7010; //img_conf_.brightness = (float)bright_; //img_conf_.contrast = (float)contrast_; diff --git a/hgdriver/hgdev/image_process.cpp b/hgdriver/hgdev/image_process.cpp index 728f7f4..a877467 100644 --- a/hgdriver/hgdev/image_process.cpp +++ b/hgdriver/hgdev/image_process.cpp @@ -431,7 +431,22 @@ namespace hg_imgproc int ret = SCANNER_ERR_OK; float scale = img_conf_.fillhole.fillholeratio / 100.0; - float val = img_conf_.resolution_dst / 10; + int dpi = img_conf_.resolution_dst; + + if (!param_.is_sup_real_300dpi_) + { + dpi = 200; + } + else + { + if (!param_.is_sup_real_600dpi_) + { + if (dpi >= 300) + dpi = 300; + } + } + + float val = dpi / 10; cv::Vec4f edgeScale; edgeScale[0] = top; edgeScale[1] = low; diff --git a/hgdriver/hgdev/image_process.h b/hgdriver/hgdev/image_process.h index 47dbfec..945c747 100644 --- a/hgdriver/hgdev/image_process.h +++ b/hgdriver/hgdev/image_process.h @@ -153,6 +153,8 @@ namespace hg_imgproc int width; // in pixel int height; // in pixel unsigned total_bytes;// total bytes + bool is_sup_real_300dpi_; + bool is_sup_real_600dpi_; bool device_7010; }IMGPRCPARAM, *LPIMGPRCPARAM; typedef struct _img_header