OpenCV functions commonly used in image processing and image recognition

Original source: https://blog.csdn.net/fengbingchun/article/details/5816253

  1. cvLoadImage: Load the image file into memory;

  2. cvNamedWindow: create a window on the screen;

  3. cvDestroyWindow: Destroy the window displaying the image file;

  4. cvDestroyAllWindows: Destroy all windows displaying image files;

  5. cvShowImage: Display the image in a created window;

  6. cvWaitKey: Pause the program, waiting for the user to trigger a key operation;

  7. cvReleaseImage: release the memory allocated by the image file;

  8. cvCreateFileCapture: Determine the AVI file to be read by parameter setting;

  9. cvQueryFrame: used to load the next frame of video file into memory;

  10. cvReleaseCapture: Release the memory space opened up by the CvCapture structure;

  11. cvCreateTrackbar: Create a scroll bar;

  12. cvSetCaptureProperty: Set various properties of the CvCapture object;

  13. cvGetCaptureProperty: Query various properties of the CvCapture object;

  14. cvGetSize: the size of the current image structure;

  15. cvSmooth: smooth the image;

  16. cvPyrDown: image pyramid, downsampling, the image is reduced to a quarter of the original;

  17. cvPyrUp: Image pyramid, which doubles the existing image in each dimension;

  18. cvResize: enlarge or reduce the image;

  19. cvCreateCameraCapture: read data from the camera device;

  20. cvCreateVideoWriter: Create a write device to write the video stream to the video file frame by frame;

  21. cvWriteFrame: Write the video stream to the file frame by frame;

  22. cvReleaseVideoWriter: Release the memory space opened up by the CvVideoWriter structure;

  23. CV_MAT_ELEM: get an element from the matrix;

  24. cvAbs: Calculate the absolute value of all elements in the array;

  25. cvAbsDiff: Calculate the absolute value of the difference between two arrays;

  26. cvAbsDiffS: Calculates the absolute value of the difference between an array and a scalar;

  27. cvAdd: element-level addition of two arrays;

  28. cvAddS: element-wise addition of an array and a scalar;

  29. cvAddWeighted: Element-wise weighted addition operation (alpha operation) of two arrays;

  30. cvScaleAdd: Calculate the sum of an array scaled with another array;

  31. cvAvg: Calculate the average of all elements in the array;

  32. cvAvgSdv: Calculate the absolute value and standard deviation of all elements in the array;

  33. cvCalcCovarMatrix: Calculate the covariance of a set of n-dimensional space vectors;

  34. cvCmp: applies the set comparison operation to all elements in the two arrays;

  35. cvCmpS: Use set comparison operations on arrays and scalars;

  36. cvConvertScale(cvConvert): converts the array element type with an optional scale value;

  37. cvCopy: Copy the values ​​in the array to another array;

  38. cvCountNonZero: Calculate the number of non-zero values ​​in the array;

  39. cvCrossProduct: Calculate the vector product (cross product) of two three-dimensional vectors;

  40. cvCvtColor: Convert the channels of the array from one color space to another;

  41. cvDet: Calculate the determinant of the square matrix;

  42. cvDotProduct: Calculates the dot product of two vectors;

  43. cvEigenVV: Calculate the eigenvalues ​​and eigenvectors of the square matrix;

  44. cvFlip: flip around the selected axis;

  45. cvGEMM: matrix multiplication;

  46. cvGetCol: Copy elements from a column of an array;

  47. cvGetCols: Copy elements from adjacent columns of data;

  48. cvGetDiag: Copy all elements on the diagonal in the array;

  49. cvGetDims: returns the dimension of the array;

  50. cvGetDimSize: returns the size of all dimensions of an array;

  51. cvGetRow: Copy the element value from the row of an array;

  52. cvGetRows: Copy element values ​​from multiple adjacent rows of an array;

  53. cvGetSize: Get the size of the two-dimensional array and return it as CvSize;

  54. cvGetSubRect: copies element values ​​from a subregion of an array;

  55. cvInRange: Checks if the elements of one array are within the range of values ​​in the other two arrays;

  56. cvInRangeS: Checks whether the value of an element of an array is within the range of two other scalars;

  57. cvInvert: find the inverse of the matrix;

  58. cvMahalonobis: Calculate the Mahalanobis distance between two vectors;

  59. cvMax: Perform element-level maximum operation in two arrays;

  60. cvMaxS: Perform element-wise maximum operation in an array and a scalar;

  61. cvMin: Perform element-level minimum operation in two arrays;

  62. cvMinS: Perform element-wise minimum operation in an array and a scalar;

  63. cvMinMaxLoc: find the maximum and minimum values ​​in the array;

  64. cvMul: Calculate the element-level product of two arrays (dot product);

  65. cvDiv: Perform element-wise division of an array with another array;

  66. cvNormalize: normalize the elements in the array;

  67. cvReduce: Reduce a two-dimensional array to a vector by a given operator;

  68. cvRepeat: Array copy in a tiled manner;

  69. cvSet: initialize the array with the given values;

  70. cvSetZero: Initialize all elements in the array to 0;

  71. cvSetIdentity: Set the elements on the diagonal in the array to 1, and the others to 0;

  72. cvSolve: find the solution of the linear system of equations;

  73. cvSplit: Split a multi-channel array into multiple single-channel arrays;

  74. cvMerge: Merge several single-channel images into a multi-channel image;

  75. cvSub: element-wise subtraction of two arrays;

  76. cvSubS: element-wise subtract scalar from array;

  77. cvSubRS: Element-wise subtract array from scalar;

  78. cvSum: sums all elements in an array;

  79. cvSVD: singular value decomposition of a two-dimensional matrix;

  80. cvSVBkSb: singular value back-substitution calculation;

  81. cvTrace: Calculate the matrix trace;

  82. cvTranspose: the transpose operation of the matrix;

  83. cvNot: Negates each element in the array bitwise;

  84. cvOr: Bitwise OR operation on two arrays;

  85. cvOrs: Bitwise OR between arrays and scalars;

  86. cvXor: bitwise XOR operation on two arrays;

  87. cvXorS: Bitwise XOR between arrays and scalars;

  88. cvAnd: bitwise AND operation on two arrays;

  89. cvAndS: Bitwise AND operation between arrays and scalars;

  90. cvZero: Set all elements in the array to 0;

  91. cvConvertScaleAbs: Calculate the absolute value of the optional scale value and then convert the type of the array elements;

  92. cvNorm: Calculate the absolute norm of the array, the absolute difference norm or the relative difference norm;

  93. cvScale: is a macro of cvConvertScale that can be used to rescale the contents of an array and convert parameters from one data type to another;

  94. cvT: is the abbreviation of the function cvTranspose;

  95. cvLine: draw a straight line;

  96. cvRectangle: draw a rectangle;

  97. cvCircle: draw a circle;

  98. cvEllipse: draw an ellipse;

  99. cvEllipseBox: Use the circumscribed rectangle to describe the ellipse;

