No need to check vector size before clear()
This commit is contained in:
parent
2a669555de
commit
ac8744af6a
@ -930,14 +930,12 @@ 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_);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user