Suppose I have a binary image with many different regions in it. One region in the image may look like this:
Using regionprops and the 'perimeter' property, Matlab would calculate the green marked perimeter, which for this region would be 17.9460.
Now, what I want to calculate is a little bit different. It's basically the length of the lines forming the region (marked red in the image). Or in other words, the number of green marked "pixels" in the following image, although the blue marked pixles would have to be counted twice to get the length of the lines:
So this would get a length of all lines (or count of pixels) of 24.
Is there a way to do this using some build in Matlab functions in the Image Processing Toolbox?
Thanks in advance, Best Regards
Best Answer