[][src]Function opencv::imgproc::fit_ellipse

pub fn fit_ellipse(points: &dyn ToInputArray) -> Result<RotatedRect>

Fits an ellipse around a set of 2D points.

The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by Fitzgibbon95 is used. Developer should keep in mind that it is possible that the returned ellipse/rotatedRect data contains negative indices, due to the data points being close to the border of the containing Mat element.

Parameters

  • points: Input 2D point set, stored in std::vector<> or Mat