필터 지우기
필터 지우기

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 (최근 30일)
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.

채택된 답변

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by