OpenCV  3.4.1
Open Source Computer Vision
Classes | Macros | Functions
imgproc_c.h File Reference
#include "opencv2/imgproc/types_c.h"

Classes

struct  CvFont
 

Macros

#define CV_AA   16
 
#define CV_FILLED   -1
 
#define CV_FONT_HERSHEY_COMPLEX   3
 
#define CV_FONT_HERSHEY_COMPLEX_SMALL   5
 
#define CV_FONT_HERSHEY_DUPLEX   2
 
#define CV_FONT_HERSHEY_PLAIN   1
 
#define CV_FONT_HERSHEY_SCRIPT_COMPLEX   7
 
#define CV_FONT_HERSHEY_SCRIPT_SIMPLEX   6
 
#define CV_FONT_HERSHEY_SIMPLEX   0
 
#define CV_FONT_HERSHEY_TRIPLEX   4
 
#define CV_FONT_ITALIC   16
 
#define CV_FONT_VECTOR0   CV_FONT_HERSHEY_SIMPLEX
 
#define CV_NEXT_LINE_POINT(line_iterator)
 
#define CV_RGB(r, g, b)   cvScalar( (b), (g), (r), 0 )
 
#define cvCalcBackProject(image, dst, hist)   cvCalcArrBackProject((CvArr**)image, dst, hist)
 
#define cvCalcBackProjectPatch(image, dst, range, hist, method, factor)   cvCalcArrBackProjectPatch( (CvArr**)image, dst, range, hist, method, factor )
 
#define cvDrawCircle   cvCircle
 
#define cvDrawEllipse   cvEllipse
 
#define cvDrawLine   cvLine
 
#define cvDrawPolyLine   cvPolyLine
 
#define cvDrawRect   cvRectangle
 

Functions

CvMatcv2DRotationMatrix (CvPoint2D32f center, double angle, double scale, CvMat *map_matrix)
 Computes rotation_matrix matrix. More...
 
void cvAcc (const CvArr *image, CvArr *sum, const CvArr *mask=NULL)
 Adds image to accumulator. More...
 
void cvAdaptiveThreshold (const CvArr *src, CvArr *dst, double max_value, int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, int threshold_type=CV_THRESH_BINARY, int block_size=3, double param1=5)
 Applies adaptive threshold to grayscale image. More...
 
CvSeqcvApproxChains (CvSeq *src_seq, CvMemStorage *storage, int method=CV_CHAIN_APPROX_SIMPLE, double parameter=0, int minimal_perimeter=0, int recursive=0)
 Approximates Freeman chain(s) with a polygonal curve. More...
 
CvSeqcvApproxPoly (const void *src_seq, int header_size, CvMemStorage *storage, int method, double eps, int recursive=0)
 Approximates a single polygonal curve (contour) or a tree of polygonal curves (contours) More...
 
double cvArcLength (const void *curve, CvSlice slice=CV_WHOLE_SEQ, int is_closed=-1)
 Calculates perimeter of a contour or length of a part of contour. More...
 
CvRect cvBoundingRect (CvArr *points, int update=0)
 Calculates contour bounding rectangle (update=1) or just retrieves pre-calculated rectangle (update=0) More...
 
void cvBoxPoints (CvBox2D box, CvPoint2D32f pt[4])
 Finds coordinates of the box vertices. More...
 
void cvCalcArrBackProject (CvArr **image, CvArr *dst, const CvHistogram *hist)
 Calculates back project. More...
 
void cvCalcArrBackProjectPatch (CvArr **image, CvArr *dst, CvSize range, CvHistogram *hist, int method, double factor)
 Locates a template within an image by using a histogram comparison. More...
 
void cvCalcArrHist (CvArr **arr, CvHistogram *hist, int accumulate=0, const CvArr *mask=NULL)
 Calculates array histogram. More...
 
