Table of Contents

Method ConvexHull

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

ConvexHull(InputArray, OutputArray, bool, bool)

Computes convex hull for a set of 2D points.

public static void ConvexHull(InputArray points, OutputArray hull, bool clockwise = false, bool returnPoints = true)

Parameters

points InputArray

The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix

hull OutputArray

The output convex hull. It is either a vector of points that form the hull (must have the same type as the input points), or a vector of 0-based point indices of the hull points in the original array (since the set of convex hull points is a subset of the original point set).

clockwise bool

If true, the output convex hull will be oriented clockwise, otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate system is assumed - the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.

returnPoints bool

ConvexHull(IEnumerable<Point>, bool)

Computes convex hull for a set of 2D points.

public static Point[] ConvexHull(IEnumerable<Point> points, bool clockwise = false)

Parameters

points IEnumerable<Point>

The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix

clockwise bool

If true, the output convex hull will be oriented clockwise, otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate system is assumed - the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.

Returns

Point[]

The output convex hull. It is a vector of points that form the hull (must have the same type as the input points).

ConvexHull(IEnumerable<Point2f>, bool)

Computes convex hull for a set of 2D points.

public static Point2f[] ConvexHull(IEnumerable<Point2f> points, bool clockwise = false)

Parameters

points IEnumerable<Point2f>

The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix

clockwise bool

If true, the output convex hull will be oriented clockwise, otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate system is assumed - the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.

Returns

Point2f[]

The output convex hull. It is a vector of points that form the hull (must have the same type as the input points).