Prechádzať zdrojové kódy

fix(调整阈值以优化水印处理): 修改水印处理模块中的阈值设置,将单元格处理的阈值从170调整至155,以提升OCR处理的准确性和灵活性。

zhch158_admin 3 dní pred
rodič
commit
b11fe5592e

+ 1 - 1
ocr_utils/watermark/presets.py

@@ -113,7 +113,7 @@ def _base_preset(scope: Scope, method: Method) -> Dict[str, Any]:
         if scope == "cell"
         else copy.deepcopy(_CONTRAST_PAGE_DEFAULT)
     )
-    threshold = 175 if scope == "page" else 170
+    threshold = 175 if scope == "page" else 155
     cfg: Dict[str, Any] = {
         "enabled": True,
         "detect_before_remove": scope == "page",

+ 1 - 1
ocr_utils/watermark/processor.py

@@ -45,7 +45,7 @@ class WatermarkProcessor:
 
     @property
     def threshold(self) -> int:
-        return int(self.config.get("threshold", 175))
+        return int(self.config.get("threshold", 155))
 
     @property
     def morph_close_kernel(self) -> int: