mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:37:00 +08:00
Merge pull request #105 from peters/master
Minor bugfixes for classifychars
This commit is contained in:
@@ -123,6 +123,11 @@ int main( int argc, const char** argv )
|
|||||||
string fullpath = inDir + "/" + files[i];
|
string fullpath = inDir + "/" + files[i];
|
||||||
cout << fullpath << endl;
|
cout << fullpath << endl;
|
||||||
frame = imread( fullpath.c_str() );
|
frame = imread( fullpath.c_str() );
|
||||||
|
if(frame.data == NULL)
|
||||||
|
{
|
||||||
|
cout << "Unable to read license plate: " << fullpath << endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
resize(frame, frame, Size(config.ocrImageWidthPx, config.ocrImageHeightPx));
|
resize(frame, frame, Size(config.ocrImageWidthPx, config.ocrImageHeightPx));
|
||||||
|
|
||||||
imshow ("Original", frame);
|
imshow ("Original", frame);
|
||||||
|
@@ -8,30 +8,23 @@ namespace alpr
|
|||||||
|
|
||||||
PipelineData::PipelineData(Mat colorImage, Rect regionOfInterest, Config* config)
|
PipelineData::PipelineData(Mat colorImage, Rect regionOfInterest, Config* config)
|
||||||
{
|
{
|
||||||
Mat grayImg;
|
Mat grayImage;
|
||||||
|
|
||||||
if (colorImage.channels() > 2)
|
if (colorImage.channels() > 2)
|
||||||
{
|
{
|
||||||
cvtColor(this->colorImg, grayImg, CV_BGR2GRAY);
|
cvtColor(colorImage, grayImage, CV_BGR2GRAY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
grayImg = colorImage;
|
grayImage = colorImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
PipelineData(colorImage, grayImg, regionOfInterest, config);
|
this->init(colorImage, grayImage, regionOfInterest, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
PipelineData::PipelineData(Mat colorImage, Mat grayImg, Rect regionOfInterest, Config* config)
|
PipelineData::PipelineData(Mat colorImage, Mat grayImg, Rect regionOfInterest, Config* config)
|
||||||
{
|
{
|
||||||
this->colorImg = colorImage;
|
this->init(colorImage, grayImg, regionOfInterest, config);
|
||||||
this->grayImg = grayImg;
|
|
||||||
|
|
||||||
this->regionOfInterest = regionOfInterest;
|
|
||||||
this->config = config;
|
|
||||||
|
|
||||||
this->region_confidence = 0;
|
|
||||||
|
|
||||||
plate_inverted = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PipelineData::~PipelineData()
|
PipelineData::~PipelineData()
|
||||||
@@ -48,4 +41,12 @@ namespace alpr
|
|||||||
thresholds.clear();
|
thresholds.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PipelineData::init(cv::Mat colorImage, cv::Mat grayImage, cv::Rect regionOfInterest, Config *config) {
|
||||||
|
this->colorImg = colorImage;
|
||||||
|
this->grayImg = grayImage;
|
||||||
|
this->regionOfInterest = regionOfInterest;
|
||||||
|
this->config = config;
|
||||||
|
this->region_confidence = 0;
|
||||||
|
this->plate_inverted = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ namespace alpr
|
|||||||
PipelineData(cv::Mat colorImage, cv::Mat grayImage, cv::Rect regionOfInterest, Config* config);
|
PipelineData(cv::Mat colorImage, cv::Mat grayImage, cv::Rect regionOfInterest, Config* config);
|
||||||
virtual ~PipelineData();
|
virtual ~PipelineData();
|
||||||
|
|
||||||
|
void init(cv::Mat colorImage, cv::Mat grayImage, cv::Rect regionOfInterest, Config* config);
|
||||||
void clearThresholds();
|
void clearThresholds();
|
||||||
|
|
||||||
// Inputs
|
// Inputs
|
||||||
|
Reference in New Issue
Block a user