First time here? Check out the FAQ!

Ask Your Question
0

i used canny function to detect the contour in my android app but i would now to fill the inside of the forms to treat the image easely.

asked Mar 10 '16

nadia gravatar image

updated Mar 11 '16

image description

image description

Preview: (hide)

Comments

please post the original image

sturkmen gravatar imagesturkmen (Mar 10 '16)edit

I post the original image .I would find image contours and fill the contours to make the picture more clear

nadia gravatar imagenadia (Mar 11 '16)edit

You can try to use cv::adaptiveThreshold() instead of cv:Canny. Or you can try cv::niBlackThreshold() from the ximgproc in contrib modules. Here I have posted some other statistical thresholds you can try (you have to scroll down).

Here is an actual link to the paper.

matman gravatar imagematman (Mar 11 '16)edit

1 answer

Sort by » oldest newest most voted
0

answered Mar 10 '16

  1. use find contour to get the contour of each letter.
  2. then draw contour() using thickness -1
Preview: (hide)

Comments

I don't like just to find contours but i would to fill the inside of contours with white color .i find the Floodfill function is it useful for me in this case?

nadia gravatar imagenadia (Mar 10 '16)edit
1

when you put thickness -1 it will fill every contour for you. i have never use floodfill, so you should give it a try

Adams30 gravatar imageAdams30 (Mar 10 '16)edit

I tried thickness -1 I test it with some formes that i draw and it works really but it doen't work efficiently in my picture case because the contours aren't very clear .Have you an other solution which help me?

nadia gravatar imagenadia (Mar 11 '16)edit
1

I think the problem here is, that cv:Canny will leave a lot of open edges, because of "non maxima suppression". So you can't fill these contours in a satisfactory way. A method to avoid this problem is to blur your image in the first step with cv::GaussianBlur or cv::blur. Than use cv::Sobel or cv::Laplacian and finally use a cv::threshold

matman gravatar imagematman (Mar 11 '16)edit

Question Tools

1 follower

Stats

Asked: Mar 10 '16

Seen: 800 times

Last updated: Mar 11 '16