LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ellipse calculation

Hi all.
I would like to know how to calculate the major and minor axes and angles of a rotated ellipse.

0 Kudos
Message 1 of 12
(1,016 Views)

Ellipse - Wikipedia

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 12
(1,005 Views)

@leesh63 wrote:
I would like to know how to calculate the major and minor axes and angles of a rotated ellipse.

These are the parameters that define the ellipse and if you don't know them, you need to solve the inverse problem..

 

What kind of ellipse do you have?

 

  • A picture with some distinctly colored pixels forming an ellipse?
  • A series of [x,y] points?
  • something else?

 

Either way, once you have a sufficient number of points, you can do a nonlinear fit with five parameters: centerX, centerY, major axis, minor axis, rotation angle.

 

Message 3 of 12
(958 Views)

Just for fun, I wrote a simple simulation how one could fit xy data to an ellipse defined by the center (x0, y0), A, B, and the rotation angle.

 

altenbach_0-1748893943457.png

 

 

Note that I wrote this from scratch during breakfast, so I am sure there are some bugs.. 😄

 

It can easily be modified for different angle definition (start angle, direction) and units (e.g. degrees instead of radians).

 

(Note that there is an infinite number of solutions at 180 degree angle increment and the program normalizes the value.)

 

Message 4 of 12
(925 Views)

On a side note, I have listed this example in my special interest group for any kind of fitting data to a model.

0 Kudos
Message 5 of 12
(879 Views)

@leesh63 wrote:
Hi all.
I would like to know how to calculate the major and minor axes and angles of a rotated ellipse.

 


eigenvalues? HU-Moments?

 

0 Kudos
Message 6 of 12
(863 Views)

leesh63_0-1748993762365.png

 

Thanks for the reply. I am attaching the XY plot. I want to find the major axis, minor axis and angle from the ellipse.

0 Kudos
Message 7 of 12
(825 Views)

Please stop placing text into code tags, makes the post hard to read. (I edited your post to remove it)

 

Have you tried my example? What is the data format? (XY graphs accept many different types!)

 

Can you attach the VI instead? How do you want to define the angle?

0 Kudos
Message 8 of 12
(812 Views)

Thanks a lot. 

Due to internal security issues, I cannot attach the file. I measured two sine function form DAQ, ans if I correspond one to X-axis and the other to Y- axis, I can obtain an elliptical XY graph. From this graph, I have to calculate the major axis, the monor axis, and rotation angle ( radian or degree). I attach bmp file. 

Thanks so much for yous reply again.

 

leesh63_0-1749023870669.png

 

0 Kudos
Message 9 of 12
(779 Views)

Thanks so much. I just saw the program. Finally I figured out how to find the major axis, the minor axis and rotation angle. Thanks again

0 Kudos
Message 10 of 12
(768 Views)