File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -153,14 +153,16 @@ class CV_EXPORTS_W OCRTesseract : public BaseOCR
153
153
@param datapath the name of the parent directory of tessdata ended with "/", or NULL to use the
154
154
system's default directory.
155
155
@param language an ISO 639-3 code or NULL will default to "eng".
156
- @param char_whitelist specifies the list of characters used for recognition. NULL defaults to
157
- "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" .
156
+ @param char_whitelist specifies the list of characters used for recognition. NULL defaults to ""
157
+ (All characters will be used for recognition) .
158
158
@param oem tesseract-ocr offers different OCR Engine Modes (OEM), by default
159
159
tesseract::OEM_DEFAULT is used. See the tesseract-ocr API documentation for other possible
160
160
values.
161
161
@param psmode tesseract-ocr offers different Page Segmentation Modes (PSM) tesseract::PSM_AUTO
162
162
(fully automatic layout analysis) is used. See the tesseract-ocr API documentation for other
163
163
possible values.
164
+
165
+ @note The char_whitelist default is changed after OpenCV 4.7.0/3.19.0 from "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" to "".
164
166
*/
165
167
CV_WRAP static Ptr<OCRTesseract> create (const char * datapath=NULL , const char * language=NULL ,
166
168
const char * char_whitelist=NULL , int oem=OEM_DEFAULT, int psmode=PSM_AUTO);
Original file line number Diff line number Diff line change @@ -163,10 +163,12 @@ class OCRTesseractImpl CV_FINAL : public OCRTesseract
163
163
tesseract::PageSegMode pagesegmode = (tesseract::PageSegMode)psmode;
164
164
tess.SetPageSegMode (pagesegmode);
165
165
166
+ // tessedit_whitelist default changes from [0-9a-zA-Z] to "".
167
+ // See https://github.com/opencv/opencv_contrib/issues/3457
166
168
if (char_whitelist != NULL )
167
169
tess.SetVariable (" tessedit_char_whitelist" , char_whitelist);
168
170
else
169
- tess.SetVariable (" tessedit_char_whitelist" , " 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " );
171
+ tess.SetVariable (" tessedit_char_whitelist" , " " );
170
172
171
173
tess.SetVariable (" save_best_choices" , " T" );
172
174
#else
You can’t perform that action at this time.
0 commit comments