MATLAB: How to compare the distance between 2 structures and a center point.

2d imagebinaryclockwisecomparedistancelineMATLABshape

As seen in the image there are 2 binary structures located in an image. I have already calculated a center point, in the image it is the red mark, and want to calculate the distance of the center point to points of both structures.
I have already used bwdist to calculate the distance between centre point and both seperate structures.
D = bwdist(map_centre_point);
%map_centre_point is a binary image, same size as struc1 and struc2, with value 1 at the centre point.
distance_struc1 = struc1 .* D;
distance_struc2 = struc2 .* D;
Now I need a method to compare the values of corresponding pixels of both structures with each other. My idea was to implement a line which goes clockwise and compare the values of the two structures, however i cannot implement this.
So to be precise: I want to know the values of struc1 and struc2 where it intersect the yellow line. And then I want to know it for the green line, etc. etc. Any ideas, or help how to implement this would be appreciated.

Best Answer

I want to know the values of struc1 and struc2 where it intersect the yellow line.
I assume you really meant to say, you want distance_struc1,2 where they intersect the yellow line.
This could be tough unless you're sure that a line radiating from the "center" will not intersect the inner or outer curve multiple times. See also this very similar thread.
You also need a way of interpolating between the pixels of the structures if the yellow line doesn't intersect the pixels on those curves precisely, which it normally will not. You could use SPLINE or something similar to fit the struc's with continuous parametric curves x(t), y(t). Then you could find the intersections of the yellow line with the continuous curve and the corresponding t0 with fminsearch. Once you have x(t0),y(t0) on each curve you can measure distances.