Calculate height of object

2 次查看(过去 30 天)
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 个评论
Sonalika
Sonalika 2014-4-21
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 2014-4-21
编辑:Sonalika 2014-4-21
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

请先登录,再进行评论。

采纳的回答

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

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by