Assign border pixels according to two regions it separates
Show older comments
Hi,
The title may be confusing. So I'll explain with the image below. I want to be able to color the borders (shown in green) depending on the regions in two sides of it. For example, if the border is between two regions shown in red and blue, I want to make the border black. If the demarcating line is between red and white, I want to make the border purple etc.
I am aware that there are some boundary cases where 3 or more regions connect, but I don't care about those. Is there a built-in or an easy way to do this on Matlab? I can think of straightforward solutions like examining the circular/rectangular neighborhood of each border (green) pixel and assigning a color based on that. This seems a bit slow, so I ask for a better way.
Thanks!

Accepted Answer
More Answers (0)
Categories
Find more on Neighborhood and Block Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!