void cvCalcBayesianProb (CvHistogram **src, int number, CvHistogram **dst)
 Calculates bayesian probabilistic histograms (each or src and dst is an array of number histograms. More...
 
float cvCalcEMD2 (const CvArr *signature1, const CvArr *signature2, int distance_type, CvDistanceFunction distance_func=NULL, const CvArr *cost_matrix=NULL, CvArr *flow=NULL, float *lower_bound=NULL, void *userdata=NULL)
 Computes earth mover distance between two weighted point sets (called signatures) More...
 
void cvCalcHist (IplImage **image, CvHistogram *hist, int accumulate=0, const CvArr *mask=NULL)
 
void cvCalcProbDensity (const CvHistogram *hist1, const CvHistogram *hist2, CvHistogram *dst_hist, double scale=255)
 Divides one histogram by another. More...
 
void cvCanny (const CvArr *image, CvArr *edges, double threshold1, double threshold2, int aperture_size=3)
 Runs canny edge detector. More...
 
int cvCheckContourConvexity (const CvArr *contour)
 Checks whether the contour is convex or not (returns 1 if convex, 0 if not) More...
 
void cvCircle (CvArr *img, CvPoint center, int radius, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 Draws a circle with specified center and radius. More...
 
void cvClearHist (CvHistogram *hist)
 Clears the histogram. More...
 
int cvClipLine (CvSize img_size, CvPoint *pt1, CvPoint *pt2)
 Clips the line segment connecting *pt1 and *pt2 by the rectangular window. More...
 
CvScalar cvColorToScalar (double packed_color, int arrtype)
 Unpacks color value. More...
 
double cvCompareHist (const CvHistogram *hist1, const CvHistogram *hist2, int method)
 
double cvContourArea (const CvArr *contour, CvSlice slice=CV_WHOLE_SEQ, int oriented=0)
 Calculates area of a contour or contour segment. More...
 
double cvContourPerimeter (const void *contour)
 
void cvConvertMaps (const CvArr *mapx, const CvArr *mapy, CvArr *mapxy, CvArr *mapalpha)
 Converts mapx & mapy from floating-point to integer formats for cvRemap. More...
 
CvSeqcvConvexHull2 (const CvArr *input, void *hull_storage=NULL, int orientation=CV_CLOCKWISE, int return_points=0)
 Calculates exact convex hull of 2d point set. More...
 
CvSeqcvConvexityDefects (const CvArr *contour, const CvArr *convexhull, CvMemStorage *storage=NULL)
 Finds convexity defects for the contour. More...
 
void cvCopyHist (const CvHistogram *src, CvHistogram **dst)
 Copies a histogram. More...
 
void cvCopyMakeBorder (const CvArr *src, CvArr *dst, CvPoint offset, int bordertype, CvScalar value=cvScalarAll(0))
 
void cvCornerEigenValsAndVecs (const CvArr *image, CvArr *eigenvv, int block_size, int aperture_size=3)
 Calculates eigen values and vectors of 2x2 gradient covariation matrix at every image pixel. More...
 
void cvCornerHarris (const CvArr *image, CvArr *harris_response, int block_size, int aperture_size=3, double k=0.04)
 Harris corner detector: More...
 
void cvCornerMinEigenVal (const CvArr *image, CvArr *eigenval, int block_size, int aperture_size=3)
 Calculates minimal eigenvalue for 2x2 gradient covariation matrix at every image pixel. More...
 
CvHistogramcvCreateHist (int dims, int *sizes, int type, float **ranges=NULL, int uniform=1)
 Creates a histogram. More...
 
CvMat ** cvCreatePyramid (const CvArr *img, int extra_layers, double rate, const CvSize *layer_sizes=0, CvArr *bufarr=0, int calc=1, int filter=CV_GAUSSIAN_5x5)
 Builds pyramid for an image. More...
 
IplConvKernelcvCreateStructuringElementEx (int cols, int rows, int anchor_x, int anchor_y, int shape, int *values=NULL)
 Returns a structuring element of the specified size and shape for morphological operations. More...
 
void cvCvtColor (const CvArr *src, CvArr *dst, int code)
 Converts input array pixels from one color space to another. More...
 
void cvDilate (const CvArr *src, CvArr *dst, IplConvKernel *element=NULL, int iterations=1)
 dilates input image (applies maximum filter) one or more times. More...
 
void cvDistTransform (const CvArr *src, CvArr *dst, int distance_type=CV_DIST_L2, int mask_size=3, const float *mask=NULL, CvArr *labels=NULL, int labelType=CV_DIST_LABEL_CCOMP)
 Applies distance transform to binary image. More...
 
void cvDrawContours (CvArr *img, CvSeq *contour, CvScalar external_color, CvScalar hole_color, int max_level, int thickness=1, int line_type=8, CvPoint offset=cvPoint(0, 0))
 Draws contour outlines or filled interiors on the image. More...
 
void cvEllipse (CvArr *img, CvPoint center, CvSize axes, double angle, double start_angle, double end_angle, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 Draws ellipse outline, filled ellipse, elliptic arc or filled elliptic sector. More...
 
int cvEllipse2Poly (CvPoint center, CvSize axes, int angle, int arc_start, int arc_end, CvPoint *pts, int delta)
 Returns the polygon points which make up the given ellipse. More...
 
void cvEllipseBox (CvArr *img, CvBox2D box, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 
CvSeqcvEndFindContours (CvContourScanner *scanner)
 Releases contour scanner and returns pointer to the first outer contour. More...
 
void cvEqualizeHist (const CvArr *src, CvArr *dst)
 equalizes histogram of 8-bit single-channel image More...
 
void cvErode (const CvArr *src, CvArr *dst, IplConvKernel *element=NULL, int iterations=1)
 erodes input image (applies minimum filter) one or more times. If element pointer is NULL, 3x3 rectangular element is used More...
 
void cvFillConvexPoly (CvArr *img, const CvPoint *pts, int npts, CvScalar color, int line_type=8, int shift=0)
 Fills convex or monotonous polygon. More...
 
void cvFillPoly (CvArr *img, CvPoint **pts, const int *npts, int contours, CvScalar color, int line_type=8, int shift=0)
 Fills an area bounded by one or more arbitrary polygons. More...
 
void cvFilter2D (const CvArr *src, CvArr *dst, const CvMat *kernel, CvPoint anchor=cvPoint(-1,-1))
 Convolves an image with the kernel. More...
 
int cvFindContours (CvArr *image, CvMemStorage *storage, CvSeq **first_contour, int header_size=sizeof(CvContour), int mode=CV_RETR_LIST, int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0, 0))
 Retrieves outer and optionally inner boundaries of white (non-zero) connected components in the black (zero) background. More...
 
void cvFindCornerSubPix (const CvArr *image, CvPoint2D32f *corners, int count, CvSize win, CvSize zero_zone, CvTermCriteria criteria)
 Adjust corner position using some sort of gradient search. More...
 
CvSeqcvFindNextContour (CvContourScanner scanner)
 Retrieves next contour. More...
 
CvBox2D cvFitEllipse2 (const CvArr *points)
 Fits ellipse into a set of 2d points. More...
 
void cvFitLine (const CvArr *points, int dist_type, double param, double reps, double aeps, float *line)
 Fits a line into set of 2d or 3d points in a robust way (M-estimator technique) More...
 
void cvFloodFill (CvArr *image, CvPoint seed_point, CvScalar new_val, CvScalar lo_diff=cvScalarAll(0), CvScalar up_diff=cvScalarAll(0), CvConnectedComp *comp=NULL, int flags=4, CvArr *mask=NULL)
 Fills the connected component until the color difference gets large enough. More...
 
CvFont cvFont (double scale, int thickness=1)
 
CvMatcvGetAffineTransform (const CvPoint2D32f *src, const CvPoint2D32f *dst, CvMat *map_matrix)
 Computes affine transform matrix for mapping src[i] to dst[i] (i=0,1,2) More...
 
double cvGetCentralMoment (CvMoments *moments, int x_order, int y_order)
 Retrieve central moments. More...
 
void cvGetHuMoments (CvMoments *moments, CvHuMoments *hu_moments)
 Calculates 7 Hu's invariants from precalculated spatial and central moments. More...
 
void cvGetMinMaxHistValue (const CvHistogram *hist, float *min_value, float *max_value, int *min_idx=NULL, int *max_idx=NULL)
 Finds the minimum and maximum histogram bins. More...
 
double cvGetNormalizedCentralMoment (CvMoments *moments, int x_order, int y_order)
 Retrieve normalized central moments. More...
 
CvMatcvGetPerspectiveTransform (const CvPoint2D32f *src, const CvPoint2D32f *dst, CvMat *map_matrix)
 Computes perspective transform matrix for mapping src[i] to dst[i] (i=0,1,2,3) More...
 
void cvGetQuadrangleSubPix (const CvArr *src, CvArr *dst, const CvMat *map_matrix)
 Retrieves quadrangle from the input array. More...
 
void cvGetRectSubPix (const CvArr *src, CvArr *dst, CvPoint2D32f center)
 Retrieves the rectangular image region with specified center from the input array. More...
 
double cvGetSpatialMoment (CvMoments *moments, int x_order, int y_order)
 Retrieve spatial moments. More...
 
void cvGetTextSize (const char *text_string, const CvFont *font, CvSize *text_size, int *baseline)
 Calculates bounding box of text stroke (useful for alignment) More...
 
void cvGoodFeaturesToTrack (const CvArr *image, CvArr *eig_image, CvArr *temp_image, CvPoint2D32f *corners, int *corner_count, double quality_level, double min_distance, const CvArr *mask=NULL, int block_size=3, int use_harris=0, double k=0.04)
 Finds a sparse set of points within the selected region that seem to be easy to track. More...
 
CvSeqcvHoughCircles (CvArr *image, void *circle_storage, int method, double dp, double min_dist, double param1=100, double param2=100, int min_radius=0, int max_radius=0)
 Finds circles in the image. More...
 
CvSeqcvHoughLines2 (CvArr *image, void *line_storage, int method, double rho, double theta, int threshold, double param1=0, double param2=0, double min_theta=0, double max_theta=CV_PI)
 Finds lines on binary image using one of several methods. More...
 
void cvInitFont (CvFont *font, int font_face, double hscale, double vscale, double shear=0, int thickness=1, int line_type=8)
 Initializes font structure (OpenCV 1.x API). More...
 
int cvInitLineIterator (const CvArr *image, CvPoint pt1, CvPoint pt2, CvLineIterator *line_iterator, int connectivity=8, int left_to_right=0)
 Initializes line iterator. More...
 
void cvInitUndistortMap (const CvMat *camera_matrix, const CvMat *distortion_coeffs, CvArr *mapx, CvArr *mapy)
 Computes transformation map from intrinsic camera parameters that can used by cvRemap. More...
 
void cvInitUndistortRectifyMap (const CvMat *camera_matrix, const CvMat *dist_coeffs, const CvMat *R, const CvMat *new_camera_matrix, CvArr *mapx, CvArr *mapy)
 Computes undistortion+rectification map for a head of stereo camera. More...
 
void cvIntegral (const CvArr *image, CvArr *sum, CvArr *sqsum=NULL, CvArr *tilted_sum=NULL)
 Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y) More...
 
void cvLaplace (const CvArr *src, CvArr *dst, int aperture_size=3)
 Calculates the image Laplacian: (d2/dx + d2/dy)I. More...
 
void cvLine (CvArr *img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 Draws 4-connected, 8-connected or antialiased line segment connecting two points. More...
 
void cvLinearPolar (const CvArr *src, CvArr *dst, CvPoint2D32f center, double maxRadius, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS)
 
void cvLogPolar (const CvArr *src, CvArr *dst, CvPoint2D32f center, double M, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS)
 Performs forward or inverse log-polar image transform. More...
 
CvHistogramcvMakeHistHeaderForArray (int dims, int *sizes, CvHistogram *hist, float *data, float **ranges=NULL, int uniform=1)
 Makes a histogram out of an array. More...
 
double cvMatchShapes (const void *object1, const void *object2, int method, double parameter=0)
 Compares two contours by matching their moments. More...
 
void cvMatchTemplate (const CvArr *image, const CvArr *templ, CvArr *result, int method)
 Measures similarity between template and overlapped windows in the source image and fills the resultant image with the measurements. More...
 
CvRect cvMaxRect (const CvRect *rect1, const CvRect *rect2)
 Finds minimum rectangle containing two given rectangles. More...
 
CvBox2D cvMinAreaRect2 (const CvArr *points, CvMemStorage *storage=NULL)
 Finds minimum area rotated rectangle bounding a set of points. More...
 
int cvMinEnclosingCircle (const CvArr *points, CvPoint2D32f *center, float *radius)
 Finds minimum enclosing circle for a set of points. More...
 
void cvMoments (const CvArr *arr, CvMoments *moments, int binary=0)
 Calculates all spatial and central moments up to the 3rd order. More...
 
void cvMorphologyEx (const CvArr *src, CvArr *dst, CvArr *temp, IplConvKernel *element, int operation, int iterations=1)
 Performs complex morphological transformation. More...
 
void cvMultiplyAcc (const CvArr *image1, const CvArr *image2, CvArr *acc, const CvArr *mask=NULL)
 Adds a product of two images to accumulator. More...
 
void cvNormalizeHist (CvHistogram *hist, double factor)
 Normalizes the histogram. More...
 
double cvPointPolygonTest (const CvArr *contour, CvPoint2D32f pt, int measure_dist)
 Checks whether the point is inside polygon, outside, on an edge (at a vertex). More...
 
CvSeqcvPointSeqFromMat (int seq_kind, const CvArr *mat, CvContour *contour_header, CvSeqBlock *block)
 Initializes sequence header for a matrix (column or row vector) of points. More...
 
void cvPolyLine (CvArr *img, CvPoint **pts, const int *npts, int contours, int is_closed, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 Draws one or more polygonal curves. More...
 
void cvPreCornerDetect (const CvArr *image, CvArr *corners, int aperture_size=3)
 Calculates constraint image for corner detection. More...
 
void cvPutText (CvArr *img, const char *text, CvPoint org, const CvFont *font, CvScalar color)
 Renders text stroke with specified font and color at specified location. CvFont should be initialized with cvInitFont. More...
 
void cvPyrDown (const CvArr *src, CvArr *dst, int filter=CV_GAUSSIAN_5x5)
 Smoothes the input image with gaussian kernel and then down-samples it. More...
 
void cvPyrMeanShiftFiltering (const CvArr *src, CvArr *dst, double sp, double sr, int max_level=1, CvTermCriteria termcrit=cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 5, 1))
 Filters image using meanshift algorithm. More...
 
void cvPyrUp (const CvArr *src, CvArr *dst, int filter=CV_GAUSSIAN_5x5)
 Up-samples image and smoothes the result with gaussian kernel. More...
 
CvPoint cvReadChainPoint (CvChainPtReader *reader)
 Retrieves the next chain point. More...
 
void cvRectangle (CvArr *img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 Draws a rectangle given two opposite corners of the rectangle (pt1 & pt2) More...
 
void cvRectangleR (CvArr *img, CvRect r, CvScalar color, int thickness=1, int line_type=8, int shift=0)
 Draws a rectangle specified by a CvRect structure. More...
 
void cvReleaseHist (CvHistogram **hist)
 Releases the histogram. More...
 
void cvReleasePyramid (CvMat ***pyramid, int extra_layers)
 Releases pyramid. More...
 
void cvReleaseStructuringElement (IplConvKernel **element)
 releases structuring element More...
 
void cvRemap (const CvArr *src, CvArr *dst, const CvArr *mapx, const CvArr *mapy, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0))
 Performs generic geometric transformation using the specified coordinate maps. More...
 
void cvResize (const CvArr *src, CvArr *dst, int interpolation=CV_INTER_LINEAR)
 Resizes image (input array is resized to fit the destination array) More...
 
void cvRunningAvg (const CvArr *image, CvArr *acc, double alpha, const CvArr *mask=NULL)
 Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha. More...
 
int cvSampleLine (const CvArr *image, CvPoint pt1, CvPoint pt2, void *buffer, int connectivity=8)
 Fetches pixels that belong to the specified line segment and stores them to the buffer. More...
 
void cvSetHistBinRanges (CvHistogram *hist, float **ranges, int uniform=1)
 Sets the bounds of the histogram bins. More...
 
void cvSmooth (const CvArr *src, CvArr *dst, int smoothtype=CV_GAUSSIAN, int size1=3, int size2=0, double sigma1=0, double sigma2=0)
 Smooths the image in one of several ways. More...
 
void cvSobel (const CvArr *src, CvArr *dst, int xorder, int yorder, int aperture_size=3)
 Calculates an image derivative using generalized Sobel. More...
 
void cvSquareAcc (const CvArr *image, CvArr *sqsum, const CvArr *mask=NULL)
 Adds squared image to accumulator. More...
 
CvContourScanner cvStartFindContours (CvArr *image, CvMemStorage *storage, int header_size=sizeof(CvContour), int mode=CV_RETR_LIST, int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0, 0))
 Initializes contour retrieving process. More...
 
void cvStartReadChainPoints (CvChain *chain, CvChainPtReader *reader)
 Initializes Freeman chain reader. More...
 
void cvSubstituteContour (CvContourScanner scanner, CvSeq *new_contour)
 Substitutes the last retrieved contour with the new one. More...
 
void cvThreshHist (CvHistogram *hist, double threshold)
 Thresholds the histogram. More...
 
double cvThreshold (const CvArr *src, CvArr *dst, double threshold, double max_value, int threshold_type)
 Applies fixed-level threshold to grayscale image. More...
 
void cvUndistort2 (const CvArr *src, CvArr *dst, const CvMat *camera_matrix, const CvMat *distortion_coeffs, const CvMat *new_camera_matrix=0)
 Transforms the input image to compensate lens distortion. More...
 
void cvUndistortPoints (const CvMat *src, CvMat *dst, const CvMat *camera_matrix, const CvMat *dist_coeffs, const CvMat *R=0, const CvMat *P=0)
 Computes the original (undistorted) feature coordinates from the observed (distorted) coordinates. More...
 
void cvWarpAffine (const CvArr *src, CvArr *dst, const CvMat *map_matrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0))
 Warps image with affine transform. More...
 
void cvWarpPerspective (const CvArr *src, CvArr *dst, const CvMat *map_matrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0))
 Warps image with perspective (projective) transform. More...
 
void cvWatershed (const CvArr *image, CvArr *markers)
 Segments image using seed "markers". More...