I am trying to find the centroid of a binary image using region props but I keep receiving the error "Field reference for multiple structure elements that is followed by more reference blocks is an error". Here is my code for finding the centroid:
measurements = regionprops(bw, 'Centroid'); hold on; plot(measurements.Centroid(1), measurements.Centroid(2), 'r+', 'MarkerSize', 120, 'LineWidth', 1);hold off;imshow(bw)
Any help would be appreciated thank you
Best Answer