You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In most (I hope, all) OpenCV functions mask can currently have CV_8U or sometimes CV_8S type; and any non-zero value value is treated as 'true', so it's compatible with 255, 1 and other values. In 5.x branch in all functions that can now handle CV_Bool, they treat any non-zero value as true. So basically we should just add CV_Bool as allowed mask type and maybe optionally modify cv::compare() to specify output type. Make it CV_Bool by default? Maybe not yet.
Activity
vpisarev commentedon Jul 12, 2024
asmorkalov commentedon Jul 12, 2024
Related: #25890
asmorkalov commentedon Jul 12, 2024
Decisions from core team meeting:
Merge pull request #25902 from asmorkalov:as/core_mask_cvbool
asmorkalov commentedon May 7, 2026
Several PRs that introduce CV_Bool support here and there:
Merge pull request opencv#25902 from asmorkalov:as/core_mask_cvbool
features: accept CV_Bool masks in SIFT detect (opencv#25895)
photo: accept CV_Bool masks in inpaint (opencv#25895)
photo: accept CV_Bool masks in inpaint (opencv#25895)
Merge pull request #29676 from Neal006:photo/inpaint-bool-mask
Merge pull request #29681 from Neal006:video/ecc-bool-mask
Merge pull request #29677 from Neal006:imgproc/matchtemplate-bool-mask
Merge pull request #29679 from Neal006/features:keypoint-bool-mask