fixed test ocl_MatchTemplate for sparse matrix

This commit is contained in:
Elena Gvozdeva
2014-08-07 16:00:25 +04:00
parent 7dd7dd97cd
commit b5f251c815
3 changed files with 43 additions and 12 deletions

View File

@@ -454,14 +454,15 @@ static bool matchTemplate_CCOEFF(InputArray _image, InputArray _templ, OutputArr
if (cn==1)
{
float templ_sum = static_cast<float>(sum(_templ)[0]) / tsize.area();
Scalar templMean = mean(templ);
float templ_sum = (float)templMean[0];
k.args(ocl::KernelArg::ReadOnlyNoSize(image_sums), ocl::KernelArg::ReadWrite(result), templ.rows, templ.cols, templ_sum);
}
else
{
Vec4f templ_sum = Vec4f::all(0);
templ_sum = sum(templ) / tsize.area();
templ_sum = (Vec4f)mean(templ);
k.args(ocl::KernelArg::ReadOnlyNoSize(image_sums), ocl::KernelArg::ReadWrite(result), templ.rows, templ.cols, templ_sum); }