Help to find ellipse in a image, with a known centre

4 views (last 30 days)
Hi, I'm new to image processing, and haven't used matlab for several years.
I'm an orthopedic surgeon and I want to make a program that checks the position of the pelvis-cup, after total hip replacement.
1-The program finds the round metallic caput (head) on the proximal part of the femur-component and marks the center
2- I want to find the long and short axis of the ellipse in the picture.
Manually I can rotate the picture and use
% imellipse
I know the center I found in 1, is a point in the middle of the two foci in the ellipse "they share the same center"
Can someone help me?
  1 Comment
Magnus
Magnus on 17 May 2015
I need help to get from picture 2 to picture 3. This is my code
gray_image = rgb2gray(img);
imshow(img);
%Exeter
[centers, radii] = imfindcircles(gray_image,[30 60],'Sensitivity',0.92);
%corail Trilogy
%[centers, radii] = imfindcircles(gray_image,[40 60],'Sensitivity',0.97);
cutImg = img(centers(2)-1.5*radii:centers(2)+1.5*radii,centers(1)-1.5*radii:centers(1)+1.5*radii);
imshow(cutImg)
hold on
plot(size(cutImg,1)/2, size(cutImg,2)/2,'r+','MarkerSize',20)
h = imellipse;
position = wait(h);

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 16 May 2015
If you can't manually adjust the ellipse to make a good fit, then maybe try imfindcircle().
  2 Comments
Magnus
Magnus on 17 May 2015
can imfindcircle() help me get the long and short axis of an ellipse?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!