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?

3 Ansichten (letzte 30 Tage)
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)]);
% display the labeled image

Akzeptierte Antwort

Image Analyst
Image Analyst am 7 Mär. 2023
You can display bw:
That will show you the blobs that are being measured.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by