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

1 view (last 30 days)
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 Comments
AUWAL ABUBAKAR
AUWAL ABUBAKAR on 14 Oct 2019
Thanks for your response. I have edited the question and lebelled the image. hope it clarifies.
thnks

Sign in to comment.

Answers (1)

Sid Singh
Sid Singh on 22 Oct 2019
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.

Community Treasure Hunt

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

Start Hunting!