mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
Fix mask thresholding
This commit is contained in:
parent
6157db6462
commit
c97942cf78
@ -779,11 +779,9 @@ static void matchTemplateMask( InputArray _img, InputArray _templ, OutputArray _
|
|||||||
}
|
}
|
||||||
if (mask.depth() == CV_8U)
|
if (mask.depth() == CV_8U)
|
||||||
{
|
{
|
||||||
Mat mask_copy = mask.clone(); // Create a copy of the mask
|
Mat maskBin;
|
||||||
|
threshold(mask, maskBin, 0/*threshold*/, 1.0/*maxVal*/, THRESH_BINARY);
|
||||||
threshold(mask_copy, mask_copy, 0/*threshold*/, 1.0/*maxVal*/, THRESH_BINARY);
|
maskBin.convertTo(mask, CV_32F);
|
||||||
mask_copy.convertTo(mask_copy, CV_32F);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Size corrSize(img.cols - templ.cols + 1, img.rows - templ.rows + 1);
|
Size corrSize(img.cols - templ.cols + 1, img.rows - templ.rows + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user