Reputation: 1170
So, lets say I have a multitude of images that contain a multitude of shapes. In these images there may be shapes inside shapes, and there are two types of shapes. There are shapes with a pattern (like hash marks or diagonal lines), and there are shapes that don't have a pattern inside them.
Such an image could like like this:
Let's say I want to only detect shapes that have a pattern in side of them, like this:
And once I have detected the shape, I want to output a file that looks like this:
My original solution was to convolve the image with the a 3 3 identity matrix, blur the image, and then try to detect blobs from the blurred image. This doesn't work very consistently, and will not work at all in my images that have a more difficult pattern (like a crosshatch)
Does anybody know of any good strategies I could use to generate that output file?
This is a follow up on a question I asked a while ago, here The answer I received last time was fantastic for the examples I posted, but I'd like to move to opencv, and the answer from last time fails for things like the example above, due to the nested shapes.
As an aside, is there a more proper way for me to ask this question? It's very similar to my previous question, but slightly different. I'm posting this on the bases that it's different enough from my last question.
Upvotes: 3
Views: 1542
Reputation: 6259
Since you have not provided code for your question, I'll also provide the answer without code:
Upvotes: 3