Calculate height of object

1 vue (au cours des 30 derniers jours)
Sonalika
Sonalika le 21 Avr 2014
Commenté : Sonalika le 22 Avr 2014
Please find attached my image. I need to find the meniscus height. algorithm so far: 1) k-means clustering 2) 8-neighborhood this gives me a binary image. How do i find the height (NOT length) of the meniscus. Also i have many such images, is there some automated way to find height of all of them with same code. Right now i manually find the height by comparing it to a line of 5-7 pixels.
  3 commentaires
Sonalika
Sonalika le 21 Avr 2014
the thin bright white line is the tear meniscus(lower lid) I'm using two clusters using the inbuilt function im giving a ginput manually selecting a point of the meniscus so that i get all the 8-connected points with it which finally gives the binary image with all the similarly illuminated points i.e the meniscus. if you have any other method of segmenting the meniscus and calculating its height, i would really appreciate that
Sonalika
Sonalika le 21 Avr 2014
Modifié(e) : Sonalika le 21 Avr 2014
for finding the neighbors:
if true
% code
end
function Phi = segCroissRegion(tolerance,Igray,x,y)
if(x == 0 || y == 0)
imshow(Igray,[0 255]);
[x,y] = ginput(1);
end
Phi = false(size(Igray,1),size(Igray,2));
ref = true(size(Igray,1),size(Igray,2));
PhiOld = Phi;
Phi(uint8(x),uint8(y)) = 1;
while(sum(Phi(:)) ~= sum(PhiOld(:)))
PhiOld = Phi;
segm_val = Igray(Phi);
meanSeg = mean(segm_val);
posVoisinsPhi = imdilate(Phi,strel('disk',1,0)) - Phi;
voisins = find(posVoisinsPhi);
valeursVoisins = Igray(voisins);
Phi(voisins(valeursVoisins > meanSeg - tolerance & valeursVoisins < meanSeg + tolerance)) = 1;
end
if true
% code
end

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 21 Avr 2014
I suggest you look into anisotropic diffusion. It's made for smoothing along lines and sharpening edges and is used in things like fingerprint analysis. See attached demo.
  3 commentaires
Image Analyst
Image Analyst le 21 Avr 2014
Take the binary image and process it to get rid of the stuff other than the meniscus sliver. Then use regionprops to get it's area. Then skeletonize and get the length. Divide the area by the length to get the average width.
Sonalika
Sonalika le 22 Avr 2014
Thank you so much sir. I also tried anisotrophic diffusion and it works beautifully. So thank you once again!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by