1 | // created: 2019/07/18
|
---|
2 | // filename: cvtypes.cpp
|
---|
3 | //
|
---|
4 | // author: Guillaume Sanahuja
|
---|
5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
6 | //
|
---|
7 | // version: $Id: $
|
---|
8 | //
|
---|
9 | // purpose: types used by both gpp and dsp
|
---|
10 | //
|
---|
11 | //
|
---|
12 | /*********************************************************************/
|
---|
13 |
|
---|
14 | #ifndef CVTYPES_H
|
---|
15 | #define CVTYPES_H
|
---|
16 |
|
---|
17 |
|
---|
18 | #define CV_PI 3.1415926535897932384626433832795
|
---|
19 |
|
---|
20 |
|
---|
21 | typedef struct _IplImage
|
---|
22 | {
|
---|
23 | int nSize; /* sizeof(IplImage) */
|
---|
24 | int ID; /* version (=0)*/
|
---|
25 | int nChannels; /* Most of OpenCV functions support 1,2,3 or 4 channels */
|
---|
26 | int alphaChannel; /* Ignored by OpenCV */
|
---|
27 | int depth; /* Pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S,
|
---|
28 | IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported. */
|
---|
29 | char colorModel[4]; /* Ignored by OpenCV */
|
---|
30 | char channelSeq[4]; /* ditto */
|
---|
31 | int dataOrder; /* 0 - interleaved color channels, 1 - separate color channels.
|
---|
32 | cvCreateImage can only create interleaved images */
|
---|
33 | int origin; /* 0 - top-left origin,
|
---|
34 | 1 - bottom-left origin (Windows bitmaps style). */
|
---|
35 | int align; /* Alignment of image rows (4 or 8).
|
---|
36 | OpenCV ignores it and uses widthStep instead. */
|
---|
37 | int width; /* Image width in pixels. */
|
---|
38 | int height; /* Image height in pixels. */
|
---|
39 | struct _IplROI *roi; /* Image ROI. If NULL, the whole image is selected. */
|
---|
40 | struct _IplImage *maskROI; /* Must be NULL. */
|
---|
41 | void *imageId; /* " " */
|
---|
42 | struct _IplTileInfo *tileInfo; /* " " */
|
---|
43 | int imageSize; /* Image data size in bytes
|
---|
44 | (==image->height*image->widthStep
|
---|
45 | in case of interleaved data)*/
|
---|
46 | char *imageData; /* Pointer to aligned image data. */
|
---|
47 | int widthStep; /* Size of aligned image row in bytes. */
|
---|
48 | int BorderMode[4]; /* Ignored by OpenCV. */
|
---|
49 | int BorderConst[4]; /* Ditto. */
|
---|
50 | char *imageDataOrigin; /* Pointer to very origin of image data
|
---|
51 | (not necessarily aligned) -
|
---|
52 | needed for correct deallocation */
|
---|
53 | }
|
---|
54 | IplImage;
|
---|
55 |
|
---|
56 | typedef struct _IplROI
|
---|
57 | {
|
---|
58 | int coi; /* 0 - no COI (all channels are selected), 1 - 0th channel is selected ...*/
|
---|
59 | int xOffset;
|
---|
60 | int yOffset;
|
---|
61 | int width;
|
---|
62 | int height;
|
---|
63 | }
|
---|
64 | IplROI;
|
---|
65 |
|
---|
66 | typedef struct _IplTileInfo IplTileInfo;
|
---|
67 |
|
---|
68 |
|
---|
69 | typedef struct CvMat
|
---|
70 | {
|
---|
71 | int type;
|
---|
72 | int step;
|
---|
73 |
|
---|
74 | /* for internal use only */
|
---|
75 | int* refcount;
|
---|
76 | int hdr_refcount;
|
---|
77 |
|
---|
78 | union
|
---|
79 | {
|
---|
80 | unsigned char* ptr;
|
---|
81 | short* s;
|
---|
82 | int* i;
|
---|
83 | float* fl;
|
---|
84 | double* db;
|
---|
85 | } data;
|
---|
86 |
|
---|
87 | #ifdef __cplusplus
|
---|
88 | union
|
---|
89 | {
|
---|
90 | int rows;
|
---|
91 | int height;
|
---|
92 | };
|
---|
93 |
|
---|
94 | union
|
---|
95 | {
|
---|
96 | int cols;
|
---|
97 | int width;
|
---|
98 | };
|
---|
99 | #else
|
---|
100 | int rows;
|
---|
101 | int cols;
|
---|
102 | #endif
|
---|
103 |
|
---|
104 | }
|
---|
105 | CvMat;
|
---|
106 |
|
---|
107 |
|
---|
108 | /*********************************** CvTermCriteria *************************************/
|
---|
109 |
|
---|
110 | #define CV_TERMCRIT_ITER 1
|
---|
111 | #define CV_TERMCRIT_NUMBER CV_TERMCRIT_ITER
|
---|
112 | #define CV_TERMCRIT_EPS 2
|
---|
113 |
|
---|
114 | typedef struct CvTermCriteria
|
---|
115 | {
|
---|
116 | int type; /* may be combination of
|
---|
117 | CV_TERMCRIT_ITER
|
---|
118 | CV_TERMCRIT_EPS */
|
---|
119 | int max_iter;
|
---|
120 | double epsilon;
|
---|
121 | }
|
---|
122 | CvTermCriteria;
|
---|
123 |
|
---|
124 | /******************************* CvPoint and variants ***********************************/
|
---|
125 |
|
---|
126 | typedef struct CvPoint
|
---|
127 | {
|
---|
128 | int x;
|
---|
129 | int y;
|
---|
130 | }
|
---|
131 | CvPoint;
|
---|
132 |
|
---|
133 | typedef struct CvPoint2D32f
|
---|
134 | {
|
---|
135 | float x;
|
---|
136 | float y;
|
---|
137 | }
|
---|
138 | CvPoint2D32f;
|
---|
139 |
|
---|
140 | /******************************** CvSize's & CvBox **************************************/
|
---|
141 |
|
---|
142 | typedef struct
|
---|
143 | {
|
---|
144 | int width;
|
---|
145 | int height;
|
---|
146 | }
|
---|
147 | CvSize;
|
---|
148 |
|
---|
149 |
|
---|
150 | #endif /*CVTYPES_H*/
|
---|