mirror of
https://github.com/opencv/opencv.git
synced 2026-12-05 22:45:01 -06:00
cv::Mat_<bool>::depth() returns CV_Bool in 5.0, where it was CV_8U in 4.x, so code that passed a boolean mask to inpaint() stopped working on the 5.x branch. icvInpaint() rejected anything that was not CV_8UC1, even though CV_Bool is a single byte like CV_8U and the uchar reads in the fast marching code are already correct for it. Relaxing the type gate is therefore sufficient, no conversion of the mask is needed. The regression test checks a boolean mask against the equivalent CV_8U mask and requires both the output type and every pixel to match, for both inpainting algorithms and for 1 and 3 channel input. Verified locally: the test fails against unmodified 5.x with "The mask must be 8-bit 1-channel image" and passes with the change. The rest of opencv_test_photo is unaffected.