OpenCV 形状拟合函数总结

Ellipse

Comments from the Wiki

void cvEllipse(CvArr* imgCvPoint centerCvSize axes, double angle, double start_angle, doubleend_angleCvScalar color, int thickness=1, int lineType=8, int shift=0)

Draws a simple or thick elliptic arc or an fills ellipse sector.

Parameters:
  • img – The image
  • center – Center of the ellipse
  • axes – Length of the ellipse axes
  • angle – Rotation angle
  • start_angle – Starting angle of the elliptic arc
  • end_angle – Ending angle of the elliptic arc.
  • color – Ellipse color
  • thickness – Thickness of the ellipse arc outline if positive, otherwise this indicates that a filled ellipse sector is to be drawn
  • lineType – Type of the ellipse boundary, see Line description
  • shift – Number of fractional bits in the center coordinates and axes’ values

The function draws a simple or thick elliptic arc or fills an ellipse sector. The arc is clipped by the ROI rectangle. A piecewise-linear approximation is used for antialiased arcs and thick arcs. All the angles are given in degrees. The picture below explains the meaning of the parameters.

Parameters of Elliptic Arc

_images/ellipse.png


MinAreaRect2

Comments from the Wiki

CvBox2D cvMinAreaRect2(const CvArr* pointsCvMemStorage* storage=NULL)

Finds the circumscribed rectangle of minimal area for a given 2D point set.

Parameters:
  • points – Sequence or array of points
  • storage – Optional temporary memory storage

The function finds a circumscribed rectangle of the minimal area for a 2D point set by building aconvex hull for the set and applying the rotating calipers technique to the hull.

Picture. Minimal-area bounding rectangle for contour

_images/minareabox.png
展开阅读全文

没有更多推荐了,返回首页