I got this image and I’d like to fill the upper left black area with white, but all I get is a completely white image … Any ideas what’s wrong with my code?
Code:
...
cv::Rect rect;
roi = cv::floodFill(roi, cv::Point(1,1), cv::Scalar(0), &rect, cv::Scalar(0), cv::Scalar(0), 4);
...
Input image:

This is the image I get with the following code:
Notice that I used 200 as upDiff parameter, since if you set it to 0 there will be some gray pixels that will not be considered inside the connected component, change that if that is indeed what you want.