diff --git a/HuaGoCorrect/HuaGoCorrect.vcxproj b/HuaGoCorrect/HuaGoCorrect.vcxproj
index 110900f..cb14a15 100644
--- a/HuaGoCorrect/HuaGoCorrect.vcxproj
+++ b/HuaGoCorrect/HuaGoCorrect.vcxproj
@@ -101,8 +101,7 @@
Windows
true
.\pub\external\lib;.\pub\opencv\lib;D:\local\boost_1_71_0_b1_rc1\lib32-msvc-14.1
- turbojpeg.lib;opencv_core2410d.lib;opencv_highgui2410d.lib;
-opencv_imgproc2410d.lib;%(AdditionalDependencies)
+ turbojpeg.lib;opencv_world346d.lib;%(AdditionalDependencies)
false
@@ -160,8 +159,7 @@ opencv_imgproc2410d.lib;%(AdditionalDependencies)
true
true
.\pub\external\lib;.\pub\opencv\lib;D:\local\boost_1_71_0_b1_rc1\lib32-msvc-14.1
- turbojpeg.lib;opencv_core2410.lib;opencv_highgui2410.lib;
-opencv_imgproc2410.lib;%(AdditionalDependencies)
+ turbojpeg.lib;opencv_world346.lib;%(AdditionalDependencies)
false
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_core2410.dll b/HuaGoCorrect/pub/opencv/bin/opencv_core2410.dll
deleted file mode 100644
index 8cf9b7e..0000000
Binary files a/HuaGoCorrect/pub/opencv/bin/opencv_core2410.dll and /dev/null differ
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_core2410d.dll b/HuaGoCorrect/pub/opencv/bin/opencv_core2410d.dll
deleted file mode 100644
index da33716..0000000
Binary files a/HuaGoCorrect/pub/opencv/bin/opencv_core2410d.dll and /dev/null differ
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_highgui2410.dll b/HuaGoCorrect/pub/opencv/bin/opencv_highgui2410.dll
deleted file mode 100644
index 1ee478f..0000000
Binary files a/HuaGoCorrect/pub/opencv/bin/opencv_highgui2410.dll and /dev/null differ
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_highgui2410d.dll b/HuaGoCorrect/pub/opencv/bin/opencv_highgui2410d.dll
deleted file mode 100644
index b57cd8a..0000000
Binary files a/HuaGoCorrect/pub/opencv/bin/opencv_highgui2410d.dll and /dev/null differ
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_imgproc2410.dll b/HuaGoCorrect/pub/opencv/bin/opencv_imgproc2410.dll
deleted file mode 100644
index cd4368e..0000000
Binary files a/HuaGoCorrect/pub/opencv/bin/opencv_imgproc2410.dll and /dev/null differ
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_imgproc2410d.dll b/HuaGoCorrect/pub/opencv/bin/opencv_imgproc2410d.dll
deleted file mode 100644
index 9f41689..0000000
Binary files a/HuaGoCorrect/pub/opencv/bin/opencv_imgproc2410d.dll and /dev/null differ
diff --git a/HuaGoCorrect/pub/opencv/bin/opencv_world346.dll b/HuaGoCorrect/pub/opencv/bin/opencv_world346.dll
new file mode 100644
index 0000000..2b0a2c6
Binary files /dev/null and b/HuaGoCorrect/pub/opencv/bin/opencv_world346.dll differ
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cv.h b/HuaGoCorrect/pub/opencv/include/opencv/cv.h
index 77d0971..19a74e2 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cv.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cv.h
@@ -40,8 +40,8 @@
//
//M*/
-#ifndef __OPENCV_OLD_CV_H__
-#define __OPENCV_OLD_CV_H__
+#ifndef OPENCV_OLD_CV_H
+#define OPENCV_OLD_CV_H
#if defined(_MSC_VER)
#define CV_DO_PRAGMA(x) __pragma(x)
@@ -61,22 +61,13 @@
//CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module")
#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc_c.h"
-#include "opencv2/imgproc/imgproc.hpp"
-#include "opencv2/video/tracking.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/flann/flann.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
-#include "opencv2/objdetect/objdetect.hpp"
-#include "opencv2/legacy/compat.hpp"
+#include "opencv2/photo/photo_c.h"
+#include "opencv2/video/tracking_c.h"
+#include "opencv2/objdetect/objdetect_c.h"
#if !defined(CV_IMPL)
#define CV_IMPL extern "C"
#endif //CV_IMPL
-#if defined(__cplusplus)
-#include "opencv2/core/internal.hpp"
-#endif //__cplusplus
-
#endif // __OPENCV_OLD_CV_H_
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cv.hpp b/HuaGoCorrect/pub/opencv/include/opencv/cv.hpp
index 37b523b..8673956 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cv.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cv.hpp
@@ -40,13 +40,21 @@
//
//M*/
-#ifndef __OPENCV_OLD_CV_HPP__
-#define __OPENCV_OLD_CV_HPP__
+#ifndef OPENCV_OLD_CV_HPP
+#define OPENCV_OLD_CV_HPP
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
-#include
+#include "cv.h"
+#include "opencv2/core.hpp"
+#include "opencv2/imgproc.hpp"
+#include "opencv2/photo.hpp"
+#include "opencv2/video.hpp"
+#include "opencv2/highgui.hpp"
+#include "opencv2/features2d.hpp"
+#include "opencv2/calib3d.hpp"
+#include "opencv2/objdetect.hpp"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cvaux.h b/HuaGoCorrect/pub/opencv/include/opencv/cvaux.h
index b15d068..c0367cc 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cvaux.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cvaux.h
@@ -39,26 +39,18 @@
//
//M*/
-#ifndef __OPENCV_OLD_AUX_H__
-#define __OPENCV_OLD_AUX_H__
+#ifndef OPENCV_OLD_AUX_H
+#define OPENCV_OLD_AUX_H
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc_c.h"
-#include "opencv2/imgproc/imgproc.hpp"
-#include "opencv2/video/tracking.hpp"
-#include "opencv2/video/background_segm.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
-#include "opencv2/objdetect/objdetect.hpp"
-#include "opencv2/legacy/legacy.hpp"
-#include "opencv2/legacy/compat.hpp"
-#include "opencv2/legacy/blobtrack.hpp"
-#include "opencv2/contrib/contrib.hpp"
+#include "opencv2/photo/photo_c.h"
+#include "opencv2/video/tracking_c.h"
+#include "opencv2/objdetect/objdetect_c.h"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cvaux.hpp b/HuaGoCorrect/pub/opencv/include/opencv/cvaux.hpp
index 952210b..4888eef 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cvaux.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cvaux.hpp
@@ -39,13 +39,14 @@
//
//M*/
-#ifndef __OPENCV_OLD_AUX_HPP__
-#define __OPENCV_OLD_AUX_HPP__
+#ifndef OPENCV_OLD_AUX_HPP
+#define OPENCV_OLD_AUX_HPP
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
-#include
+#include "cvaux.h"
+#include "opencv2/core/utility.hpp"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cvwimage.h b/HuaGoCorrect/pub/opencv/include/opencv/cvwimage.h
index de89c92..ec0ab14 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cvwimage.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cvwimage.h
@@ -38,8 +38,8 @@
// the use of this software, even if advised of the possibility of such damage.
-#ifndef __OPENCV_OLD_WIMAGE_HPP__
-#define __OPENCV_OLD_WIMAGE_HPP__
+#ifndef OPENCV_OLD_WIMAGE_HPP
+#define OPENCV_OLD_WIMAGE_HPP
#include "opencv2/core/wimage.hpp"
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cxcore.h b/HuaGoCorrect/pub/opencv/include/opencv/cxcore.h
index d52ad4f..dc070c7 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cxcore.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cxcore.h
@@ -40,14 +40,13 @@
//
//M*/
-#ifndef __OPENCV_OLD_CXCORE_H__
-#define __OPENCV_OLD_CXCORE_H__
+#ifndef OPENCV_OLD_CXCORE_H
+#define OPENCV_OLD_CXCORE_H
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cxcore.hpp b/HuaGoCorrect/pub/opencv/include/opencv/cxcore.hpp
index 033b365..c371677 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cxcore.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cxcore.hpp
@@ -40,13 +40,14 @@
//
//M*/
-#ifndef __OPENCV_OLD_CXCORE_HPP__
-#define __OPENCV_OLD_CXCORE_HPP__
+#ifndef OPENCV_OLD_CXCORE_HPP
+#define OPENCV_OLD_CXCORE_HPP
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
-#include
+#include "cxcore.h"
+#include "opencv2/core.hpp"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cxeigen.hpp b/HuaGoCorrect/pub/opencv/include/opencv/cxeigen.hpp
index 1f04d1a..1d3df91 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cxeigen.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cxeigen.hpp
@@ -40,8 +40,8 @@
//
//M*/
-#ifndef __OPENCV_OLD_EIGEN_HPP__
-#define __OPENCV_OLD_EIGEN_HPP__
+#ifndef OPENCV_OLD_EIGEN_HPP
+#define OPENCV_OLD_EIGEN_HPP
#include "opencv2/core/eigen.hpp"
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/cxmisc.h b/HuaGoCorrect/pub/opencv/include/opencv/cxmisc.h
index 6446944..9b9bc82 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/cxmisc.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/cxmisc.h
@@ -1,6 +1,8 @@
-#ifndef __OPENCV_OLD_CXMISC_H__
-#define __OPENCV_OLD_CXMISC_H__
+#ifndef OPENCV_OLD_CXMISC_H
+#define OPENCV_OLD_CXMISC_H
-#include "opencv2/core/internal.hpp"
+#ifdef __cplusplus
+# include "opencv2/core/utility.hpp"
+#endif
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/highgui.h b/HuaGoCorrect/pub/opencv/include/opencv/highgui.h
index 9725c9f..69b394e 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/highgui.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/highgui.h
@@ -39,12 +39,10 @@
//
//M*/
-#ifndef __OPENCV_OLD_HIGHGUI_H__
-#define __OPENCV_OLD_HIGHGUI_H__
+#ifndef OPENCV_OLD_HIGHGUI_H
+#define OPENCV_OLD_HIGHGUI_H
#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui_c.h"
-#include "opencv2/highgui/highgui.hpp"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv/ml.h b/HuaGoCorrect/pub/opencv/include/opencv/ml.h
index 0383a2f..0c376ba 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv/ml.h
+++ b/HuaGoCorrect/pub/opencv/include/opencv/ml.h
@@ -38,11 +38,10 @@
//
//M*/
-#ifndef __OPENCV_OLD_ML_H__
-#define __OPENCV_OLD_ML_H__
+#ifndef OPENCV_OLD_ML_H
+#define OPENCV_OLD_ML_H
#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
-#include "opencv2/ml/ml.hpp"
+#include "opencv2/ml.hpp"
#endif
diff --git a/HuaGoCorrect/pub/opencv/include/opencv2/calib3d/calib3d.hpp b/HuaGoCorrect/pub/opencv/include/opencv2/calib3d/calib3d.hpp
index 5e9cde8..b3da45e 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv2/calib3d/calib3d.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv2/calib3d/calib3d.hpp
@@ -7,11 +7,12 @@
// copy or use the software.
//
//
-// License Agreement
+// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
+// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
@@ -40,772 +41,8 @@
//
//M*/
-#ifndef __OPENCV_CALIB3D_HPP__
-#define __OPENCV_CALIB3D_HPP__
-
-#include "opencv2/core/core.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/core/affine.hpp"
-
-#ifdef __cplusplus
-extern "C" {
+#ifdef __OPENCV_BUILD
+#error this is a compatibility header which should not be used inside the OpenCV library
#endif
-/****************************************************************************************\
-* Camera Calibration, Pose Estimation and Stereo *
-\****************************************************************************************/
-
-typedef struct CvPOSITObject CvPOSITObject;
-
-/* Allocates and initializes CvPOSITObject structure before doing cvPOSIT */
-CVAPI(CvPOSITObject*) cvCreatePOSITObject( CvPoint3D32f* points, int point_count );
-
-
-/* Runs POSIT (POSe from ITeration) algorithm for determining 3d position of
- an object given its model and projection in a weak-perspective case */
-CVAPI(void) cvPOSIT( CvPOSITObject* posit_object, CvPoint2D32f* image_points,
- double focal_length, CvTermCriteria criteria,
- float* rotation_matrix, float* translation_vector);
-
-/* Releases CvPOSITObject structure */
-CVAPI(void) cvReleasePOSITObject( CvPOSITObject** posit_object );
-
-/* updates the number of RANSAC iterations */
-CVAPI(int) cvRANSACUpdateNumIters( double p, double err_prob,
- int model_points, int max_iters );
-
-CVAPI(void) cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst );
-
-/* Calculates fundamental matrix given a set of corresponding points */
-#define CV_FM_7POINT 1
-#define CV_FM_8POINT 2
-
-#define CV_LMEDS 4
-#define CV_RANSAC 8
-
-#define CV_FM_LMEDS_ONLY CV_LMEDS
-#define CV_FM_RANSAC_ONLY CV_RANSAC
-#define CV_FM_LMEDS CV_LMEDS
-#define CV_FM_RANSAC CV_RANSAC
-
-enum
-{
- CV_ITERATIVE = 0,
- CV_EPNP = 1, // F.Moreno-Noguer, V.Lepetit and P.Fua "EPnP: Efficient Perspective-n-Point Camera Pose Estimation"
- CV_P3P = 2 // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; "Complete Solution Classification for the Perspective-Three-Point Problem"
-};
-
-CVAPI(int) cvFindFundamentalMat( const CvMat* points1, const CvMat* points2,
- CvMat* fundamental_matrix,
- int method CV_DEFAULT(CV_FM_RANSAC),
- double param1 CV_DEFAULT(3.), double param2 CV_DEFAULT(0.99),
- CvMat* status CV_DEFAULT(NULL) );
-
-/* For each input point on one of images
- computes parameters of the corresponding
- epipolar line on the other image */
-CVAPI(void) cvComputeCorrespondEpilines( const CvMat* points,
- int which_image,
- const CvMat* fundamental_matrix,
- CvMat* correspondent_lines );
-
-/* Triangulation functions */
-
-CVAPI(void) cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2,
- CvMat* projPoints1, CvMat* projPoints2,
- CvMat* points4D);
-
-CVAPI(void) cvCorrectMatches(CvMat* F, CvMat* points1, CvMat* points2,
- CvMat* new_points1, CvMat* new_points2);
-
-
-/* Computes the optimal new camera matrix according to the free scaling parameter alpha:
- alpha=0 - only valid pixels will be retained in the undistorted image
- alpha=1 - all the source image pixels will be retained in the undistorted image
-*/
-CVAPI(void) cvGetOptimalNewCameraMatrix( const CvMat* camera_matrix,
- const CvMat* dist_coeffs,
- CvSize image_size, double alpha,
- CvMat* new_camera_matrix,
- CvSize new_imag_size CV_DEFAULT(cvSize(0,0)),
- CvRect* valid_pixel_ROI CV_DEFAULT(0),
- int center_principal_point CV_DEFAULT(0));
-
-/* Converts rotation vector to rotation matrix or vice versa */
-CVAPI(int) cvRodrigues2( const CvMat* src, CvMat* dst,
- CvMat* jacobian CV_DEFAULT(0) );
-
-/* Finds perspective transformation between the object plane and image (view) plane */
-CVAPI(int) cvFindHomography( const CvMat* src_points,
- const CvMat* dst_points,
- CvMat* homography,
- int method CV_DEFAULT(0),
- double ransacReprojThreshold CV_DEFAULT(3),
- CvMat* mask CV_DEFAULT(0));
-
-/* Computes RQ decomposition for 3x3 matrices */
-CVAPI(void) cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
- CvMat *matrixQx CV_DEFAULT(NULL),
- CvMat *matrixQy CV_DEFAULT(NULL),
- CvMat *matrixQz CV_DEFAULT(NULL),
- CvPoint3D64f *eulerAngles CV_DEFAULT(NULL));
-
-/* Computes projection matrix decomposition */
-CVAPI(void) cvDecomposeProjectionMatrix( const CvMat *projMatr, CvMat *calibMatr,
- CvMat *rotMatr, CvMat *posVect,
- CvMat *rotMatrX CV_DEFAULT(NULL),
- CvMat *rotMatrY CV_DEFAULT(NULL),
- CvMat *rotMatrZ CV_DEFAULT(NULL),
- CvPoint3D64f *eulerAngles CV_DEFAULT(NULL));
-
-/* Computes d(AB)/dA and d(AB)/dB */
-CVAPI(void) cvCalcMatMulDeriv( const CvMat* A, const CvMat* B, CvMat* dABdA, CvMat* dABdB );
-
-/* Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
- t3 = rodrigues(r2)*t1 + t2 and the respective derivatives */
-CVAPI(void) cvComposeRT( const CvMat* _rvec1, const CvMat* _tvec1,
- const CvMat* _rvec2, const CvMat* _tvec2,
- CvMat* _rvec3, CvMat* _tvec3,
- CvMat* dr3dr1 CV_DEFAULT(0), CvMat* dr3dt1 CV_DEFAULT(0),
- CvMat* dr3dr2 CV_DEFAULT(0), CvMat* dr3dt2 CV_DEFAULT(0),
- CvMat* dt3dr1 CV_DEFAULT(0), CvMat* dt3dt1 CV_DEFAULT(0),
- CvMat* dt3dr2 CV_DEFAULT(0), CvMat* dt3dt2 CV_DEFAULT(0) );
-
-/* Projects object points to the view plane using
- the specified extrinsic and intrinsic camera parameters */
-CVAPI(void) cvProjectPoints2( const CvMat* object_points, const CvMat* rotation_vector,
- const CvMat* translation_vector, const CvMat* camera_matrix,
- const CvMat* distortion_coeffs, CvMat* image_points,
- CvMat* dpdrot CV_DEFAULT(NULL), CvMat* dpdt CV_DEFAULT(NULL),
- CvMat* dpdf CV_DEFAULT(NULL), CvMat* dpdc CV_DEFAULT(NULL),
- CvMat* dpddist CV_DEFAULT(NULL),
- double aspect_ratio CV_DEFAULT(0));
-
-/* Finds extrinsic camera parameters from
- a few known corresponding point pairs and intrinsic parameters */
-CVAPI(void) cvFindExtrinsicCameraParams2( const CvMat* object_points,
- const CvMat* image_points,
- const CvMat* camera_matrix,
- const CvMat* distortion_coeffs,
- CvMat* rotation_vector,
- CvMat* translation_vector,
- int use_extrinsic_guess CV_DEFAULT(0) );
-
-/* Computes initial estimate of the intrinsic camera parameters
- in case of planar calibration target (e.g. chessboard) */
-CVAPI(void) cvInitIntrinsicParams2D( const CvMat* object_points,
- const CvMat* image_points,
- const CvMat* npoints, CvSize image_size,
- CvMat* camera_matrix,
- double aspect_ratio CV_DEFAULT(1.) );
-
-#define CV_CALIB_CB_ADAPTIVE_THRESH 1
-#define CV_CALIB_CB_NORMALIZE_IMAGE 2
-#define CV_CALIB_CB_FILTER_QUADS 4
-#define CV_CALIB_CB_FAST_CHECK 8
-
-// Performs a fast check if a chessboard is in the input image. This is a workaround to
-// a problem of cvFindChessboardCorners being slow on images with no chessboard
-// - src: input image
-// - size: chessboard size
-// Returns 1 if a chessboard can be in this image and findChessboardCorners should be called,
-// 0 if there is no chessboard, -1 in case of error
-CVAPI(int) cvCheckChessboard(IplImage* src, CvSize size);
-
- /* Detects corners on a chessboard calibration pattern */
-CVAPI(int) cvFindChessboardCorners( const void* image, CvSize pattern_size,
- CvPoint2D32f* corners,
- int* corner_count CV_DEFAULT(NULL),
- int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) );
-
-/* Draws individual chessboard corners or the whole chessboard detected */
-CVAPI(void) cvDrawChessboardCorners( CvArr* image, CvSize pattern_size,
- CvPoint2D32f* corners,
- int count, int pattern_was_found );
-
-#define CV_CALIB_USE_INTRINSIC_GUESS 1
-#define CV_CALIB_FIX_ASPECT_RATIO 2
-#define CV_CALIB_FIX_PRINCIPAL_POINT 4
-#define CV_CALIB_ZERO_TANGENT_DIST 8
-#define CV_CALIB_FIX_FOCAL_LENGTH 16
-#define CV_CALIB_FIX_K1 32
-#define CV_CALIB_FIX_K2 64
-#define CV_CALIB_FIX_K3 128
-#define CV_CALIB_FIX_K4 2048
-#define CV_CALIB_FIX_K5 4096
-#define CV_CALIB_FIX_K6 8192
-#define CV_CALIB_RATIONAL_MODEL 16384
-
-/* Finds intrinsic and extrinsic camera parameters
- from a few views of known calibration pattern */
-CVAPI(double) cvCalibrateCamera2( const CvMat* object_points,
- const CvMat* image_points,
- const CvMat* point_counts,
- CvSize image_size,
- CvMat* camera_matrix,
- CvMat* distortion_coeffs,
- CvMat* rotation_vectors CV_DEFAULT(NULL),
- CvMat* translation_vectors CV_DEFAULT(NULL),
- int flags CV_DEFAULT(0),
- CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria(
- CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,DBL_EPSILON)) );
-
-/* Computes various useful characteristics of the camera from the data computed by
- cvCalibrateCamera2 */
-CVAPI(void) cvCalibrationMatrixValues( const CvMat *camera_matrix,
- CvSize image_size,
- double aperture_width CV_DEFAULT(0),
- double aperture_height CV_DEFAULT(0),
- double *fovx CV_DEFAULT(NULL),
- double *fovy CV_DEFAULT(NULL),
- double *focal_length CV_DEFAULT(NULL),
- CvPoint2D64f *principal_point CV_DEFAULT(NULL),
- double *pixel_aspect_ratio CV_DEFAULT(NULL));
-
-#define CV_CALIB_FIX_INTRINSIC 256
-#define CV_CALIB_SAME_FOCAL_LENGTH 512
-
-/* Computes the transformation from one camera coordinate system to another one
- from a few correspondent views of the same calibration target. Optionally, calibrates
- both cameras */
-CVAPI(double) cvStereoCalibrate( const CvMat* object_points, const CvMat* image_points1,
- const CvMat* image_points2, const CvMat* npoints,
- CvMat* camera_matrix1, CvMat* dist_coeffs1,
- CvMat* camera_matrix2, CvMat* dist_coeffs2,
- CvSize image_size, CvMat* R, CvMat* T,
- CvMat* E CV_DEFAULT(0), CvMat* F CV_DEFAULT(0),
- CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria(
- CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,1e-6)),
- int flags CV_DEFAULT(CV_CALIB_FIX_INTRINSIC));
-
-#define CV_CALIB_ZERO_DISPARITY 1024
-
-/* Computes 3D rotations (+ optional shift) for each camera coordinate system to make both
- views parallel (=> to make all the epipolar lines horizontal or vertical) */
-CVAPI(void) cvStereoRectify( const CvMat* camera_matrix1, const CvMat* camera_matrix2,
- const CvMat* dist_coeffs1, const CvMat* dist_coeffs2,
- CvSize image_size, const CvMat* R, const CvMat* T,
- CvMat* R1, CvMat* R2, CvMat* P1, CvMat* P2,
- CvMat* Q CV_DEFAULT(0),
- int flags CV_DEFAULT(CV_CALIB_ZERO_DISPARITY),
- double alpha CV_DEFAULT(-1),
- CvSize new_image_size CV_DEFAULT(cvSize(0,0)),
- CvRect* valid_pix_ROI1 CV_DEFAULT(0),
- CvRect* valid_pix_ROI2 CV_DEFAULT(0));
-
-/* Computes rectification transformations for uncalibrated pair of images using a set
- of point correspondences */
-CVAPI(int) cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2,
- const CvMat* F, CvSize img_size,
- CvMat* H1, CvMat* H2,
- double threshold CV_DEFAULT(5));
-
-
-
-/* stereo correspondence parameters and functions */
-
-#define CV_STEREO_BM_NORMALIZED_RESPONSE 0
-#define CV_STEREO_BM_XSOBEL 1
-
-/* Block matching algorithm structure */
-typedef struct CvStereoBMState
-{
- // pre-filtering (normalization of input images)
- int preFilterType; // =CV_STEREO_BM_NORMALIZED_RESPONSE now
- int preFilterSize; // averaging window size: ~5x5..21x21
- int preFilterCap; // the output of pre-filtering is clipped by [-preFilterCap,preFilterCap]
-
- // correspondence using Sum of Absolute Difference (SAD)
- int SADWindowSize; // ~5x5..21x21
- int minDisparity; // minimum disparity (can be negative)
- int numberOfDisparities; // maximum disparity - minimum disparity (> 0)
-
- // post-filtering
- int textureThreshold; // the disparity is only computed for pixels
- // with textured enough neighborhood
- int uniquenessRatio; // accept the computed disparity d* only if
- // SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.)
- // for any d != d*+/-1 within the search range.
- int speckleWindowSize; // disparity variation window
- int speckleRange; // acceptable range of variation in window
-
- int trySmallerWindows; // if 1, the results may be more accurate,
- // at the expense of slower processing
- CvRect roi1, roi2;
- int disp12MaxDiff;
-
- // temporary buffers
- CvMat* preFilteredImg0;
- CvMat* preFilteredImg1;
- CvMat* slidingSumBuf;
- CvMat* cost;
- CvMat* disp;
-} CvStereoBMState;
-
-#define CV_STEREO_BM_BASIC 0
-#define CV_STEREO_BM_FISH_EYE 1
-#define CV_STEREO_BM_NARROW 2
-
-CVAPI(CvStereoBMState*) cvCreateStereoBMState(int preset CV_DEFAULT(CV_STEREO_BM_BASIC),
- int numberOfDisparities CV_DEFAULT(0));
-
-CVAPI(void) cvReleaseStereoBMState( CvStereoBMState** state );
-
-CVAPI(void) cvFindStereoCorrespondenceBM( const CvArr* left, const CvArr* right,
- CvArr* disparity, CvStereoBMState* state );
-
-CVAPI(CvRect) cvGetValidDisparityROI( CvRect roi1, CvRect roi2, int minDisparity,
- int numberOfDisparities, int SADWindowSize );
-
-CVAPI(void) cvValidateDisparity( CvArr* disparity, const CvArr* cost,
- int minDisparity, int numberOfDisparities,
- int disp12MaxDiff CV_DEFAULT(1) );
-
-/* Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix */
-CVAPI(void) cvReprojectImageTo3D( const CvArr* disparityImage,
- CvArr* _3dImage, const CvMat* Q,
- int handleMissingValues CV_DEFAULT(0) );
-
-
-#ifdef __cplusplus
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-class CV_EXPORTS CvLevMarq
-{
-public:
- CvLevMarq();
- CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria=
- cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),
- bool completeSymmFlag=false );
- ~CvLevMarq();
- void init( int nparams, int nerrs, CvTermCriteria criteria=
- cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),
- bool completeSymmFlag=false );
- bool update( const CvMat*& param, CvMat*& J, CvMat*& err );
- bool updateAlt( const CvMat*& param, CvMat*& JtJ, CvMat*& JtErr, double*& errNorm );
-
- void clear();
- void step();
- enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 };
-
- cv::Ptr mask;
- cv::Ptr prevParam;
- cv::Ptr param;
- cv::Ptr J;
- cv::Ptr err;
- cv::Ptr JtJ;
- cv::Ptr JtJN;
- cv::Ptr JtErr;
- cv::Ptr JtJV;
- cv::Ptr JtJW;
- double prevErrNorm, errNorm;
- int lambdaLg10;
- CvTermCriteria criteria;
- int state;
- int iters;
- bool completeSymmFlag;
-};
-
-namespace cv
-{
-//! converts rotation vector to rotation matrix or vice versa using Rodrigues transformation
-CV_EXPORTS_W void Rodrigues(InputArray src, OutputArray dst, OutputArray jacobian=noArray());
-
-//! type of the robust estimation algorithm
-enum
-{
- LMEDS=CV_LMEDS, //!< least-median algorithm
- RANSAC=CV_RANSAC //!< RANSAC algorithm
-};
-
-//! computes the best-fit perspective transformation mapping srcPoints to dstPoints.
-CV_EXPORTS_W Mat findHomography( InputArray srcPoints, InputArray dstPoints,
- int method=0, double ransacReprojThreshold=3,
- OutputArray mask=noArray());
-
-//! variant of findHomography for backward compatibility
-CV_EXPORTS Mat findHomography( InputArray srcPoints, InputArray dstPoints,
- OutputArray mask, int method=0, double ransacReprojThreshold=3);
-
-//! Computes RQ decomposition of 3x3 matrix
-CV_EXPORTS_W Vec3d RQDecomp3x3( InputArray src, OutputArray mtxR, OutputArray mtxQ,
- OutputArray Qx=noArray(),
- OutputArray Qy=noArray(),
- OutputArray Qz=noArray());
-
-//! Decomposes the projection matrix into camera matrix and the rotation martix and the translation vector
-CV_EXPORTS_W void decomposeProjectionMatrix( InputArray projMatrix, OutputArray cameraMatrix,
- OutputArray rotMatrix, OutputArray transVect,
- OutputArray rotMatrixX=noArray(),
- OutputArray rotMatrixY=noArray(),
- OutputArray rotMatrixZ=noArray(),
- OutputArray eulerAngles=noArray() );
-
-//! computes derivatives of the matrix product w.r.t each of the multiplied matrix coefficients
-CV_EXPORTS_W void matMulDeriv( InputArray A, InputArray B,
- OutputArray dABdA,
- OutputArray dABdB );
-
-//! composes 2 [R|t] transformations together. Also computes the derivatives of the result w.r.t the arguments
-CV_EXPORTS_W void composeRT( InputArray rvec1, InputArray tvec1,
- InputArray rvec2, InputArray tvec2,
- OutputArray rvec3, OutputArray tvec3,
- OutputArray dr3dr1=noArray(), OutputArray dr3dt1=noArray(),
- OutputArray dr3dr2=noArray(), OutputArray dr3dt2=noArray(),
- OutputArray dt3dr1=noArray(), OutputArray dt3dt1=noArray(),
- OutputArray dt3dr2=noArray(), OutputArray dt3dt2=noArray() );
-
-//! projects points from the model coordinate space to the image coordinates. Also computes derivatives of the image coordinates w.r.t the intrinsic and extrinsic camera parameters
-CV_EXPORTS_W void projectPoints( InputArray objectPoints,
- InputArray rvec, InputArray tvec,
- InputArray cameraMatrix, InputArray distCoeffs,
- OutputArray imagePoints,
- OutputArray jacobian=noArray(),
- double aspectRatio=0 );
-
-//! computes the camera pose from a few 3D points and the corresponding projections. The outliers are not handled.
-enum
-{
- ITERATIVE=CV_ITERATIVE,
- EPNP=CV_EPNP,
- P3P=CV_P3P
-};
-CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints,
- InputArray cameraMatrix, InputArray distCoeffs,
- OutputArray rvec, OutputArray tvec,
- bool useExtrinsicGuess=false, int flags=ITERATIVE);
-
-//! computes the camera pose from a few 3D points and the corresponding projections. The outliers are possible.
-CV_EXPORTS_W void solvePnPRansac( InputArray objectPoints,
- InputArray imagePoints,
- InputArray cameraMatrix,
- InputArray distCoeffs,
- OutputArray rvec,
- OutputArray tvec,
- bool useExtrinsicGuess = false,
- int iterationsCount = 100,
- float reprojectionError = 8.0,
- int minInliersCount = 100,
- OutputArray inliers = noArray(),
- int flags = ITERATIVE);
-
-//! initializes camera matrix from a few 3D points and the corresponding projections.
-CV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints,
- InputArrayOfArrays imagePoints,
- Size imageSize, double aspectRatio=1. );
-
-enum { CALIB_CB_ADAPTIVE_THRESH = 1, CALIB_CB_NORMALIZE_IMAGE = 2,
- CALIB_CB_FILTER_QUADS = 4, CALIB_CB_FAST_CHECK = 8 };
-
-//! finds checkerboard pattern of the specified size in the image
-CV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize,
- OutputArray corners,
- int flags=CALIB_CB_ADAPTIVE_THRESH+CALIB_CB_NORMALIZE_IMAGE );
-
-//! finds subpixel-accurate positions of the chessboard corners
-CV_EXPORTS bool find4QuadCornerSubpix(InputArray img, InputOutputArray corners, Size region_size);
-
-//! draws the checkerboard pattern (found or partly found) in the image
-CV_EXPORTS_W void drawChessboardCorners( InputOutputArray image, Size patternSize,
- InputArray corners, bool patternWasFound );
-
-enum { CALIB_CB_SYMMETRIC_GRID = 1, CALIB_CB_ASYMMETRIC_GRID = 2,
- CALIB_CB_CLUSTERING = 4 };
-
-//! finds circles' grid pattern of the specified size in the image
-CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize,
- OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID,
- const Ptr &blobDetector = new SimpleBlobDetector());
-
-//! the deprecated function. Use findCirclesGrid() instead of it.
-CV_EXPORTS_W bool findCirclesGridDefault( InputArray image, Size patternSize,
- OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID );
-enum
-{
- CALIB_USE_INTRINSIC_GUESS = CV_CALIB_USE_INTRINSIC_GUESS,
- CALIB_FIX_ASPECT_RATIO = CV_CALIB_FIX_ASPECT_RATIO,
- CALIB_FIX_PRINCIPAL_POINT = CV_CALIB_FIX_PRINCIPAL_POINT,
- CALIB_ZERO_TANGENT_DIST = CV_CALIB_ZERO_TANGENT_DIST,
- CALIB_FIX_FOCAL_LENGTH = CV_CALIB_FIX_FOCAL_LENGTH,
- CALIB_FIX_K1 = CV_CALIB_FIX_K1,
- CALIB_FIX_K2 = CV_CALIB_FIX_K2,
- CALIB_FIX_K3 = CV_CALIB_FIX_K3,
- CALIB_FIX_K4 = CV_CALIB_FIX_K4,
- CALIB_FIX_K5 = CV_CALIB_FIX_K5,
- CALIB_FIX_K6 = CV_CALIB_FIX_K6,
- CALIB_RATIONAL_MODEL = CV_CALIB_RATIONAL_MODEL,
- // only for stereo
- CALIB_FIX_INTRINSIC = CV_CALIB_FIX_INTRINSIC,
- CALIB_SAME_FOCAL_LENGTH = CV_CALIB_SAME_FOCAL_LENGTH,
- // for stereo rectification
- CALIB_ZERO_DISPARITY = CV_CALIB_ZERO_DISPARITY
-};
-
-//! finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern.
-CV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints,
- InputArrayOfArrays imagePoints,
- Size imageSize,
- CV_OUT InputOutputArray cameraMatrix,
- CV_OUT InputOutputArray distCoeffs,
- OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
- int flags=0, TermCriteria criteria = TermCriteria(
- TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON) );
-
-//! computes several useful camera characteristics from the camera matrix, camera frame resolution and the physical sensor size.
-CV_EXPORTS_W void calibrationMatrixValues( InputArray cameraMatrix,
- Size imageSize,
- double apertureWidth,
- double apertureHeight,
- CV_OUT double& fovx,
- CV_OUT double& fovy,
- CV_OUT double& focalLength,
- CV_OUT Point2d& principalPoint,
- CV_OUT double& aspectRatio );
-
-//! finds intrinsic and extrinsic parameters of a stereo camera
-CV_EXPORTS_W double stereoCalibrate( InputArrayOfArrays objectPoints,
- InputArrayOfArrays imagePoints1,
- InputArrayOfArrays imagePoints2,
- CV_OUT InputOutputArray cameraMatrix1,
- CV_OUT InputOutputArray distCoeffs1,
- CV_OUT InputOutputArray cameraMatrix2,
- CV_OUT InputOutputArray distCoeffs2,
- Size imageSize, OutputArray R,
- OutputArray T, OutputArray E, OutputArray F,
- TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6),
- int flags=CALIB_FIX_INTRINSIC );
-
-
-//! computes the rectification transformation for a stereo camera from its intrinsic and extrinsic parameters
-CV_EXPORTS_W void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1,
- InputArray cameraMatrix2, InputArray distCoeffs2,
- Size imageSize, InputArray R, InputArray T,
- OutputArray R1, OutputArray R2,
- OutputArray P1, OutputArray P2,
- OutputArray Q, int flags=CALIB_ZERO_DISPARITY,
- double alpha=-1, Size newImageSize=Size(),
- CV_OUT Rect* validPixROI1=0, CV_OUT Rect* validPixROI2=0 );
-
-//! computes the rectification transformation for an uncalibrated stereo camera (zero distortion is assumed)
-CV_EXPORTS_W bool stereoRectifyUncalibrated( InputArray points1, InputArray points2,
- InputArray F, Size imgSize,
- OutputArray H1, OutputArray H2,
- double threshold=5 );
-
-//! computes the rectification transformations for 3-head camera, where all the heads are on the same line.
-CV_EXPORTS_W float rectify3Collinear( InputArray cameraMatrix1, InputArray distCoeffs1,
- InputArray cameraMatrix2, InputArray distCoeffs2,
- InputArray cameraMatrix3, InputArray distCoeffs3,
- InputArrayOfArrays imgpt1, InputArrayOfArrays imgpt3,
- Size imageSize, InputArray R12, InputArray T12,
- InputArray R13, InputArray T13,
- OutputArray R1, OutputArray R2, OutputArray R3,
- OutputArray P1, OutputArray P2, OutputArray P3,
- OutputArray Q, double alpha, Size newImgSize,
- CV_OUT Rect* roi1, CV_OUT Rect* roi2, int flags );
-
-//! returns the optimal new camera matrix
-CV_EXPORTS_W Mat getOptimalNewCameraMatrix( InputArray cameraMatrix, InputArray distCoeffs,
- Size imageSize, double alpha, Size newImgSize=Size(),
- CV_OUT Rect* validPixROI=0, bool centerPrincipalPoint=false);
-
-//! converts point coordinates from normal pixel coordinates to homogeneous coordinates ((x,y)->(x,y,1))
-CV_EXPORTS_W void convertPointsToHomogeneous( InputArray src, OutputArray dst );
-
-//! converts point coordinates from homogeneous to normal pixel coordinates ((x,y,z)->(x/z, y/z))
-CV_EXPORTS_W void convertPointsFromHomogeneous( InputArray src, OutputArray dst );
-
-//! for backward compatibility
-CV_EXPORTS void convertPointsHomogeneous( InputArray src, OutputArray dst );
-
-//! the algorithm for finding fundamental matrix
-enum
-{
- FM_7POINT = CV_FM_7POINT, //!< 7-point algorithm
- FM_8POINT = CV_FM_8POINT, //!< 8-point algorithm
- FM_LMEDS = CV_FM_LMEDS, //!< least-median algorithm
- FM_RANSAC = CV_FM_RANSAC //!< RANSAC algorithm
-};
-
-//! finds fundamental matrix from a set of corresponding 2D points
-CV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2,
- int method=FM_RANSAC,
- double param1=3., double param2=0.99,
- OutputArray mask=noArray());
-
-//! variant of findFundamentalMat for backward compatibility
-CV_EXPORTS Mat findFundamentalMat( InputArray points1, InputArray points2,
- OutputArray mask, int method=FM_RANSAC,
- double param1=3., double param2=0.99);
-
-//! finds coordinates of epipolar lines corresponding the specified points
-CV_EXPORTS_W void computeCorrespondEpilines( InputArray points,
- int whichImage, InputArray F,
- OutputArray lines );
-
-CV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2,
- InputArray projPoints1, InputArray projPoints2,
- OutputArray points4D );
-
-CV_EXPORTS_W void correctMatches( InputArray F, InputArray points1, InputArray points2,
- OutputArray newPoints1, OutputArray newPoints2 );
-
-template<> CV_EXPORTS void Ptr::delete_obj();
-
-/*!
- Block Matching Stereo Correspondence Algorithm
-
- The class implements BM stereo correspondence algorithm by K. Konolige.
-*/
-class CV_EXPORTS_W StereoBM
-{
-public:
- enum { PREFILTER_NORMALIZED_RESPONSE = 0, PREFILTER_XSOBEL = 1,
- BASIC_PRESET=0, FISH_EYE_PRESET=1, NARROW_PRESET=2 };
-
- //! the default constructor
- CV_WRAP StereoBM();
- //! the full constructor taking the camera-specific preset, number of disparities and the SAD window size
- CV_WRAP StereoBM(int preset, int ndisparities=0, int SADWindowSize=21);
- //! the method that reinitializes the state. The previous content is destroyed
- void init(int preset, int ndisparities=0, int SADWindowSize=21);
- //! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair
- CV_WRAP_AS(compute) void operator()( InputArray left, InputArray right,
- OutputArray disparity, int disptype=CV_16S );
-
- //! pointer to the underlying CvStereoBMState
- Ptr state;
-};
-
-
-/*!
- Semi-Global Block Matching Stereo Correspondence Algorithm
-
- The class implements the original SGBM stereo correspondence algorithm by H. Hirschmuller and some its modification.
- */
-class CV_EXPORTS_W StereoSGBM
-{
-public:
- enum { DISP_SHIFT=4, DISP_SCALE = (1<(X,Y,Z) using the matrix Q returned by cv::stereoRectify
-CV_EXPORTS_W void reprojectImageTo3D( InputArray disparity,
- OutputArray _3dImage, InputArray Q,
- bool handleMissingValues=false,
- int ddepth=-1 );
-
-CV_EXPORTS_W int estimateAffine3D(InputArray src, InputArray dst,
- OutputArray out, OutputArray inliers,
- double ransacThreshold=3, double confidence=0.99);
-
-namespace fisheye
-{
- enum{
- CALIB_USE_INTRINSIC_GUESS = 1,
- CALIB_RECOMPUTE_EXTRINSIC = 2,
- CALIB_CHECK_COND = 4,
- CALIB_FIX_SKEW = 8,
- CALIB_FIX_K1 = 16,
- CALIB_FIX_K2 = 32,
- CALIB_FIX_K3 = 64,
- CALIB_FIX_K4 = 128,
- CALIB_FIX_INTRINSIC = 256
- };
-
- //! projects 3D points using fisheye model
- CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine,
- InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());
-
- //! projects points using fisheye model
- CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec,
- InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());
-
- //! distorts 2D points using fisheye model
- CV_EXPORTS void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0);
-
- //! undistorts 2D points using fisheye model
- CV_EXPORTS void undistortPoints(InputArray distorted, OutputArray undistorted,
- InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray());
-
- //! computing undistortion and rectification maps for image transform by cv::remap()
- //! If D is empty zero distortion is used, if R or P is empty identity matrixes are used
- CV_EXPORTS void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P,
- const cv::Size& size, int m1type, OutputArray map1, OutputArray map2);
-
- //! undistorts image, optionally changes resolution and camera matrix. If Knew zero identity matrix is used
- CV_EXPORTS void undistortImage(InputArray distorted, OutputArray undistorted,
- InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size());
-
- //! estimates new camera matrix for undistortion or rectification
- CV_EXPORTS void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R,
- OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0);
-
- //! performs camera calibaration
- CV_EXPORTS double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size,
- InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0,
- TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));
-
- //! stereo rectification estimation
- CV_EXPORTS void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec,
- OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(),
- double balance = 0.0, double fov_scale = 1.0);
-
- //! performs stereo calibaration
- CV_EXPORTS double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,
- InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize,
- OutputArray R, OutputArray T, int flags = CALIB_FIX_INTRINSIC,
- TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));
-
-}
-
-}
-
-#endif
-#endif
+#include "opencv2/calib3d.hpp"
diff --git a/HuaGoCorrect/pub/opencv/include/opencv2/core/affine.hpp b/HuaGoCorrect/pub/opencv/include/opencv2/core/affine.hpp
index 827d044..7e2ed30 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv2/core/affine.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv2/core/affine.hpp
@@ -41,15 +41,87 @@
//
//M*/
-#ifndef __OPENCV_CORE_AFFINE3_HPP__
-#define __OPENCV_CORE_AFFINE3_HPP__
+#ifndef OPENCV_CORE_AFFINE3_HPP
+#define OPENCV_CORE_AFFINE3_HPP
#ifdef __cplusplus
-#include
+#include
namespace cv
{
+
+//! @addtogroup core
+//! @{
+
+ /** @brief Affine transform
+ *
+ * It represents a 4x4 homogeneous transformation matrix \f$T\f$
+ *
+ * \f[T =
+ * \begin{bmatrix}
+ * R & t\\
+ * 0 & 1\\
+ * \end{bmatrix}
+ * \f]
+ *
+ * where \f$R\f$ is a 3x3 rotation matrix and \f$t\f$ is a 3x1 translation vector.
+ *
+ * You can specify \f$R\f$ either by a 3x3 rotation matrix or by a 3x1 rotation vector,
+ * which is converted to a 3x3 rotation matrix by the Rodrigues formula.
+ *
+ * To construct a matrix \f$T\f$ representing first rotation around the axis \f$r\f$ with rotation
+ * angle \f$|r|\f$ in radian (right hand rule) and then translation by the vector \f$t\f$, you can use
+ *
+ * @code
+ * cv::Vec3f r, t;
+ * cv::Affine3f T(r, t);
+ * @endcode
+ *
+ * If you already have the rotation matrix \f$R\f$, then you can use
+ *
+ * @code
+ * cv::Matx33f R;
+ * cv::Affine3f T(R, t);
+ * @endcode
+ *
+ * To extract the rotation matrix \f$R\f$ from \f$T\f$, use
+ *
+ * @code
+ * cv::Matx33f R = T.rotation();
+ * @endcode
+ *
+ * To extract the translation vector \f$t\f$ from \f$T\f$, use
+ *
+ * @code
+ * cv::Vec3f t = T.translation();
+ * @endcode
+ *
+ * To extract the rotation vector \f$r\f$ from \f$T\f$, use
+ *
+ * @code
+ * cv::Vec3f r = T.rvec();
+ * @endcode
+ *
+ * Note that since the mapping from rotation vectors to rotation matrices
+ * is many to one. The returned rotation vector is not necessarily the one
+ * you used before to set the matrix.
+ *
+ * If you have two transformations \f$T = T_1 * T_2\f$, use
+ *
+ * @code
+ * cv::Affine3f T, T1, T2;
+ * T = T2.concatenate(T1);
+ * @endcode
+ *
+ * To get the inverse transform of \f$T\f$, use
+ *
+ * @code
+ * cv::Affine3f T, T_inv;
+ * T_inv = T.inv();
+ * @endcode
+ *
+ */
template
class Affine3
{
@@ -59,56 +131,139 @@ namespace cv
typedef Matx Mat4;
typedef Vec Vec3;
+ //! Default constructor. It represents a 4x4 identity matrix.
Affine3();
- //Augmented affine matrix
+ //! Augmented affine matrix
Affine3(const Mat4& affine);
- //Rotation matrix
+ /**
+ * The resulting 4x4 matrix is
+ *
+ * \f[
+ * \begin{bmatrix}
+ * R & t\\
+ * 0 & 1\\
+ * \end{bmatrix}
+ * \f]
+ *
+ * @param R 3x3 rotation matrix.
+ * @param t 3x1 translation vector.
+ */
Affine3(const Mat3& R, const Vec3& t = Vec3::all(0));
- //Rodrigues vector
+ /**
+ * Rodrigues vector.
+ *
+ * The last row of the current matrix is set to [0,0,0,1].
+ *
+ * @param rvec 3x1 rotation vector. Its direction indicates the rotation axis and its length
+ * indicates the rotation angle in radian (using right hand rule).
+ * @param t 3x1 translation vector.
+ */
Affine3(const Vec3& rvec, const Vec3& t = Vec3::all(0));
- //Combines all contructors above. Supports 4x4, 4x3, 3x3, 1x3, 3x1 sizes of data matrix
+ /**
+ * Combines all constructors above. Supports 4x4, 3x4, 3x3, 1x3, 3x1 sizes of data matrix.
+ *
+ * The last row of the current matrix is set to [0,0,0,1] when data is not 4x4.
+ *
+ * @param data 1-channel matrix.
+ * when it is 4x4, it is copied to the current matrix and t is not used.
+ * When it is 3x4, it is copied to the upper part 3x4 of the current matrix and t is not used.
+ * When it is 3x3, it is copied to the upper left 3x3 part of the current matrix.
+ * When it is 3x1 or 1x3, it is treated as a rotation vector and the Rodrigues formula is used
+ * to compute a 3x3 rotation matrix.
+ * @param t 3x1 translation vector. It is used only when data is neither 4x4 nor 3x4.
+ */
explicit Affine3(const Mat& data, const Vec3& t = Vec3::all(0));
- //From 16th element array
+ //! From 16-element array
explicit Affine3(const float_type* vals);
+ //! Create an 4x4 identity transform
static Affine3 Identity();
- //Rotation matrix
+ /**
+ * Rotation matrix.
+ *
+ * Copy the rotation matrix to the upper left 3x3 part of the current matrix.
+ * The remaining elements of the current matrix are not changed.
+ *
+ * @param R 3x3 rotation matrix.
+ *
+ */
void rotation(const Mat3& R);
- //Rodrigues vector
+ /**
+ * Rodrigues vector.
+ *
+ * It sets the upper left 3x3 part of the matrix. The remaining part is unaffected.
+ *
+ * @param rvec 3x1 rotation vector. The direction indicates the rotation axis and
+ * its length indicates the rotation angle in radian (using the right thumb convention).
+ */
void rotation(const Vec3& rvec);
- //Combines rotation methods above. Suports 3x3, 1x3, 3x1 sizes of data matrix;
+ /**
+ * Combines rotation methods above. Supports 3x3, 1x3, 3x1 sizes of data matrix.
+ *
+ * It sets the upper left 3x3 part of the matrix. The remaining part is unaffected.
+ *
+ * @param data 1-channel matrix.
+ * When it is a 3x3 matrix, it sets the upper left 3x3 part of the current matrix.
+ * When it is a 1x3 or 3x1 matrix, it is used as a rotation vector. The Rodrigues formula
+ * is used to compute the rotation matrix and sets the upper left 3x3 part of the current matrix.
+ */
void rotation(const Mat& data);
+ /**
+ * Copy the 3x3 matrix L to the upper left part of the current matrix
+ *
+ * It sets the upper left 3x3 part of the matrix. The remaining part is unaffected.
+ *
+ * @param L 3x3 matrix.
+ */
void linear(const Mat3& L);
+
+ /**
+ * Copy t to the first three elements of the last column of the current matrix
+ *
+ * It sets the upper right 3x1 part of the matrix. The remaining part is unaffected.
+ *
+ * @param t 3x1 translation vector.
+ */
void translation(const Vec3& t);
+ //! @return the upper left 3x3 part
Mat3 rotation() const;
+
+ //! @return the upper left 3x3 part
Mat3 linear() const;
+
+ //! @return the upper right 3x1 part
Vec3 translation() const;
- //Rodrigues vector
+ //! Rodrigues vector.
+ //! @return a vector representing the upper left 3x3 rotation matrix of the current matrix.
+ //! @warning Since the mapping between rotation vectors and rotation matrices is many to one,
+ //! this function returns only one rotation vector that represents the current rotation matrix,
+ //! which is not necessarily the same one set by `rotation(const Vec3& rvec)`.
Vec3 rvec() const;
+ //! @return the inverse of the current matrix.
Affine3 inv(int method = cv::DECOMP_SVD) const;
- // a.rotate(R) is equivalent to Affine(R, 0) * a;
+ //! a.rotate(R) is equivalent to Affine(R, 0) * a;
Affine3 rotate(const Mat3& R) const;
- // a.rotate(R) is equivalent to Affine(rvec, 0) * a;
+ //! a.rotate(rvec) is equivalent to Affine(rvec, 0) * a;
Affine3 rotate(const Vec3& rvec) const;
- // a.translate(t) is equivalent to Affine(E, t) * a;
+ //! a.translate(t) is equivalent to Affine(E, t) * a, where E is an identity matrix
Affine3 translate(const Vec3& t) const;
- // a.concatenate(affine) is equivalent to affine * a;
+ //! a.concatenate(affine) is equivalent to affine * a;
Affine3 concatenate(const Affine3& affine) const;
template operator Affine3() const;
@@ -128,6 +283,7 @@ namespace cv
template static
Affine3 operator*(const Affine3& affine1, const Affine3& affine2);
+ //! V is a 3-element vector with member fields x, y and z
template static
V operator*(const Affine3& affine, const V& vector);
@@ -145,19 +301,32 @@ namespace cv
typedef _Tp channel_type;
enum { generic_type = 0,
- depth = DataType::depth,
channels = 16,
- fmt = DataType::fmt + ((channels - 1) << 8),
- type = CV_MAKETYPE(depth, channels)
+ fmt = traits::SafeFmt::fmt + ((channels - 1) << 8)
+#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
+ ,depth = DataType::depth
+ ,type = CV_MAKETYPE(depth, channels)
+#endif
};
typedef Vec vec_type;
};
+
+ namespace traits {
+ template
+ struct Depth< Affine3<_Tp> > { enum { value = Depth<_Tp>::value }; };
+ template
+ struct Type< Affine3<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 16) }; };
+ } // namespace
+
+//! @} core
+
}
+//! @cond IGNORED
///////////////////////////////////////////////////////////////////////////////////
-/// Implementaiton
+// Implementation
template inline
cv::Affine3::Affine3()
@@ -190,7 +359,8 @@ cv::Affine3::Affine3(const Vec3& _rvec, const Vec3& t)
template inline
cv::Affine3::Affine3(const cv::Mat& data, const Vec3& t)
{
- CV_Assert(data.type() == cv::DataType::type);
+ CV_Assert(data.type() == cv::traits::Type::value);
+ CV_Assert(data.channels() == 1);
if (data.cols == 4 && data.rows == 4)
{
@@ -201,11 +371,13 @@ cv::Affine3::Affine3(const cv::Mat& data, const Vec3& t)
{
rotation(data(Rect(0, 0, 3, 3)));
translation(data(Rect(3, 0, 1, 3)));
- return;
+ }
+ else
+ {
+ rotation(data);
+ translation(t);
}
- rotation(data);
- translation(t);
matrix.val[12] = matrix.val[13] = matrix.val[14] = 0;
matrix.val[15] = 1;
}
@@ -229,40 +401,36 @@ void cv::Affine3::rotation(const Mat3& R)
template inline
void cv::Affine3::rotation(const Vec3& _rvec)
{
- double rx = _rvec[0], ry = _rvec[1], rz = _rvec[2];
- double theta = std::sqrt(rx*rx + ry*ry + rz*rz);
+ double theta = norm(_rvec);
if (theta < DBL_EPSILON)
rotation(Mat3::eye());
else
{
- const double I[] = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
-
double c = std::cos(theta);
double s = std::sin(theta);
double c1 = 1. - c;
- double itheta = theta ? 1./theta : 0.;
+ double itheta = (theta != 0) ? 1./theta : 0.;
- rx *= itheta; ry *= itheta; rz *= itheta;
+ Point3_ r = _rvec*itheta;
- double rrt[] = { rx*rx, rx*ry, rx*rz, rx*ry, ry*ry, ry*rz, rx*rz, ry*rz, rz*rz };
- double _r_x_[] = { 0, -rz, ry, rz, 0, -rx, -ry, rx, 0 };
- Mat3 R;
+ Mat3 rrt( r.x*r.x, r.x*r.y, r.x*r.z, r.x*r.y, r.y*r.y, r.y*r.z, r.x*r.z, r.y*r.z, r.z*r.z );
+ Mat3 r_x( 0, -r.z, r.y, r.z, 0, -r.x, -r.y, r.x, 0 );
// R = cos(theta)*I + (1 - cos(theta))*r*rT + sin(theta)*[r_x]
// where [r_x] is [0 -rz ry; rz 0 -rx; -ry rx 0]
- for(int k = 0; k < 9; ++k)
- R.val[k] = static_cast(c*I[k] + c1*rrt[k] + s*_r_x_[k]);
+ Mat3 R = c*Mat3::eye() + c1*rrt + s*r_x;
rotation(R);
}
}
-//Combines rotation methods above. Suports 3x3, 1x3, 3x1 sizes of data matrix;
+//Combines rotation methods above. Supports 3x3, 1x3, 3x1 sizes of data matrix;
template inline
void cv::Affine3::rotation(const cv::Mat& data)
{
- CV_Assert(data.type() == cv::DataType::type);
+ CV_Assert(data.type() == cv::traits::Type::value);
+ CV_Assert(data.channels() == 1);
if (data.cols == 3 && data.rows == 3)
{
@@ -277,7 +445,7 @@ void cv::Affine3::rotation(const cv::Mat& data)
rotation(_rvec);
}
else
- CV_Assert(!"Input marix can be 3x3, 1x3 or 3x1");
+ CV_Error(Error::StsError, "Input matrix can only be 3x3, 1x3 or 3x1");
}
template inline
@@ -476,21 +644,21 @@ cv::Vec3d cv::operator*(const cv::Affine3d& affine, const cv::Vec3d& v)
template inline
cv::Affine3::Affine3(const Eigen::Transform& affine)
{
- cv::Mat(4, 4, cv::DataType::type, affine.matrix().data()).copyTo(matrix);
+ cv::Mat(4, 4, cv::traits::Type::value, affine.matrix().data()).copyTo(matrix);
}
template inline
cv::Affine3::Affine3(const Eigen::Transform& affine)
{
Eigen::Transform a = affine;
- cv::Mat(4, 4, cv::DataType::type, a.matrix().data()).copyTo(matrix);
+ cv::Mat(4, 4, cv::traits::Type::value, a.matrix().data()).copyTo(matrix);
}
template inline
cv::Affine3::operator Eigen::Transform() const
{
Eigen::Transform r;
- cv::Mat hdr(4, 4, cv::DataType::type, r.matrix().data());
+ cv::Mat hdr(4, 4, cv::traits::Type::value, r.matrix().data());
cv::Mat(matrix, false).copyTo(hdr);
return r;
}
@@ -503,7 +671,8 @@ cv::Affine3::operator Eigen::Transform() const
#endif /* defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H */
+//! @endcond
#endif /* __cplusplus */
-#endif /* __OPENCV_CORE_AFFINE3_HPP__ */
+#endif /* OPENCV_CORE_AFFINE3_HPP */
diff --git a/HuaGoCorrect/pub/opencv/include/opencv2/core/core.hpp b/HuaGoCorrect/pub/opencv/include/opencv2/core/core.hpp
index a0a7392..4389183 100644
--- a/HuaGoCorrect/pub/opencv/include/opencv2/core/core.hpp
+++ b/HuaGoCorrect/pub/opencv/include/opencv2/core/core.hpp
@@ -1,6 +1,3 @@
-/*! \file core.hpp
- \brief The Core Functionality
- */
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
@@ -10,11 +7,12 @@
// copy or use the software.
//
//
-// License Agreement
+// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
-// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
+// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
+// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
@@ -43,4821 +41,8 @@
//
//M*/
-#ifndef __OPENCV_CORE_HPP__
-#define __OPENCV_CORE_HPP__
-
-#include "opencv2/core/types_c.h"
-#include "opencv2/core/version.hpp"
-
-#ifdef __cplusplus
-
-#ifndef SKIP_INCLUDES
-#include
-#include
-#include
-#include
-#include
-#include