Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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;

}

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

image description