Commit ac8744af authored by Andy Maloney's avatar Andy Maloney

No need to check vector size before clear()

parent 2a669555
...@@ -930,15 +930,13 @@ void ChamferMatcher::Template::show() const ...@@ -930,15 +930,13 @@ void ChamferMatcher::Template::show() const
void ChamferMatcher::Matching::addTemplateFromImage(Mat& templ, float scale) void ChamferMatcher::Matching::addTemplateFromImage(Mat& templ, float scale)
{ {
Template* cmt = new Template(templ, scale); Template* cmt = new Template(templ, scale);
if(templates.size() > 0) templates.clear();
templates.clear();
templates.push_back(cmt); templates.push_back(cmt);
cmt->show(); cmt->show();
} }
void ChamferMatcher::Matching::addTemplate(Template& template_){ void ChamferMatcher::Matching::addTemplate(Template& template_){
if(templates.size() > 0) templates.clear();
templates.clear();
templates.push_back(&template_); templates.push_back(&template_);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment