mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 16:21:01 +08:00
Resolves issue #53
This commit is contained in:
@@ -92,7 +92,7 @@ void OCR::performOCR(PipelineData* pipeline_data)
|
|||||||
|
|
||||||
if(symbol != 0 && pointsize >= config->ocrMinFontSize)
|
if(symbol != 0 && pointsize >= config->ocrMinFontSize)
|
||||||
{
|
{
|
||||||
postProcessor->addLetter(*symbol, j, conf);
|
postProcessor->addLetter(string(symbol), j, conf);
|
||||||
|
|
||||||
if (this->config->debugOcr)
|
if (this->config->debugOcr)
|
||||||
printf("charpos%d: threshold %d: symbol %s, conf: %f font: %s (index %d) size %dpx", j, i, symbol, conf, fontName, fontindex, pointsize);
|
printf("charpos%d: threshold %d: symbol %s, conf: %f font: %s (index %d) size %dpx", j, i, symbol, conf, fontName, fontindex, pointsize);
|
||||||
@@ -103,7 +103,7 @@ void OCR::performOCR(PipelineData* pipeline_data)
|
|||||||
{
|
{
|
||||||
const char* choice = ci.GetUTF8Text();
|
const char* choice = ci.GetUTF8Text();
|
||||||
|
|
||||||
postProcessor->addLetter(*choice, j, ci.Confidence());
|
postProcessor->addLetter(string(choice), j, ci.Confidence());
|
||||||
|
|
||||||
//letterScores.addScore(*choice, j, ci.Confidence() - MIN_CONFIDENCE);
|
//letterScores.addScore(*choice, j, ci.Confidence() - MIN_CONFIDENCE);
|
||||||
if (this->config->debugOcr)
|
if (this->config->debugOcr)
|
||||||
|
@@ -69,7 +69,7 @@ PostProcess::~PostProcess()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostProcess::addLetter(char letter, int charposition, float score)
|
void PostProcess::addLetter(string letter, int charposition, float score)
|
||||||
{
|
{
|
||||||
if (score < config->postProcessMinConfidence)
|
if (score < config->postProcessMinConfidence)
|
||||||
return;
|
return;
|
||||||
@@ -88,7 +88,7 @@ void PostProcess::addLetter(char letter, int charposition, float score)
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostProcess::insertLetter(char letter, int charposition, float score)
|
void PostProcess::insertLetter(string letter, int charposition, float score)
|
||||||
{
|
{
|
||||||
score = score - config->postProcessMinConfidence;
|
score = score - config->postProcessMinConfidence;
|
||||||
|
|
||||||
|
@@ -30,11 +30,11 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#define SKIP_CHAR '~'
|
#define SKIP_CHAR "~"
|
||||||
|
|
||||||
struct Letter
|
struct Letter
|
||||||
{
|
{
|
||||||
char letter;
|
std::string letter;
|
||||||
int charposition;
|
int charposition;
|
||||||
float totalscore;
|
float totalscore;
|
||||||
int occurences;
|
int occurences;
|
||||||
@@ -73,7 +73,7 @@ class PostProcess
|
|||||||
PostProcess(Config* config);
|
PostProcess(Config* config);
|
||||||
~PostProcess();
|
~PostProcess();
|
||||||
|
|
||||||
void addLetter(char letter, int charposition, float score);
|
void addLetter(std::string letter, int charposition, float score);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void analyze(std::string templateregion, int topn);
|
void analyze(std::string templateregion, int topn);
|
||||||
@@ -88,7 +88,7 @@ class PostProcess
|
|||||||
//void getTopN();
|
//void getTopN();
|
||||||
void findAllPermutations(std::vector<Letter> prevletters, int charPos, int substitutionsLeft);
|
void findAllPermutations(std::vector<Letter> prevletters, int charPos, int substitutionsLeft);
|
||||||
|
|
||||||
void insertLetter(char letter, int charPosition, float score);
|
void insertLetter(std::string letter, int charPosition, float score);
|
||||||
|
|
||||||
std::map<std::string, std::vector<RegexRule*> > rules;
|
std::map<std::string, std::vector<RegexRule*> > rules;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user