Distance from image center to the surface of an object in the image

1 次查看(过去 30 天)
Hello everyone.
Could please someone help me on how to measure perpendicular distance from the center of the image to surface of the object?
Attched is the sample of my image. i would like to measure the distacne from the image center at the level of the sternum (a) to the chest surface (b)
I worked out the image center as follows:
I = imread('CTimage.jpg');
[row,col,numberOfChannels] = size(I) ;
[X,Y] = meshgrid(1:col,1:row) ;
center = [mean(X(:)) mean(Y(:))] ;
the pixel coodinate at image center is = [295 288.5]
so i want to measure from the same horizontal level but at the level of the sternum above, point a with pixel coordinate [174 288.5] to the chest surface, point b corrsponding to coodiante [174 'unknown'].
Thanks for your kind assistance
  4 个评论
AUWAL ABUBAKAR
AUWAL ABUBAKAR 2019-10-14
Thanks for your response. I have edited the question and lebelled the image. hope it clarifies.
thnks

请先登录,再进行评论。

回答(1 个)

Sid Singh
Sid Singh 2019-10-22
Hi, you can use the Data Cursor tool in imshow window to pinpoint the unknown coordinate and use L2 norm for the distance between the points.
If you want to automatically find the point, you can binarize the image and look for an edge along the red line shown in the image.

类别

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