opencv: /usr/ports/pobj/OpenCV-2.2.0/OpenCV-2.2.0/modules/imgproc/include/opencv2/imgproc/types_c.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

# /usr/ports/pobj/OpenCV-2.2.0/OpenCV-2.2.0/modules/imgproc/include/opencv2/imgproc/types_c.h

Go to the documentation of this file.

    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 #include "opencv2/imgproc/types_c.h"
    00048
    00049 #ifdef __cplusplus
    00050 extern "C" {
    00051 #endif
    00052
    00053 /* Connected component structure */
    00054 typedef struct CvConnectedComp
    00055 {
    00056     double area;    /* area of the connected component  */
    00057     CvScalar value; /* average color of the connected component */
    00058     CvRect rect;    /* ROI of the component  */
    00059     CvSeq* contour; /* optional component boundary
    00060                       (the contour might have child contours corresponding to the holes)*/
    00061 }
    00062 CvConnectedComp;
    00063
    00064 /* Image smooth methods */
    00065 enum
    00066 {
    00067     CV_BLUR_NO_SCALE =0,
    00068     CV_BLUR  =1,
    00069     CV_GAUSSIAN  =2,
    00070     CV_MEDIAN =3,
    00071     CV_BILATERAL =4
    00072 };
    00073
    00074 /* Filters used in pyramid decomposition */
    00075 enum
    00076 {
    00077     CV_GAUSSIAN_5x5 = 7
    00078 };
    00079
    00080 /* Inpainting algorithms */
    00081 enum
    00082 {
    00083     CV_INPAINT_NS      =0,
    00084     CV_INPAINT_TELEA   =1
    00085 };
    00086
    00087 /* Special filters */
    00088 enum
    00089 {
    00090     CV_SCHARR =-1,
    00091     CV_MAX_SOBEL_KSIZE =7
    00092 };
    00093
    00094 /* Constants for color conversion */
    00095 enum
    00096 {
    00097     CV_BGR2BGRA    =0,
    00098     CV_RGB2RGBA    =CV_BGR2BGRA,
    00099
    00100     CV_BGRA2BGR    =1,
    00101     CV_RGBA2RGB    =CV_BGRA2BGR,
    00102
    00103     CV_BGR2RGBA    =2,
    00104     CV_RGB2BGRA    =CV_BGR2RGBA,
    00105
    00106     CV_RGBA2BGR    =3,
    00107     CV_BGRA2RGB    =CV_RGBA2BGR,
    00108
    00109     CV_BGR2RGB     =4,
    00110     CV_RGB2BGR     =CV_BGR2RGB,
    00111
    00112     CV_BGRA2RGBA   =5,
    00113     CV_RGBA2BGRA   =CV_BGRA2RGBA,
    00114
    00115     CV_BGR2GRAY    =6,
    00116     CV_RGB2GRAY    =7,
    00117     CV_GRAY2BGR    =8,
    00118     CV_GRAY2RGB    =CV_GRAY2BGR,
    00119     CV_GRAY2BGRA   =9,
    00120     CV_GRAY2RGBA   =CV_GRAY2BGRA,
    00121     CV_BGRA2GRAY   =10,
    00122     CV_RGBA2GRAY   =11,
    00123
    00124     CV_BGR2BGR565  =12,
    00125     CV_RGB2BGR565  =13,
    00126     CV_BGR5652BGR  =14,
    00127     CV_BGR5652RGB  =15,
    00128     CV_BGRA2BGR565 =16,
    00129     CV_RGBA2BGR565 =17,
    00130     CV_BGR5652BGRA =18,
    00131     CV_BGR5652RGBA =19,
    00132
    00133     CV_GRAY2BGR565 =20,
    00134     CV_BGR5652GRAY =21,
    00135
    00136     CV_BGR2BGR555  =22,
    00137     CV_RGB2BGR555  =23,
    00138     CV_BGR5552BGR  =24,
    00139     CV_BGR5552RGB  =25,
    00140     CV_BGRA2BGR555 =26,
    00141     CV_RGBA2BGR555 =27,
    00142     CV_BGR5552BGRA =28,
    00143     CV_BGR5552RGBA =29,
    00144
    00145     CV_GRAY2BGR555 =30,
    00146     CV_BGR5552GRAY =31,
    00147
    00148     CV_BGR2XYZ     =32,
    00149     CV_RGB2XYZ     =33,
    00150     CV_XYZ2BGR     =34,
    00151     CV_XYZ2RGB     =35,
    00152
    00153     CV_BGR2YCrCb   =36,
    00154     CV_RGB2YCrCb   =37,
    00155     CV_YCrCb2BGR   =38,
    00156     CV_YCrCb2RGB   =39,
    00157
    00158     CV_BGR2HSV     =40,
    00159     CV_RGB2HSV     =41,
    00160
    00161     CV_BGR2Lab     =44,
    00162     CV_RGB2Lab     =45,
    00163
    00164     CV_BayerBG2BGR =46,
    00165     CV_BayerGB2BGR =47,
    00166     CV_BayerRG2BGR =48,
    00167     CV_BayerGR2BGR =49,
    00168
    00169     CV_BayerBG2RGB =CV_BayerRG2BGR,
    00170     CV_BayerGB2RGB =CV_BayerGR2BGR,
    00171     CV_BayerRG2RGB =CV_BayerBG2BGR,
    00172     CV_BayerGR2RGB =CV_BayerGB2BGR,
    00173
    00174     CV_BGR2Luv     =50,
    00175     CV_RGB2Luv     =51,
    00176     CV_BGR2HLS     =52,
    00177     CV_RGB2HLS     =53,
    00178
    00179     CV_HSV2BGR     =54,
    00180     CV_HSV2RGB     =55,
    00181
    00182     CV_Lab2BGR     =56,
    00183     CV_Lab2RGB     =57,
    00184     CV_Luv2BGR     =58,
    00185     CV_Luv2RGB     =59,
    00186     CV_HLS2BGR     =60,
    00187     CV_HLS2RGB     =61,
    00188
    00189     CV_BayerBG2BGR_VNG =62,
    00190     CV_BayerGB2BGR_VNG =63,
    00191     CV_BayerRG2BGR_VNG =64,
    00192     CV_BayerGR2BGR_VNG =65,
    00193
    00194     CV_BayerBG2RGB_VNG =CV_BayerRG2BGR_VNG,
    00195     CV_BayerGB2RGB_VNG =CV_BayerGR2BGR_VNG,
    00196     CV_BayerRG2RGB_VNG =CV_BayerBG2BGR_VNG,
    00197     CV_BayerGR2RGB_VNG =CV_BayerGB2BGR_VNG,
    00198
    00199     CV_BGR2HSV_FULL = 66,
    00200     CV_RGB2HSV_FULL = 67,
    00201     CV_BGR2HLS_FULL = 68,
    00202     CV_RGB2HLS_FULL = 69,
    00203
    00204     CV_HSV2BGR_FULL = 70,
    00205     CV_HSV2RGB_FULL = 71,
    00206     CV_HLS2BGR_FULL = 72,
    00207     CV_HLS2RGB_FULL = 73,
    00208
    00209     CV_LBGR2Lab     = 74,
    00210     CV_LRGB2Lab     = 75,
    00211     CV_LBGR2Luv     = 76,
    00212     CV_LRGB2Luv     = 77,
    00213
    00214     CV_Lab2LBGR     = 78,
    00215     CV_Lab2LRGB     = 79,
    00216     CV_Luv2LBGR     = 80,
    00217     CV_Luv2LRGB     = 81,
    00218
    00219     CV_BGR2YUV      = 82,
    00220     CV_RGB2YUV      = 83,
    00221     CV_YUV2BGR      = 84,
    00222     CV_YUV2RGB      = 85,
    00223
    00224     CV_COLORCVT_MAX  =100
    00225 };
    00226
    00227
    00228 /* Sub-pixel interpolation methods */
    00229 enum
    00230 {
    00231     CV_INTER_NN        =0,
    00232     CV_INTER_LINEAR    =1,
    00233     CV_INTER_CUBIC     =2,
    00234     CV_INTER_AREA      =3,
    00235     CV_INTER_LANCZOS4  =4
    00236 };
    00237
    00238 /* ... and other image warping flags */
    00239 enum
    00240 {
    00241     CV_WARP_FILL_OUTLIERS =8,
    00242     CV_WARP_INVERSE_MAP  =16
    00243 };
    00244
    00245 /* Shapes of a structuring element for morphological operations */
    00246 enum
    00247 {
    00248     CV_SHAPE_RECT      =0,
    00249     CV_SHAPE_CROSS     =1,
    00250     CV_SHAPE_ELLIPSE   =2,
    00251     CV_SHAPE_CUSTOM    =100
    00252 };
    00253
    00254 /* Morphological operations */
    00255 enum
    00256 {
    00257     CV_MOP_ERODE        =0,
    00258     CV_MOP_DILATE       =1,
    00259     CV_MOP_OPEN         =2,
    00260     CV_MOP_CLOSE        =3,
    00261     CV_MOP_GRADIENT     =4,
    00262     CV_MOP_TOPHAT       =5,
    00263     CV_MOP_BLACKHAT     =6
    00264 };
    00265
    00266 /* Spatial and central moments */
    00267 typedef struct CvMoments
    00268 {
    00269     double  m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /* spatial moments */
    00270     double  mu20, mu11, mu02, mu30, mu21, mu12, mu03; /* central moments */
    00271     double  inv_sqrt_m00; /* m00 != 0 ? 1/sqrt(m00) : 0 */
    00272 }
    00273 CvMoments;
    00274
    00275 /* Hu invariants */
    00276 typedef struct CvHuMoments
    00277 {
    00278     double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /* Hu invariants */
    00279 }
    00280 CvHuMoments;
    00281
    00282 /* Template matching methods */
    00283 enum
    00284 {
    00285     CV_TM_SQDIFF        =0,
    00286     CV_TM_SQDIFF_NORMED =1,
    00287     CV_TM_CCORR         =2,
    00288     CV_TM_CCORR_NORMED  =3,
    00289     CV_TM_CCOEFF        =4,
    00290     CV_TM_CCOEFF_NORMED =5
    00291 };
    00292
    00293 typedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param );
    00294
    00295 /* Contour retrieval modes */
    00296 enum
    00297 {
    00298     CV_RETR_EXTERNAL=0,
    00299     CV_RETR_LIST=1,
    00300     CV_RETR_CCOMP=2,
    00301     CV_RETR_TREE=3
    00302 };
    00303
    00304 /* Contour approximation methods */
    00305 enum
    00306 {
    00307     CV_CHAIN_CODE=0,
    00308     CV_CHAIN_APPROX_NONE=1,
    00309     CV_CHAIN_APPROX_SIMPLE=2,
    00310     CV_CHAIN_APPROX_TC89_L1=3,
    00311     CV_CHAIN_APPROX_TC89_KCOS=4,
    00312     CV_LINK_RUNS=5
    00313 };
    00314
    00315 /*
    00316 Internal structure that is used for sequental retrieving contours from the image.
    00317 It supports both hierarchical and plane variants of Suzuki algorithm.
    00318 */
    00319 typedef struct _CvContourScanner* CvContourScanner;
    00320
    00321 /* Freeman chain reader state */
    00322 typedef struct CvChainPtReader
    00323 {
    00324     CV_SEQ_READER_FIELDS()
    00325     char      code;
    00326     CvPoint   pt;
    00327     schar     deltas[8][2];
    00328 }
    00329 CvChainPtReader;
    00330
    00331 /* initializes 8-element array for fast access to 3x3 neighborhood of a pixel */
    00332 #define  CV_INIT_3X3_DELTAS( deltas, step, nch )            \
    00333     ((deltas)[0] =  (nch),  (deltas)[1] = -(step) + (nch),  \
    00334      (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),  \
    00335      (deltas)[4] = -(nch),  (deltas)[5] =  (step) - (nch),  \
    00336      (deltas)[6] =  (step), (deltas)[7] =  (step) + (nch))
    00337
    00338
    00339 /****************************************************************************************\
    00340 *                              Planar subdivisions                                       *
    00341 \****************************************************************************************/
    00342
    00343 typedef size_t CvSubdiv2DEdge;
    00344
    00345 #define CV_QUADEDGE2D_FIELDS()     \
    00346     int flags;                     \
    00347     struct CvSubdiv2DPoint* pt[4]; \
    00348     CvSubdiv2DEdge  next[4];
    00349
    00350 #define CV_SUBDIV2D_POINT_FIELDS()\
    00351     int            flags;      \
    00352     CvSubdiv2DEdge first;      \
    00353     CvPoint2D32f   pt;         \
    00354     int id;
    00355
    00356 #define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)
    00357
    00358 typedef struct CvQuadEdge2D
    00359 {
    00360     CV_QUADEDGE2D_FIELDS()
    00361 }
    00362 CvQuadEdge2D;
    00363
    00364 typedef struct CvSubdiv2DPoint
    00365 {
    00366     CV_SUBDIV2D_POINT_FIELDS()
    00367 }
    00368 CvSubdiv2DPoint;
    00369
    00370 #define CV_SUBDIV2D_FIELDS()    \
    00371     CV_GRAPH_FIELDS()           \
    00372     int  quad_edges;            \
    00373     int  is_geometry_valid;     \
    00374     CvSubdiv2DEdge recent_edge; \
    00375     CvPoint2D32f  topleft;      \
    00376     CvPoint2D32f  bottomright;
    00377
    00378 typedef struct CvSubdiv2D
    00379 {
    00380     CV_SUBDIV2D_FIELDS()
    00381 }
    00382 CvSubdiv2D;
    00383
    00384
    00385 typedef enum CvSubdiv2DPointLocation
    00386 {
    00387     CV_PTLOC_ERROR = -2,
    00388     CV_PTLOC_OUTSIDE_RECT = -1,
    00389     CV_PTLOC_INSIDE = 0,
    00390     CV_PTLOC_VERTEX = 1,
    00391     CV_PTLOC_ON_EDGE = 2
    00392 }
    00393 CvSubdiv2DPointLocation;
    00394
    00395 typedef enum CvNextEdgeType
    00396 {
    00397     CV_NEXT_AROUND_ORG   = 0x00,
    00398     CV_NEXT_AROUND_DST   = 0x22,
    00399     CV_PREV_AROUND_ORG   = 0x11,
    00400     CV_PREV_AROUND_DST   = 0x33,
    00401     CV_NEXT_AROUND_LEFT  = 0x13,
    00402     CV_NEXT_AROUND_RIGHT = 0x31,
    00403     CV_PREV_AROUND_LEFT  = 0x20,
    00404     CV_PREV_AROUND_RIGHT = 0x02
    00405 }
    00406 CvNextEdgeType;
    00407
    00408 /* get the next edge with the same origin point (counterwise) */
    00409 #define  CV_SUBDIV2D_NEXT_EDGE( edge )  (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3])
    00410
    00411
    00412 /* Contour approximation algorithms */
    00413 enum
    00414 {
    00415     CV_POLY_APPROX_DP = 0
    00416 };
    00417
    00418 /* Shape matching methods */
    00419 enum
    00420 {
    00421     CV_CONTOURS_MATCH_I1  =1,
    00422     CV_CONTOURS_MATCH_I2  =2,
    00423     CV_CONTOURS_MATCH_I3  =3
    00424 };
    00425
    00426 /* Shape orientation */
    00427 enum
    00428 {
    00429     CV_CLOCKWISE         =1,
    00430     CV_COUNTER_CLOCKWISE =2
    00431 };
    00432
    00433
    00434 /* Convexity defect */
    00435 typedef struct CvConvexityDefect
    00436 {
    00437     CvPoint* start; /* point of the contour where the defect begins */
    00438     CvPoint* end; /* point of the contour where the defect ends */
    00439     CvPoint* depth_point; /* the farthest from the convex hull point within the defect */
    00440     float depth; /* distance between the farthest point and the convex hull */
    00441 } CvConvexityDefect;
    00442
    00443
    00444 /* Histogram comparison methods */
    00445 enum
    00446 {
    00447     CV_COMP_CORREL        =0,
    00448     CV_COMP_CHISQR        =1,
    00449     CV_COMP_INTERSECT     =2,
    00450     CV_COMP_BHATTACHARYYA =3
    00451 };
    00452
    00453 /* Mask size for distance transform */
    00454 enum
    00455 {
    00456     CV_DIST_MASK_3   =3,
    00457     CV_DIST_MASK_5   =5,
    00458     CV_DIST_MASK_PRECISE =0
    00459 };
    00460
    00461 /* Distance types for Distance Transform and M-estimators */
    00462 enum
    00463 {
    00464     CV_DIST_USER    =-1,  /* User defined distance */
    00465     CV_DIST_L1      =1,   /* distance = |x1-x2| + |y1-y2| */
    00466     CV_DIST_L2      =2,   /* the simple euclidean distance */
    00467     CV_DIST_C       =3,   /* distance = max(|x1-x2|,|y1-y2|) */
    00468     CV_DIST_L12     =4,   /* L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */
    00469     CV_DIST_FAIR    =5,   /* distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */
    00470     CV_DIST_WELSCH  =6,   /* distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */
    00471     CV_DIST_HUBER   =7    /* distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */
    00472 };
    00473
    00474
    00475 /* Threshold types */
    00476 enum
    00477 {
    00478     CV_THRESH_BINARY      =0,  /* value = value > threshold ? max_value : 0       */
    00479     CV_THRESH_BINARY_INV  =1,  /* value = value > threshold ? 0 : max_value       */
    00480     CV_THRESH_TRUNC       =2,  /* value = value > threshold ? threshold : value   */
    00481     CV_THRESH_TOZERO      =3,  /* value = value > threshold ? value : 0           */
    00482     CV_THRESH_TOZERO_INV  =4,  /* value = value > threshold ? 0 : value           */
    00483     CV_THRESH_MASK        =7,
    00484     CV_THRESH_OTSU        =8  /* use Otsu algorithm to choose the optimal threshold value;
    00485                                  combine the flag with one of the above CV_THRESH_* values */
    00486 };
    00487
    00488 /* Adaptive threshold methods */
    00489 enum
    00490 {
    00491     CV_ADAPTIVE_THRESH_MEAN_C  =0,
    00492     CV_ADAPTIVE_THRESH_GAUSSIAN_C  =1
    00493 };
    00494
    00495 /* FloodFill flags */
    00496 enum
    00497 {
    00498     CV_FLOODFILL_FIXED_RANGE =(1 << 16),
    00499     CV_FLOODFILL_MASK_ONLY   =(1 << 17)
    00500 };
    00501
    00502
    00503 /* Canny edge detector flags */
    00504 enum
    00505 {
    00506     CV_CANNY_L2_GRADIENT  =(1 << 31)
    00507 };
    00508
    00509 /* Variants of a Hough transform */
    00510 enum
    00511 {
    00512     CV_HOUGH_STANDARD =0,
    00513     CV_HOUGH_PROBABILISTIC =1,
    00514     CV_HOUGH_MULTI_SCALE =2,
    00515     CV_HOUGH_GRADIENT =3
    00516 };
    00517
    00518
    00519 /* Fast search data structures  */
    00520 struct CvFeatureTree;
    00521 struct CvLSH;
    00522 struct CvLSHOperations;
    00523
    00524 #ifdef __cplusplus
    00525 }
    00526 #endif
    00527
    00528 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines