📄 cv.h
字号:
/* Types of thresholding */
#define CV_THRESH_BINARY 0 /* value = value > threshold ? max_value : 0 */
#define CV_THRESH_BINARY_INV 1 /* value = value > threshold ? 0 : max_value */
#define CV_THRESH_TRUNC 2 /* value = value > threshold ? threshold : value */
#define CV_THRESH_TOZERO 3 /* value = value > threshold ? value : 0 */
#define CV_THRESH_TOZERO_INV 4 /* value = value > threshold ? 0 : value */
/* Applies fixed-level threshold to grayscale image.
This is a basic operation applied before retrieving contours */
CVAPI(void) cvThreshold( const CvArr* src, CvArr* dst,
double threshold, double max_value,
int threshold_type );
#define CV_ADAPTIVE_THRESH_MEAN_C 0
#define CV_ADAPTIVE_THRESH_GAUSSIAN_C 1
/* Applies adaptive threshold to grayscale image.
The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and
CV_ADAPTIVE_THRESH_GAUSSIAN_C are:
neighborhood size (3, 5, 7 etc.),
and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...) */
CVAPI(void) cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value,
int adaptive_method CV_DEFAULT(CV_ADAPTIVE_THRESH_MEAN_C),
int threshold_type CV_DEFAULT(CV_THRESH_BINARY),
int block_size CV_DEFAULT(3),
double param1 CV_DEFAULT(5));
#define CV_FLOODFILL_FIXED_RANGE (1 << 16)
#define CV_FLOODFILL_MASK_ONLY (1 << 17)
/* Fills the connected component until the color difference gets large enough */
CVAPI(void) cvFloodFill( CvArr* image, CvPoint seed_point,
CvScalar new_val, CvScalar lo_diff CV_DEFAULT(cvScalarAll(0)),
CvScalar up_diff CV_DEFAULT(cvScalarAll(0)),
CvConnectedComp* comp CV_DEFAULT(NULL),
int flags CV_DEFAULT(4),
CvArr* mask CV_DEFAULT(NULL));
/****************************************************************************************\
* Feature detection *
\****************************************************************************************/
/* Runs canny edge detector */
CVAPI(void) cvCanny( const CvArr* image, CvArr* edges, double threshold1,
double threshold2, int aperture_size CV_DEFAULT(3) );
/* Calculates constraint image for corner detection
Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy.
Applying threshold to the result gives coordinates of corners */
CVAPI(void) cvPreCornerDetect( const CvArr* image, CvArr* corners,
int aperture_size CV_DEFAULT(3) );
/* Calculates eigen values and vectors of 2x2
gradient matrix at every image pixel */
CVAPI(void) cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv,
int block_size, int aperture_size CV_DEFAULT(3) );
/* Calculates minimal eigenvalue for 2x2 gradient matrix at
every image pixel */
CVAPI(void) cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval,
int block_size, int aperture_size CV_DEFAULT(3) );
/* Adjust corner position using some sort of gradient search */
CVAPI(void) cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,
int count, CvSize win, CvSize zero_zone,
CvTermCriteria criteria );
/* Finds a sparse set of points within the selected region
that seem to be easy to track */
CVAPI(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 CV_DEFAULT(NULL));
#define CV_HOUGH_STANDARD 0
#define CV_HOUGH_PROBABILISTIC 1
#define CV_HOUGH_MULTI_SCALE 2
/* Finds lines on binary image using one of several methods.
line_storage is either memory storage or 1 x <max number of lines> CvMat, its
number of columns is changed by the function.
method is one of CV_HOUGH_*;
rho, theta and threshold are used for each of those methods;
param1 ~ line length, param2 ~ line gap - for probabilistic,
param1 ~ srn, param2 ~ stn - for multi-scale */
CVAPI(CvSeq*) cvHoughLines2( CvArr* image, void* line_storage, int method,
double rho, double theta, int threshold,
double param1 CV_DEFAULT(0), double param2 CV_DEFAULT(0));
/* Fits a line into set of 2d or 3d points in a robust way (M-estimator technique) */
CVAPI(void) cvFitLine( const CvArr* points, int dist_type, double param,
double reps, double aeps, float* line );
/****************************************************************************************\
* Haar-like Object Detection functions *
\****************************************************************************************/
/* Loads haar classifier cascade from a directory.
It is obsolete: convert your cascade to xml and use cvLoad instead */
CVAPI(CvHaarClassifierCascade*) cvLoadHaarClassifierCascade(
const char* directory, CvSize orig_window_size);
CVAPI(void) cvReleaseHaarClassifierCascade( CvHaarClassifierCascade** cascade );
#define CV_HAAR_DO_CANNY_PRUNING 1
CVAPI(CvSeq*) cvHaarDetectObjects( const CvArr* image,
CvHaarClassifierCascade* cascade,
CvMemStorage* storage, double scale_factor CV_DEFAULT(1.1),
int min_neighbors CV_DEFAULT(3), int flags CV_DEFAULT(0),
CvSize min_size CV_DEFAULT(cvSize(0,0)));
/* sets images for haar classifier cascade */
CVAPI(void) cvSetImagesForHaarClassifierCascade( CvHaarClassifierCascade* cascade,
const CvArr* sum, const CvArr* sqsum,
const CvArr* tilted_sum, double scale );
/* runs the cascade on the specified window */
CVAPI(int) cvRunHaarClassifierCascade( CvHaarClassifierCascade* cascade,
CvPoint pt, int start_stage CV_DEFAULT(0));
/****************************************************************************************\
* Camera Calibration and Rectification functions *
\****************************************************************************************/
/* The function corrects radial and tangential image distortion using known
matrix of the camera intrinsic parameters and distortion coefficients */
CVAPI(void) cvUnDistortOnce( const CvArr* src, CvArr* dst,
const float* intrinsic_matrix,
const float* distortion_coeffs,
int interpolate CV_DEFAULT(1) );
/* The function calculates map of distorted points indices and
interpolation coefficients for cvUnDistort function using known
matrix of the camera intrinsic parameters and distortion coefficients */
CVAPI(void) cvUnDistortInit( const CvArr* src, CvArr* undistortion_map,
const float* intrinsic_matrix,
const float* distortion_coeffs,
int interpolate CV_DEFAULT(1) );
/* The function corrects radial and tangential image distortion
using previousely calculated (via cvUnDistortInit) map */
CVAPI(void) cvUnDistort( const CvArr* src, CvArr* dst, const CvArr* undistortion_map,
int interpolate CV_DEFAULT(1));
#define cvRemap cvUnDistort
/* The function converts floating-point pixel coordinate map to
faster fixed-point map, used by cvUnDistort (cvRemap) */
CVAPI(void) cvConvertMap( const CvArr* src, const CvArr* map_xy,
CvArr* map_fast, int iterpolate CV_DEFAULT(1) );
/* Calibrates camera using multiple views of calibration pattern */
CVAPI(void) cvCalibrateCamera( int image_count,
int* point_counts,
CvSize image_size,
CvPoint2D32f* image_points,
CvPoint3D32f* object_points,
CvVect32f distortion_coeffs,
CvMatr32f camera_matrix,
CvVect32f translation_vectors,
CvMatr32f rotation_matrixes,
int use_intrinsic_guess);
/* Variant of the previous function that takes double-precision parameters */
CVAPI(void) cvCalibrateCamera_64d( int image_count,
int* point_counts,
CvSize image_size,
CvPoint2D64d* image_points,
CvPoint3D64d* object_points,
CvVect64d distortion_coeffs,
CvMatr64d camera_matrix,
CvVect64d translation_vectors,
CvMatr64d rotation_matrixes,
int use_intrinsic_guess);
/* Find 3d position of object given intrinsic camera parameters,
3d model of the object and projection of the object into view plane */
CVAPI(void) cvFindExtrinsicCameraParams( int point_count,
CvSize image_size,
CvPoint2D32f* image_points,
CvPoint3D32f* object_points,
CvVect32f focal_length,
CvPoint2D32f principal_point,
CvVect32f distortion_coeffs,
CvVect32f rotation_vector,
CvVect32f translation_vector);
/* Variant of the previous function that takes double-precision parameters */
CVAPI(void) cvFindExtrinsicCameraParams_64d( int point_count,
CvSize image_size,
CvPoint2D64d* image_points,
CvPoint3D64d* object_points,
CvVect64d focal_length,
CvPoint2D64d principal_point,
CvVect64d distortion_coeffs,
CvVect64d rotation_vector,
CvVect64d translation_vector);
/* Rodrigues transform */
#define CV_RODRIGUES_M2V 0
#define CV_RODRIGUES_V2M 1
/* Converts rotation_matrix matrix to rotation_matrix vector or vice versa */
CVAPI(void) cvRodrigues( CvMat* rotation_matrix, CvMat* rotation_vector,
CvMat* jacobian, int conv_type);
/* Does reprojection of 3d object points to the view plane */
CVAPI(void) cvProjectPoints( int point_count,
CvPoint3D64d* object_points,
CvVect64d rotation_vector,
CvVect64d translation_vector,
CvVect64d focal_length,
CvPoint2D64d principal_point,
CvVect64d distortion,
CvPoint2D64d* image_points,
CvVect64d deriv_points_rotation_matrix,
CvVect64d deriv_points_translation_vect,
CvVect64d deriv_points_focal,
CvVect64d deriv_points_principal_point,
CvVect64d deriv_points_distortion_coeffs);
/* Simpler version of the previous function */
CVAPI(void) cvProjectPointsSimple( int point_count,
CvPoint3D64d * object_points,
CvVect64d rotation_matrix,
CvVect64d translation_vector,
CvMatr64d camera_matrix,
CvVect64d distortion,
CvPoint2D64d* image_points);
/* Detects corners on a chess-board */
CVAPI(int) cvFindChessBoardCornerGuesses( const CvArr* image, CvArr* thresh,
CvMemStorage* storage, CvSize board_size,
CvPoint2D32f* corners,
int* corner_count CV_DEFAULT(NULL));
typedef struct CvPOSITObject CvPOSITObject;
/* Allocates and initializes CvPOSITObject structure before doing cvPOSIT */
CVAPI(CvPOSITObject*) cvCreatePOSITObject( CvPoint3D32f* points, int point_count );
/* Runs POSIT (POSe from ITeration) algorithm for determining 3d position of
an object given its model and projection in a weak-perspective case */
CVAPI(void) cvPOSIT( CvPOSITObject* posit_object, CvPoint2D32f* image_points,
double focal_length, CvTermCriteria criteria,
CvMatr32f rotation_matrix, CvVect32f translation_vector);
/* Releases CvPOSITObject structure */
CVAPI(void) cvReleasePOSITObject( CvPOSITObject** posit_object );
/****************************************************************************************\
* Epipolar Geometry *
\****************************************************************************************/
CVAPI(void) cvMake2DPoints( CvMat* src, CvMat* dst );
CVAPI(void) cvMake3DPoints( CvMat* src, CvMat* dst );
CVAPI(int) cvSolveCubic( CvMat* coeffs, CvMat* roots );
/* Calculates fundamental matrix given a set of corresponding points */
#define CV_FM_7POINT 1
#define CV_FM_8POINT 2
#define CV_FM_RANSAC 3
#define CV_FM_LMEDS 4
CVAPI(int) cvFindFundamentalMat( CvMat* points1, CvMat* points2,
CvMat* fundamental_matrix, int method,
double param1, double param2,
CvMat* status CV_DEFAULT(0) );
/* For each input point on one of images
computes parameters of the corresponding
epipolar line on the other image */
CVAPI(void) cvComputeCorrespondEpilines( const CvMat* points,
int which_image,
const CvMat* fundamental_matrix,
CvMat* correspondent_lines );
#ifdef __cplusplus
}
#endif
/****************************************************************************************\
* Backward compatibility *
\****************************************************************************************/
#ifndef _CV_NO_BACKWARD_COMPATIBILITY
#include "cvcompat.h"
#endif
#endif /*_CV_H_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -