Add empty lines where it makes sense

This commit is contained in:
Philippe Vaucher
2014-03-24 10:45:14 +01:00
parent 4934cf59d2
commit d24ed44f83
7 changed files with 20 additions and 0 deletions

View File

@@ -26,10 +26,12 @@ Alpr::Alpr(const std::string country, const std::string runtimeDir)
{ {
impl = new AlprImpl(country, runtimeDir); impl = new AlprImpl(country, runtimeDir);
} }
Alpr::~Alpr() Alpr::~Alpr()
{ {
delete impl; delete impl;
} }
std::vector<AlprResult> Alpr::recognize(std::string filepath) std::vector<AlprResult> Alpr::recognize(std::string filepath)
{ {
cv::Mat img = cv::imread(filepath, CV_LOAD_IMAGE_COLOR); cv::Mat img = cv::imread(filepath, CV_LOAD_IMAGE_COLOR);
@@ -53,10 +55,12 @@ void Alpr::setDetectRegion(bool detectRegion)
{ {
impl->setDetectRegion(detectRegion); impl->setDetectRegion(detectRegion);
} }
void Alpr::setTopN(int topN) void Alpr::setTopN(int topN)
{ {
impl->setTopN(topN); impl->setTopN(topN);
} }
void Alpr::setDefaultRegion(std::string region) void Alpr::setDefaultRegion(std::string region)
{ {
impl->setDefaultRegion(region); impl->setDefaultRegion(region);
@@ -72,6 +76,7 @@ bool Alpr::isLoaded()
AlprResult::AlprResult() AlprResult::AlprResult()
{ {
} }
AlprResult::~AlprResult() AlprResult::~AlprResult()
{ {
} }

View File

@@ -58,6 +58,7 @@ AlprImpl::AlprImpl(const std::string country, const std::string runtimeDir)
} }
} }
} }
AlprImpl::~AlprImpl() AlprImpl::~AlprImpl()
{ {
delete config; delete config;
@@ -245,10 +246,12 @@ void AlprImpl::setDetectRegion(bool detectRegion)
{ {
this->detectRegion = detectRegion; this->detectRegion = detectRegion;
} }
void AlprImpl::setTopN(int topn) void AlprImpl::setTopN(int topn)
{ {
this->topN = topn; this->topN = topn;
} }
void AlprImpl::setDefaultRegion(string region) void AlprImpl::setDefaultRegion(string region)
{ {
this->defaultRegion = region; this->defaultRegion = region;

View File

@@ -697,6 +697,7 @@ void CharacterSegmenter::cleanMostlyFullBoxes(vector<Mat> thresholds, const vect
} }
} }
} }
vector<Rect> CharacterSegmenter::filterMostlyEmptyBoxes(vector<Mat> thresholds, const vector<Rect> charRegions) vector<Rect> CharacterSegmenter::filterMostlyEmptyBoxes(vector<Mat> thresholds, const vector<Rect> charRegions)
{ {
// Of the n thresholded images, if box 3 (for example) is empty in half (for example) of the thresholded images, // Of the n thresholded images, if box 3 (for example) is empty in half (for example) of the thresholded images,

View File

@@ -61,6 +61,7 @@ Config::Config(const std::string country, const std::string runtimeBaseDir)
loadValues(country); loadValues(country);
} }
Config::~Config() Config::~Config()
{ {
delete ini; delete ini;
@@ -148,14 +149,17 @@ string Config::getCascadeRuntimeDir()
{ {
return this->runtimeBaseDir + CASCADE_DIR; return this->runtimeBaseDir + CASCADE_DIR;
} }
string Config::getKeypointsRuntimeDir() string Config::getKeypointsRuntimeDir()
{ {
return this->runtimeBaseDir + KEYPOINTS_DIR; return this->runtimeBaseDir + KEYPOINTS_DIR;
} }
string Config::getPostProcessRuntimeDir() string Config::getPostProcessRuntimeDir()
{ {
return this->runtimeBaseDir + POSTPROCESS_DIR; return this->runtimeBaseDir + POSTPROCESS_DIR;
} }
string Config::getTessdataPrefix() string Config::getTessdataPrefix()
{ {
return "TESSDATA_PREFIX=" + this->runtimeBaseDir + "/ocr/"; return "TESSDATA_PREFIX=" + this->runtimeBaseDir + "/ocr/";
@@ -173,6 +177,7 @@ float Config::getFloat(string section, string key, float defaultValue)
float val = atof(pszValue); float val = atof(pszValue);
return val; return val;
} }
int Config::getInt(string section, string key, int defaultValue) int Config::getInt(string section, string key, int defaultValue)
{ {
const char * pszValue = ini->GetValue(section.c_str(), key.c_str(), NULL /*default*/); const char * pszValue = ini->GetValue(section.c_str(), key.c_str(), NULL /*default*/);
@@ -185,6 +190,7 @@ int Config::getInt(string section, string key, int defaultValue)
int val = atoi(pszValue); int val = atoi(pszValue);
return val; return val;
} }
bool Config::getBoolean(string section, string key, bool defaultValue) bool Config::getBoolean(string section, string key, bool defaultValue)
{ {
const char * pszValue = ini->GetValue(section.c_str(), key.c_str(), NULL /*default*/); const char * pszValue = ini->GetValue(section.c_str(), key.c_str(), NULL /*default*/);
@@ -197,6 +203,7 @@ bool Config::getBoolean(string section, string key, bool defaultValue)
int val = atoi(pszValue); int val = atoi(pszValue);
return val != 0; return val != 0;
} }
string Config::getString(string section, string key, string defaultValue) string Config::getString(string section, string key, string defaultValue)
{ {
const char * pszValue = ini->GetValue(section.c_str(), key.c_str(), NULL /*default*/); const char * pszValue = ini->GetValue(section.c_str(), key.c_str(), NULL /*default*/);

View File

@@ -142,6 +142,7 @@ void PostProcess::clear()
bestChars = ""; bestChars = "";
matchesTemplate = false; matchesTemplate = false;
} }
void PostProcess::analyze(string templateregion, int topn) void PostProcess::analyze(string templateregion, int topn)
{ {
timespec startTime; timespec startTime;

View File

@@ -72,6 +72,7 @@ void getTime(timespec* time)
{ {
clock_gettime(0, time); clock_gettime(0, time);
} }
double diffclock(timespec time1,timespec time2) double diffclock(timespec time1,timespec time2)
{ {
timespec delta = diff(time1,time2); timespec delta = diff(time1,time2);
@@ -112,6 +113,7 @@ void getTime(timespec* time)
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, time); clock_gettime(CLOCK_PROCESS_CPUTIME_ID, time);
#endif #endif
} }
double diffclock(timespec time1,timespec time2) double diffclock(timespec time1,timespec time2)
{ {
timespec delta = diff(time1,time2); timespec delta = diff(time1,time2);

View File

@@ -262,6 +262,7 @@ LineSegment::LineSegment(Point p1, Point p2)
{ {
init(p1.x, p1.y, p2.x, p2.y); init(p1.x, p1.y, p2.x, p2.y);
} }
LineSegment::LineSegment(int x1, int y1, int x2, int y2) LineSegment::LineSegment(int x1, int y1, int x2, int y2)
{ {
init(x1, y1, x2, y2); init(x1, y1, x2, y2);