# Fit Ellipse (G Dataflow)

Finds the ellipse that best represents a set of points and returns the center, major and minor axes, perimeter, and area of the ellipse.

This node requires a minimum of five or six points, depending on the value of reject outliers. The resulting ellipse may take into account only a subset of the points you provide.  Array of point-coordinate clusters that correspond to points along the perimeter of the ellipse.

The minimum number of points needed along the perimeter of the ellipse is 5 points if reject outliers is TRUE, or 6 points if reject outliers is FALSE. ## minimum score

Required quality of the fitted ellipse.

The score can vary from 0 to 1000, where 1000 represents a perfect ellipse.

Default: 500 ## maximum iterations

Maximum number of refining steps the algorithm takes to ensure that the quality of the fit is better than minimum score.

maximum iterations is valid only when reject outliers is TRUE. ## reject outliers

Boolean that specifies whether to use every given radial point or only a subset of the points to fit the ellipse.

 True Algorithm determines the best subset of points to use and ignores the points outside the subset. False Algorithm uses every given point.

Default: False ## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error Acceptable distance, in pixels, that a point determined to belong to the ellipse can be from the perimeter of the ellipse. ## ellipse

Cluster with data from center, major axis and minor axis. ### center

Coordinates of the center of the ellipse. ### major axis

Cluster of two point-coordinate clusters.

This cluster specifies the coordinates of the points that compose the major axis of the ellipse. ### minor axis

Cluster of two point-coordinate clusters.

This cluster specifies the coordinates of the points that compose the minor axis of the ellipse. ## measurements

Cluster with data from area and perimeter. ### area

Area of the ellipse. ### perimeter

Length of the perimeter of the fit ellipse. ## residual

Least square error of the fitted ellipse over every given radial point.

Residual = where e i is the distance from the i th input point to the fit line. ## valid fit?

Boolean that indicates if the fit is valid.

This indicator is TRUE if the quality of the fit is better than minimum score and the fit was attained within maximum iterations. valid fit? is a function of minimum score, maximum iterations, and pixel radius. ## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out. ## indexes of points used

Array that returns the indexes of points in the radial points array that were used to fit the ellipse.

Some points may be excluded based on the minimum score, pixel radius, or reject outliers specified.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application