using inpainting function
am having an image with a red line on it, the mask i created was not able to located the red line, can anyone help me the solution, i want to know how to specify the region of the image i want to concentrate on... thanks in advance
int main()
{
Mat img = imread("Lennared.jpg");
Mat mask, inpainted;
//inRange(img, Scalar(0, 0, 250), Scalar(0, 0, 255),mask);
//mask = Mat::zeros(img.size(), img.type()); // creating a mask image
mask = img.clone(); // cloning the same image and putting it into mask
cvtColor(mask, mask, CV_RGB2GRAY);
threshold(mask, mask, 100 ,255, CV_THRESH_BINARY);
inpaint(img, mask, inpainted,3,CV_INPAINT_TELEA);
for (int key = 0; 27 != key; key = waitKey())
{
switch (key)
{
case 'm': imshow("image mask", mask);
break;
case 'i': imshow("inpainted image", inpainted);
break;
default: imshow("original", img);
}
}
return 0;
}
this is the image
there is an example here and without your code we cannot help you
can you take another look at the example code ? you cannot use your image as a mask, but have to manually specify (eg, by drawing with the mouse) regions in a black uchar image, where inpainting on the original should be applied.