types_c.h
Go to the documentation of this file.
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
8 //
9 //
10 // License Agreement
11 // For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Third party copyrights are property of their respective owners.
16 //
17 // Redistribution and use in source and binary forms, with or without modification,
18 // are permitted provided that the following conditions are met:
19 //
20 // * Redistribution's of source code must retain the above copyright notice,
21 // this list of conditions and the following disclaimer.
22 //
23 // * Redistribution's in binary form must reproduce the above copyright notice,
24 // this list of conditions and the following disclaimer in the documentation
25 // and/or other materials provided with the distribution.
26 //
27 // * The name of the copyright holders may not be used to endorse or promote products
28 // derived from this software without specific prior written permission.
29 //
30 // This software is provided by the copyright holders and contributors "as is" and
31 // any express or implied warranties, including, but not limited to, the implied
32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
33 // In no event shall the Intel Corporation or contributors be liable for any direct,
34 // indirect, incidental, special, exemplary, or consequential damages
35 // (including, but not limited to, procurement of substitute goods or services;
36 // loss of use, data, or profits; or business interruption) however caused
37 // and on any theory of liability, whether in contract, strict liability,
38 // or tort (including negligence or otherwise) arising in any way out of
39 // the use of this software, even if advised of the possibility of such damage.
40 //
41 //M*/
42 
43 #ifndef __OPENCV_IMGPROC_TYPES_C_H__
44 #define __OPENCV_IMGPROC_TYPES_C_H__
45 
46 #include "opencv2/core/core_c.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /* Connected component structure */
53 typedef struct CvConnectedComp
54 {
55  double area; /* area of the connected component */
56  CvScalar value; /* average color of the connected component */
57  CvRect rect; /* ROI of the component */
58  CvSeq* contour; /* optional component boundary
59  (the contour might have child contours corresponding to the holes)*/
60 }
62 
63 /* Image smooth methods */
64 enum
65 {
67  CV_BLUR =1,
71 };
72 
73 /* Filters used in pyramid decomposition */
74 enum
75 {
77 };
78 
79 /* Special filters */
80 enum
81 {
82  CV_SCHARR =-1,
84 };
85 
86 /* Constants for color conversion */
87 enum
88 {
91 
94 
97 
100 
103 
106 
115 
124 
127 
136 
139 
144 
149 
152 
155 
160 
165 
170 
173 
180 
185 
190 
195 
200 
205 
210 
215 
220 
221  //YUV 4:2:0 formats family
228 
235 
244 
253 
262 
263  //YUV 4:2:2 formats family
266  //CV_YUV2RGB_VYUY = 109,
267  //CV_YUV2BGR_VYUY = 110,
272 
275  //CV_YUV2RGBA_VYUY = 113,
276  //CV_YUV2BGRA_VYUY = 114,
281 
290 
299 
302  //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY,
308 
309  // alpha premultiplication
312 
317 
326 
328 };
329 
330 
331 /* Sub-pixel interpolation methods */
332 enum
333 {
339 };
340 
341 /* ... and other image warping flags */
342 enum
343 {
346 };
347 
348 /* Shapes of a structuring element for morphological operations */
349 enum
350 {
355 };
356 
357 /* Morphological operations */
358 enum
359 {
367 };
368 
369 /* Spatial and central moments */
370 typedef struct CvMoments
371 {
372  double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /* spatial moments */
373  double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /* central moments */
374  double inv_sqrt_m00; /* m00 != 0 ? 1/sqrt(m00) : 0 */
375 }
376 CvMoments;
377 
378 /* Hu invariants */
379 typedef struct CvHuMoments
380 {
381  double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /* Hu invariants */
382 }
384 
385 /* Template matching methods */
386 enum
387 {
394 };
395 
396 typedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param );
397 
398 /* Contour retrieval modes */
399 enum
400 {
406 };
407 
408 /* Contour approximation methods */
409 enum
410 {
417 };
418 
419 /*
420 Internal structure that is used for sequental retrieving contours from the image.
421 It supports both hierarchical and plane variants of Suzuki algorithm.
422 */
423 typedef struct _CvContourScanner* CvContourScanner;
424 
425 /* Freeman chain reader state */
426 typedef struct CvChainPtReader
427 {
429  char code;
431  schar deltas[8][2];
432 }
434 
435 /* initializes 8-element array for fast access to 3x3 neighborhood of a pixel */
436 #define CV_INIT_3X3_DELTAS( deltas, step, nch ) \
437  ((deltas)[0] = (nch), (deltas)[1] = -(step) + (nch), \
438  (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch), \
439  (deltas)[4] = -(nch), (deltas)[5] = (step) - (nch), \
440  (deltas)[6] = (step), (deltas)[7] = (step) + (nch))
441 
442 
443 /****************************************************************************************\
444 * Planar subdivisions *
445 \****************************************************************************************/
446 
447 typedef size_t CvSubdiv2DEdge;
448 
449 #define CV_QUADEDGE2D_FIELDS() \
450  int flags; \
451  struct CvSubdiv2DPoint* pt[4]; \
452  CvSubdiv2DEdge next[4];
453 
454 #define CV_SUBDIV2D_POINT_FIELDS()\
455  int flags; \
456  CvSubdiv2DEdge first; \
457  CvPoint2D32f pt; \
458  int id;
459 
460 #define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)
461 
462 typedef struct CvQuadEdge2D
463 {
464  CV_QUADEDGE2D_FIELDS()
465 }
467 
468 typedef struct CvSubdiv2DPoint
469 {
470  CV_SUBDIV2D_POINT_FIELDS()
471 }
473 
474 #define CV_SUBDIV2D_FIELDS() \
475  CV_GRAPH_FIELDS() \
476  int quad_edges; \
477  int is_geometry_valid; \
478  CvSubdiv2DEdge recent_edge; \
479  CvPoint2D32f topleft; \
480  CvPoint2D32f bottomright;
481 
482 typedef struct CvSubdiv2D
483 {
484  CV_SUBDIV2D_FIELDS()
485 }
486 CvSubdiv2D;
487 
488 
490 {
496 }
498 
499 typedef enum CvNextEdgeType
500 {
509 }
511 
512 /* get the next edge with the same origin point (counterwise) */
513 #define CV_SUBDIV2D_NEXT_EDGE( edge ) (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3])
514 
515 
516 /* Contour approximation algorithms */
517 enum
518 {
520 };
521 
522 /* Shape matching methods */
523 enum
524 {
528 };
529 
530 /* Shape orientation */
531 enum
532 {
535 };
536 
537 
538 /* Convexity defect */
539 typedef struct CvConvexityDefect
540 {
541  CvPoint* start; /* point of the contour where the defect begins */
542  CvPoint* end; /* point of the contour where the defect ends */
543  CvPoint* depth_point; /* the farthest from the convex hull point within the defect */
544  float depth; /* distance between the farthest point and the convex hull */
546 
547 
548 /* Histogram comparison methods */
549 enum
550 {
556 };
557 
558 /* Mask size for distance transform */
559 enum
560 {
564 };
565 
566 /* Content of output label array: connected components or pixels */
567 enum
568 {
571 };
572 
573 /* Distance types for Distance Transform and M-estimators */
574 enum
575 {
576  CV_DIST_USER =-1, /* User defined distance */
577  CV_DIST_L1 =1, /* distance = |x1-x2| + |y1-y2| */
578  CV_DIST_L2 =2, /* the simple euclidean distance */
579  CV_DIST_C =3, /* distance = max(|x1-x2|,|y1-y2|) */
580  CV_DIST_L12 =4, /* L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */
581  CV_DIST_FAIR =5, /* distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */
582  CV_DIST_WELSCH =6, /* distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */
583  CV_DIST_HUBER =7 /* distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */
584 };
585 
586 
587 /* Threshold types */
588 enum
589 {
590  CV_THRESH_BINARY =0, /* value = value > threshold ? max_value : 0 */
591  CV_THRESH_BINARY_INV =1, /* value = value > threshold ? 0 : max_value */
592  CV_THRESH_TRUNC =2, /* value = value > threshold ? threshold : value */
593  CV_THRESH_TOZERO =3, /* value = value > threshold ? value : 0 */
594  CV_THRESH_TOZERO_INV =4, /* value = value > threshold ? 0 : value */
596  CV_THRESH_OTSU =8 /* use Otsu algorithm to choose the optimal threshold value;
597  combine the flag with one of the above CV_THRESH_* values */
598 };
599 
600 /* Adaptive threshold methods */
601 enum
602 {
605 };
606 
607 /* FloodFill flags */
608 enum
609 {
612 };
613 
614 
615 /* Canny edge detector flags */
616 enum
617 {
619 };
620 
621 /* Variants of a Hough transform */
622 enum
623 {
628 };
629 
630 
631 /* Fast search data structures */
632 struct CvFeatureTree;
633 struct CvLSH;
634 struct CvLSHOperations;
635 
636 #ifdef __cplusplus
637 }
638 #endif
639 
640 #endif
Definition: types_c.h:283
double mu20
Definition: types_c.h:373
Definition: types_c.h:114
Definition: types_c.h:247
Definition: types_c.h:83
Definition: types_c.h:504
Definition: types_c.h:352
double mu30
Definition: types_c.h:373
Definition: types_c.h:201
Definition: types_c.h:198
Definition: types_c.h:257
Definition: types_c.h:255
Definition: types_c.h:112
Definition: types_c.h:218
Definition: types_c.h:166
Definition: types_c.h:90
Definition: types_c.h:495
Definition: types_c.h:226
Definition: types_c.h:493
Definition: types_c.h:625
Definition: types_c.h:319
Definition: types_c.h:310
signed char schar
Definition: types_c.h:174
Definition: types_c.h:1021
Definition: types_c.h:249
double m21
Definition: types_c.h:372
Definition: types_c.h:246
Definition: types_c.h:236
Definition: types_c.h:186
Definition: types_c.h:300
size_t CvSubdiv2DEdge
Definition: types_c.h:447
Definition: types_c.h:104
Definition: types_c.h:135
double hu2
Definition: types_c.h:381
Definition: types_c.h:216
Definition: types_c.h:462
Definition: types_c.h:95
Definition: types_c.h:582
Definition: types_c.h:67
Definition: types_c.h:171
Definition: types_c.h:603
Definition: types_c.h:265
Definition: types_c.h:415
Definition: types_c.h:627
Definition: types_c.h:313
Definition: types_c.h:192
Definition: types_c.h:534
Definition: types_c.h:578
Definition: types_c.h:338
Definition: types_c.h:189
Definition: types_c.h:82
Definition: types_c.h:405
Definition: types_c.h:151
Definition: types_c.h:234
Definition: types_c.h:118
Definition: types_c.h:301
Definition: types_c.h:576
struct CvConnectedComp CvConnectedComp
Definition: types_c.h:951
CvPoint * end
Definition: types_c.h:542
Definition: types_c.h:259
Definition: types_c.h:611
Definition: types_c.h:159
Definition: types_c.h:502
Definition: types_c.h:158
Definition: types_c.h:361
Definition: types_c.h:525
Definition: types_c.h:211
CvPoint2D32f float float b
Definition: legacy.hpp:578
Definition: types_c.h:562
double hu4
Definition: types_c.h:381
double hu7
Definition: types_c.h:381
Definition: types_c.h:208
Definition: types_c.h:392
Definition: types_c.h:193
Definition: types_c.h:232
double m03
Definition: types_c.h:372
Definition: types_c.h:105
Definition: types_c.h:222
Definition: types_c.h:53
Definition: types_c.h:157
Definition: types_c.h:401
Definition: types_c.h:229
Definition: types_c.h:175
Definition: types_c.h:282
Definition: types_c.h:66
Definition: types_c.h:353
Definition: types_c.h:403
Definition: types_c.h:116
Definition: types_c.h:197
struct CvMoments CvMoments
Definition: types_c.h:163
Definition: types_c.h:231
Definition: types_c.h:204
Definition: types_c.h:169
Definition: types_c.h:533
Definition: types_c.h:570
Definition: types_c.h:264
Definition: types_c.h:320
Definition: types_c.h:187
Definition: types_c.h:327
Definition: types_c.h:337
double m02
Definition: types_c.h:372
Definition: types_c.h:287
CvSeq * contour
Definition: types_c.h:58
Definition: types_c.h:146
double mu02
Definition: types_c.h:373
Definition: types_c.h:130
Definition: types_c.h:314
Definition: types_c.h:293
Definition: types_c.h:366
Definition: types_c.h:360
Definition: types_c.h:579
Definition: types_c.h:150
Definition: types_c.h:148
Definition: types_c.h:414
Definition: types_c.h:503
Definition: types_c.h:321
Definition: types_c.h:593
Definition: types_c.h:121
Definition: types_c.h:168
double m00
Definition: types_c.h:372
double hu5
Definition: types_c.h:381
Definition: types_c.h:240
Definition: types_c.h:225
CvNextEdgeType
Definition: types_c.h:499
Definition: types_c.h:291
Definition: types_c.h:563
double hu1
Definition: types_c.h:381
Definition: types_c.h:162
Definition: types_c.h:137
Definition: types_c.h:345
Definition: types_c.h:391
Definition: types_c.h:590
Definition: types_c.h:334
Definition: types_c.h:174
Definition: types_c.h:307
Definition: types_c.h:224
Definition: types_c.h:182
Definition: types_c.h:351
Definition: types_c.h:491
Definition: types_c.h:555
CvPoint * depth_point
Definition: types_c.h:543
CvScalar value
Definition: types_c.h:56
double mu21
Definition: types_c.h:373
Definition: types_c.h:69
Definition: types_c.h:92
CV_SEQ_READER_FIELDS() char code
Definition: types_c.h:344
Definition: types_c.h:581
struct CvSubdiv2D CvSubdiv2D
Definition: types_c.h:184
Definition: types_c.h:492
Definition: types_c.h:133
Definition: types_c.h:196
Definition: types_c.h:416
Definition: types_c.h:70
Definition: types_c.h:278
Definition: types_c.h:123
double hu6
Definition: types_c.h:381
Definition: types_c.h:122
Definition: types_c.h:109
Definition: types_c.h:183
Definition: types_c.h:280
double m11
Definition: types_c.h:372
Definition: types_c.h:142
Definition: types_c.h:577
Definition: types_c.h:306
float depth
Definition: types_c.h:544
Definition: types_c.h:379
Definition: types_c.h:364
Definition: types_c.h:580
Definition: types_c.h:325
Definition: types_c.h:569
Definition: types_c.h:507
struct CvChainPtReader CvChainPtReader
Definition: types_c.h:119
Definition: types_c.h:268
Definition: types_c.h:93
Definition: types_c.h:172
Definition: types_c.h:254
double inv_sqrt_m00
Definition: types_c.h:374
Definition: types_c.h:108
Definition: types_c.h:370
Definition: types_c.h:354
Definition: types_c.h:412
Definition: types_c.h:164
Definition: types_c.h:610
Definition: types_c.h:258
Definition: types_c.h:242
Definition: types_c.h:303
Definition: types_c.h:596
Definition: types_c.h:591
Definition: types_c.h:388
Definition: types_c.h:214
double mu11
Definition: types_c.h:373
Definition: types_c.h:238
Definition: types_c.h:318
Definition: types_c.h:296
Definition: types_c.h:233
Definition: types_c.h:223
Definition: types_c.h:494
Definition: types_c.h:323
Definition: types_c.h:161
Definition: types_c.h:178
struct CvQuadEdge2D CvQuadEdge2D
Definition: types_c.h:203
Definition: types_c.h:506
Definition: types_c.h:482
Definition: types_c.h:147
Definition: types_c.h:295
Definition: types_c.h:230
Definition: types_c.h:404
struct _CvContourScanner * CvContourScanner
Definition: types_c.h:423
Definition: types_c.h:227
Definition: types_c.h:402
Definition: types_c.h:304
Definition: types_c.h:552
Definition: types_c.h:134
Definition: types_c.h:315
Definition: types_c.h:501
Definition: types_c.h:128
Definition: types_c.h:519
Definition: types_c.h:311
Definition: types_c.h:298
Definition: types_c.h:362
Definition: types_c.h:553
double m01
Definition: types_c.h:372
Definition: types_c.h:273
Definition: types_c.h:261
CvSubdiv2DPointLocation
Definition: types_c.h:489
Definition: types_c.h:110
Definition: types_c.h:120
Definition: types_c.h:141
Definition: types_c.h:206
double m20
Definition: types_c.h:372
Definition: types_c.h:274
Definition: legacy.hpp:2892
Definition: types_c.h:156
Definition: types_c.h:89
struct CvHuMoments CvHuMoments
double m30
Definition: types_c.h:372
Definition: types_c.h:239
Definition: types_c.h:251
Definition: types_c.h:132
Definition: types_c.h:286
Definition: types_c.h:176
Definition: types_c.h:624
Definition: types_c.h:505
Definition: types_c.h:269
Definition: types_c.h:154
Definition: types_c.h:213
Definition: types_c.h:96
Definition: types_c.h:177
Definition: types_c.h:389
Definition: types_c.h:256
float(CV_CDECL * CvDistanceFunction)(const float *a, const float *b, void *user_param)
Definition: types_c.h:396
Definition: types_c.h:209
Definition: types_c.h:237
Definition: types_c.h:626
Definition: types_c.h:219
Definition: types_c.h:594
Definition: types_c.h:1223
CvArr int code
Definition: imgproc_c.h:144
Definition: types_c.h:618
Definition: types_c.h:241
Definition: types_c.h:271
Definition: types_c.h:551
Definition: types_c.h:126
Definition: types_c.h:243
Definition: types_c.h:248
Definition: types_c.h:99
Definition: types_c.h:140
double m12
Definition: types_c.h:372
Definition: types_c.h:98
Definition: types_c.h:179
Definition: types_c.h:107
Definition: types_c.h:604
Definition: types_c.h:292
Definition: types_c.h:68
Definition: types_c.h:1333
Definition: types_c.h:217
Definition: types_c.h:297
Definition: types_c.h:508
schar deltas[8][2]
Definition: types_c.h:431
::max::max::max float
Definition: functional.hpp:326
Definition: types_c.h:526
Definition: types_c.h:101
double mu12
Definition: types_c.h:373
Definition: types_c.h:102
Definition: types_c.h:595
Definition: types_c.h:194
Definition: types_c.h:365
Definition: types_c.h:289
Definition: types_c.h:279
Definition: types_c.h:191
Definition: types_c.h:181
Definition: types_c.h:592
CvPoint2D32f float a
Definition: legacy.hpp:578
Definition: types_c.h:390
Definition: types_c.h:167
double area
Definition: types_c.h:55
Definition: types_c.h:145
Definition: types_c.h:129
double mu03
Definition: types_c.h:373
struct CvConvexityDefect CvConvexityDefect
Definition: types_c.h:583
Definition: types_c.h:250
Definition: types_c.h:305
Definition: types_c.h:363
Definition: types_c.h:252
Definition: types_c.h:117
Definition: types_c.h:322
Definition: types_c.h:561
Definition: types_c.h:125
double m10
Definition: types_c.h:372
Definition: types_c.h:131
Definition: types_c.h:212
Definition: types_c.h:270
Definition: types_c.h:245
Definition: types_c.h:426
Definition: types_c.h:316
Definition: types_c.h:411
Definition: types_c.h:336
CvRect rect
Definition: types_c.h:57
Definition: types_c.h:111
Definition: types_c.h:539
Definition: types_c.h:468
Definition: types_c.h:277
Definition: types_c.h:294
Definition: types_c.h:284
Definition: types_c.h:324
Definition: types_c.h:335
Definition: types_c.h:153
Definition: types_c.h:199
CvPoint * start
Definition: types_c.h:541
Definition: types_c.h:260
Definition: types_c.h:393
Definition: types_c.h:113
struct CvSubdiv2DPoint CvSubdiv2DPoint
Definition: types_c.h:76
double hu3
Definition: types_c.h:381
Definition: types_c.h:413
Definition: types_c.h:527
Definition: types_c.h:554
Definition: types_c.h:207
CvPoint pt
Definition: types_c.h:430
Definition: types_c.h:143
Definition: types_c.h:285
Definition: types_c.h:188
Definition: types_c.h:202
Definition: types_c.h:138
Definition: types_c.h:288