@@ -55,45 +55,8 @@ extern "C" {
55
55
* Camera Calibration, Pose Estimation and Stereo *
56
56
\****************************************************************************************/
57
57
58
- typedef struct CvPOSITObject CvPOSITObject ;
59
-
60
- /* Allocates and initializes CvPOSITObject structure before doing cvPOSIT */
61
- CvPOSITObject * cvCreatePOSITObject ( CvPoint3D32f * points , int point_count );
62
-
63
-
64
- /* Runs POSIT (POSe from ITeration) algorithm for determining 3d position of
65
- an object given its model and projection in a weak-perspective case */
66
- void cvPOSIT ( CvPOSITObject * posit_object , CvPoint2D32f * image_points ,
67
- double focal_length , CvTermCriteria criteria ,
68
- float * rotation_matrix , float * translation_vector );
69
-
70
- /* Releases CvPOSITObject structure */
71
- void cvReleasePOSITObject ( CvPOSITObject * * posit_object );
72
-
73
- /* updates the number of RANSAC iterations */
74
- int cvRANSACUpdateNumIters ( double p , double err_prob ,
75
- int model_points , int max_iters );
76
-
77
58
void cvConvertPointsHomogeneous ( const CvMat * src , CvMat * dst );
78
59
79
- /* Calculates fundamental matrix given a set of corresponding points */
80
- /*#define CV_FM_7POINT 1
81
- #define CV_FM_8POINT 2
82
-
83
- #define CV_LMEDS 4
84
- #define CV_RANSAC 8
85
-
86
- #define CV_FM_LMEDS_ONLY CV_LMEDS
87
- #define CV_FM_RANSAC_ONLY CV_RANSAC
88
- #define CV_FM_LMEDS CV_LMEDS
89
- #define CV_FM_RANSAC CV_RANSAC*/
90
-
91
- int cvFindFundamentalMat ( const CvMat * points1 , const CvMat * points2 ,
92
- CvMat * fundamental_matrix ,
93
- int method CV_DEFAULT (CV_FM_RANSAC ),
94
- double param1 CV_DEFAULT (3. ), double param2 CV_DEFAULT (0.99 ),
95
- CvMat * status CV_DEFAULT (NULL) );
96
-
97
60
/* For each input point on one of images
98
61
computes parameters of the corresponding
99
62
epipolar line on the other image */
@@ -102,15 +65,6 @@ void cvComputeCorrespondEpilines( const CvMat* points,
102
65
const CvMat * fundamental_matrix ,
103
66
CvMat * correspondent_lines );
104
67
105
- /* Triangulation functions */
106
-
107
- void cvTriangulatePoints (CvMat * projMatr1 , CvMat * projMatr2 ,
108
- CvMat * projPoints1 , CvMat * projPoints2 ,
109
- CvMat * points4D );
110
-
111
- void cvCorrectMatches (CvMat * F , CvMat * points1 , CvMat * points2 ,
112
- CvMat * new_points1 , CvMat * new_points2 );
113
-
114
68
/* Finds perspective transformation between the object plane and image (view) plane */
115
69
int cvFindHomography ( const CvMat * src_points ,
116
70
const CvMat * dst_points ,
@@ -129,45 +83,6 @@ void cvInitIntrinsicParams2D( const CvMat* object_points,
129
83
CvMat * camera_matrix ,
130
84
double aspect_ratio CV_DEFAULT (1. ) );
131
85
132
- // Performs a fast check if a chessboard is in the input image. This is a workaround to
133
- // a problem of cvFindChessboardCorners being slow on images with no chessboard
134
- // - src: input image
135
- // - size: chessboard size
136
- // Returns 1 if a chessboard can be in this image and findChessboardCorners should be called,
137
- // 0 if there is no chessboard, -1 in case of error
138
- int cvCheckChessboard (IplImage * src , CvSize size );
139
-
140
- /* Detects corners on a chessboard calibration pattern */
141
- /*int cvFindChessboardCorners( const void* image, CvSize pattern_size,
142
- CvPoint2D32f* corners,
143
- int* corner_count CV_DEFAULT(NULL),
144
- int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) );*/
145
-
146
- /* Draws individual chessboard corners or the whole chessboard detected */
147
- /*void cvDrawChessboardCorners( CvArr* image, CvSize pattern_size,
148
- CvPoint2D32f* corners,
149
- int count, int pattern_was_found );*/
150
-
151
- /*#define CV_CALIB_USE_INTRINSIC_GUESS 1
152
- #define CV_CALIB_FIX_ASPECT_RATIO 2
153
- #define CV_CALIB_FIX_PRINCIPAL_POINT 4
154
- #define CV_CALIB_ZERO_TANGENT_DIST 8
155
- #define CV_CALIB_FIX_FOCAL_LENGTH 16
156
- #define CV_CALIB_FIX_K1 32
157
- #define CV_CALIB_FIX_K2 64
158
- #define CV_CALIB_FIX_K3 128
159
- #define CV_CALIB_FIX_K4 2048
160
- #define CV_CALIB_FIX_K5 4096
161
- #define CV_CALIB_FIX_K6 8192
162
- #define CV_CALIB_RATIONAL_MODEL 16384
163
- #define CV_CALIB_THIN_PRISM_MODEL 32768
164
- #define CV_CALIB_FIX_S1_S2_S3_S4 65536
165
- #define CV_CALIB_TILTED_MODEL 262144
166
- #define CV_CALIB_FIX_TAUX_TAUY 524288
167
- #define CV_CALIB_FIX_TANGENT_DIST 2097152
168
-
169
- #define CV_CALIB_NINTRINSIC 18*/
170
-
171
86
/* Finds intrinsic and extrinsic camera parameters
172
87
from a few views of known calibration pattern */
173
88
double cvCalibrateCamera2 ( const CvMat * object_points ,
@@ -182,37 +97,6 @@ double cvCalibrateCamera2( const CvMat* object_points,
182
97
CvTermCriteria term_crit CV_DEFAULT (cvTermCriteria (
183
98
CV_TERMCRIT_ITER + CV_TERMCRIT_EPS ,30 ,DBL_EPSILON )) );
184
99
185
- /* Finds intrinsic and extrinsic camera parameters
186
- from a few views of known calibration pattern */
187
- double cvCalibrateCamera4 ( const CvMat * object_points ,
188
- const CvMat * image_points ,
189
- const CvMat * point_counts ,
190
- CvSize image_size ,
191
- int iFixedPoint ,
192
- CvMat * camera_matrix ,
193
- CvMat * distortion_coeffs ,
194
- CvMat * rotation_vectors CV_DEFAULT (NULL ),
195
- CvMat * translation_vectors CV_DEFAULT (NULL ),
196
- CvMat * newObjPoints CV_DEFAULT (NULL ),
197
- int flags CV_DEFAULT (0 ),
198
- CvTermCriteria term_crit CV_DEFAULT (cvTermCriteria (
199
- CV_TERMCRIT_ITER + CV_TERMCRIT_EPS ,30 ,DBL_EPSILON )) );
200
-
201
- /* Computes various useful characteristics of the camera from the data computed by
202
- cvCalibrateCamera2 */
203
- void cvCalibrationMatrixValues ( const CvMat * camera_matrix ,
204
- CvSize image_size ,
205
- double aperture_width CV_DEFAULT (0 ),
206
- double aperture_height CV_DEFAULT (0 ),
207
- double * fovx CV_DEFAULT (NULL ),
208
- double * fovy CV_DEFAULT (NULL ),
209
- double * focal_length CV_DEFAULT (NULL ),
210
- CvPoint2D64f * principal_point CV_DEFAULT (NULL ),
211
- double * pixel_aspect_ratio CV_DEFAULT (NULL ));
212
-
213
- /*#define CV_CALIB_FIX_INTRINSIC 256
214
- #define CV_CALIB_SAME_FOCAL_LENGTH 512*/
215
-
216
100
/* Computes the transformation from one camera coordinate system to another one
217
101
from a few correspondent views of the same calibration target. Optionally, calibrates
218
102
both cameras */
@@ -248,95 +132,6 @@ int cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2,
248
132
CvMat * H1 , CvMat * H2 ,
249
133
double threshold CV_DEFAULT (5 ));
250
134
251
-
252
-
253
- /* stereo correspondence parameters and functions */
254
-
255
- #define CV_STEREO_BM_NORMALIZED_RESPONSE 0
256
- #define CV_STEREO_BM_XSOBEL 1
257
-
258
- /* Block matching algorithm structure */
259
- typedef struct CvStereoBMState
260
- {
261
- // pre-filtering (normalization of input images)
262
- int preFilterType ; // =CV_STEREO_BM_NORMALIZED_RESPONSE now
263
- int preFilterSize ; // averaging window size: ~5x5..21x21
264
- int preFilterCap ; // the output of pre-filtering is clipped by [-preFilterCap,preFilterCap]
265
-
266
- // correspondence using Sum of Absolute Difference (SAD)
267
- int SADWindowSize ; // ~5x5..21x21
268
- int minDisparity ; // minimum disparity (can be negative)
269
- int numberOfDisparities ; // maximum disparity - minimum disparity (> 0)
270
-
271
- // post-filtering
272
- int textureThreshold ; // the disparity is only computed for pixels
273
- // with textured enough neighborhood
274
- int uniquenessRatio ; // accept the computed disparity d* only if
275
- // SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.)
276
- // for any d != d*+/-1 within the search range.
277
- int speckleWindowSize ; // disparity variation window
278
- int speckleRange ; // acceptable range of variation in window
279
-
280
- int trySmallerWindows ; // if 1, the results may be more accurate,
281
- // at the expense of slower processing
282
- CvRect roi1 , roi2 ;
283
- int disp12MaxDiff ;
284
-
285
- // temporary buffers
286
- CvMat * preFilteredImg0 ;
287
- CvMat * preFilteredImg1 ;
288
- CvMat * slidingSumBuf ;
289
- CvMat * cost ;
290
- CvMat * disp ;
291
- } CvStereoBMState ;
292
-
293
- #define CV_STEREO_BM_BASIC 0
294
- #define CV_STEREO_BM_FISH_EYE 1
295
- #define CV_STEREO_BM_NARROW 2
296
-
297
- CvStereoBMState * cvCreateStereoBMState (int preset CV_DEFAULT (CV_STEREO_BM_BASIC ),
298
- int numberOfDisparities CV_DEFAULT (0 ));
299
-
300
- void cvReleaseStereoBMState ( CvStereoBMState * * state );
301
-
302
- void cvFindStereoCorrespondenceBM ( const CvArr * left , const CvArr * right ,
303
- CvArr * disparity , CvStereoBMState * state );
304
-
305
- CvRect cvGetValidDisparityROI ( CvRect roi1 , CvRect roi2 , int minDisparity ,
306
- int numberOfDisparities , int SADWindowSize );
307
-
308
- void cvValidateDisparity ( CvArr * disparity , const CvArr * cost ,
309
- int minDisparity , int numberOfDisparities ,
310
- int disp12MaxDiff CV_DEFAULT (1 ) );
311
-
312
- /* Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix */
313
- void cvReprojectImageTo3D ( const CvArr * disparityImage ,
314
- CvArr * _3dImage , const CvMat * Q ,
315
- int handleMissingValues CV_DEFAULT (0 ) );
316
-
317
- /** @brief Transforms the input image to compensate lens distortion
318
- @see cv::undistort
319
- */
320
- void cvUndistort2 ( const CvArr * src , CvArr * dst ,
321
- const CvMat * camera_matrix ,
322
- const CvMat * distortion_coeffs ,
323
- const CvMat * new_camera_matrix CV_DEFAULT (0 ) );
324
-
325
- /** @brief Computes transformation map from intrinsic camera parameters
326
- that can used by cvRemap
327
- */
328
- void cvInitUndistortMap ( const CvMat * camera_matrix ,
329
- const CvMat * distortion_coeffs ,
330
- CvArr * mapx , CvArr * mapy );
331
-
332
- /** @brief Computes undistortion+rectification map for a head of stereo camera
333
- @see cv::initUndistortRectifyMap
334
- */
335
- void cvInitUndistortRectifyMap ( const CvMat * camera_matrix ,
336
- const CvMat * dist_coeffs ,
337
- const CvMat * R , const CvMat * new_camera_matrix ,
338
- CvArr * mapx , CvArr * mapy );
339
-
340
135
/** @brief Computes the original (undistorted) feature coordinates
341
136
from the observed (distorted) coordinates
342
137
@see cv::undistortPoints
0 commit comments