0

I'm trying to extract the contour of some traffic signs. The images pass through several steps in order to get a good segmented image. In the final step before applying Canny method I get this image:

enter image description here

After applying Canny I get this image:

enter image description here

The algorithm performs as expected except the top left image for which returns an open contour. So, my question is, is there any way to use Canny in a manner that the top left image returns an closed contour?

3 Answers 3

3

If you already have a binary image, Canny does not give much more information. Canny is useful for finding edges in grayscale images (it decides if a gradient is an edge or not), if the image is black and white, Canny will return the edges that you already have,

I think that you need to use findContours(), which depending on the parameters will return only white or black objects, with or without the holes. It also handles the edges of the image.

Sign up to request clarification or add additional context in comments.

Comments

2

Image boundary conditions are problematic in most cases. In this particular case, I would try padding the original image with some extra pixels around the image. Depending on how you add those padding pixels, you should get a complete contour around the signs.

Comments

1

You can use Morphological Transformations before and after applying Canny Edge Detection to manipulate the result.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.