RTAB-Map 0.24.5
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
stereoRectifyFisheye.h
1/*
2Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5This code is the same has cv::stereoRectify() but accepting fisheye distortion model:
6All cvUndistortPoints() have been replaced by cv::fisheye::undistortPoints()
7See https://github.com/opencv/opencv/blob/master/modules/calib3d/src/calibration.cpp
8
9Redistribution and use in source and binary forms, with or without
10modification, are permitted provided that the following conditions are met:
11 * Redistributions of source code must retain the above copyright
12 notice, this list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16 * Neither the name of the Universite de Sherbrooke nor the
17 names of its contributors may be used to endorse or promote products
18 derived from this software without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
24DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30*/
31
32#ifndef CORELIB_SRC_OPENCV_STEREORECTIFYFISHEYE_H_
33#define CORELIB_SRC_OPENCV_STEREORECTIFYFISHEYE_H_
34
35#include <rtabmap/core/rtabmap_core_export.h>
36#include <opencv2/core/core.hpp>
37
38// stereoRectifyFisheye() relies on the OpenCV C API, which was removed in
39// OpenCV 5 (use cv::fisheye::stereoRectify() instead). It also requires the
40// fisheye module, added in OpenCV 2.4.10.
41#if (CV_MAJOR_VERSION > 2 && CV_MAJOR_VERSION < 5) || \
42 (CV_MAJOR_VERSION == 2 && (CV_MINOR_VERSION > 4 || (CV_MINOR_VERSION == 4 && CV_SUBMINOR_VERSION >= 10)))
43#define RTABMAP_HAS_STEREO_RECTIFY_FISHEYE 1
44#else
45#define RTABMAP_HAS_STEREO_RECTIFY_FISHEYE 0
46#endif
47
48#if RTABMAP_HAS_STEREO_RECTIFY_FISHEYE
49
50namespace rtabmap
51{
52
57void RTABMAP_CORE_EXPORT stereoRectifyFisheye(
58 cv::InputArray cameraMatrix1, cv::InputArray distCoeffs1,
59 cv::InputArray cameraMatrix2, cv::InputArray distCoeffs2,
60 cv::Size imageSize, cv::InputArray R, cv::InputArray T,
61 cv::OutputArray R1, cv::OutputArray R2,
62 cv::OutputArray P1, cv::OutputArray P2,
63 cv::OutputArray Q, int flags,
64 double alpha, cv::Size newImageSize);
65
66}
67
68#endif // RTABMAP_HAS_STEREO_RECTIFY_FISHEYE
69
70#endif /* CORELIB_SRC_OPENCV_STEREORECTIFYFISHEYE_H_ */