📄 cv.h
字号:
//////////////////////////////////////////////////////////////////////////////////////////// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.//// By downloading, copying, installing or using the software you agree to this license.// If you do not agree to this license, do not download, install,// copy or use the software.////// License For Embedded Computer Vision Library//// Copyright (c) 2008, EMCV Project,// Copyright (c) 2000-2007, Intel Corporation,// All rights reserved.// Third party copyrights are property of their respective owners.//// Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met://// * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer.// * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution.// * Neither the name of the copyright holders nor the names of their contributors // may be used to endorse or promote products derived from this software // without specific prior written permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY // OF SUCH DAMAGE.//// Contributors:// * Shiqi Yu (Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences)#ifndef _CV_H_#define _CV_H_#include "cxcore.h"#include "cvtypes.h"#ifdef __cplusplusextern "C" {#endif/****************************************************************************************\* Image Processing *\****************************************************************************************//* Copies source 2D array inside of the larger destination array and makes a border of the specified type (IPL_BORDER_*) around the copied area. */CVAPI(void) cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset, int bordertype, CvScalar value CV_DEFAULT(cvScalarAll(0)));#define CV_BLUR_NO_SCALE 0#define CV_BLUR 1#define CV_GAUSSIAN 2#define CV_MEDIAN 3#define CV_BILATERAL 4/* Smoothes array (removes noise) */CVAPI(void) cvSmooth( const CvArr* src, CvArr* dst, int smoothtype CV_DEFAULT(CV_GAUSSIAN), int param1 CV_DEFAULT(3), int param2 CV_DEFAULT(0), double param3 CV_DEFAULT(0), double param4 CV_DEFAULT(0));/* Convolves the image with the kernel */CVAPI(void) cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel, CvPoint anchor CV_DEFAULT(cvPoint(-1,-1)));/* Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y) */CVAPI(void) cvIntegral( const CvArr* image, CvArr* sum, CvArr* sqsum CV_DEFAULT(NULL), CvArr* tilted_sum CV_DEFAULT(NULL));/* Smoothes the input image with gaussian kernel and then down-samples it. dst_width = floor(src_width/2)[+1], dst_height = floor(src_height/2)[+1]*/CVAPI(void) cvPyrDown( const CvArr* src, CvArr* dst, int filter CV_DEFAULT(0) );/* Up-samples image and smoothes the result with gaussian kernel. dst_width = src_width*2, dst_height = src_height*2*/CVAPI(void) cvPyrUp( const CvArr* src, CvArr* dst, int filter CV_DEFAULT(0) );/* Builds the whole pyramid at once. Output array of CvMat headers (levels[*]) is initialized with the headers of subsequent pyramid levels *//*CVAPI void cvCalcPyramid( const CvArr* src, CvArr* container, CvMat* levels, int level_count, int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );*//* Splits color or grayscale image into multiple connected components of nearly the same color/brightness using modification of Burt algorithm. comp with contain a pointer to sequence (CvSeq) of connected components (CvConnectedComp) */CVAPI(void) cvPyrSegmentation( IplImage* src, IplImage* dst, CvMemStorage* storage, CvSeq** comp, int level, double threshold1, double threshold2 );/* Filters image using meanshift algorithm */CVAPI(void) cvPyrMeanShiftFiltering( const CvArr* src, CvArr* dst, double sp, double sr, int max_level CV_DEFAULT(1), CvTermCriteria termcrit CV_DEFAULT(cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,5,1)));/* Segments image using seed "markers" */CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );#define CV_INPAINT_NS 0#define CV_INPAINT_TELEA 1/* Inpaints the selected region in the image */CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, CvArr* dst, double inpaintRange, int flags );#define CV_SCHARR -1#define CV_MAX_SOBEL_KSIZE 7/* Calculates an image derivative using generalized Sobel (aperture_size = 1,3,5,7) or Scharr (aperture_size = -1) operator. Scharr can be used only for the first dx or dy derivative */CVAPI(void) cvSobel( const CvArr* src, CvArr* dst, int xorder, int yorder, int aperture_size CV_DEFAULT(3));/* Calculates the image Laplacian: (d2/dx + d2/dy)I */CVAPI(void) cvLaplace( const CvArr* src, CvArr* dst, int aperture_size CV_DEFAULT(3) );/* Constants for color conversion */#define CV_BGR2BGRA 0#define CV_RGB2RGBA CV_BGR2BGRA#define CV_BGRA2BGR 1#define CV_RGBA2RGB CV_BGRA2BGR#define CV_BGR2RGBA 2#define CV_RGB2BGRA CV_BGR2RGBA#define CV_RGBA2BGR 3#define CV_BGRA2RGB CV_RGBA2BGR#define CV_BGR2RGB 4#define CV_RGB2BGR CV_BGR2RGB#define CV_BGRA2RGBA 5#define CV_RGBA2BGRA CV_BGRA2RGBA#define CV_BGR2GRAY 6#define CV_RGB2GRAY 7#define CV_GRAY2BGR 8#define CV_GRAY2RGB CV_GRAY2BGR#define CV_GRAY2BGRA 9#define CV_GRAY2RGBA CV_GRAY2BGRA#define CV_BGRA2GRAY 10#define CV_RGBA2GRAY 11#define CV_BGR2BGR565 12#define CV_RGB2BGR565 13#define CV_BGR5652BGR 14#define CV_BGR5652RGB 15#define CV_BGRA2BGR565 16#define CV_RGBA2BGR565 17#define CV_BGR5652BGRA 18#define CV_BGR5652RGBA 19#define CV_GRAY2BGR565 20#define CV_BGR5652GRAY 21#define CV_BGR2BGR555 22#define CV_RGB2BGR555 23#define CV_BGR5552BGR 24#define CV_BGR5552RGB 25#define CV_BGRA2BGR555 26#define CV_RGBA2BGR555 27#define CV_BGR5552BGRA 28#define CV_BGR5552RGBA 29#define CV_GRAY2BGR555 30#define CV_BGR5552GRAY 31#define CV_BGR2XYZ 32#define CV_RGB2XYZ 33#define CV_XYZ2BGR 34#define CV_XYZ2RGB 35#define CV_BGR2YCrCb 36#define CV_RGB2YCrCb 37#define CV_YCrCb2BGR 38#define CV_YCrCb2RGB 39#define CV_BGR2HSV 40#define CV_RGB2HSV 41#define CV_BGR2Lab 44#define CV_RGB2Lab 45#define CV_BayerBG2BGR 46#define CV_BayerGB2BGR 47#define CV_BayerRG2BGR 48#define CV_BayerGR2BGR 49#define CV_BayerBG2RGB CV_BayerRG2BGR#define CV_BayerGB2RGB CV_BayerGR2BGR#define CV_BayerRG2RGB CV_BayerBG2BGR#define CV_BayerGR2RGB CV_BayerGB2BGR#define CV_BGR2Luv 50#define CV_RGB2Luv 51#define CV_BGR2HLS 52#define CV_RGB2HLS 53#define CV_HSV2BGR 54#define CV_HSV2RGB 55#define CV_Lab2BGR 56#define CV_Lab2RGB 57#define CV_Luv2BGR 58#define CV_Luv2RGB 59#define CV_HLS2BGR 60#define CV_HLS2RGB 61#define CV_COLORCVT_MAX 100/* Converts input array pixels from one color space to another */CVAPI(void) cvCvtColor( const CvArr* src, CvArr* dst, int code );#define CV_INTER_NN 0#define CV_INTER_LINEAR 1#define CV_INTER_CUBIC 2#define CV_INTER_AREA 3#define CV_WARP_FILL_OUTLIERS 8#define CV_WARP_INVERSE_MAP 16/* Resizes image (input array is resized to fit the destination array) */CVAPI(void) cvResize( const CvArr* src, CvArr* dst, int interpolation CV_DEFAULT( CV_INTER_LINEAR ));/* Warps image with affine transform */ CVAPI(void) cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* map_matrix, int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS), CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );/* Computes affine transform matrix for mapping src[i] to dst[i] (i=0,1,2) */CVAPI(CvMat*) cvGetAffineTransform( const CvPoint2D32f * src, const CvPoint2D32f * dst, CvMat * map_matrix );/* Computes rotation_matrix matrix */CVAPI(CvMat*) cv2DRotationMatrix( CvPoint2D32f center, double angle, double scale, CvMat* map_matrix );/* Warps image with perspective (projective) transform */CVAPI(void) cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix, int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS), CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );/* Computes perspective transform matrix for mapping src[i] to dst[i] (i=0,1,2,3) */CVAPI(CvMat*) cvGetPerspectiveTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* map_matrix );/* Performs generic geometric transformation using the specified coordinate maps */CVAPI(void) cvRemap( const CvArr* src, CvArr* dst, const CvArr* mapx, const CvArr* mapy, int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS), CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );/* Performs forward or inverse log-polar image transform */CVAPI(void) cvLogPolar( const CvArr* src, CvArr* dst, CvPoint2D32f center, double M, int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));#define CV_SHAPE_RECT 0#define CV_SHAPE_CROSS 1#define CV_SHAPE_ELLIPSE 2#define CV_SHAPE_CUSTOM 100/* creates structuring element used for morphological operations */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -