mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-09 04:50:05 +08:00
Added pipeline_data to character analaysis and character segmentation
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user