Skip to content

Commit e0e70c4

Browse files
committed
Add GEM_GRAY_EQUALIZE for low-contrast VIN images
dark_vin.png (faint green text on near-black) fails even with GTM_INVERTED because the contrast is too low for text detection. - Add GEM_GRAY_EQUALIZE as fallback enhancement in ip_recognize_text and tls_vin_text to boost contrast via histogram equalization - Increase text detection sensitivity from 7 to 9
1 parent d259ecb commit e0e70c4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lab/vin-scanner/template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,13 @@
261261
"Name": "ip_recognize_text",
262262
"BinarizationModes": [{ "BinarizationThreshold": -1, "BlockSizeX": 0, "BlockSizeY": 0, "EnableFillBinaryVacancy": 1, "GrayscaleEnhancementModesIndex": -1, "Mode": "BM_LOCAL_BLOCK", "MorphOperation": "Close", "MorphOperationKernelSizeX": 0, "MorphOperationKernelSizeY": 0, "MorphShape": "Rectangle", "ThresholdCompensation": 10 }],
263263
"ColourConversionModes": [{ "BlueChannelWeight": -1, "GreenChannelWeight": -1, "Mode": "CICM_GENERAL", "RedChannelWeight": -1, "ReferChannel": "H_CHANNEL" }],
264-
"GrayscaleEnhancementModes": [{ "Mode": "GEM_GENERAL", "Sensitivity": -1, "SharpenBlockSizeX": -1, "SharpenBlockSizeY": -1, "SmoothBlockSizeX": -1, "SmoothBlockSizeY": -1 }],
264+
"GrayscaleEnhancementModes": [{ "Mode": "GEM_GENERAL", "Sensitivity": -1, "SharpenBlockSizeX": -1, "SharpenBlockSizeY": -1, "SmoothBlockSizeX": -1, "SmoothBlockSizeY": -1 }, { "Mode": "GEM_GRAY_EQUALIZE", "Sensitivity": 9, "SharpenBlockSizeX": -1, "SharpenBlockSizeY": -1, "SmoothBlockSizeX": -1, "SmoothBlockSizeY": -1 }],
265265
"GrayscaleTransformationModes": [{ "Mode": "GTM_INVERTED" }, { "Mode": "GTM_ORIGINAL" }],
266266
"IfEraseTextZone": 0,
267267
"RegionPredetectionModes": [{ "AspectRatioRange": "[]", "FindAccurateBoundary": 0, "ForeAndBackgroundColours": "[]", "HeightRange": "[]", "ImageParameterName": "", "MeasuredByPercentage": 1, "MinImageDimension": 262144, "Mode": "RPM_GENERAL", "RelativeRegions": "[]", "Sensitivity": 1, "SpatialIndexBlockSize": 5, "WidthRange": "[]" }],
268268
"ScaleDownThreshold": 2300,
269269
"ScaleUpModes": [{ "AcuteAngleWithXThreshold": -1, "LetterHeightThreshold": 0, "Mode": "SUM_AUTO", "ModuleSizeThreshold": 0, "TargetLetterHeight": 0, "TargetModuleSize": 0 }],
270-
"TextDetectionMode": { "CharHeightRange": [5, 1000, 1], "Direction": "HORIZONTAL", "MaxSpacingInALine": -1, "Mode": "TTDM_LINE", "Sensitivity": 7, "StringLengthRange": null },
270+
"TextDetectionMode": { "CharHeightRange": [5, 1000, 1], "Direction": "HORIZONTAL", "MaxSpacingInALine": -1, "Mode": "TTDM_LINE", "Sensitivity": 9, "StringLengthRange": null },
271271
"TextureDetectionModes": [{ "Mode": "TDM_GENERAL_WIDTH_CONCENTRATION", "Sensitivity": 5 }]
272272
}
273273
],
@@ -336,7 +336,7 @@
336336
"TextLinesCount": 1,
337337
"BinarizationModes": [{ "BinarizationThreshold": -1, "BlockSizeX": 11, "BlockSizeY": 11, "EnableFillBinaryVacancy": 1, "GrayscaleEnhancementModesIndex": -1, "Mode": "BM_LOCAL_BLOCK", "MorphOperation": "Erode", "MorphOperationKernelSizeX": 0, "MorphOperationKernelSizeY": 0, "MorphShape": "Rectangle", "ThresholdCompensation": 10 }],
338338
"CharacterNormalizationModes": [{ "Mode": "CNM_AUTO", "MorphArgument": "3", "MorphOperation": "Close" }],
339-
"GrayscaleEnhancementModes": [{ "Mode": "GEM_GENERAL", "Sensitivity": 5, "SharpenBlockSizeX": 3, "SharpenBlockSizeY": 3, "SmoothBlockSizeX": 3, "SmoothBlockSizeY": 3 }],
339+
"GrayscaleEnhancementModes": [{ "Mode": "GEM_GENERAL", "Sensitivity": 5, "SharpenBlockSizeX": 3, "SharpenBlockSizeY": 3, "SmoothBlockSizeX": 3, "SmoothBlockSizeY": 3 }, { "Mode": "GEM_GRAY_EQUALIZE", "Sensitivity": 9, "SharpenBlockSizeX": -1, "SharpenBlockSizeY": -1, "SmoothBlockSizeX": -1, "SmoothBlockSizeY": -1 }],
340340
"ConcatResults": 0,
341341
"ConcatSeparator": "\n",
342342
"ConcatStringLengthRange": [3, 200],

0 commit comments

Comments
 (0)