fixed test ocl_MatchTemplate for sparse matrix
This commit is contained in:
@@ -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); }
|
||||
|
||||
|
Reference in New Issue
Block a user