OpenCV 形状拟合函数总结

Ellipse

Comments from the Wiki

void  cvEllipse ( CvArr*  img,  CvPoint  center,  CvSize  axes, double  angle, double  start_angle, double end_angle,  CvScalar  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


MinAreaRect2

Comments from the Wiki

CvBox2D  cvMinAreaRect2 (const  CvArr*  points,  CvMemStorage*  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


你可能感兴趣的:(计算机视觉,OpenCV,C++笔记)