Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to get a mask of an image so that i can use it in the inpainting function

i want my mask to be black obviously and the red line which is my region of interest to be white so that i can use it inside the inpainting function...! am having this code but it not working

 cv::inRange(img, cv::Scalar(0, 100, 220), cv::Scalar(10, 255, 255), lower);
    cv::inRange(img, cv::Scalar(0, 10, 100), cv::Scalar(255, 255, 255), upper);
threshold(mask, mask,10,255, CV_THRESH_BINARY); inpaint(img, mask, inpainted,3,CV_INPAINT_TELEA);

can someone help me..

image description

click to hide/show revision 2
None

updated 2018-12-19 11:42:57 -0600

berak gravatar image

how to get a mask of an image so that i can use it in the inpainting function

i want my mask to be black obviously and the red line which is my region of interest to be white so that i can use it inside the inpainting function...! am having this code but it not working

 cv::inRange(img, cv::Scalar(0, 100, 220), cv::Scalar(10, 255, 255), lower);
    cv::inRange(img, cv::Scalar(0, 10, 100), cv::Scalar(255, 255, 255), upper);
threshold(mask, mask,10,255, CV_THRESH_BINARY); inpaint(img, mask, inpainted,3,CV_INPAINT_TELEA);

can someone help me..

image descriptionimage description)