Merge pull request #2756 from ElenaGvozdeva:ippi_matchTemplate

pull/2681/merge
Alexander Alekhin 11 years ago committed by OpenCV Buildbot
commit ada2879faa
  1. 6
      modules/imgproc/src/templmatch.cpp

@ -634,7 +634,9 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
#endif #endif
#if defined HAVE_IPP #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)) if (ipp_sqrDistance(img, templ, result))
return; return;
@ -643,7 +645,7 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
#endif #endif
#if defined HAVE_IPP #if defined HAVE_IPP
if (cn == 1) if (cn == 1 && useIppMT)
{ {
if (!ipp_crossCorr(img, templ, result)) if (!ipp_crossCorr(img, templ, result))
{ {

Loading…
Cancel
Save