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
{{ message }}
Repository navigation
cv::boundingRect called with cv::Mat_<bool> throws exception in 5.0.0, works in 4.x #29578
When passed a cv::Mat_<bool>, this worked fine in 4.x, but now throws an exception from pointSetBoundingRect that depth needs to be CV_32F or CV_32S.
I believe this function was missed when CV_Bool was added, and it should follow (conceptually) the maskBoundingRect path. Unfortunately, that function seems to assume 1 byte wide element type so it will need a specific CV_Bool implementation.
CV_Bool matrices can now be used as masks wherever a CV_8U or CV_8S mask was previously accepted.
Workarounds include not using cv::Mat_<bool> as a mask type (at least for cv::boundingRect, which seems contrary to the intention of having a boolean datatype?
Activity
rubenvb commentedon Jul 24, 2026
The proposed fix seems to work for our codebase.