Added prewarp reset by passing in empty prewarp config

This commit is contained in:
Matt Hill
2016-02-16 15:17:15 -05:00
parent b20c7becb5
commit 4735b5d89b
3 changed files with 8 additions and 1 deletions

View File

@@ -661,7 +661,10 @@ namespace alpr
void AlprImpl::setPrewarp(std::string prewarp_config)
{
prewarp->initialize(prewarp_config);
if (prewarp_config.length() == 0)
prewarp ->clear();
else
prewarp->initialize(prewarp_config);
}

View File

@@ -103,6 +103,9 @@ namespace alpr
if (config->debugTiming)
cout << "Prewarp Initialization Time: " << diffclock(startTime, endTime) << "ms." << endl;
}
void PreWarp::clear() {
this->valid = false;
}
PreWarp::~PreWarp() {
}

View File

@@ -35,6 +35,7 @@ namespace alpr
virtual ~PreWarp();
void initialize(std::string prewarp_config);
void clear();
cv::Mat warpImage(cv::Mat image);
std::vector<cv::Point2f> projectPoints(std::vector<cv::Point2f> points, bool inverse);