Commit ada2879f authored by Alexander Alekhin's avatar Alexander Alekhin Committed by OpenCV Buildbot

Merge pull request #2756 from ElenaGvozdeva:ippi_matchTemplate

parents cafcfc4d ce0b808e
......@@ -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;
......@@ -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))
{
......
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