How to avoid contours of different shapes to combine

asked 2020-05-05 14:35:39 -0600

Cătălina Sîrbu gravatar image

updated 2020-05-05 16:09:55 -0600

Using opencv along with python, I'm trying to extract a contour of a triangle inside a square. With my camera being at a distance of aprox 30 cm from this picture, everything works ok.

image description

As I go away from the image, the black "border" around the triangle get smaller and smaller resulting in this:

image description

What should I do in order to reconstruct the sape of the triangle? The problem is that if my background is white (after applying binary filter) the triangle will be combined with it (resulting in one contour only). I was thinking about Morphology operations but I don't know what Structuring Element should I use or how to do it. I have read about it but I don't know how to get started ( the order of operations )

edit retag flag offensive close merge delete

Comments

Show your code.

supra56 gravatar imagesupra56 ( 2020-05-05 20:44:48 -0600 )edit