Reputation: 1358
I'm using opencv and I need to obtain a single region of white pixels starting from many regions, like in the image:
what I want to get is a single region of white pixels. can be that some regions have to be discarded, but is another point. now I'd like to know if there is a way to unite all the regions, even in a not convex poly, because it can be done later.
Upvotes: 1
Views: 835
Reputation: 4341
Why don't you calculate the convex hull of your pixels? As far as I can see this is included in opencv.
Upvotes: 0
Reputation: 93410
I know that this is probably not the best way to do it but it's a way.
As you said, the region you are interested in will always be squared. I suggest you take a look at the Square Detector application that ships with OpenCV.
If you are looking for demos, check this answer.
Upvotes: 1