I have mass images that I want to extract the feret, circularity and area of but how do I know that's what is being counted?

1 view (last 30 days)
I managed to write this code. But what in the image is it measuring the properties from? like how can i confirm that it is measuring the area and number of the cells in the image?:
% read the image and convert to binary
im = imread('my_image.png');
bw = im2bw(im);
% remove small objects
bw = bwareaopen(bw, 50);
% fill the holes
bw = imfill(bw, 'holes');
% label the objects
cc = bwconncomp(bw);
labeled = labelmatrix(cc);
% extract region properties
props = regionprops(cc, 'Area', 'Perimeter', 'Centroid', 'Eccentricity', 'Circularity', 'MinorAxisLength', 'MajorAxisLength');
% loop over the objects
for i = 1:length(props)
% extract the properties for the i-th object
% display the properties
disp(['Object ', num2str(i), ':']);
disp(['Area = ', num2str(area)]);
disp(['Perimeter = ', num2str(perimeter)]);
disp(['Centroid = ', num2str(centroid)]);
disp(['Eccentricity = ', num2str(eccentricity)]);
disp(['Circularity = ', num2str(circularity)]);
disp(['Feret diameter = ', num2str(feret_diameter)]);
end
% display the labeled image
imshow(label2rgb(labeled))
Thanks,
L.

Accepted Answer

Image Analyst
Image Analyst on 7 Mar 2023
You can display bw:
imshow(bw);
That will show you the blobs that are being measured.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!