MATLAB: Centroid distance calculation at 10 degree

10 degreecentroid distanceimage processingImage Processing Toolboxleaf

I m having leaf image I need to calculate 36 centroid contour descriptor of it @ distance of 10 degree starting from maximum radius. I have used flavia dataset and have to calculate for its image but here I have attached one image. I got the centroid, centroid distance from centroid to every boundary pixel and max of it also. kindly guide me how can I proceed further. plz help
Thanx

Best Answer

Use max() on the distances from the centroid to the boundary pixels. Then use circshift to move that index to the beginning:
% Find out where the max distance is.
[maxDistance, indexOfMaxDistance] = max(distances);
% Shift that index to be at index #1.
newDistances = circshift(distances, -(indexOfMaxDistance-1));
Then you will have to subsample that to get indexes only at every 10 degrees. This means that for every boundary point, you have to compute its angle as well as its distances using atand2(). I hope you can figure out that part.