Merge pull request #23694 from dkurt:update_matchTemplateMask

Update matchTemplate with mask
pull/23695/head
Alexander Smorkalov 2 years ago committed by GitHub
commit 7b998c30e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      modules/imgproc/src/templmatch.cpp

@ -779,9 +779,9 @@ static void matchTemplateMask( InputArray _img, InputArray _templ, OutputArray _
}
if (mask.depth() == CV_8U)
{
// To keep compatibility to other masks in OpenCV: CV_8U masks are binary masks
threshold(mask, mask, 0/*threshold*/, 1.0/*maxVal*/, THRESH_BINARY);
mask.convertTo(mask, CV_32F);
Mat maskBin;
threshold(mask, maskBin, 0/*threshold*/, 1.0/*maxVal*/, THRESH_BINARY);
maskBin.convertTo(mask, CV_32F);
}
Size corrSize(img.cols - templ.cols + 1, img.rows - templ.rows + 1);

Loading…
Cancel
Save