Skip to content

Commit

Permalink
Merge pull request opencv#2756 from ElenaGvozdeva:ippi_matchTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek authored and OpenCV Buildbot committed May 15, 2014
2 parents cafcfc4 + ce0b808 commit ada2879
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/imgproc/src/templmatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,9 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
#endif

#if defined HAVE_IPP
if (method == CV_TM_SQDIFF && cn == 1)
bool useIppMT = (templ.rows < img.rows/2 && templ.cols < img.cols/2);

if (method == CV_TM_SQDIFF && cn == 1 && useIppMT)
{
if (ipp_sqrDistance(img, templ, result))
return;
Expand All @@ -643,7 +645,7 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
#endif

#if defined HAVE_IPP
if (cn == 1)
if (cn == 1 && useIppMT)
{
if (!ipp_crossCorr(img, templ, result))
{
Expand Down

0 comments on commit ada2879

Please sign in to comment.