user3461851
user3461851

Reputation: 45

Find major axis of an ellipse

I have an image which contains an ellipse(a cell), I am trying to work out its major and minor axis. I know I have to work out the major axis first and possibly the foci points before this, but I'm not sure how to go about this exactly.

I don't know how I should cycle through the image to obtain the measurement and how to correctly identify the major axis if I did.

If anyone can offer any information on how to go about doing this it would be a great help.

This is the type of ellipse I'm trying to find the axis of.

Upvotes: 1

Views: 1236

Answers (2)

zuuz
zuuz

Reputation: 879

If your image contains no "noise", then what you probably want to do is simply use the information from the boundaries of your cell. Specifically, you'd want to get (x,y) point pairs of the "edge" of the cell. Then you can run PCA to get the 2 dominant directions.

You'd probably do that in Matlab, right? (or is something you need to automate, and so would be written in C++ or python?). If so, you need to blur the inside of your cell, since it contains no useful information. Then, find the edges of the shape. Both of these are morphological operations which are really-well explained in this example and in this one. Then you can use matlab's PCA (or svd) functions.

If you need more guidance please let me know!

Upvotes: 0

Rex Kerr
Rex Kerr

Reputation: 167901

Identifying cells can in general be quite hard. I don't think there's any good advice I can give without knowing more details about what the images look like.

One possibility if the cells are nearly circular is to start by actually finding the best-fitting circles, which is built in to the Image Processing Toolbox as imfindcirles. You could then find edges, cast rays out in various directions until they hit those edges, and pick a major and minor axis accordingly.

The Computer Vision System Analysis toolbox has explicit blob detection algorithms that will do what you want out of the box, pretty much. In particular, it will tell you the major and minor axes.

Upvotes: 0

Related Questions