mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:46:59 +08:00
Ignoring space (' ') character whenever Tesseract returns it
This commit is contained in:
@@ -53,6 +53,8 @@ namespace alpr
|
|||||||
|
|
||||||
void OCR::performOCR(PipelineData* pipeline_data)
|
void OCR::performOCR(PipelineData* pipeline_data)
|
||||||
{
|
{
|
||||||
|
const int SPACE_CHAR_CODE = 32;
|
||||||
|
|
||||||
timespec startTime;
|
timespec startTime;
|
||||||
getTimeMonotonic(&startTime);
|
getTimeMonotonic(&startTime);
|
||||||
|
|
||||||
@@ -89,7 +91,8 @@ namespace alpr
|
|||||||
int pointsize = 0;
|
int pointsize = 0;
|
||||||
const char* fontName = ri->WordFontAttributes(&dontcare, &dontcare, &dontcare, &dontcare, &dontcare, &dontcare, &pointsize, &fontindex);
|
const char* fontName = ri->WordFontAttributes(&dontcare, &dontcare, &dontcare, &dontcare, &dontcare, &dontcare, &pointsize, &fontindex);
|
||||||
|
|
||||||
if(symbol != 0 && pointsize >= config->ocrMinFontSize)
|
// Ignore NULL pointers, spaces, and characters that are way too small to be valid
|
||||||
|
if(symbol != 0 && symbol[0] != SPACE_CHAR_CODE && pointsize >= config->ocrMinFontSize)
|
||||||
{
|
{
|
||||||
postProcessor.addLetter(string(symbol), j, conf);
|
postProcessor.addLetter(string(symbol), j, conf);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user