Added pipeline_data to character analaysis and character segmentation

This commit is contained in:
Matt Hill
2014-07-01 18:26:01 -04:00
parent b9422dc063
commit a0af4093d6
13 changed files with 49 additions and 67 deletions

View File

@@ -104,6 +104,8 @@ int main( int argc, const char** argv )
plateCoords.y = 0;
plateCoords.width = frame.cols;
plateCoords.height = frame.rows;
PipelineData pipeline_data(frame, plateCoords, config);
char statecode[3];
statecode[0] = files[i][0];
@@ -111,7 +113,7 @@ int main( int argc, const char** argv )
statecode[2] = '\0';
string statecodestr(statecode);
CharacterRegion charRegion(frame, config);
CharacterRegion charRegion(&pipeline_data);
if (abs(charRegion.getTopLine().angle) > 4)
{
@@ -124,9 +126,10 @@ int main( int argc, const char** argv )
warpAffine( frame, rotated, rot_mat, frame.size() );
rotated.copyTo(frame);
pipeline_data.crop_gray = frame;
}
CharacterSegmenter charSegmenter(frame, charRegion.thresholdsInverted(), config);
CharacterSegmenter charSegmenter(&pipeline_data);
ocr->performOCR(charSegmenter.getThresholds(), charSegmenter.characters);
ocr->postProcessor->analyze(statecode, 25);

View File

@@ -124,13 +124,14 @@ int main( int argc, const char** argv )
imshow ("Original", frame);
PipelineData pipeline_data(frame, Rect(0, 0, frame.cols, frame.rows), &config);
char statecode[3];
statecode[0] = files[i][0];
statecode[1] = files[i][1];
statecode[2] = '\0';
string statecodestr(statecode);
CharacterRegion regionizer(frame, &config);
CharacterRegion regionizer(&pipeline_data);
if (abs(regionizer.getTopLine().angle) > 4)
{
@@ -143,9 +144,10 @@ int main( int argc, const char** argv )
warpAffine( frame, rotated, rot_mat, frame.size() );
rotated.copyTo(frame);
pipeline_data.crop_gray = rotated;
}
CharacterSegmenter charSegmenter(frame, regionizer.thresholdsInverted(), &config);
CharacterSegmenter charSegmenter(&pipeline_data);
//ocr.cleanCharRegions(charSegmenter.thresholds, charSegmenter.characters);