필터 지우기
필터 지우기

How to calculate diameter of object

조회 수: 14 (최근 30일)
Ahmed Ismail
Ahmed Ismail 2016년 8월 9일
댓글: Ahmed Ismail 2016년 8월 10일
I have the following code to find the centroids of the particles within this image <- Hyperlink:-
I would like to calculate the diameter of each of the particles so to generate the diameter distribution of the entire image.
X=Image;
template = fspecial('LoG',[51,51],3); % produces a laplacian of Gaussian curve as a template mask use to compare all the intensities in the image
y = conv2(double(X),-template,'same'); % convolves the image with the template to find all the points which correspond to the template mask
FoVY = y(500:700,730:940);
Peaks = imregionalmax(FoVY); % finds all the local maxima
imagesc(Peaks)
LPeaks = bwlabel(Peaks);
R = regionprops(LPeaks);
FoVY = X(500:700,730:940);
imagesc(FoVY);
hold on;
for i = 1:length(R)
plot(R(i).Centroid(1),R(i).Centroid(2),'r.');
centroid = cat(1, R.Centroid);
end
no_of_collagen=length(centroid);

채택된 답변

Image Analyst
Image Analyst 2016년 8월 9일
You can call regionprops() and then ask for EquivDiameter. You might get batter, more comprehensive answers if you put as much effort into your question here on the Mathworks MATLAB Central as you did for some other forum.
  댓글 수: 12
Image Analyst
Image Analyst 2016년 8월 10일
It would be difficult, even manually with imfreehand. I can't really tell where one starts and the other stops. Why isn't the count enough? If you know the total area, and the count, you can get the average area of the collagen.
Ahmed Ismail
Ahmed Ismail 2016년 8월 10일
That is true, I guess with some images you have to be realistic with what you can extract. Thanks for the help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by