100.cvFillPoly, cvFillConvexPoly, cvPolyLine: draw polygons;

101.cvPutText: output some text on the image;

102.cvGetTextSize: Calculate the width and height of the text string;

103.cvInitFont: Use a set of parameters to configure some basic specific fonts for screen output;

104.cvSave: matrix save;

105.cvLoad: matrix read;

106. cvOpenFileStorage: open storage file for read/write;

107.cvReleaseFileStorage: release the stored data;

108.cvStartWriteStruct: Start writing a new data structure;

109.cvEndWriteStruct: end writing data structure;

110.cvWriteInt: write integer type;

111.cvWriteReal: write floating point type;

112.cvWriteString: write character type;

113.cvWriteComment: Write an XML or YAML comment string;

114.cvWrite: write an object;

115.cvWriteRawData: write multiple values;

116. cvWriteFileNode: write the file node to another file storage;

117.cvGetRootFileNode: Get the topmost node of the memory;

118. cvGetFileNodeByName: find the corresponding node in the map or memory;

119. cvGetHashedKey: returns a unique pointer for the name;

120.cvGetFileNode: find the node in the map or file memory;

121.cvGetFileNodeName: returns the node name of the file;

122.cvReadInt: read an unnamed integer type;

123.cvReadIntByName: read a named integer;

124.cvReadReal: read an unnamed floating point type;

125. cvReadRealByName: read a floating-point type with a name;

126.cvReadString: find the string from the file node;

127. cvReadStringByName: find a named file node and return it;

128. cvRead: decode the object and return its pointer;

129. cvReadByName: find the object and decode it;

130.cvReadRawData: read multiple values;

131. cvStartReadRawData: Initialize the reading of the file node sequence;

132.cvReadRawDataSlice: Read the content of the file node;

133.cvGetModuleInfo: Check whether the IPP library has been installed normally and check whether the operation is normal;

134.cvResizeWindow: used to adjust the size of the window;

135.cvSaveImage: save the image;

136.cvMoveWindow: move the window to the position where its upper left corner is x, y;

137.cvDestroyAllWindow: used to close all windows and release window-related memory space;

138.cvGetTrackbarPos: read the value of the slider;

139.cvSetTrackbarPos: Set the value of the slider;

140.cvGrabFrame: Quickly grab frames from a camera or video file, and the captured frames are stored internally;

141. cvRetrieveFrame: retrieve the image captured by the function cvGrabFrame, the returned image cannot be released or modified by the user;

142.cvConvertImage: used to convert between different commonly used image formats;

143.cvErode: Morphological corrosion;

144.cvDilate: morphological expansion;

145. cvMorphologyEx: a more general morphological function;

146. cvCreateStructuringElementEx: Create a custom IplConvKernel kernel, which is used in the corresponding morphological operations;

147. cvReleaseStructuringElement: Release the IplConvKernel core created by custom;

148.cvFloodFill: flood filling algorithm, used to further control which areas will be filled with color;

149.cvPyrSegmentation: use pyramid to achieve image segmentation;

150.cvThreshold: image thresholding;

151.cvAcc: 8-bit integer type images can be accumulated as floating-point images;

152.cvAdaptiveThreshold: image adaptive threshold;

153.cvFilter2D: image convolution;

154. cvCopyMakeBorder: Make a specific image slightly larger, and then automatically fill the image border in various ways;

155.cvCanny: Canny edge detection;

156.cvSobel: image edge detection, Sobel operator;

157.cvLaplace: Laplace transform, image edge detection;

158.cvHoughLines2: Hough line transform;

159.cvHoughCircles: Hough circle transform;

160.cvWarpAffine: dense affine transformation;

161. cvGetQuadrangleSubPix: affine transformation (extract pixel quadrilateral, using sub-pixel precision);

162.cvGetRectSubPix: Extract pixel rectangle from image, using sub-pixel precision;

163.cvGetAffineTransform: Calculation of affine mapping matrix;

164.cvCloneImage: Copy the entire IplImage structure to a new IplImage;

165.cv2DRotationMatrix: Calculation of affine mapping matrix;

166.cvTransform: sparse affine transformation;

167.cvWarpPerspective: dense perspective transformation (homography);

168. cvGetPerspectiveTransform: Calculate the perspective mapping matrix;

169.cvPerspectiveTransform: sparse perspective transformation;

170.cvCartToPolar: Map values ​​from Cartesian space to polar coordinates (polar space);

171.cvPolarToCart: Map values ​​from polar space to Cartesian space;

172.cvLogPolar: log polar coordinate transformation;

173.cvDFT: discrete Fourier transform;

174. cvMulSpectrums: spectrum multiplication;

175.cvDCT: discrete cosine transform;

176.cvIntegral: Calculate the integral image;

177.cvDistTransform: distance transformation of the image;

178.cvEqualizeHist: histogram equalization;

179.cvCreateHist: Create a new histogram;

180.cvReleaseHist: Release the created histogram;

181. cvMakeHistHeaderForArray: Create a histogram based on the given data;

182.cvNormalizeHist: normalized histogram;

183. cvThreshHist: histogram threshold function;

184. cvCalcHist: automatically calculate the histogram from the image;

185.cvCompareHist: used to compare the similarity of two histograms;

186.cvCalcEMD2: Land Movement Distance (EMD) algorithm;

187.cvCalcBackProject: backprojection;

188.cvCalcBackProjectPatch: the direction projection of the tile;

189.cvMatchTemplate: template matching;

190.cvCreateMemStorage: used to create a memory storage;

191.cvCreateSeq: create sequence;

192.cvSeqInvert: Reverse the sequence;

193. cvCvtSeqToArray: Copy all or part of the sequence to a contiguous memory array;

194.cvFindContours: Find contours from binary images;

195.cvDrawContours: draw contours;

196.cvApproxPoly: Use polygons to approximate a contour;

197.cvConvexHull2: Calculate the convex shape of a 2D point set using the Sklansky algorithm;

198.cvPointPolygonTest: The position of the point in the polygon (inside, outside, on the edge of the polygon);

199.cvContourPerimeter: contour length;

200.cvContoursMoments: Calculate contour moments;

201.cvMoments: Calculate Hu invariant moments;

202.cvMatchShapes: use moments for matching;

203.cvInitLineIterator: Sampling pixels on any line;

204.cvSampleLine: Sampling a straight line;

205.cvAbsDiff: frame difference;

206.cvWatershed: watershed algorithm;

207.cvInpaint: patch image;

208.cvGoodFeaturesToTrack: find corners;

209.cvCornerHarris: Harris corner detection;

210.cvFindCornerSubPix: used to find the corner position of sub-pixel accuracy;

211.cvMeanShift: mean-shift tracking algorithm;

212.cvCamShift: camshift tracking algorithm;

213.cvCreateConDensation: condensation algorithm, assigning condensation filter structure;

214.cvReleaseConDensation: condensation algorithm, release the condensation filter structure;

215.cvConDensInitSampleSet: condensation algorithm, initializes the particle set in the condensation algorithm;

216. cvConDensUpdateByTime: condensation algorithm to estimate the next model state;

217.cvConvertPointsHomogenious: Convert the alignment secondary coordinates;

218.cvFindChessboardCorners: locate the corners of the chessboard;

219.cvCalibrateCamera2: Use calibration to calculate the internal and external parameters of the camera;

220.cvInitUndistortMap: Calculate the correspondence between deformation and non-line deformation images;

221.cvInitUndistortRectifyMap:computes the undistortion and rectification transformation map;

222.cvRemap: image remapping, calibration calibration image, image interpolation;

223.cvFindFundamentalMat: Calculate the basic matrix from the corresponding points in the two images;

224.cvComputeCorrespondEpilines: Calculate the corresponding epipolar lines in another image for a point in one image;

225.cvDrawChessboardCorners: draw the detected chessboard corners;

226.cvFindHomography: Calculate the homography matrix;

227.cvRodrigues2: Rodrigues transform;

228.cvFitLine: line fitting algorithm;

229.cvCalcCovarMatrix: Calculate covariance matrix;

230.cvInvert: Calculate the inverse of the covariance matrix;

231.cvMahalanobis: Calculate the Mahalanobis distance;

232.cvKMeans2: K-means;

233.cvCloneMat: Create a new matrix based on an existing matrix;

234.cvPreCornerDetect: Calculate the feature map for corner detection;

235.cvGetImage: Convert the CvMat image data format to the IplImage image data format;

236.cvMatMul: Multiplication of two matrices;

237.cvMatMulAdd dst = src1 * src2 + src3

238.cvRound: Returns the closest integer value to the parameter;

239.cvFloor: returns the largest integer value not greater than the parameter;

240.cvCeil: returns the smallest integer value not less than the parameter;

241.cvCreateImage: create image;

242.cvSetMouseCallback: use the mouse to obtain the rectangle on the determined window;

243.cvContourArea: Calculate the area of ​​the whole or part of the contour;

244.cvArcLength: Calculate the contour perimeter or curve length;

245.cvBoundingRect: Calculate the outermost rectangle boundary of the point set (obtain the circumscribed rectangle of the outline);

246. cvSeqRemove: delete the element (contour) at the specified position in the sequence;

247.cvGetTickCount: returns the time data of a 64-bit long integer;

248.cvGetTickFrequency: returns the system clock frequency;

249.cvRNG: Randomly generate a 64-bit random number (uint64);

250.cvRandInt: Returns a uniformly distributed 32-bit random number (uint32);

251.cvRandReal: returns a random number between 0 and 1 uniformly distributed;

252. cvRandArr: fill the array with random numbers and update the RNG state;

253.cvRandInit: Initialize the CvRandState data structure, you can select the type of random distribution and give it a seed;

254.cvInitMatHeader: Initialize the matrix header without allocating storage space;

255.cvTermCriteria: iterative algorithm termination criterion;

256. CvSVMParams: SVM training parameters, this structure needs to be initialized and passed to the CvSVM training function;

257. CvSVM::train: training SVM (support vector machine);

258. CvSVM::predict: predict the response value of a new sample, in classification problems, this function returns the category number, in regression problems, returns the function value;

259.cvSet2D: modify the specified array;

260. CvSVM::get_support_vector_count: Get the number of support vectors;

261. CvSVM::get_support_vector: Get the support vector corresponding to the index number;

262. CvSVM::save: save the data after SVM training to the specified file (save comes from cvStatModel is a general class of the ML library);

263. CvSVM::load: Load the specified file into the object specified by the SVM;

264. cvCreateBGCodeBookModel: in the codebook method, initialization;

265.cvBGCodeBookUpdate: In the codebook method, update the background model;

266. cvBGCodeBookClearStale: In the codebook method, clear the negative codebook;

267.cvBGCodeBookDiff: In the codebook method, background subtraction;

268. cvReleaseBGCodeBookModel: In the codebook method, release resources;

269.cvSegmentFGMask: segment the foreground connected domain;

270.cvRunningAvg: Update the running average, which can be used to update the background in moving target detection;

271.cvCalcOpticalFlowHS: Calculate the optical flow of two images using the Horn & Schunck algorithm;

272.cvCalcOpticalFlowLK: Calculate the optical flow (non-pyramid) of two images using the Lucas&Kanade algorithm;

273.cvCalcOpticalFlowPyrLK: Calculate the optical flow of a sparse feature set using the pyramid Lucas&Kanade method;

274.cvCalcOpticalFlowBM: Calculate the optical flow of two images using the block matching method;

275.cvUpdateMotionHistory: In the motion template, remove the image to update the motion history image;

276.cvRunningAvg: Update running average sliding average;

277.cvCalcMotionGradient: In the motion template, calculate the gradient direction of the motion history image;

278.cvSegmentMotion: In the motion template, the entire motion is divided into independent motion parts;

279.cvCalcGlobalOrientation: In the motion template, calculate the global motion direction of some selected areas;

280.cvGetMinMaxHistValue: find the minimum and maximum values ​​in the histogram;

281.cvMinAreaRect2: Find the circumscribed rectangle of the smallest area;

282.cvMinEnclosingCircle: Calculate the minimum circumscribed circle of the contour;

283.cvFitEllipse2: Get the ellipse bounding box of the contour;

284.cvMaxRect: Find the rectangle boundary with the smallest area that contains the two input rectangles;

