You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SerialPrograms/Source/CommonTools/OCR/OCR_NumberReader.h
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,10 @@ int read_number(Logger& logger, const ImageViewRGB32& image, Language language =
27
27
// This version attempts to improve reliability by first isolating each number
28
28
// via waterfill. Then it OCRs each number by itself and recombines them at the
29
29
// end. This requires specifying the color range for the text.
30
+
//
31
+
// text_inside_range: binary filter is applied to the image so that any pixels within the color range will be turned black, and everything else will be white
32
+
// width_max: return -1 if any character's width is greater than width_max (likely means that two characters are touching, and so are treated as one large character)
33
+
// check_empty_string: if set to true, return -1 (and stop evaluation) if any character returns an empty string from OCR
30
34
intread_number_waterfill(
31
35
Logger& logger, const ImageViewRGB32& image,
32
36
uint32_t rgb32_min, uint32_t rgb32_max,
@@ -35,10 +39,8 @@ int read_number_waterfill(
35
39
bool check_empty_string = false
36
40
);
37
41
38
-
// applies color filters on the text, until each individual waterfilled character/number is less than width_max. then apply OCR.
39
-
// this solves the problem where characters are too close to each other and touch, causing more than one character to be OCR'ed
40
-
// also, if running OCR on a character results in an empty string, try the next color filter
41
-
// the filters should be arranged in order of preference. (probably should be arranged broadest to narrowest)
0 commit comments