In 5.0 cv::Mat_<bool>::depth() returns CV_Bool instead of CV_8U, so
boundingRect routed boolean masks into pointSetBoundingRect, which expects
a CV_32S/CV_32F point set and threw. CV_Bool is a 1-byte 0/1 mask type, so
handle it like CV_8U/CV_8S via the byte-wise maskBoundingRect path.