mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 20:09:23 +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)
|
||||
{
|
||||
Mat mask_copy = mask.clone(); // Create a copy of the mask
|
||||
|
||||
threshold(mask_copy, mask_copy, 0/*threshold*/, 1.0/*maxVal*/, THRESH_BINARY);
|
||||
mask_copy.convertTo(mask_copy, 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…
Reference in New Issue
Block a user