From 85d519b6c3b6e2d3597fdabb4cd57158e8a13c30 Mon Sep 17 00:00:00 2001 From: Elena Gvozdeva Date: Tue, 4 Feb 2014 10:54:02 +0400 Subject: [PATCH] fixed --- modules/imgproc/src/templmatch.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/templmatch.cpp b/modules/imgproc/src/templmatch.cpp index b5dbba992a..f138427dcb 100644 --- a/modules/imgproc/src/templmatch.cpp +++ b/modules/imgproc/src/templmatch.cpp @@ -191,8 +191,13 @@ static bool matchTemplate_CCOEFF(InputArray _image, InputArray _templ, OutputArr { matchTemplate(_image, _templ, _result, CV_TM_CCORR); - UMat image_sums; - integral(_image, image_sums); + UMat image_sums, temp; + integral(_image, temp); + + if(temp.depth() == CV_64F) + temp.convertTo(image_sums, CV_32F); + else + image_sums = temp; int type = image_sums.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);