# How does this function "regionprops" to find the orientation of any object?

33 views (last 30 days)

Show older comments

How does this function "regionprops" to find the orientation of any object?

##### 9 Comments

Simone conigliaro
on 31 Aug 2017

### Accepted Answer

David Legland
on 22 Oct 2013

Hi Marian,

the code is in the regionprops function, you can access it via "edit regionprops", and checking the "ComputeEllipseParams" function.

The principle is to compute the inertia ellipse of a shape. It is obtained by computing normalised centered moments. The matrix of Inertia is obtained from the normalised moments of order 2 : Ixx, Ixy, and Iyy. By extracting eigen values and eigen vectors of the inertia matrix, it is possible to obtain the direction of the first eigen vector, that is converted into angle.

### More Answers (1)

Image Analyst
on 22 Oct 2013

### See Also

### Products

### Community Treasure Hunt

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

Start Hunting!