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::distanceTransform throws exception on input mask of type CV_Bool #29596
When passed a cv::Mat_<bool>, cv::distanceTransform worked fine in 4.x, but now asserts at modules/imgproc/src/distransform.cpp:1024:
CV_Assert( src.type() == CV_8UC1);
I believe this function was (and all other related functions were) missed when CV_Bool was added, and the assertion should be extended to allow CV_Bool as src.type() value.
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::connectedComponentsWithStats), which seems contrary to the intention of having a boolean datatype?
See also previous similar issues: #29578, #29593
Activity
imgproc: accept CV_Bool masks in distanceTransform