|
45 | 45 |
|
46 | 46 | #include "opencv2/core/core.hpp"
|
47 | 47 | #include "opencv2/features2d/features2d.hpp"
|
| 48 | +#include "opencv2/core/affine.hpp" |
48 | 49 |
|
49 | 50 | #ifdef __cplusplus
|
50 | 51 | extern "C" {
|
@@ -744,8 +745,67 @@ CV_EXPORTS_W int estimateAffine3D(InputArray src, InputArray dst,
|
744 | 745 | OutputArray out, OutputArray inliers,
|
745 | 746 | double ransacThreshold=3, double confidence=0.99);
|
746 | 747 |
|
| 748 | +namespace fisheye |
| 749 | +{ |
| 750 | + enum{ |
| 751 | + CALIB_USE_INTRINSIC_GUESS = 1, |
| 752 | + CALIB_RECOMPUTE_EXTRINSIC = 2, |
| 753 | + CALIB_CHECK_COND = 4, |
| 754 | + CALIB_FIX_SKEW = 8, |
| 755 | + CALIB_FIX_K1 = 16, |
| 756 | + CALIB_FIX_K2 = 32, |
| 757 | + CALIB_FIX_K3 = 64, |
| 758 | + CALIB_FIX_K4 = 128, |
| 759 | + CALIB_FIX_INTRINSIC = 256 |
| 760 | + }; |
| 761 | + |
| 762 | + //! projects 3D points using fisheye model |
| 763 | + CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine, |
| 764 | + InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray()); |
| 765 | + |
| 766 | + //! projects points using fisheye model |
| 767 | + CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, |
| 768 | + InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray()); |
| 769 | + |
| 770 | + //! distorts 2D points using fisheye model |
| 771 | + CV_EXPORTS void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0); |
| 772 | + |
| 773 | + //! undistorts 2D points using fisheye model |
| 774 | + CV_EXPORTS void undistortPoints(InputArray distorted, OutputArray undistorted, |
| 775 | + InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray()); |
| 776 | + |
| 777 | + //! computing undistortion and rectification maps for image transform by cv::remap() |
| 778 | + //! If D is empty zero distortion is used, if R or P is empty identity matrixes are used |
| 779 | + CV_EXPORTS void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P, |
| 780 | + const cv::Size& size, int m1type, OutputArray map1, OutputArray map2); |
| 781 | + |
| 782 | + //! undistorts image, optionally changes resolution and camera matrix. If Knew zero identity matrix is used |
| 783 | + CV_EXPORTS void undistortImage(InputArray distorted, OutputArray undistorted, |
| 784 | + InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size()); |
| 785 | + |
| 786 | + //! estimates new camera matrix for undistortion or rectification |
| 787 | + CV_EXPORTS void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R, |
| 788 | + OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0); |
| 789 | + |
| 790 | + //! performs camera calibaration |
| 791 | + CV_EXPORTS double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size, |
| 792 | + InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0, |
| 793 | + TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)); |
| 794 | + |
| 795 | + //! stereo rectification estimation |
| 796 | + CV_EXPORTS void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec, |
| 797 | + OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(), |
| 798 | + double balance = 0.0, double fov_scale = 1.0); |
| 799 | + |
| 800 | + //! performs stereo calibaration |
| 801 | + CV_EXPORTS double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, |
| 802 | + InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, |
| 803 | + OutputArray R, OutputArray T, int flags = CALIB_FIX_INTRINSIC, |
| 804 | + TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)); |
| 805 | + |
747 | 806 | }
|
748 | 807 |
|
749 |
| -#endif |
| 808 | +} |
750 | 809 |
|
751 | 810 | #endif
|
| 811 | +#endif |
0 commit comments