285.cvBoxPoints: Find the vertices of the box;

286.cvCreateKalman: In Kalman, assign the Kalman filter structure;

287.cvReleaseKalman: In Kalman, release the Kalman filter structure;

288.cvKalmanPredict: In Kalman, the subsequent model state is estimated;

289.cvKalmanCorrect: In Kalman, adjust the model state;

290.cvLoadHaarClassifierCascade: In CvHaarClassifierCascade, load the trained cascade classifier from the file or import it from the classifier database embedded in OpenCV;

291.cvHaarDetectObjects: In CvHaarClassifierCascade, detect the target in the image;

292.cvSetImageForHaarClassifierCascade: In CvHaarClassifierCascade, specify the image for the hidden cascade (hidden cascade);

293.cvReleaseHaarClassifierCascade: In CvHaarClassifierCascade, release the haar classifier cascade;

294.cvRunHaarClassifierCascade: In CvHaarClassifierCascade, run the cascade of boosted classifier in the image at a given position;

295. CvAdaptiveSkinDetector::process: skin detection;

296.cvCalcEigenObjects: Calculate the eigen vector, eigen value, and image average of the incoming image array;

297.cvEigenDecomposite: Analyze the corresponding coefficients of each image after dimensionality reduction through the eigen vector and the original image set;

298.cvEigenProjection: The projected image is in the feature space;

299.cvAlloc: allocate memory;

300.cvFree: release memory (cvAlloc and cvFree should match);

301.CvANN_MLP::create:constructs MLP(multi-layer perceptrons) withthe specified topology;

302.CvANN_MLP::train:trains/updates MLP;

303.CvANN_MLP::predict:predicts responses for input samples;

304.CvANN_MLP::get_layer_count:returns the number fo layers in the MLP;

305.CvANN_MLP::get_layer_size:returns numbers of neurons in each layer ofthe MLP;

306.CvANN_MLP::get_weights:returns neurons weights of the particularlayer;

307.CvKNearest::CvKNearest:default and training constructors;

308.CvKNearest::train:trains the model;

309.CvKNearest::find_nearest:finds the neighbors and predicts responses forinput vectors;

310.CvKNearest::get_max_k:returns the number of maximum neighbors thatmay be passed to the method CvKNearest::find_nearest();

311.CvKNearest::get_var_count:returns the number of used features(variablescount);

312.CvKNearest::get_sample_count:returns the total number of train samples;

313.CvKNearest::is_regression:returns type of the problem(true forregression and false for classification);

314.cvGetSeqElem:returns a pointer to a sequenceelement according to its index;

315.cvGetReal2D:return a specific element ofsingle-channel 2D array;

316.cvSqrt: Calculate the square root;

317.cvPow: exponentiate each element in the array;

318.cvCbrt: Calculate the cube root;

319.cvExp: Calculate the exponential power of array elements;

320.cvLog: Calculate the natural logarithm of the absolute value of each array element;

321.cvSetImageROI: Set the region of interest;

322.cvResetImageROI: Release the region of interest;

323.cvSetImageCOI: Set the channel of interest;

324.cvLUT: Display lookup table, which is actually a mapping table of pixel grayscale values, which undergoes certain transformations such as threshold, inversion, binarization, contrast adjustment, and linear transformation on the actual sampled pixel grayscale values. and so on, it becomes another gray value corresponding to it;

  1. class FeatureDetector:abstract base class for 2D image feature detectors;

  2. class FastFeatureDetector:wrapping class for feature detection using the FAST() method;

  3. class SURF(SurfFeatureDetector、SurfDescriptorExtractor):extracting Speeded Up RobustFeatures from an image;

  4. class SIFT(SiftFeatureDetector):extracting keypoints and computingdescriptors using the Scale Invariant Feature Transform(SIFT) algorithm;

329.cvExtractSURF:detects keypoints andcomputes SURF descriptors for them;

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326569076&siteId=291194637