Ask Your Question
0

How can I find the regions in an image that have exactly the same color?

asked 2016-04-28 15:20:35 -0600

Given a 3-channel color image what is the easiest the way to find connected components such that pixel A is considered connected to pixel B if A and B are adjacent and exactly the same color?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-29 11:25:15 -0600

Tetragramm gravatar image

The best way would be to modify the connected components code. You have to change the conditions it uses from a binary yes, to an equals. You're going to get huge numbers of components in a natural image, so you'll need to filter by size and maybe other things.

If you know the exact colors, it's much easier. Just use inRange to extract a map of each color, then run connected components normally.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-28 15:20:35 -0600

Seen: 296 times

Last updated: Apr 29 '16