📄 cv.h
字号:
// Parameters:
// moments - moments state.
// hu_moments - Hu moments
// Returns:
//F*/
OPENCVAPI void cvGetHuMoments( CvMoments* moments, CvHuMoments* hu_moments );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvNorm, cvNormMask
// Purpose:
// Calculates different types of norm for single or a pair of images
// Context:
// Parameters:
// imgA - first input image
// imgB - second input image
// mask - determine pixels that are considered in norm calculation
// norm_type - type of the norm.
// imgB == 0 imgB != 0
// ---------------------------------------------------------------------------
// CV_C: ||imgA||_inf ||imgA - imgB||_inf
// CV_L1: ||imgA||_L1 ||imgA - imgB||_L1
// CV_L2: ||imgA||_L2 ||imgA - imgB||_L2
// ---------------------------------------------------------------------------
// CV_RELATIVE_C: forbidden ||imgA - imgB||_inf/||imgB||_inf
// CV_RELATIVE_L1: forbidden ||imgA - imgB||_L1/||imgB||_L1
// CV_RELATIVE_L2: forbidden ||imgA - imgB||_L2/||imgB||_L2
// Returns:
// required norm
//F*/
OPENCVAPI double cvNorm( IplImage* imgA, IplImage* imgB, int norm_type,
IplImage* mask CV_DEFAULT(0) );
#define cvNormMask(imgA, imgB, mask, norm_type) cvNorm(imgA, imgB, norm_type, mask)
/****************************************************************************************\
* Drawing *
\****************************************************************************************/
/****************************************************************************************\
* Drawing functions work with the following formats: *
* single channel: IPL_DEPTH_8U, IPL_DEPTH_8S *
* three channels: IPL_DEPTH_8U, IPL_DEPTH_8S, coi must be == 0 *
* All the functions include parameter color that means rgb value for three-channel *
* images(and may be constructed with CV_RGB macro) and brightness *
* (least-significant byte of color) for grayscale images. *
* If drawn figure is partially or completely outside the image, it is clipped. *
\****************************************************************************************/
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvLine
// Purpose:
// Draws line on the image ROI between two points
// Context:
// Parameters:
// img - image where the line is drawn.
// pt1 - starting point
// pt2 - ending point
// thickness - line thickness. 1 means simple line.
// if line is thick, function draws the line with round endings.
// color - line color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvLine( IplImage* img, CvPoint pt1, CvPoint pt2,
int color, int thickness CV_DEFAULT(1) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvLineAA
// Purpose:
// Draws thin antialiazed line on the image ROI between two points
// Context:
// Parameters:
// img - image where the line is drawn.
// pt1 - starting point
// pt2 - ending point
// scale - number of fractional bits in point coordinates.
// That is, line can be drawn with sub-pixel accuracy
// color - line color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvLineAA( IplImage* img, CvPoint pt1, CvPoint pt2,
int color, int scale CV_DEFAULT(0) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvRectangle
// Purpose:
// Draws rectangle on the image ROI
// Context:
// Parameters:
// img - image where the rectangle is drawn.
// pt1 - one of the rectangle corners
// pt2 - opposite corner of the rectangle
// thickness - thickness of the lines that made up rectangle.
// color - line color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvRectangle( IplImage* img, CvPoint pt1, CvPoint pt2,
int color, int thickness CV_DEFAULT(1) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvCircle
// Purpose:
// Draws circle on the image ROI
// Context:
// Parameters:
// img - image.
// center - circle center
// radius - circle radius(must be >= 0)
// color - circle color(or brightness)
// thickenss - thickness of drawn circle. <0 means filled circle.
// Returns:
//F*/
OPENCVAPI void cvCircle( IplImage* img, CvPoint center, int radius,
int color, int thickness CV_DEFAULT(1) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvCircleAA
// Purpose:
// Draws circle on the image ROI
// Context:
// Parameters:
// img - image.
// center - circle center
// radius - circle radius(must be >= 0)
// color - circle color(or brightness)
// scale - number of fractional bits in point coordinates.
// That is, circle can be drawn with sub-pixel accuracy
// Returns:
//F*/
OPENCVAPI void cvCircleAA( IplImage* img, CvPoint center, int radius,
int color, int scale CV_DEFAULT(0) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvEllipse
// Purpose:
// Draws elliptic arc
// Context:
// Parameters:
// img - image.
// center - ellipse center
// axes - half axes of the ellipse
// angle - ellipse angle
// startAngle - starting angle of elliptic arc
// endAngle - ending angle of elliptic arc
// thickness - arc thickness
// color - ellipse color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvEllipse( IplImage* img, CvPoint center, CvSize axes,
double angle, double startAngle, double endAngle,
int color, int thickness CV_DEFAULT(1) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvEllipseAA
// Purpose:
// Draws antialiazed elliptic arc
// Context:
// Parameters:
// img - image.
// center - ellipse center
// axes - half axes of the ellipse
// angle - ellipse angle
// startAngle - starting angle of elliptic arc
// endAngle - ending angle of elliptic arc
// scale - number of fractioanl bits in center coordinates and axes sizes.
// color - ellipse color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvEllipseAA( IplImage* img, CvPoint center, CvSize axes,
double angle, double startAngle,
double endAngle, int color, int scale CV_DEFAULT(0) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvFillConvexPoly
// Purpose:
// Fills convex polygon
// Context:
// Parameters:
// img - image.
// pts - array of polygon vertices
// ntps - number of vertices in the polygon
// color - polygon color(or brightness)
// Returns:
// Notes:
// fucntion automatically closes the contour -
// adds edge between first and last vertices.
// function doesn't check that input polygon is convex.
//F*/
OPENCVAPI void cvFillConvexPoly( IplImage* img, CvPoint* pts, int npts, int color );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvFillPoly
// Purpose:
// Fills arbitrary regions, bounded by several polygonal contours.
// Context:
// Parameters:
// img - image.
// contours - number of contours
// pts - array of pointers to polygonal contours
// ntps - array of vertices counters for the contours
// color - polygons color(or brightness)
// Returns:
// Notes:
// function automatically closes each polygonal contour.
// If some contours are overlapped, they are added modulo 2.
// That is, pixel is filled, if it belongs to odd number of polygonal contours.
//F*/
OPENCVAPI void cvFillPoly( IplImage* img, CvPoint** pts,
int* npts, int contours, int color );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvPolyLine
// Purpose:
// Draws polygons outline with simple or thick lines.
// Context:
// Parameters:
// img - image.
// contours - number of contours
// pts - array of pointers to polygonal contours
// ntps - array of vertices counters for the contours
// closed - if non-zero, function closes each contour.
// thickness - line thickness
// color - polygons color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvPolyLine( IplImage* img, CvPoint** pts, int* npts, int contours,
int closed, int color, int thickness CV_DEFAULT(1) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvPolyLineAA
// Purpose:
// Draws polygons outline with antialiazes lines.
// Context:
// Parameters:
// img - image.
// contours - number of contours
// pts - array of pointers to polygonal contours
// ntps - array of vertices counters for the contours
// closed - if non-zero, function closes each contour.
// scale - number of fractioanl bits in vertex coordinates
// color - polygons color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvPolyLineAA( IplImage* img, CvPoint** pts, int* npts, int contours,
int closed, int color, int scale CV_DEFAULT(0) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvInitFont
// Purpose:
// Initializes font to use it in following text rendering operations
// Context:
// Parameters:
// font - pointer to initialized font structure.
// font_face - font family. There is a single font,
// supported now - CV_FONT_VECTOR0.
// hscale - multiplier for horizontal letter sizes.
// If 1 then the original size is used,
// if 2 - twice wider, if 0.5 - twice thinner etc.
// vscale - multiplier for vertical letter sizes.
// If 1 then the original size is used,
// if 2 - twice longer, if 0.5 - twice shorter etc.
// italic_scale - tangent of letter slope, 0 means no slope,
// 1 - 45 degree slope
// thickness - letter thickness
// Returns:
//F*/
OPENCVAPI void cvInitFont( CvFont* font, CvFontFace font_face,
double hscale, double vscale,
double italic_scale CV_DEFAULT(0),
int thickness CV_DEFAULT(1) );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvPutText
// Purpose:
// Draws text string on the image with given font
// Context:
// Parameters:
// img - image.
// text - text string
// org - left-bottom corner of output text string
// font - text font
// color - polygons color(or brightness)
// Returns:
//F*/
OPENCVAPI void cvPutText( IplImage* img, const char* text, CvPoint org,
CvFont* font, int color );
/*F///////////////////////////////////////////////////////////////////////////////////////
//
// Name: cvGetTextSize
// Purpose:
// Calculates bounding rectangle for given text string and font.
// Context:
// Parameters:
// text - text string
// font - font to draw the string with
// text_size - output parameter. width and height of bounding box
// (not including part of the text below base line)
// ymin - output parameter. negative value or zero - minus height of
// text part below base line
// Returns:
//F*/
OPENCVAPI void cvGetTextSize( const char* text_string, CvFont* font,
CvSize* text_size, int* ymin );
/****************************************************************************************\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -