From a436d7448237b8bd54034fa4fd4827172d3f5e61 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Fri, 12 Aug 2022 10:49:21 +0800 Subject: [PATCH] =?UTF-8?q?win=20=E5=9B=BE=E5=83=8F=E6=97=8B=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/ImageProcess/ImageApplyRotation.h | 34 +++++++++++----------- hgdriver/hgdev/image_process.cpp | 6 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hgdriver/ImageProcess/ImageApplyRotation.h b/hgdriver/ImageProcess/ImageApplyRotation.h index 2310438..82c4ad4 100644 --- a/hgdriver/ImageProcess/ImageApplyRotation.h +++ b/hgdriver/ImageProcess/ImageApplyRotation.h @@ -1,14 +1,14 @@ /* * ==================================================== - * 功能:旋转图像 - * 作者:刘丁维 - * 生成时间:2020/4/21 - * 最近修改时间:v1.0 2020/04/21 - v1.1 2020/08/12 修复文稿方向自动识别导致崩溃的BUG - v1.2 2021/10/15 开放文稿方向识别模块 - v1.2.1 2022/04/25 补充切换版本的预处理代码 - * 版本号:v1.2.1 + * 鍔熻兘锛氭棆杞浘鍍 + * 浣滆咃細鍒樹竵缁 + * 鐢熸垚鏃堕棿锛2020/4/21 + * 鏈杩戜慨鏀规椂闂达細v1.0 2020/04/21 + v1.1 2020/08/12 淇鏂囩ǹ鏂瑰悜鑷姩璇嗗埆瀵艰嚧宕╂簝鐨凚UG + v1.2 2021/10/15 寮鏀炬枃绋挎柟鍚戣瘑鍒ā鍧 + v1.2.1 2022/04/25 琛ュ厖鍒囨崲鐗堟湰鐨勯澶勭悊浠g爜 + * 鐗堟湰鍙凤細v1.2.1 * ==================================================== */ @@ -31,21 +31,21 @@ class GIMGPROC_LIBRARY_API CImageApplyRotation : public CImageApply public: enum class RotationType { - Invalid, //无效 - Rotate_90_clockwise, //顺时针90° - Rotate_180, //180° - Rotate_90_anti_clockwise, //逆时针90°,即270° + Invalid, //鏃犳晥 + Rotate_90_clockwise, //椤烘椂閽90掳 + Rotate_180, //180掳 + Rotate_90_anti_clockwise, //閫嗘椂閽90掳锛屽嵆270掳 - AutoTextOrientation //自动文稿方向识别旋转 + AutoTextOrientation //鑷姩鏂囩ǹ鏂瑰悜璇嗗埆鏃嬭浆 }; public: /* - * rotation [in]:旋转类型 - * isBackTransposed [in]:true为背面180°旋转,反之亦然 - * dpi [in]:当前图像的DPI,该参数在rotation为AutoTextOrientation时生效。在识别文稿方向时,会默认将图像变换为200DPI进行识别 - * tessadataPath [in]:训练库文件路径,该参数在rotation为AutoTextOrientation时生效 + * rotation [in]:鏃嬭浆绫诲瀷 + * isBackTransposed [in]:true涓鸿儗闈180掳鏃嬭浆锛屽弽涔嬩害鐒 + * dpi [in]:褰撳墠鍥惧儚鐨凞PI锛岃鍙傛暟鍦╮otation涓篈utoTextOrientation鏃剁敓鏁堛傚湪璇嗗埆鏂囩ǹ鏂瑰悜鏃讹紝浼氶粯璁ゅ皢鍥惧儚鍙樻崲涓200DPI杩涜璇嗗埆 + * tessadataPath [in]:璁粌搴撴枃浠惰矾寰勶紝璇ュ弬鏁板湪rotation涓篈utoTextOrientation鏃剁敓鏁 */ CImageApplyRotation(RotationType rotation, bool isBackTransposed = false, int dpi = 200, const char* tessdataPath = nullptr); diff --git a/hgdriver/hgdev/image_process.cpp b/hgdriver/hgdev/image_process.cpp index c431ddb..c25f253 100644 --- a/hgdriver/hgdev/image_process.cpp +++ b/hgdriver/hgdev/image_process.cpp @@ -620,18 +620,18 @@ namespace hg_imgproc if (img_conf_.is_autotext) rotatetype = CImageApplyRotation::RotationType::AutoTextOrientation; -#if defined(WIN32) || defined(_WIN64) +/*#if defined(WIN32) || defined(_WIN64) char szIniFile[MAX_PATH] = {0}; SHGetSpecialFolderPathA(NULL, szIniFile, CSIDL_WINDOWS, TRUE); strcat(szIniFile, "\\twain_32\\HuaGoScan\\tessdata"); // m_iaList.push_back(shared_ptr(new CImageApplyRotation(rotatetype, imgparams.BackRotate180, imgparams.DestResulution, szIniFile))); -#else // WIN32 +#else // WIN32*/ CImageApplyRotation Rotation(rotatetype,img_conf_.is_backrotate180,img_conf_.resolution_native,"./tessdata"); Rotation.apply(mats,img_conf_.is_duplex); mats_ = mats; -#endif +//#endif return ret; } //闄ょ綉锟?