mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 04:36:50 +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];
|
||||
cout << fullpath << endl;
|
||||
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));
|
||||
|
||||
imshow ("Original", frame);
|
||||
|
@@ -8,30 +8,23 @@ namespace alpr
|
||||
|
||||
PipelineData::PipelineData(Mat colorImage, Rect regionOfInterest, Config* config)
|
||||
{
|
||||
Mat grayImg;
|
||||
Mat grayImage;
|
||||
|
||||
if (colorImage.channels() > 2)
|
||||
{
|
||||
cvtColor(this->colorImg, grayImg, CV_BGR2GRAY);
|
||||
cvtColor(colorImage, grayImage, CV_BGR2GRAY);
|
||||
}
|
||||
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)
|
||||
{
|
||||
this->colorImg = colorImage;
|
||||
this->grayImg = grayImg;
|
||||
|
||||
this->regionOfInterest = regionOfInterest;
|
||||
this->config = config;
|
||||
|
||||
this->region_confidence = 0;
|
||||
|
||||
plate_inverted = false;
|
||||
this->init(colorImage, grayImg, regionOfInterest, config);
|
||||
}
|
||||
|
||||
PipelineData::~PipelineData()
|
||||
@@ -48,4 +41,12 @@ namespace alpr
|
||||
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);
|
||||
virtual ~PipelineData();
|
||||
|
||||
void init(cv::Mat colorImage, cv::Mat grayImage, cv::Rect regionOfInterest, Config* config);
|
||||
void clearThresholds();
|
||||
|
||||
// Inputs
|
||||
|
Reference in New Issue
Block a user