mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:06:54 +08:00
c++03 does not support delegating constructors, fallback to init pattern
This commit is contained in:
@@ -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(colorImage, 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