opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers types_c.h Source File

types_c.h

00001 /*M///////////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
00004 //
00005 //  By downloading, copying, installing or using the software you agree to this license.
00006 //  If you do not agree to this license, do not download, install,
00007 //  copy or use the software.
00008 //
00009 //
00010 //                           License Agreement
00011 //                For Open Source Computer Vision Library
00012 //
00013 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
00014 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
00015 // Third party copyrights are property of their respective owners.
00016 //
00017 // Redistribution and use in source and binary forms, with or without modification,
00018 // are permitted provided that the following conditions are met:
00019 //
00020 //   * Redistribution's of source code must retain the above copyright notice,
00021 //     this list of conditions and the following disclaimer.
00022 //
00023 //   * Redistribution's in binary form must reproduce the above copyright notice,
00024 //     this list of conditions and the following disclaimer in the documentation
00025 //     and/or other materials provided with the distribution.
00026 //
00027 //   * The name of the copyright holders may not be used to endorse or promote products
00028 //     derived from this software without specific prior written permission.
00029 //
00030 // This software is provided by the copyright holders and contributors "as is" and
00031 // any express or implied warranties, including, but not limited to, the implied
00032 // warranties of merchantability and fitness for a particular purpose are disclaimed.
00033 // In no event shall the Intel Corporation or contributors be liable for any direct,
00034 // indirect, incidental, special, exemplary, or consequential damages
00035 // (including, but not limited to, procurement of substitute goods or services;
00036 // loss of use, data, or profits; or business interruption) however caused
00037 // and on any theory of liability, whether in contract, strict liability,
00038 // or tort (including negligence or otherwise) arising in any way out of
00039 // the use of this software, even if advised of the possibility of such damage.
00040 //
00041 //M*/
00042 
00043 #ifndef __OPENCV_IMGPROC_TYPES_C_H__
00044 #define __OPENCV_IMGPROC_TYPES_C_H__
00045 
00046 #include "opencv2/core/core_c.h"
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052 /** @addtogroup imgproc_c
00053   @{
00054 */
00055 
00056 /** Connected component structure */
00057 typedef struct CvConnectedComp
00058 {
00059     double area;    /**<area of the connected component  */
00060     CvScalar  value; /**<average color of the connected component */
00061     CvRect  rect;    /**<ROI of the component  */
00062     CvSeq* contour; /**<optional component boundary
00063                       (the contour might have child contours corresponding to the holes)*/
00064 }
00065 CvConnectedComp;
00066 
00067 /** Image smooth methods */
00068 enum SmoothMethod_c
00069 {
00070     /** linear convolution with \f$\texttt{size1}\times\texttt{size2}\f$ box kernel (all 1's). If
00071     you want to smooth different pixels with different-size box kernels, you can use the integral
00072     image that is computed using integral */
00073     CV_BLUR_NO_SCALE =0,
00074     /** linear convolution with \f$\texttt{size1}\times\texttt{size2}\f$ box kernel (all
00075     1's) with subsequent scaling by \f$1/(\texttt{size1}\cdot\texttt{size2})\f$ */
00076     CV_BLUR  =1,
00077     /** linear convolution with a \f$\texttt{size1}\times\texttt{size2}\f$ Gaussian kernel */
00078     CV_GAUSSIAN  =2,
00079     /** median filter with a \f$\texttt{size1}\times\texttt{size1}\f$ square aperture */
00080     CV_MEDIAN =3,
00081     /** bilateral filter with a \f$\texttt{size1}\times\texttt{size1}\f$ square aperture, color
00082     sigma= sigma1 and spatial sigma= sigma2. If size1=0, the aperture square side is set to
00083     cvRound(sigma2\*1.5)\*2+1. See cv::bilateralFilter */
00084     CV_BILATERAL =4
00085 };
00086 
00087 /** Filters used in pyramid decomposition */
00088 enum
00089 {
00090     CV_GAUSSIAN_5x5 = 7
00091 };
00092 
00093 /** Special filters */
00094 enum
00095 {
00096     CV_SCHARR =-1,
00097     CV_MAX_SOBEL_KSIZE =7
00098 };
00099 
00100 /** Constants for color conversion */
00101 enum
00102 {
00103     CV_BGR2BGRA    =0,
00104     CV_RGB2RGBA    =CV_BGR2BGRA,
00105 
00106     CV_BGRA2BGR    =1,
00107     CV_RGBA2RGB    =CV_BGRA2BGR,
00108 
00109     CV_BGR2RGBA    =2,
00110     CV_RGB2BGRA    =CV_BGR2RGBA,
00111 
00112     CV_RGBA2BGR    =3,
00113     CV_BGRA2RGB    =CV_RGBA2BGR,
00114 
00115     CV_BGR2RGB     =4,
00116     CV_RGB2BGR     =CV_BGR2RGB,
00117 
00118     CV_BGRA2RGBA   =5,
00119     CV_RGBA2BGRA   =CV_BGRA2RGBA,
00120 
00121     CV_BGR2GRAY    =6,
00122     CV_RGB2GRAY    =7,
00123     CV_GRAY2BGR    =8,
00124     CV_GRAY2RGB    =CV_GRAY2BGR,
00125     CV_GRAY2BGRA   =9,
00126     CV_GRAY2RGBA   =CV_GRAY2BGRA,
00127     CV_BGRA2GRAY   =10,
00128     CV_RGBA2GRAY   =11,
00129 
00130     CV_BGR2BGR565  =12,
00131     CV_RGB2BGR565  =13,
00132     CV_BGR5652BGR  =14,
00133     CV_BGR5652RGB  =15,
00134     CV_BGRA2BGR565 =16,
00135     CV_RGBA2BGR565 =17,
00136     CV_BGR5652BGRA =18,
00137     CV_BGR5652RGBA =19,
00138 
00139     CV_GRAY2BGR565 =20,
00140     CV_BGR5652GRAY =21,
00141 
00142     CV_BGR2BGR555  =22,
00143     CV_RGB2BGR555  =23,
00144     CV_BGR5552BGR  =24,
00145     CV_BGR5552RGB  =25,
00146     CV_BGRA2BGR555 =26,
00147     CV_RGBA2BGR555 =27,
00148     CV_BGR5552BGRA =28,
00149     CV_BGR5552RGBA =29,
00150 
00151     CV_GRAY2BGR555 =30,
00152     CV_BGR5552GRAY =31,
00153 
00154     CV_BGR2XYZ     =32,
00155     CV_RGB2XYZ     =33,
00156     CV_XYZ2BGR     =34,
00157     CV_XYZ2RGB     =35,
00158 
00159     CV_BGR2YCrCb   =36,
00160     CV_RGB2YCrCb   =37,
00161     CV_YCrCb2BGR   =38,
00162     CV_YCrCb2RGB   =39,
00163 
00164     CV_BGR2HSV     =40,
00165     CV_RGB2HSV     =41,
00166 
00167     CV_BGR2Lab     =44,
00168     CV_RGB2Lab     =45,
00169 
00170     CV_BayerBG2BGR =46,
00171     CV_BayerGB2BGR =47,
00172     CV_BayerRG2BGR =48,
00173     CV_BayerGR2BGR =49,
00174 
00175     CV_BayerBG2RGB =CV_BayerRG2BGR,
00176     CV_BayerGB2RGB =CV_BayerGR2BGR,
00177     CV_BayerRG2RGB =CV_BayerBG2BGR,
00178     CV_BayerGR2RGB =CV_BayerGB2BGR,
00179 
00180     CV_BGR2Luv     =50,
00181     CV_RGB2Luv     =51,
00182     CV_BGR2HLS     =52,
00183     CV_RGB2HLS     =53,
00184 
00185     CV_HSV2BGR     =54,
00186     CV_HSV2RGB     =55,
00187 
00188     CV_Lab2BGR     =56,
00189     CV_Lab2RGB     =57,
00190     CV_Luv2BGR     =58,
00191     CV_Luv2RGB     =59,
00192     CV_HLS2BGR     =60,
00193     CV_HLS2RGB     =61,
00194 
00195     CV_BayerBG2BGR_VNG =62,
00196     CV_BayerGB2BGR_VNG =63,
00197     CV_BayerRG2BGR_VNG =64,
00198     CV_BayerGR2BGR_VNG =65,
00199 
00200     CV_BayerBG2RGB_VNG =CV_BayerRG2BGR_VNG,
00201     CV_BayerGB2RGB_VNG =CV_BayerGR2BGR_VNG,
00202     CV_BayerRG2RGB_VNG =CV_BayerBG2BGR_VNG,
00203     CV_BayerGR2RGB_VNG =CV_BayerGB2BGR_VNG,
00204 
00205     CV_BGR2HSV_FULL = 66,
00206     CV_RGB2HSV_FULL = 67,
00207     CV_BGR2HLS_FULL = 68,
00208     CV_RGB2HLS_FULL = 69,
00209 
00210     CV_HSV2BGR_FULL = 70,
00211     CV_HSV2RGB_FULL = 71,
00212     CV_HLS2BGR_FULL = 72,
00213     CV_HLS2RGB_FULL = 73,
00214 
00215     CV_LBGR2Lab     = 74,
00216     CV_LRGB2Lab     = 75,
00217     CV_LBGR2Luv     = 76,
00218     CV_LRGB2Luv     = 77,
00219 
00220     CV_Lab2LBGR     = 78,
00221     CV_Lab2LRGB     = 79,
00222     CV_Luv2LBGR     = 80,
00223     CV_Luv2LRGB     = 81,
00224 
00225     CV_BGR2YUV      = 82,
00226     CV_RGB2YUV      = 83,
00227     CV_YUV2BGR      = 84,
00228     CV_YUV2RGB      = 85,
00229 
00230     CV_BayerBG2GRAY = 86,
00231     CV_BayerGB2GRAY = 87,
00232     CV_BayerRG2GRAY = 88,
00233     CV_BayerGR2GRAY = 89,
00234 
00235     //YUV 4:2:0 formats family
00236     CV_YUV2RGB_NV12 = 90,
00237     CV_YUV2BGR_NV12 = 91,
00238     CV_YUV2RGB_NV21 = 92,
00239     CV_YUV2BGR_NV21 = 93,
00240     CV_YUV420sp2RGB = CV_YUV2RGB_NV21,
00241     CV_YUV420sp2BGR = CV_YUV2BGR_NV21,
00242 
00243     CV_YUV2RGBA_NV12 = 94,
00244     CV_YUV2BGRA_NV12 = 95,
00245     CV_YUV2RGBA_NV21 = 96,
00246     CV_YUV2BGRA_NV21 = 97,
00247     CV_YUV420sp2RGBA = CV_YUV2RGBA_NV21,
00248     CV_YUV420sp2BGRA = CV_YUV2BGRA_NV21,
00249 
00250     CV_YUV2RGB_YV12 = 98,
00251     CV_YUV2BGR_YV12 = 99,
00252     CV_YUV2RGB_IYUV = 100,
00253     CV_YUV2BGR_IYUV = 101,
00254     CV_YUV2RGB_I420 = CV_YUV2RGB_IYUV,
00255     CV_YUV2BGR_I420 = CV_YUV2BGR_IYUV,
00256     CV_YUV420p2RGB = CV_YUV2RGB_YV12,
00257     CV_YUV420p2BGR = CV_YUV2BGR_YV12,
00258 
00259     CV_YUV2RGBA_YV12 = 102,
00260     CV_YUV2BGRA_YV12 = 103,
00261     CV_YUV2RGBA_IYUV = 104,
00262     CV_YUV2BGRA_IYUV = 105,
00263     CV_YUV2RGBA_I420 = CV_YUV2RGBA_IYUV,
00264     CV_YUV2BGRA_I420 = CV_YUV2BGRA_IYUV,
00265     CV_YUV420p2RGBA = CV_YUV2RGBA_YV12,
00266     CV_YUV420p2BGRA = CV_YUV2BGRA_YV12,
00267 
00268     CV_YUV2GRAY_420 = 106,
00269     CV_YUV2GRAY_NV21 = CV_YUV2GRAY_420,
00270     CV_YUV2GRAY_NV12 = CV_YUV2GRAY_420,
00271     CV_YUV2GRAY_YV12 = CV_YUV2GRAY_420,
00272     CV_YUV2GRAY_IYUV = CV_YUV2GRAY_420,
00273     CV_YUV2GRAY_I420 = CV_YUV2GRAY_420,
00274     CV_YUV420sp2GRAY = CV_YUV2GRAY_420,
00275     CV_YUV420p2GRAY = CV_YUV2GRAY_420,
00276 
00277     //YUV 4:2:2 formats family
00278     CV_YUV2RGB_UYVY = 107,
00279     CV_YUV2BGR_UYVY = 108,
00280     //CV_YUV2RGB_VYUY = 109,
00281     //CV_YUV2BGR_VYUY = 110,
00282     CV_YUV2RGB_Y422 = CV_YUV2RGB_UYVY,
00283     CV_YUV2BGR_Y422 = CV_YUV2BGR_UYVY,
00284     CV_YUV2RGB_UYNV = CV_YUV2RGB_UYVY,
00285     CV_YUV2BGR_UYNV = CV_YUV2BGR_UYVY,
00286 
00287     CV_YUV2RGBA_UYVY = 111,
00288     CV_YUV2BGRA_UYVY = 112,
00289     //CV_YUV2RGBA_VYUY = 113,
00290     //CV_YUV2BGRA_VYUY = 114,
00291     CV_YUV2RGBA_Y422 = CV_YUV2RGBA_UYVY,
00292     CV_YUV2BGRA_Y422 = CV_YUV2BGRA_UYVY,
00293     CV_YUV2RGBA_UYNV = CV_YUV2RGBA_UYVY,
00294     CV_YUV2BGRA_UYNV = CV_YUV2BGRA_UYVY,
00295 
00296     CV_YUV2RGB_YUY2 = 115,
00297     CV_YUV2BGR_YUY2 = 116,
00298     CV_YUV2RGB_YVYU = 117,
00299     CV_YUV2BGR_YVYU = 118,
00300     CV_YUV2RGB_YUYV = CV_YUV2RGB_YUY2,
00301     CV_YUV2BGR_YUYV = CV_YUV2BGR_YUY2,
00302     CV_YUV2RGB_YUNV = CV_YUV2RGB_YUY2,
00303     CV_YUV2BGR_YUNV = CV_YUV2BGR_YUY2,
00304 
00305     CV_YUV2RGBA_YUY2 = 119,
00306     CV_YUV2BGRA_YUY2 = 120,
00307     CV_YUV2RGBA_YVYU = 121,
00308     CV_YUV2BGRA_YVYU = 122,
00309     CV_YUV2RGBA_YUYV = CV_YUV2RGBA_YUY2,
00310     CV_YUV2BGRA_YUYV = CV_YUV2BGRA_YUY2,
00311     CV_YUV2RGBA_YUNV = CV_YUV2RGBA_YUY2,
00312     CV_YUV2BGRA_YUNV = CV_YUV2BGRA_YUY2,
00313 
00314     CV_YUV2GRAY_UYVY = 123,
00315     CV_YUV2GRAY_YUY2 = 124,
00316     //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY,
00317     CV_YUV2GRAY_Y422 = CV_YUV2GRAY_UYVY,
00318     CV_YUV2GRAY_UYNV = CV_YUV2GRAY_UYVY,
00319     CV_YUV2GRAY_YVYU = CV_YUV2GRAY_YUY2,
00320     CV_YUV2GRAY_YUYV = CV_YUV2GRAY_YUY2,
00321     CV_YUV2GRAY_YUNV = CV_YUV2GRAY_YUY2,
00322 
00323     // alpha premultiplication
00324     CV_RGBA2mRGBA = 125,
00325     CV_mRGBA2RGBA = 126,
00326 
00327     CV_RGB2YUV_I420 = 127,
00328     CV_BGR2YUV_I420 = 128,
00329     CV_RGB2YUV_IYUV = CV_RGB2YUV_I420,
00330     CV_BGR2YUV_IYUV = CV_BGR2YUV_I420,
00331 
00332     CV_RGBA2YUV_I420 = 129,
00333     CV_BGRA2YUV_I420 = 130,
00334     CV_RGBA2YUV_IYUV = CV_RGBA2YUV_I420,
00335     CV_BGRA2YUV_IYUV = CV_BGRA2YUV_I420,
00336     CV_RGB2YUV_YV12  = 131,
00337     CV_BGR2YUV_YV12  = 132,
00338     CV_RGBA2YUV_YV12 = 133,
00339     CV_BGRA2YUV_YV12 = 134,
00340 
00341     // Edge-Aware Demosaicing
00342     CV_BayerBG2BGR_EA = 135,
00343     CV_BayerGB2BGR_EA = 136,
00344     CV_BayerRG2BGR_EA = 137,
00345     CV_BayerGR2BGR_EA = 138,
00346 
00347     CV_BayerBG2RGB_EA = CV_BayerRG2BGR_EA,
00348     CV_BayerGB2RGB_EA = CV_BayerGR2BGR_EA,
00349     CV_BayerRG2RGB_EA = CV_BayerBG2BGR_EA,
00350     CV_BayerGR2RGB_EA = CV_BayerGB2BGR_EA,
00351 
00352     CV_COLORCVT_MAX  = 139
00353 };
00354 
00355 
00356 /** Sub-pixel interpolation methods */
00357 enum
00358 {
00359     CV_INTER_NN        =0,
00360     CV_INTER_LINEAR    =1,
00361     CV_INTER_CUBIC     =2,
00362     CV_INTER_AREA      =3,
00363     CV_INTER_LANCZOS4  =4
00364 };
00365 
00366 /** ... and other image warping flags */
00367 enum
00368 {
00369     CV_WARP_FILL_OUTLIERS =8,
00370     CV_WARP_INVERSE_MAP  =16
00371 };
00372 
00373 /** Shapes of a structuring element for morphological operations
00374 @see cv::MorphShapes, cv::getStructuringElement
00375 */
00376 enum MorphShapes_c
00377 {
00378     CV_SHAPE_RECT      =0,
00379     CV_SHAPE_CROSS     =1,
00380     CV_SHAPE_ELLIPSE   =2,
00381     CV_SHAPE_CUSTOM    =100 //!< custom structuring element
00382 };
00383 
00384 /** Morphological operations */
00385 enum
00386 {
00387     CV_MOP_ERODE        =0,
00388     CV_MOP_DILATE       =1,
00389     CV_MOP_OPEN         =2,
00390     CV_MOP_CLOSE        =3,
00391     CV_MOP_GRADIENT     =4,
00392     CV_MOP_TOPHAT       =5,
00393     CV_MOP_BLACKHAT     =6
00394 };
00395 
00396 /** Spatial and central moments */
00397 typedef struct CvMoments
00398 {
00399     double  m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /**< spatial moments */
00400     double  mu20, mu11, mu02, mu30, mu21, mu12, mu03; /**< central moments */
00401     double  inv_sqrt_m00; /**< m00 != 0 ? 1/sqrt(m00) : 0 */
00402 
00403 #ifdef __cplusplus
00404     CvMoments(){}
00405     CvMoments(const cv::Moments& m)
00406     {
00407         m00 = m.m00; m10 = m.m10; m01 = m.m01;
00408         m20 = m.m20; m11 = m.m11; m02 = m.m02;
00409         m30 = m.m30; m21 = m.m21; m12 = m.m12; m03 = m.m03;
00410         mu20 = m.mu20; mu11 = m.mu11; mu02 = m.mu02;
00411         mu30 = m.mu30; mu21 = m.mu21; mu12 = m.mu12; mu03 = m.mu03;
00412         double am00 = std::abs(m.m00);
00413         inv_sqrt_m00 = am00 > DBL_EPSILON ? 1./std::sqrt(am00) : 0;
00414     }
00415     operator cv::Moments() const
00416     {
00417         return cv::Moments(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03);
00418     }
00419 #endif
00420 }
00421 CvMoments;
00422 
00423 /** Hu invariants */
00424 typedef struct CvHuMoments
00425 {
00426     double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /**< Hu invariants */
00427 }
00428 CvHuMoments;
00429 
00430 /** Template matching methods */
00431 enum
00432 {
00433     CV_TM_SQDIFF        =0,
00434     CV_TM_SQDIFF_NORMED =1,
00435     CV_TM_CCORR         =2,
00436     CV_TM_CCORR_NORMED  =3,
00437     CV_TM_CCOEFF        =4,
00438     CV_TM_CCOEFF_NORMED =5
00439 };
00440 
00441 typedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param );
00442 
00443 /** Contour retrieval modes */
00444 enum
00445 {
00446     CV_RETR_EXTERNAL=0,
00447     CV_RETR_LIST=1,
00448     CV_RETR_CCOMP=2,
00449     CV_RETR_TREE=3,
00450     CV_RETR_FLOODFILL=4
00451 };
00452 
00453 /** Contour approximation methods */
00454 enum
00455 {
00456     CV_CHAIN_CODE=0,
00457     CV_CHAIN_APPROX_NONE=1,
00458     CV_CHAIN_APPROX_SIMPLE=2,
00459     CV_CHAIN_APPROX_TC89_L1=3,
00460     CV_CHAIN_APPROX_TC89_KCOS=4,
00461     CV_LINK_RUNS=5
00462 };
00463 
00464 /*
00465 Internal structure that is used for sequential retrieving contours from the image.
00466 It supports both hierarchical and plane variants of Suzuki algorithm.
00467 */
00468 typedef struct _CvContourScanner* CvContourScanner;
00469 
00470 /** Freeman chain reader state */
00471 typedef struct CvChainPtReader
00472 {
00473     CV_SEQ_READER_FIELDS()
00474     char      code;
00475     CvPoint   pt;
00476     schar     deltas[8][2];
00477 }
00478 CvChainPtReader;
00479 
00480 /** initializes 8-element array for fast access to 3x3 neighborhood of a pixel */
00481 #define  CV_INIT_3X3_DELTAS( deltas, step, nch )            \
00482     ((deltas)[0] =  (nch),  (deltas)[1] = -(step) + (nch),  \
00483      (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),  \
00484      (deltas)[4] = -(nch),  (deltas)[5] =  (step) - (nch),  \
00485      (deltas)[6] =  (step), (deltas)[7] =  (step) + (nch))
00486 
00487 
00488 /** Contour approximation algorithms */
00489 enum
00490 {
00491     CV_POLY_APPROX_DP = 0
00492 };
00493 
00494 /** @brief Shape matching methods
00495 
00496 \f$A\f$ denotes object1,\f$B\f$ denotes object2
00497 
00498 \f$\begin{array}{l} m^A_i =  \mathrm{sign} (h^A_i)  \cdot \log{h^A_i} \\ m^B_i =  \mathrm{sign} (h^B_i)  \cdot \log{h^B_i} \end{array}\f$
00499 
00500 and \f$h^A_i, h^B_i\f$ are the Hu moments of \f$A\f$ and \f$B\f$ , respectively.
00501 */
00502 enum ShapeMatchModes
00503 {
00504     CV_CONTOURS_MATCH_I1   =1, //!< \f[I_1(A,B) =  \sum _{i=1...7}  \left |  \frac{1}{m^A_i} -  \frac{1}{m^B_i} \right |\f]
00505     CV_CONTOURS_MATCH_I2   =2, //!< \f[I_2(A,B) =  \sum _{i=1...7}  \left | m^A_i - m^B_i  \right |\f]
00506     CV_CONTOURS_MATCH_I3   =3  //!< \f[I_3(A,B) =  \max _{i=1...7}  \frac{ \left| m^A_i - m^B_i \right| }{ \left| m^A_i \right| }\f]
00507 };
00508 
00509 /** Shape orientation */
00510 enum
00511 {
00512     CV_CLOCKWISE         =1,
00513     CV_COUNTER_CLOCKWISE =2
00514 };
00515 
00516 
00517 /** Convexity defect */
00518 typedef struct CvConvexityDefect
00519 {
00520     CvPoint* start; /**< point of the contour where the defect begins */
00521     CvPoint* end; /**< point of the contour where the defect ends */
00522     CvPoint* depth_point; /**< the farthest from the convex hull point within the defect */
00523     float depth; /**< distance between the farthest point and the convex hull */
00524 } CvConvexityDefect;
00525 
00526 
00527 /** Histogram comparison methods */
00528 enum
00529 {
00530     CV_COMP_CORREL        =0,
00531     CV_COMP_CHISQR        =1,
00532     CV_COMP_INTERSECT     =2,
00533     CV_COMP_BHATTACHARYYA =3,
00534     CV_COMP_HELLINGER     =CV_COMP_BHATTACHARYYA,
00535     CV_COMP_CHISQR_ALT    =4,
00536     CV_COMP_KL_DIV        =5
00537 };
00538 
00539 /** Mask size for distance transform */
00540 enum
00541 {
00542     CV_DIST_MASK_3   =3,
00543     CV_DIST_MASK_5   =5,
00544     CV_DIST_MASK_PRECISE =0
00545 };
00546 
00547 /** Content of output label array: connected components or pixels */
00548 enum
00549 {
00550   CV_DIST_LABEL_CCOMP = 0,
00551   CV_DIST_LABEL_PIXEL = 1
00552 };
00553 
00554 /** Distance types for Distance Transform and M-estimators */
00555 enum
00556 {
00557     CV_DIST_USER    =-1,  /**< User defined distance */
00558     CV_DIST_L1      =1,   /**< distance = |x1-x2| + |y1-y2| */
00559     CV_DIST_L2      =2,   /**< the simple euclidean distance */
00560     CV_DIST_C       =3,   /**< distance = max(|x1-x2|,|y1-y2|) */
00561     CV_DIST_L12     =4,   /**< L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */
00562     CV_DIST_FAIR    =5,   /**< distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */
00563     CV_DIST_WELSCH  =6,   /**< distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */
00564     CV_DIST_HUBER   =7    /**< distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */
00565 };
00566 
00567 
00568 /** Threshold types */
00569 enum
00570 {
00571     CV_THRESH_BINARY      =0,  /**< value = value > threshold ? max_value : 0       */
00572     CV_THRESH_BINARY_INV  =1,  /**< value = value > threshold ? 0 : max_value       */
00573     CV_THRESH_TRUNC       =2,  /**< value = value > threshold ? threshold : value   */
00574     CV_THRESH_TOZERO      =3,  /**< value = value > threshold ? value : 0           */
00575     CV_THRESH_TOZERO_INV  =4,  /**< value = value > threshold ? 0 : value           */
00576     CV_THRESH_MASK        =7,
00577     CV_THRESH_OTSU        =8, /**< use Otsu algorithm to choose the optimal threshold value;
00578                                  combine the flag with one of the above CV_THRESH_* values */
00579     CV_THRESH_TRIANGLE    =16  /**< use Triangle algorithm to choose the optimal threshold value;
00580                                  combine the flag with one of the above CV_THRESH_* values, but not
00581                                  with CV_THRESH_OTSU */
00582 };
00583 
00584 /** Adaptive threshold methods */
00585 enum
00586 {
00587     CV_ADAPTIVE_THRESH_MEAN_C  =0,
00588     CV_ADAPTIVE_THRESH_GAUSSIAN_C  =1
00589 };
00590 
00591 /** FloodFill flags */
00592 enum
00593 {
00594     CV_FLOODFILL_FIXED_RANGE =(1 << 16),
00595     CV_FLOODFILL_MASK_ONLY   =(1 << 17)
00596 };
00597 
00598 
00599 /** Canny edge detector flags */
00600 enum
00601 {
00602     CV_CANNY_L2_GRADIENT  =(1 << 31)
00603 };
00604 
00605 /** Variants of a Hough transform */
00606 enum
00607 {
00608     CV_HOUGH_STANDARD =0,
00609     CV_HOUGH_PROBABILISTIC =1,
00610     CV_HOUGH_MULTI_SCALE =2,
00611     CV_HOUGH_GRADIENT =3
00612 };
00613 
00614 
00615 /* Fast search data structures  */
00616 struct CvFeatureTree;
00617 struct CvLSH;
00618 struct CvLSHOperations;
00619 
00620 /** @} */
00621 
00622 #ifdef __cplusplus
00623 }
00624 #endif
00625 
00626 #endif
00627