Calculate height of object

3 views (last 30 days)
Sonalika
Sonalika on 21 Apr 2014
Commented: Sonalika on 22 Apr 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 Comments
Sonalika
Sonalika on 21 Apr 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 on 21 Apr 2014
Edited: Sonalika on 21 Apr 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

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 21 Apr 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 Comments
Image Analyst
Image Analyst on 21 Apr 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 on 22 Apr 2014
Thank you so much sir. I also tried anisotrophic diffusion and it works beautifully. So thank you once again!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!