mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-03 16:47:47 +08:00
OpenCV 5 support
This commit is contained in:
+6
-1
@@ -241,7 +241,12 @@ option(BUILD_WITH_RPATH_NOT_RUNPATH "Explicitly disable usage of RUNPATH for the
|
||||
set(RTABMAP_QT_VERSION AUTO CACHE STRING "Force a specific Qt version.")
|
||||
set_property(CACHE RTABMAP_QT_VERSION PROPERTY STRINGS AUTO 4 5 6)
|
||||
|
||||
FIND_PACKAGE(OpenCV REQUIRED QUIET COMPONENTS core calib3d imgproc highgui stitching photo video videoio OPTIONAL_COMPONENTS aruco objdetect xfeatures2d nonfree gpu cudafeatures2d cudaoptflow cudaimgproc)
|
||||
# Try OpenCV 5 first (calib3d was split into "calib" + "geometry" modules in OpenCV 5)
|
||||
FIND_PACKAGE(OpenCV 5 QUIET COMPONENTS core calib imgproc highgui stitching photo video videoio geometry OPTIONAL_COMPONENTS aruco objdetect xfeatures2d nonfree gpu cudafeatures2d cudaoptflow cudaimgproc)
|
||||
IF(NOT OpenCV_FOUND)
|
||||
# Fall back to OpenCV < 5 (calib3d module)
|
||||
FIND_PACKAGE(OpenCV REQUIRED QUIET COMPONENTS core calib3d imgproc highgui stitching photo video videoio OPTIONAL_COMPONENTS aruco objdetect xfeatures2d nonfree gpu cudafeatures2d cudaoptflow cudaimgproc)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_QT)
|
||||
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
|
||||
|
||||
@@ -30,7 +30,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||
#include "rtabmap/core/DBDriver.h"
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
|
||||
typedef struct sqlite3_stmt sqlite3_stmt;
|
||||
typedef struct sqlite3 sqlite3;
|
||||
|
||||
@@ -31,7 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/core/Parameters.h"
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <pcl/point_cloud.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <list>
|
||||
|
||||
@@ -32,7 +32,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <list>
|
||||
#include <numeric>
|
||||
#include "rtabmap/core/Parameters.h"
|
||||
@@ -70,6 +74,10 @@ class BriefDescriptorExtractor;
|
||||
class SIFT;
|
||||
#endif
|
||||
class SURF;
|
||||
#if (CV_MAJOR_VERSION == 5)
|
||||
class BRISK;
|
||||
class KAZE;
|
||||
#endif
|
||||
}
|
||||
namespace cuda {
|
||||
class FastFeatureDetector;
|
||||
@@ -89,7 +97,13 @@ typedef cv::xfeatures2d::FREAK CV_FREAK;
|
||||
typedef cv::xfeatures2d::DAISY CV_DAISY;
|
||||
typedef cv::GFTTDetector CV_GFTT;
|
||||
typedef cv::xfeatures2d::BriefDescriptorExtractor CV_BRIEF;
|
||||
#if (CV_MAJOR_VERSION < 5)
|
||||
typedef cv::BRISK CV_BRISK;
|
||||
typedef cv::KAZE CV_KAZE;
|
||||
#else
|
||||
typedef cv::xfeatures2d::BRISK CV_BRISK;
|
||||
typedef cv::xfeatures2d::KAZE CV_KAZE;
|
||||
#endif
|
||||
typedef cv::ORB CV_ORB;
|
||||
typedef cv::cuda::SURF_CUDA CV_SURF_GPU;
|
||||
typedef cv::cuda::ORB CV_ORB_GPU;
|
||||
@@ -578,7 +592,7 @@ private:
|
||||
int diffusivity_;
|
||||
|
||||
#if CV_MAJOR_VERSION > 2
|
||||
cv::Ptr<cv::KAZE> kaze_;
|
||||
cv::Ptr<CV_KAZE> kaze_;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -41,7 +41,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <set>
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <pcl/pcl_config.h>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -34,7 +34,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/core/RegistrationInfo.h"
|
||||
#include "rtabmap/core/CameraModel.h"
|
||||
#include "rtabmap/core/LaserScan.h"
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
|
||||
@@ -34,7 +34,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/StereoCameraModel.h>
|
||||
#include <rtabmap/core/Transform.h>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <rtabmap/core/LaserScan.h>
|
||||
#include <rtabmap/core/IMU.h>
|
||||
#include <rtabmap/core/GPS.h>
|
||||
|
||||
@@ -31,7 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <pcl/point_types.h>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <map>
|
||||
#include <list>
|
||||
@@ -62,7 +66,7 @@ public:
|
||||
virtual ~Signature();
|
||||
|
||||
/**
|
||||
* Must return a value between >=0 and <=1 (1 means 100% similarity).
|
||||
* Must return a value between >=0 and <=1 (1 means 100% similarity).
|
||||
*/
|
||||
float compareTo(const Signature & signature) const;
|
||||
bool isBadSignature() const;
|
||||
|
||||
@@ -31,7 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
@@ -31,7 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include "rtabmap/core/Parameters.h"
|
||||
|
||||
@@ -32,7 +32,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <pcl/point_cloud.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <opencv2/core/version.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
@@ -30,7 +30,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <rtabmap/core/rtabmap_core_export.h>
|
||||
|
||||
#include <opencv2/core/version.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/calib.hpp>
|
||||
#endif
|
||||
#include <rtabmap/core/Transform.h>
|
||||
#include <rtabmap/core/CameraModel.h>
|
||||
#include <rtabmap/core/StereoCameraModel.h>
|
||||
|
||||
@@ -33,8 +33,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UMath.h"
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core/core_c.h>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include <iostream>
|
||||
|
||||
namespace rtabmap
|
||||
|
||||
+29
-11
@@ -36,7 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UMath.h"
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include <opencv2/imgproc/imgproc_c.h>
|
||||
#include <opencv2/core/version.hpp>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
|
||||
@@ -865,7 +864,7 @@ std::vector<cv::KeyPoint> Feature2D::generateKeypoints(const cv::Mat & image, co
|
||||
cv::cornerSubPix( image, corners,
|
||||
cv::Size( _subPixWinSize, _subPixWinSize ),
|
||||
cv::Size( -1, -1 ),
|
||||
cv::TermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, _subPixIterations, _subPixEps ) );
|
||||
cv::TermCriteria( cv::TermCriteria::MAX_ITER | cv::TermCriteria::EPS, _subPixIterations, _subPixEps ) );
|
||||
|
||||
for(unsigned int i=0;i<corners.size(); ++i)
|
||||
{
|
||||
@@ -2377,8 +2376,13 @@ void BRISK::parseParameters(const ParametersMap & parameters)
|
||||
Parameters::parse(parameters, Parameters::kBRISKThresh(), thresh_);
|
||||
Parameters::parse(parameters, Parameters::kBRISKOctaves(), octaves_);
|
||||
Parameters::parse(parameters, Parameters::kBRISKPatternScale(), patternScale_);
|
||||
|
||||
#if CV_MAJOR_VERSION < 3
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#ifdef HAVE_OPENCV_XFEATURES2D
|
||||
brisk_ = CV_BRISK::create(thresh_, octaves_, patternScale_);
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with OpenCV xfeatures2d module so BRISK cannot be used!");
|
||||
#endif
|
||||
#elif CV_MAJOR_VERSION < 3
|
||||
brisk_ = cv::Ptr<CV_BRISK>(new CV_BRISK(thresh_, octaves_, patternScale_));
|
||||
#else
|
||||
brisk_ = CV_BRISK::create(thresh_, octaves_, patternScale_);
|
||||
@@ -2389,6 +2393,7 @@ std::vector<cv::KeyPoint> BRISK::generateKeypointsImpl(const cv::Mat & image, co
|
||||
{
|
||||
UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
#if CV_MAJOR_VERSION < 5 || (CV_MAJOR_VERSION > 4 && defined(HAVE_OPENCV_XFEATURES2D))
|
||||
cv::Mat imgRoi(image, roi);
|
||||
cv::Mat maskRoi;
|
||||
if(!mask.empty())
|
||||
@@ -2396,6 +2401,9 @@ std::vector<cv::KeyPoint> BRISK::generateKeypointsImpl(const cv::Mat & image, co
|
||||
maskRoi = cv::Mat(mask, roi);
|
||||
}
|
||||
brisk_->detect(imgRoi, keypoints, maskRoi); // Opencv keypoints
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with BRISK feature support!");
|
||||
#endif
|
||||
return keypoints;
|
||||
}
|
||||
|
||||
@@ -2403,7 +2411,11 @@ cv::Mat BRISK::generateDescriptorsImpl(const cv::Mat & image, std::vector<cv::Ke
|
||||
{
|
||||
UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
|
||||
cv::Mat descriptors;
|
||||
#if CV_MAJOR_VERSION < 5 || (CV_MAJOR_VERSION > 4 && defined(HAVE_OPENCV_XFEATURES2D))
|
||||
brisk_->compute(image, keypoints, descriptors);
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with BRISK feature support!");
|
||||
#endif
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
@@ -2436,10 +2448,16 @@ void KAZE::parseParameters(const ParametersMap & parameters)
|
||||
Parameters::parse(parameters, Parameters::kKAZENOctaveLayers(), nOctaveLayers_);
|
||||
Parameters::parse(parameters, Parameters::kKAZEDiffusivity(), diffusivity_);
|
||||
|
||||
#if CV_MAJOR_VERSION > 3
|
||||
kaze_ = cv::KAZE::create(extended_, upright_, threshold_, nOctaves_, nOctaveLayers_, (cv::KAZE::DiffusivityType)diffusivity_);
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#ifdef HAVE_OPENCV_XFEATURES2D
|
||||
kaze_ = CV_KAZE::create(extended_, upright_, threshold_, nOctaves_, nOctaveLayers_, (CV_KAZE::DiffusivityType)diffusivity_);
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with OpenCV xfeatures2d module so KAZE cannot be used!");
|
||||
#endif
|
||||
#elif CV_MAJOR_VERSION > 3
|
||||
kaze_ = CV_KAZE::create(extended_, upright_, threshold_, nOctaves_, nOctaveLayers_, (CV_KAZE::DiffusivityType)diffusivity_);
|
||||
#elif CV_MAJOR_VERSION > 2
|
||||
kaze_ = cv::KAZE::create(extended_, upright_, threshold_, nOctaves_, nOctaveLayers_, diffusivity_);
|
||||
kaze_ = CV_KAZE::create(extended_, upright_, threshold_, nOctaves_, nOctaveLayers_, diffusivity_);
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with OpenCV3 so Kaze feature cannot be used!");
|
||||
#endif
|
||||
@@ -2449,7 +2467,7 @@ std::vector<cv::KeyPoint> KAZE::generateKeypointsImpl(const cv::Mat & image, con
|
||||
{
|
||||
UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
#if CV_MAJOR_VERSION > 2
|
||||
#if (CV_MAJOR_VERSION > 2 && CV_MAJOR_VERSION < 5) || (CV_MAJOR_VERSION > 4 && defined(HAVE_OPENCV_XFEATURES2D))
|
||||
cv::Mat imgRoi(image, roi);
|
||||
cv::Mat maskRoi;
|
||||
if (!mask.empty())
|
||||
@@ -2458,7 +2476,7 @@ std::vector<cv::KeyPoint> KAZE::generateKeypointsImpl(const cv::Mat & image, con
|
||||
}
|
||||
kaze_->detect(imgRoi, keypoints, maskRoi); // Opencv keypoints
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with OpenCV3 so Kaze feature cannot be used!");
|
||||
UWARN("RTAB-Map is not built with Kaze feature support!");
|
||||
#endif
|
||||
return keypoints;
|
||||
}
|
||||
@@ -2467,10 +2485,10 @@ cv::Mat KAZE::generateDescriptorsImpl(const cv::Mat & image, std::vector<cv::Key
|
||||
{
|
||||
UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
|
||||
cv::Mat descriptors;
|
||||
#if CV_MAJOR_VERSION > 2
|
||||
#if (CV_MAJOR_VERSION > 2 && CV_MAJOR_VERSION < 5) || (CV_MAJOR_VERSION > 4 && defined(HAVE_OPENCV_XFEATURES2D))
|
||||
kaze_->compute(image, keypoints, descriptors);
|
||||
#else
|
||||
UWARN("RTAB-Map is not built with OpenCV3 so Kaze feature cannot be used!");
|
||||
UWARN("RTAB-Map is not built with Kaze feature support!");
|
||||
#endif
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/ULogger.h>
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV_ARUCO
|
||||
#if CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <8)
|
||||
namespace cv{
|
||||
|
||||
@@ -62,8 +62,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/common/common.h>
|
||||
#include <rtabmap/core/MarkerDetector.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <rtabmap/core/LocalGridMaker.h>
|
||||
#if CV_MAJOR_VERSION >=5
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -5373,7 +5375,7 @@ Signature * Memory::createSignature(const SensorData & inputData, const Transfor
|
||||
cv::Mat imageMono;
|
||||
if(decimatedData.imageRaw().channels() == 3)
|
||||
{
|
||||
cv::cvtColor(decimatedData.imageRaw(), imageMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(decimatedData.imageRaw(), imageMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5681,7 +5683,7 @@ Signature * Memory::createSignature(const SensorData & inputData, const Transfor
|
||||
cv::Mat imageMono;
|
||||
if(data.imageRaw().channels() == 3)
|
||||
{
|
||||
cv::cvtColor(data.imageRaw(), imageMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), imageMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -43,7 +43,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UMath.h>
|
||||
#include <opencv2/core/core_c.h>
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENCV_XFEATURES2D) && (CV_MAJOR_VERSION > 3 || (CV_MAJOR_VERSION==3 && CV_MINOR_VERSION >=4 && CV_SUBMINOR_VERSION >= 1))
|
||||
#include <opencv2/xfeatures2d.hpp> // For GMS matcher
|
||||
@@ -2172,7 +2174,7 @@ Transform RegistrationVis::computeTransformationImpl(
|
||||
if(!transform.isNull() && !pcaData.empty())
|
||||
{
|
||||
cv::Mat pcaEigenVectors, pcaEigenValues;
|
||||
cv::PCA pca_analysis(pcaData, cv::Mat(), CV_PCA_DATA_AS_ROW);
|
||||
cv::PCA pca_analysis(pcaData, cv::Mat(), cv::PCA::DATA_AS_ROW);
|
||||
// We take the second eigen value
|
||||
info.inliersDistribution = pca_analysis.eigenvalues.at<float>(0, 1);
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/core/IMUFilter.h"
|
||||
#include "rtabmap/core/Features2d.h"
|
||||
#include "rtabmap/core/clams/discrete_depth_distortion_model.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <opencv2/stitching/detail/exposure_compensate.hpp>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/ULogger.h>
|
||||
@@ -757,11 +756,11 @@ void SensorCaptureThread::postUpdate(SensorData * dataPtr, SensorCaptureInfo * i
|
||||
else if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::Mat channels[3];
|
||||
cv::cvtColor(data.imageRaw(), image, CV_BGR2YCrCb);
|
||||
cv::cvtColor(data.imageRaw(), image, cv::COLOR_BGR2YCrCb);
|
||||
cv::split(image, channels);
|
||||
cv::equalizeHist(channels[0], channels[0]);
|
||||
cv::merge(channels, 3, image);
|
||||
cv::cvtColor(image, image, CV_YCrCb2BGR);
|
||||
cv::cvtColor(image, image, cv::COLOR_YCrCb2BGR);
|
||||
}
|
||||
if(!data.depthRaw().empty())
|
||||
{
|
||||
@@ -777,11 +776,11 @@ void SensorCaptureThread::postUpdate(SensorData * dataPtr, SensorCaptureInfo * i
|
||||
else if(data.rightRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::Mat channels[3];
|
||||
cv::cvtColor(data.rightRaw(), right, CV_BGR2YCrCb);
|
||||
cv::cvtColor(data.rightRaw(), right, cv::COLOR_BGR2YCrCb);
|
||||
cv::split(right, channels);
|
||||
cv::equalizeHist(channels[0], channels[0]);
|
||||
cv::merge(channels, 3, right);
|
||||
cv::cvtColor(right, right, CV_YCrCb2BGR);
|
||||
cv::cvtColor(right, right, cv::COLOR_YCrCb2BGR);
|
||||
}
|
||||
data.setStereoImage(image, right, data.stereoCameraModels()[0]);
|
||||
}
|
||||
@@ -796,11 +795,11 @@ void SensorCaptureThread::postUpdate(SensorData * dataPtr, SensorCaptureInfo * i
|
||||
else if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::Mat channels[3];
|
||||
cv::cvtColor(data.imageRaw(), image, CV_BGR2YCrCb);
|
||||
cv::cvtColor(data.imageRaw(), image, cv::COLOR_BGR2YCrCb);
|
||||
cv::split(image, channels);
|
||||
clahe->apply(channels[0], channels[0]);
|
||||
cv::merge(channels, 3, image);
|
||||
cv::cvtColor(image, image, CV_YCrCb2BGR);
|
||||
cv::cvtColor(image, image, cv::COLOR_YCrCb2BGR);
|
||||
}
|
||||
if(!data.depthRaw().empty())
|
||||
{
|
||||
@@ -816,11 +815,11 @@ void SensorCaptureThread::postUpdate(SensorData * dataPtr, SensorCaptureInfo * i
|
||||
else if(data.rightRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::Mat channels[3];
|
||||
cv::cvtColor(data.rightRaw(), right, CV_BGR2YCrCb);
|
||||
cv::cvtColor(data.rightRaw(), right, cv::COLOR_BGR2YCrCb);
|
||||
cv::split(right, channels);
|
||||
clahe->apply(channels[0], channels[0]);
|
||||
cv::merge(channels, 3, right);
|
||||
cv::cvtColor(right, right, CV_YCrCb2BGR);
|
||||
cv::cvtColor(right, right, cv::COLOR_YCrCb2BGR);
|
||||
}
|
||||
data.setStereoImage(image, right, data.stereoCameraModels()[0]);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#if CV_MAJOR_VERSION > 2 or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10)))
|
||||
#if (CV_MAJOR_VERSION > 2 and CV_MAJOR_VERSION < 5) or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10)))
|
||||
#include <rtabmap/core/stereo/stereoRectifyFisheye.h>
|
||||
#endif
|
||||
|
||||
@@ -179,12 +179,20 @@ void StereoCameraModel::updateStereoRectification()
|
||||
{
|
||||
cv::Vec4d D_left(left_.D_raw().at<double>(0,0), left_.D_raw().at<double>(0,1), left_.D_raw().at<double>(0,4), left_.D_raw().at<double>(0,5));
|
||||
cv::Vec4d D_right(right_.D_raw().at<double>(0,0), right_.D_raw().at<double>(0,1), right_.D_raw().at<double>(0,4), right_.D_raw().at<double>(0,5));
|
||||
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
stereoRectifyFisheye(
|
||||
left_.K_raw(), D_left,
|
||||
right_.K_raw(), D_right,
|
||||
left_.imageSize(), R_, T_, R1, R2, P1, P2, Q,
|
||||
cv::CALIB_ZERO_DISPARITY, 0, left_.imageSize());
|
||||
#else
|
||||
double balance = 0.0, fov_scale = 1.0;
|
||||
cv::fisheye::stereoRectify(
|
||||
left_.K_raw(), D_left,
|
||||
right_.K_raw(), D_right,
|
||||
left_.imageSize(), R_, T_, R1, R2, P1, P2, Q,
|
||||
cv::CALIB_ZERO_DISPARITY, left_.imageSize(), balance, fov_scale);
|
||||
#endif
|
||||
|
||||
// Re-zoom to original focal distance
|
||||
if(P1.at<double>(0,0) < 0)
|
||||
|
||||
@@ -28,7 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UThread.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/core/util2d.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_FREENECT
|
||||
#include <libfreenect.h>
|
||||
@@ -183,7 +182,7 @@ private:
|
||||
|
||||
if(color_)
|
||||
{
|
||||
cv::cvtColor(rgbIrBuffer_, rgbIrLastFrame_, CV_RGB2BGR);
|
||||
cv::cvtColor(rgbIrBuffer_, rgbIrLastFrame_, cv::COLOR_RGB2BGR);
|
||||
}
|
||||
else // IrDepth
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UMath.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/core/util2d.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_FREENECT2
|
||||
#include <libfreenect2/libfreenect2.hpp>
|
||||
@@ -430,11 +429,11 @@ SensorData CameraFreenect2::captureImage(SensorCaptureInfo * info)
|
||||
cv::Mat rgbMat; // rtabmap uses 3 channels RGB
|
||||
#ifdef LIBFREENECT2_WITH_TEGRAJPEG_SUPPORT
|
||||
|
||||
cv::cvtColor(rgbMatC4, rgbMat, CV_RGBA2BGR);
|
||||
cv::cvtColor(rgbMatC4, rgbMat, cv::COLOR_RGBA2BGR);
|
||||
|
||||
#else
|
||||
|
||||
cv::cvtColor(rgbMatC4, rgbMat, CV_BGRA2BGR);
|
||||
cv::cvtColor(rgbMatC4, rgbMat, cv::COLOR_BGRA2BGR);
|
||||
|
||||
#endif
|
||||
cv::flip(rgbMat, rgb, 1);
|
||||
@@ -490,11 +489,11 @@ SensorData CameraFreenect2::captureImage(SensorCaptureInfo * info)
|
||||
cv::Mat rgbMat; // rtabmap uses 3 channels RGB
|
||||
#ifdef LIBFREENECT2_WITH_TEGRAJPEG_SUPPORT
|
||||
|
||||
cv::cvtColor(rgbMatC4, rgbMat, CV_RGB2BGR);
|
||||
cv::cvtColor(rgbMatC4, rgbMat, cv::COLOR_RGB2BGR);
|
||||
|
||||
#else
|
||||
|
||||
cv::cvtColor(rgbMatC4, rgbMat, CV_BGRA2BGR);
|
||||
cv::cvtColor(rgbMatC4, rgbMat, cv::COLOR_BGRA2BGR);
|
||||
|
||||
#endif
|
||||
cv::flip(rgbMat, rgb, 1);
|
||||
@@ -607,11 +606,11 @@ SensorData CameraFreenect2::captureImage(SensorCaptureInfo * info)
|
||||
// rtabmap uses 3 channels RGB
|
||||
#ifdef LIBFREENECT2_WITH_TEGRAJPEG_SUPPORT
|
||||
|
||||
cv::cvtColor(rgbMatBGRA, rgb, CV_RGBA2BGR);
|
||||
cv::cvtColor(rgbMatBGRA, rgb, cv::COLOR_RGBA2BGR);
|
||||
|
||||
#else
|
||||
|
||||
cv::cvtColor(rgbMatBGRA, rgb, CV_BGRA2BGR);
|
||||
cv::cvtColor(rgbMatBGRA, rgb, cv::COLOR_BGRA2BGR);
|
||||
|
||||
#endif
|
||||
cv::flip(rgb, rgb, 1);
|
||||
@@ -629,11 +628,11 @@ SensorData CameraFreenect2::captureImage(SensorCaptureInfo * info)
|
||||
// rtabmap uses 3 channels RGB
|
||||
#ifdef LIBFREENECT2_WITH_TEGRAJPEG_SUPPORT
|
||||
|
||||
cv::cvtColor(rgbMatBGRA, rgb, CV_RGBA2BGR);
|
||||
cv::cvtColor(rgbMatBGRA, rgb, cv::COLOR_RGBA2BGR);
|
||||
|
||||
#else
|
||||
|
||||
cv::cvtColor(rgbMatBGRA, rgb, CV_BGRA2BGR);
|
||||
cv::cvtColor(rgbMatBGRA, rgb, cv::COLOR_BGRA2BGR);
|
||||
|
||||
#endif
|
||||
cv::flip(rgb, rgb, 1);
|
||||
|
||||
@@ -34,7 +34,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/util3d.h>
|
||||
#include <rtabmap/core/util3d_filtering.h>
|
||||
#include <rtabmap/core/Graph.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#else
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#endif
|
||||
#include <fstream>
|
||||
|
||||
namespace rtabmap
|
||||
@@ -1111,7 +1115,7 @@ SensorData CameraImages::captureImage(SensorCaptureInfo * info)
|
||||
{
|
||||
UWARN("Conversion from 4 channels to 3 channels (file=%s)", imageFilePath.c_str());
|
||||
cv::Mat out;
|
||||
cv::cvtColor(img, out, CV_BGRA2BGR);
|
||||
cv::cvtColor(img, out, cv::COLOR_BGRA2BGR);
|
||||
img = out;
|
||||
}
|
||||
else if(!img.empty() && _bayerMode >= 0 && _bayerMode <=3)
|
||||
@@ -1119,7 +1123,7 @@ SensorData CameraImages::captureImage(SensorCaptureInfo * info)
|
||||
cv::Mat debayeredImg;
|
||||
try
|
||||
{
|
||||
cv::cvtColor(img, debayeredImg, CV_BayerBG2BGR + _bayerMode);
|
||||
cv::cvtColor(img, debayeredImg, cv::COLOR_BayerBG2BGR + _bayerMode);
|
||||
img = debayeredImg;
|
||||
}
|
||||
catch(const cv::Exception & e)
|
||||
|
||||
@@ -29,7 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UThreadC.h>
|
||||
#include <rtabmap/core/util2d.h>
|
||||
#include <rtabmap/core/Compression.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_K4A
|
||||
#include <k4a/k4a.h>
|
||||
@@ -508,7 +507,7 @@ SensorData CameraK4A::captureImage(SensorCaptureInfo * info)
|
||||
CV_8UC4,
|
||||
(void*)k4a_image_get_buffer(rgb_image_));
|
||||
|
||||
cv::cvtColor(bgra, bgrCV, CV_BGRA2BGR);
|
||||
cv::cvtColor(bgra, bgrCV, cv::COLOR_BGRA2BGR);
|
||||
}
|
||||
bgrCV = model_.rectifyImage(bgrCV);
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UThreadC.h>
|
||||
#include <rtabmap/core/util2d.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_K4W2
|
||||
#include <Kinect.h>
|
||||
@@ -486,11 +485,11 @@ SensorData CameraK4W2::captureImage(SensorCaptureInfo * info)
|
||||
{
|
||||
cv::Mat tmp;
|
||||
cv::resize(cv::Mat(nColorHeight, nColorWidth, CV_8UC4, pColorBuffer), tmp, cv::Size(), 0.5, 0.5, cv::INTER_AREA);
|
||||
cv::cvtColor(tmp, imageColor, CV_BGRA2BGR);
|
||||
cv::cvtColor(tmp, imageColor, cv::COLOR_BGRA2BGR);
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::cvtColor(cv::Mat(nColorHeight, nColorWidth, CV_8UC4, pColorBuffer), imageColor, CV_BGRA2BGR);
|
||||
cv::cvtColor(cv::Mat(nColorHeight, nColorWidth, CV_8UC4, pColorBuffer), imageColor, cv::COLOR_BGRA2BGR);
|
||||
}
|
||||
// loop over output pixels
|
||||
for (int depthIndex = 0; depthIndex < (nDepthWidth*nDepthHeight); ++depthIndex)
|
||||
|
||||
@@ -29,7 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UFile.h>
|
||||
#include <rtabmap/utilite/UThreadC.h>
|
||||
#include <rtabmap/core/util2d.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_OPENNI2
|
||||
#include <OniVersion.h>
|
||||
@@ -514,7 +513,7 @@ SensorData CameraOpenNI2::captureImage(SensorCaptureInfo * info)
|
||||
cv::Mat tmp(h, w, CV_8UC3, (void *)colorFrame.getData());
|
||||
if(_type==kTypeColorDepth)
|
||||
{
|
||||
cv::cvtColor(tmp, rgb, CV_RGB2BGR);
|
||||
cv::cvtColor(tmp, rgb, cv::COLOR_RGB2BGR);
|
||||
}
|
||||
else // IR
|
||||
{
|
||||
|
||||
@@ -26,7 +26,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <rtabmap/core/camera/CameraOpenNICV.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#if CV_MAJOR_VERSION > 3
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#include <opencv2/videoio.hpp>
|
||||
#elif CV_MAJOR_VERSION > 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#endif
|
||||
|
||||
@@ -59,30 +61,34 @@ bool CameraOpenNICV::init(const std::string & calibrationFolder, const std::stri
|
||||
}
|
||||
|
||||
ULOGGER_DEBUG("Camera::init()");
|
||||
_capture.open( _asus?CV_CAP_OPENNI_ASUS:CV_CAP_OPENNI );
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
_capture.open( _asus?cv::CAP_OPENNI_ASUS:cv::CAP_OPENNI );
|
||||
#else
|
||||
_capture.open( _asus?cv::CAP_OPENNI2_ASUS:cv::CAP_OPENNI2 );
|
||||
#endif
|
||||
if(_capture.isOpened())
|
||||
{
|
||||
_capture.set( CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE, CV_CAP_OPENNI_VGA_30HZ );
|
||||
_depthFocal = _capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH );
|
||||
_capture.set( cv::CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE, cv::CAP_OPENNI_VGA_30HZ );
|
||||
_depthFocal = _capture.get( cv::CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH );
|
||||
// Print some avalible device settings.
|
||||
UINFO("Depth generator output mode:");
|
||||
UINFO("FRAME_WIDTH %f", _capture.get( CV_CAP_PROP_FRAME_WIDTH ));
|
||||
UINFO("FRAME_HEIGHT %f", _capture.get( CV_CAP_PROP_FRAME_HEIGHT ));
|
||||
UINFO("FRAME_MAX_DEPTH %f mm", _capture.get( CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH ));
|
||||
UINFO("BASELINE %f mm", _capture.get( CV_CAP_PROP_OPENNI_BASELINE ));
|
||||
UINFO("FPS %f", _capture.get( CV_CAP_PROP_FPS ));
|
||||
UINFO("Focal %f", _capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ));
|
||||
UINFO("REGISTRATION %f", _capture.get( CV_CAP_PROP_OPENNI_REGISTRATION ));
|
||||
if(_capture.get( CV_CAP_PROP_OPENNI_REGISTRATION ) == 0.0)
|
||||
UINFO("FRAME_WIDTH %f", _capture.get( cv::CAP_PROP_FRAME_WIDTH ));
|
||||
UINFO("FRAME_HEIGHT %f", _capture.get( cv::CAP_PROP_FRAME_HEIGHT ));
|
||||
UINFO("FRAME_MAX_DEPTH %f mm", _capture.get( cv::CAP_PROP_OPENNI_FRAME_MAX_DEPTH ));
|
||||
UINFO("BASELINE %f mm", _capture.get( cv::CAP_PROP_OPENNI_BASELINE ));
|
||||
UINFO("FPS %f", _capture.get( cv::CAP_PROP_FPS ));
|
||||
UINFO("Focal %f", _capture.get( cv::CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ));
|
||||
UINFO("REGISTRATION %f", _capture.get( cv::CAP_PROP_OPENNI_REGISTRATION ));
|
||||
if(_capture.get( cv::CAP_PROP_OPENNI_REGISTRATION ) == 0.0)
|
||||
{
|
||||
UERROR("Depth registration is not activated on this device!");
|
||||
}
|
||||
if( _capture.get( CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT ) )
|
||||
if( _capture.get( cv::CAP_OPENNI_IMAGE_GENERATOR_PRESENT ) )
|
||||
{
|
||||
UINFO("Image generator output mode:");
|
||||
UINFO("FRAME_WIDTH %f", _capture.get( CV_CAP_OPENNI_IMAGE_GENERATOR+CV_CAP_PROP_FRAME_WIDTH ));
|
||||
UINFO("FRAME_HEIGHT %f", _capture.get( CV_CAP_OPENNI_IMAGE_GENERATOR+CV_CAP_PROP_FRAME_HEIGHT ));
|
||||
UINFO("FPS %f", _capture.get( CV_CAP_OPENNI_IMAGE_GENERATOR+CV_CAP_PROP_FPS ));
|
||||
UINFO("FRAME_WIDTH %f", _capture.get( cv::CAP_OPENNI_IMAGE_GENERATOR+cv::CAP_PROP_FRAME_WIDTH ));
|
||||
UINFO("FRAME_HEIGHT %f", _capture.get( cv::CAP_OPENNI_IMAGE_GENERATOR+cv::CAP_PROP_FRAME_HEIGHT ));
|
||||
UINFO("FPS %f", _capture.get( cv::CAP_OPENNI_IMAGE_GENERATOR+cv::CAP_PROP_FPS ));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -112,8 +118,8 @@ SensorData CameraOpenNICV::captureImage(SensorCaptureInfo * info)
|
||||
{
|
||||
_capture.grab();
|
||||
cv::Mat depth, rgb;
|
||||
_capture.retrieve(depth, CV_CAP_OPENNI_DEPTH_MAP );
|
||||
_capture.retrieve(rgb, CV_CAP_OPENNI_BGR_IMAGE );
|
||||
_capture.retrieve(depth, cv::CAP_OPENNI_DEPTH_MAP );
|
||||
_capture.retrieve(rgb, cv::CAP_OPENNI_BGR_IMAGE );
|
||||
|
||||
depth = depth.clone();
|
||||
rgb = rgb.clone();
|
||||
|
||||
@@ -28,7 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UFile.h>
|
||||
#include <rtabmap/utilite/UThreadC.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_OPENNI
|
||||
#include <pcl/io/openni_grabber.h>
|
||||
@@ -94,7 +93,7 @@ void CameraOpenni::image_cb (
|
||||
|
||||
cv::Mat rgbFrame(rgb->getHeight(), rgb->getWidth(), CV_8UC3);
|
||||
rgb->fillRGB(rgb->getWidth(), rgb->getHeight(), rgbFrame.data);
|
||||
cv::cvtColor(rgbFrame, rgb_, CV_RGB2BGR);
|
||||
cv::cvtColor(rgbFrame, rgb_, cv::COLOR_RGB2BGR);
|
||||
|
||||
depth_ = cv::Mat(rgb->getHeight(), rgb->getWidth(), CV_16UC1);
|
||||
depth->fillDepthImageRaw(rgb->getWidth(), rgb->getHeight(), (unsigned short*)depth_.data);
|
||||
|
||||
@@ -29,7 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UMath.h>
|
||||
#include <rtabmap/utilite/UThreadC.h>
|
||||
#include <rtabmap/core/util2d.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_REALSENSE
|
||||
#include <librealsense/rs.hpp>
|
||||
@@ -938,7 +937,7 @@ SensorData CameraRealSense::captureImage(SensorCaptureInfo * info)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::cvtColor(rgb, bgr, CV_RGB2BGR);
|
||||
cv::cvtColor(rgb, bgr, cv::COLOR_RGB2BGR);
|
||||
}
|
||||
|
||||
bool rectified = false;
|
||||
|
||||
@@ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
#include <rtabmap/utilite/UDirectory.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_REALSENSE2
|
||||
#include <librealsense2/rsutil.h>
|
||||
@@ -1440,7 +1439,7 @@ SensorData CameraRealSense2::captureImage(SensorCaptureInfo * info)
|
||||
cv::Mat bgr;
|
||||
if(rgb.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(rgb, bgr, CV_RGB2BGR);
|
||||
cv::cvtColor(rgb, bgr, cv::COLOR_RGB2BGR);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/camera/CameraStereoDC1394.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_DC1394
|
||||
#include <dc1394/dc1394.h>
|
||||
@@ -295,8 +294,8 @@ public:
|
||||
|
||||
//DC1394_COLOR_CODING_RAW16:
|
||||
//DC1394_COLOR_FILTER_BGGR
|
||||
cv::cvtColor(cv::Mat(frame->size[1], frame->size[0], CV_8UC1, capture_buffer), left, CV_BayerRG2BGR);
|
||||
cv::cvtColor(cv::Mat(frame->size[1], frame->size[0], CV_8UC1, capture_buffer+image.total()), right, CV_BayerRG2GRAY);
|
||||
cv::cvtColor(cv::Mat(frame->size[1], frame->size[0], CV_8UC1, capture_buffer), left, cv::COLOR_BayerRG2BGR);
|
||||
cv::cvtColor(cv::Mat(frame->size[1], frame->size[0], CV_8UC1, capture_buffer+image.total()), right, cv::COLOR_BayerRG2GRAY);
|
||||
|
||||
dc1394_capture_enqueue(camera_, frame);
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
#include <rtabmap/utilite/UFile.h>
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
namespace rtabmap
|
||||
{
|
||||
@@ -339,7 +338,7 @@ SensorData CameraStereoImages::captureImage(SensorCaptureInfo * info)
|
||||
if(rightImage.type() != CV_8UC1 && rightGrayScale_)
|
||||
{
|
||||
cv::Mat tmp;
|
||||
cv::cvtColor(rightImage, tmp, CV_BGR2GRAY);
|
||||
cv::cvtColor(rightImage, tmp, cv::COLOR_BGR2GRAY);
|
||||
rightImage = tmp;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UThreadC.h>
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#if CV_MAJOR_VERSION > 3
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#include <opencv2/videoio.hpp>
|
||||
#elif CV_MAJOR_VERSION > 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#endif
|
||||
|
||||
@@ -81,18 +83,18 @@ bool CameraStereoTara::init(const std::string & calibrationFolder, const std::st
|
||||
|
||||
capture_.open(usbDevice_);
|
||||
|
||||
capture_.set(CV_CAP_PROP_FOURCC, CV_FOURCC('Y', '1', '6', ' '));
|
||||
capture_.set(CV_CAP_PROP_FPS, 60);
|
||||
capture_.set(CV_CAP_PROP_FRAME_WIDTH, 752);
|
||||
capture_.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
|
||||
capture_.set(CV_CAP_PROP_CONVERT_RGB,false);
|
||||
capture_.set(cv::CAP_PROP_FOURCC, CV_FOURCC('Y', '1', '6', ' '));
|
||||
capture_.set(cv::CAP_PROP_FPS, 60);
|
||||
capture_.set(cv::CAP_PROP_FRAME_WIDTH, 752);
|
||||
capture_.set(cv::CAP_PROP_FRAME_HEIGHT, 480);
|
||||
capture_.set(cv::CAP_PROP_CONVERT_RGB,false);
|
||||
|
||||
ULOGGER_DEBUG("CameraStereoTara: Usb device initialization on device %d", usbDevice_);
|
||||
|
||||
|
||||
if (cameraName_.empty())
|
||||
{
|
||||
unsigned int guid = (unsigned int)capture_.get(CV_CAP_PROP_GUID);
|
||||
unsigned int guid = (unsigned int)capture_.get(cv::CAP_PROP_GUID);
|
||||
if (guid != 0 && guid != 0xffffffff)
|
||||
{
|
||||
cameraName_ = uFormat("%08x", guid);
|
||||
|
||||
@@ -28,12 +28,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/camera/CameraStereoVideo.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#if CV_MAJOR_VERSION > 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#include <opencv2/videoio/legacy/constants_c.h>
|
||||
#endif
|
||||
#include <opencv2/videoio.hpp>
|
||||
#elif CV_MAJOR_VERSION > 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#endif
|
||||
|
||||
namespace rtabmap
|
||||
@@ -172,7 +170,7 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
||||
|
||||
if (cameraName_.empty())
|
||||
{
|
||||
unsigned int guid = (unsigned int)capture_.get(CV_CAP_PROP_GUID);
|
||||
unsigned int guid = (unsigned int)capture_.get(cv::CAP_PROP_GUID);
|
||||
if (guid != 0 && guid != 0xffffffff)
|
||||
{
|
||||
cameraName_ = uFormat("%08x", guid);
|
||||
@@ -214,17 +212,17 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
||||
if(capture_.isOpened())
|
||||
{
|
||||
bool resolutionSet = false;
|
||||
resolutionSet = capture_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.left().imageWidth()*(capture2_.isOpened()?1:2));
|
||||
resolutionSet = resolutionSet && capture_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.left().imageHeight());
|
||||
resolutionSet = capture_.set(cv::CAP_PROP_FRAME_WIDTH, stereoModel_.left().imageWidth()*(capture2_.isOpened()?1:2));
|
||||
resolutionSet = resolutionSet && capture_.set(cv::CAP_PROP_FRAME_HEIGHT, stereoModel_.left().imageHeight());
|
||||
if(capture2_.isOpened())
|
||||
{
|
||||
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.right().imageWidth());
|
||||
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.right().imageHeight());
|
||||
resolutionSet = resolutionSet && capture2_.set(cv::CAP_PROP_FRAME_WIDTH, stereoModel_.right().imageWidth());
|
||||
resolutionSet = resolutionSet && capture2_.set(cv::CAP_PROP_FRAME_HEIGHT, stereoModel_.right().imageHeight());
|
||||
}
|
||||
|
||||
// Check if the resolution was set successfully
|
||||
int actualWidth = int(capture_.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(capture_.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||
int actualWidth = int(capture_.get(cv::CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(capture_.get(cv::CAP_PROP_FRAME_HEIGHT));
|
||||
if(!resolutionSet ||
|
||||
actualWidth != stereoModel_.left().imageWidth()*(capture2_.isOpened()?1:2) ||
|
||||
actualHeight != stereoModel_.left().imageHeight())
|
||||
@@ -244,17 +242,17 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
||||
if(capture_.isOpened())
|
||||
{
|
||||
bool resolutionSet = false;
|
||||
resolutionSet = capture_.set(CV_CAP_PROP_FRAME_WIDTH, _width*(capture2_.isOpened()?1:2));
|
||||
resolutionSet = resolutionSet && capture_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
||||
resolutionSet = capture_.set(cv::CAP_PROP_FRAME_WIDTH, _width*(capture2_.isOpened()?1:2));
|
||||
resolutionSet = resolutionSet && capture_.set(cv::CAP_PROP_FRAME_HEIGHT, _height);
|
||||
if(capture2_.isOpened())
|
||||
{
|
||||
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_WIDTH, _width);
|
||||
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
||||
resolutionSet = resolutionSet && capture2_.set(cv::CAP_PROP_FRAME_WIDTH, _width);
|
||||
resolutionSet = resolutionSet && capture2_.set(cv::CAP_PROP_FRAME_HEIGHT, _height);
|
||||
}
|
||||
|
||||
// Check if the resolution was set successfully
|
||||
int actualWidth = int(capture_.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(capture_.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||
int actualWidth = int(capture_.get(cv::CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(capture_.get(cv::CAP_PROP_FRAME_HEIGHT));
|
||||
if(!resolutionSet ||
|
||||
actualWidth != _width*(capture2_.isOpened()?1:2) ||
|
||||
actualHeight != _height)
|
||||
@@ -273,10 +271,10 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
||||
if (this->getFrameRate() > 0)
|
||||
{
|
||||
bool fpsSupported = false;
|
||||
fpsSupported = capture_.set(CV_CAP_PROP_FPS, this->getFrameRate());
|
||||
fpsSupported = capture_.set(cv::CAP_PROP_FPS, this->getFrameRate());
|
||||
if (capture2_.isOpened())
|
||||
{
|
||||
fpsSupported = fpsSupported && capture2_.set(CV_CAP_PROP_FPS, this->getFrameRate());
|
||||
fpsSupported = fpsSupported && capture2_.set(cv::CAP_PROP_FPS, this->getFrameRate());
|
||||
}
|
||||
if(fpsSupported)
|
||||
{
|
||||
@@ -310,14 +308,14 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
||||
std::string fourccUpperCase = uToUpperCase(_fourcc);
|
||||
int fourcc = cv::VideoWriter::fourcc(fourccUpperCase.at(0), fourccUpperCase.at(1), fourccUpperCase.at(2), fourccUpperCase.at(3));
|
||||
bool fourccSupported = false;
|
||||
fourccSupported = capture_.set(CV_CAP_PROP_FOURCC, fourcc);
|
||||
fourccSupported = capture_.set(cv::CAP_PROP_FOURCC, fourcc);
|
||||
if (capture2_.isOpened())
|
||||
{
|
||||
fourccSupported = fourccSupported && capture2_.set(CV_CAP_PROP_FOURCC, fourcc);
|
||||
fourccSupported = fourccSupported && capture2_.set(cv::CAP_PROP_FOURCC, fourcc);
|
||||
}
|
||||
|
||||
// Check if the FOURCC was set successfully
|
||||
int actualFourcc = int(capture_.get(CV_CAP_PROP_FOURCC));
|
||||
int actualFourcc = int(capture_.get(cv::CAP_PROP_FOURCC));
|
||||
|
||||
if(!fourccSupported || actualFourcc != fourcc)
|
||||
{
|
||||
@@ -386,7 +384,7 @@ SensorData CameraStereoVideo::captureImage(SensorCaptureInfo * info)
|
||||
if(rightImage.type() != CV_8UC1 && rightGrayScale_)
|
||||
{
|
||||
cv::Mat tmp;
|
||||
cv::cvtColor(rightImage, tmp, CV_BGR2GRAY);
|
||||
cv::cvtColor(rightImage, tmp, cv::COLOR_BGR2GRAY);
|
||||
rightImage = tmp;
|
||||
rightCvt = true;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <zed-open-capture/sensorcapture.hpp>
|
||||
#include "SimpleIni.h"
|
||||
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2018, STEREOLABS.
|
||||
|
||||
@@ -28,11 +28,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/camera/CameraVideo.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#if CV_MAJOR_VERSION > 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#include <opencv2/videoio/legacy/constants_c.h>
|
||||
#endif
|
||||
#include <opencv2/videoio.hpp>
|
||||
#elif CV_MAJOR_VERSION > 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#endif
|
||||
|
||||
namespace rtabmap
|
||||
@@ -105,7 +104,7 @@ bool CameraVideo::init(const std::string & calibrationFolder, const std::string
|
||||
{
|
||||
if (_guid.empty())
|
||||
{
|
||||
unsigned int guid = (unsigned int)_capture.get(CV_CAP_PROP_GUID);
|
||||
unsigned int guid = (unsigned int)_capture.get(cv::CAP_PROP_GUID);
|
||||
if (guid != 0 && guid != 0xffffffff)
|
||||
{
|
||||
_guid = uFormat("%08x", guid);
|
||||
@@ -143,12 +142,12 @@ bool CameraVideo::init(const std::string & calibrationFolder, const std::string
|
||||
}
|
||||
|
||||
bool resolutionSet = false;
|
||||
resolutionSet = _capture.set(CV_CAP_PROP_FRAME_WIDTH, _model.imageWidth());
|
||||
resolutionSet = resolutionSet && _capture.set(CV_CAP_PROP_FRAME_HEIGHT, _model.imageHeight());
|
||||
resolutionSet = _capture.set(cv::CAP_PROP_FRAME_WIDTH, _model.imageWidth());
|
||||
resolutionSet = resolutionSet && _capture.set(cv::CAP_PROP_FRAME_HEIGHT, _model.imageHeight());
|
||||
|
||||
// Check if the resolution was set successfully
|
||||
int actualWidth = int(_capture.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(_capture.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||
int actualWidth = int(_capture.get(cv::CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(_capture.get(cv::CAP_PROP_FRAME_HEIGHT));
|
||||
if(!resolutionSet ||
|
||||
actualWidth != _model.imageWidth() ||
|
||||
actualHeight != _model.imageHeight())
|
||||
@@ -165,12 +164,12 @@ bool CameraVideo::init(const std::string & calibrationFolder, const std::string
|
||||
else if(_width > 0 && _height > 0)
|
||||
{
|
||||
int resolutionSet = false;
|
||||
resolutionSet = _capture.set(CV_CAP_PROP_FRAME_WIDTH, _width);
|
||||
resolutionSet = resolutionSet && _capture.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
||||
resolutionSet = _capture.set(cv::CAP_PROP_FRAME_WIDTH, _width);
|
||||
resolutionSet = resolutionSet && _capture.set(cv::CAP_PROP_FRAME_HEIGHT, _height);
|
||||
|
||||
// Check if the resolution was set successfully
|
||||
int actualWidth = int(_capture.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(_capture.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||
int actualWidth = int(_capture.get(cv::CAP_PROP_FRAME_WIDTH));
|
||||
int actualHeight = int(_capture.get(cv::CAP_PROP_FRAME_HEIGHT));
|
||||
if(!resolutionSet || actualWidth != _width || actualHeight != _height)
|
||||
{
|
||||
UWARN("Desired resolution (%dx%d) cannot be set to camera driver, "
|
||||
@@ -182,7 +181,7 @@ bool CameraVideo::init(const std::string & calibrationFolder, const std::string
|
||||
}
|
||||
|
||||
// Set FPS
|
||||
if (this->getFrameRate() > 0 && _capture.set(CV_CAP_PROP_FPS, this->getFrameRate()))
|
||||
if (this->getFrameRate() > 0 && _capture.set(cv::CAP_PROP_FPS, this->getFrameRate()))
|
||||
{
|
||||
// Check if the FPS was set successfully
|
||||
double actualFPS = _capture.get(cv::CAP_PROP_FPS);
|
||||
@@ -213,10 +212,10 @@ bool CameraVideo::init(const std::string & calibrationFolder, const std::string
|
||||
std::string fourccUpperCase = uToUpperCase(_fourcc);
|
||||
int fourcc = cv::VideoWriter::fourcc(fourccUpperCase.at(0), fourccUpperCase.at(1), fourccUpperCase.at(2), fourccUpperCase.at(3));
|
||||
|
||||
bool fourccSupported = _capture.set(CV_CAP_PROP_FOURCC, fourcc);
|
||||
bool fourccSupported = _capture.set(cv::CAP_PROP_FOURCC, fourcc);
|
||||
|
||||
// Check if the FOURCC was set successfully
|
||||
int actualFourcc = int(_capture.get(CV_CAP_PROP_FOURCC));
|
||||
int actualFourcc = int(_capture.get(cv::CAP_PROP_FOURCC));
|
||||
|
||||
if(!fourccSupported || actualFourcc != fourcc)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_DVO
|
||||
#include <dvo/dense_tracking.h>
|
||||
@@ -124,7 +123,7 @@ Transform OdometryDVO::computeTransform(
|
||||
{
|
||||
if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.imageRaw(), grey, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), grey, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,7 +42,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include "rtabmap/utilite/UMath.h"
|
||||
#include "rtabmap/utilite/UConversion.h"
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include <rtabmap/core/odometry/OdometryF2M.h>
|
||||
#include <pcl/common/io.h>
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_FOVIS
|
||||
#include <libfovis/fovis.hpp>
|
||||
@@ -137,7 +136,7 @@ Transform OdometryFovis::computeTransform(
|
||||
cv::Mat gray;
|
||||
if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.imageRaw(), gray, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), gray, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(data.imageRaw().type() == CV_8UC1)
|
||||
{
|
||||
@@ -302,7 +301,7 @@ Transform OdometryFovis::computeTransform(
|
||||
}
|
||||
if(data.rightRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.rightRaw(), right, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.rightRaw(), right, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(data.rightRaw().type() == CV_8UC1)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include "rtabmap/utilite/UThread.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_MSCKF_VIO
|
||||
#include <msckf_vio/image_processor.h>
|
||||
@@ -867,7 +866,7 @@ Transform OdometryMSCKF::computeTransform(
|
||||
|
||||
if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.imageRaw(), cam0.image, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), cam0.image, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -875,7 +874,7 @@ Transform OdometryMSCKF::computeTransform(
|
||||
}
|
||||
if(data.rightRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.rightRaw(), cam1.image, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.rightRaw(), cam1.image, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -43,7 +43,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include "rtabmap/utilite/UMath.h"
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include <opencv2/video/tracking.hpp>
|
||||
#include <pcl/common/centroid.h>
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include "rtabmap/utilite/UDirectory.h"
|
||||
#include <pcl/common/transforms.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <rtabmap/core/odometry/OdometryORBSLAM2.h>
|
||||
|
||||
#if defined(RTABMAP_ORB_SLAM) and RTABMAP_ORB_SLAM == 2
|
||||
@@ -426,7 +425,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
cvtColor(mImGray,mImGray,CV_BGR2GRAY);
|
||||
cvtColor(mImGray,mImGray,cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
}
|
||||
else if(mImGray.channels()==4)
|
||||
@@ -437,7 +436,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
cvtColor(mImGray,mImGray,CV_BGRA2GRAY);
|
||||
cvtColor(mImGray,mImGray,cv::COLOR_BGRA2GRAY);
|
||||
}
|
||||
}
|
||||
if(imGrayRight.channels()==3)
|
||||
@@ -448,7 +447,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
cvtColor(imGrayRight,imGrayRight,CV_BGR2GRAY);
|
||||
cvtColor(imGrayRight,imGrayRight,cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
}
|
||||
else if(imGrayRight.channels()==4)
|
||||
@@ -459,7 +458,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
cvtColor(imGrayRight,imGrayRight,CV_BGRA2GRAY);
|
||||
cvtColor(imGrayRight,imGrayRight,cv::COLOR_BGRA2GRAY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,14 +479,14 @@ public:
|
||||
if(mbRGB)
|
||||
cvtColor(mImGray,mImGray,CV_RGB2GRAY);
|
||||
else
|
||||
cvtColor(mImGray,mImGray,CV_BGR2GRAY);
|
||||
cvtColor(mImGray,mImGray,cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(mImGray.channels()==4)
|
||||
{
|
||||
if(mbRGB)
|
||||
cvtColor(mImGray,mImGray,CV_RGBA2GRAY);
|
||||
else
|
||||
cvtColor(mImGray,mImGray,CV_BGRA2GRAY);
|
||||
cvtColor(mImGray,mImGray,cv::COLOR_BGRA2GRAY);
|
||||
}
|
||||
|
||||
UASSERT(imDepth.type()==CV_32F);
|
||||
|
||||
@@ -34,7 +34,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UDirectory.h"
|
||||
#include "rtabmap/utilite/UFile.h"
|
||||
#include <pcl/common/transforms.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <rtabmap/core/odometry/OdometryORBSLAM3.h>
|
||||
|
||||
#if defined(RTABMAP_ORB_SLAM) and RTABMAP_ORB_SLAM == 3
|
||||
@@ -469,12 +468,12 @@ Transform OdometryORBSLAM3::computeTransform(
|
||||
cv::Mat leftMono = data.imageRaw();
|
||||
if(data.imageRaw().channels() == 3) {
|
||||
leftMono = cv::Mat();
|
||||
cv::cvtColor(data.imageRaw(), leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
cv::Mat rightMono = data.rightRaw();
|
||||
if(data.rightRaw().channels() == 3) {
|
||||
rightMono = cv::Mat();
|
||||
cv::cvtColor(data.imageRaw(), rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
UDEBUG("Adding Stereo Frame %f", data.stamp());
|
||||
Tcw = orbslam_->TrackStereo(leftMono, rightMono, data.stamp(), orbslamImus_);
|
||||
|
||||
@@ -34,7 +34,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UThread.h"
|
||||
#include "rtabmap/utilite/UFile.h"
|
||||
#include "rtabmap/utilite/UDirectory.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_OKVIS
|
||||
#include <iostream>
|
||||
@@ -427,7 +426,7 @@ Transform OdometryOkvis::computeTransform(
|
||||
cv::Mat gray;
|
||||
if(images[i].type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(images[i], gray, CV_BGR2GRAY);
|
||||
cv::cvtColor(images[i], gray, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(images[i].type() == CV_8UC1)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include <opencv2/core/eigen.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_OPENVINS
|
||||
#include "core/VioManager.h"
|
||||
@@ -419,7 +418,7 @@ Transform OdometryOpenVINS::computeTransform(
|
||||
|
||||
cv::Mat image;
|
||||
if(data.imageRaw().type() == CV_8UC3)
|
||||
cv::cvtColor(data.imageRaw(), image, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), image, cv::COLOR_BGR2GRAY);
|
||||
else if(data.imageRaw().type() == CV_8UC1)
|
||||
image = data.imageRaw().clone();
|
||||
else
|
||||
@@ -450,7 +449,7 @@ Transform OdometryOpenVINS::computeTransform(
|
||||
if(!data.rightRaw().empty())
|
||||
{
|
||||
if(data.rightRaw().type() == CV_8UC3)
|
||||
cv::cvtColor(data.rightRaw(), image, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.rightRaw(), image, cv::COLOR_BGR2GRAY);
|
||||
else if(data.rightRaw().type() == CV_8UC1)
|
||||
image = data.rightRaw().clone();
|
||||
else
|
||||
|
||||
@@ -33,7 +33,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include "rtabmap/utilite/UThread.h"
|
||||
#include "rtabmap/utilite/UDirectory.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_VINS_FUSION
|
||||
#include <estimator/estimator.h>
|
||||
@@ -444,7 +443,7 @@ Transform OdometryVINSFusion::computeTransform(
|
||||
cv::Mat right;
|
||||
if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.imageRaw(), left, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), left, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(data.imageRaw().type() == CV_8UC1)
|
||||
{
|
||||
@@ -456,7 +455,7 @@ Transform OdometryVINSFusion::computeTransform(
|
||||
}
|
||||
if(data.rightRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.rightRaw(), right, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.rightRaw(), right, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(data.rightRaw().type() == CV_8UC1)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
#ifdef RTABMAP_VISO2
|
||||
#include <viso_stereo.h>
|
||||
@@ -131,7 +130,7 @@ Transform OdometryViso2::computeTransform(
|
||||
cv::Mat leftGray;
|
||||
if(data.imageRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.imageRaw(), leftGray, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.imageRaw(), leftGray, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(data.imageRaw().type() == CV_8UC1)
|
||||
{
|
||||
@@ -144,7 +143,7 @@ Transform OdometryViso2::computeTransform(
|
||||
cv::Mat rightGray;
|
||||
if(data.rightRaw().type() == CV_8UC3)
|
||||
{
|
||||
cv::cvtColor(data.rightRaw(), rightGray, CV_BGR2GRAY);
|
||||
cv::cvtColor(data.rightRaw(), rightGray, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else if(data.rightRaw().type() == CV_8UC1)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,11 @@
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <opencv2/core/core_c.h>
|
||||
|
||||
|
||||
namespace rtabmap
|
||||
{
|
||||
|
||||
@@ -752,7 +752,7 @@ void CV_ORB::operator()( InputArray _image, InputArray _mask, std::vector<KeyPoi
|
||||
|
||||
Mat image = _image.getMat(), mask = _mask.getMat();
|
||||
if( image.type() != CV_8UC1 )
|
||||
cvtColor(_image, image, CV_BGR2GRAY);
|
||||
cvtColor(_image, image, cv::COLOR_BGR2GRAY);
|
||||
|
||||
int levelsNum = this->nlevels;
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
#ifndef CORELIB_SRC_OPENCV_FIVE_POINT_H_
|
||||
#define CORELIB_SRC_OPENCV_FIVE_POINT_H_
|
||||
|
||||
#if CV_MAJOR_VERSION > 4
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
namespace cv3
|
||||
{
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class PnPRansacCallback : public PointSetRegistrator::Callback
|
||||
|
||||
public:
|
||||
|
||||
PnPRansacCallback(Mat _cameraMatrix=Mat(3,3,CV_64F), Mat _distCoeffs=Mat(4,1,CV_64F), int _flags=CV_ITERATIVE,
|
||||
PnPRansacCallback(Mat _cameraMatrix=Mat(3,3,CV_64F), Mat _distCoeffs=Mat(4,1,CV_64F), int _flags=cv::SOLVEPNP_ITERATIVE,
|
||||
bool _useExtrinsicGuess=false, Mat _rvec=Mat(), Mat _tvec=Mat() )
|
||||
: cameraMatrix(_cameraMatrix), distCoeffs(_distCoeffs), flags(_flags), useExtrinsicGuess(_useExtrinsicGuess),
|
||||
rvec(_rvec), tvec(_tvec) {}
|
||||
@@ -142,12 +142,12 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
|
||||
Mat cameraMatrix = _cameraMatrix.getMat(), distCoeffs = _distCoeffs.getMat();
|
||||
|
||||
int model_points = 6;
|
||||
int ransac_kernel_method = CV_EPNP;
|
||||
int ransac_kernel_method = cv::SOLVEPNP_EPNP;
|
||||
|
||||
if( npoints == 4 )
|
||||
{
|
||||
model_points = 4;
|
||||
ransac_kernel_method = CV_P3P;
|
||||
ransac_kernel_method = cv::SOLVEPNP_P3P;
|
||||
}
|
||||
|
||||
Ptr<PointSetRegistrator::Callback> cb; // pointer to callback
|
||||
@@ -178,7 +178,7 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
|
||||
opoints_inliers.resize(npoints1);
|
||||
ipoints_inliers.resize(npoints1);
|
||||
result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix,
|
||||
distCoeffs, rvec, tvec, useExtrinsicGuess, flags == CV_P3P ? CV_EPNP : flags) ? 1 : -1;
|
||||
distCoeffs, rvec, tvec, useExtrinsicGuess, flags == cv::SOLVEPNP_P3P ? cv::SOLVEPNP_EPNP : flags) ? 1 : -1;
|
||||
}
|
||||
|
||||
if( result <= 0 || _local_model.rows <= 0)
|
||||
@@ -213,7 +213,11 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
|
||||
int RANSACUpdateNumIters( double p, double ep, int modelPoints, int maxIters )
|
||||
{
|
||||
if( modelPoints <= 0 )
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
CV_Error( 0, "the number of model points should be positive" );
|
||||
#else
|
||||
CV_Error( cv::Error::Code::StsBadArg, "the number of model points should be positive" );
|
||||
#endif
|
||||
|
||||
p = MAX(p, 0.);
|
||||
p = MIN(p, 1.);
|
||||
|
||||
@@ -45,10 +45,14 @@
|
||||
#define RTABMAP_CORELIB_SRC_OPENCV_SOLVEPNP_H_
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#include <opencv2/geometry.hpp>
|
||||
#else
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#if CV_MAJOR_VERSION >= 3
|
||||
#include <opencv2/calib3d/calib3d_c.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace cv3 {
|
||||
|
||||
@@ -95,7 +99,7 @@ bool solvePnPRansac( cv::InputArray objectPoints, cv::InputArray imagePoints,
|
||||
cv::OutputArray rvec, cv::OutputArray tvec,
|
||||
bool useExtrinsicGuess = false, int iterationsCount = 100,
|
||||
float reprojectionError = 8.0, double confidence = 0.99,
|
||||
cv::OutputArray inliers = cv::noArray(), int flags = CV_ITERATIVE );
|
||||
cv::OutputArray inliers = cv::noArray(), int flags = cv::SOLVEPNP_ITERATIVE );
|
||||
|
||||
int RANSACUpdateNumIters( double p, double ep, int modelPoints, int maxIters );
|
||||
|
||||
|
||||
@@ -27,9 +27,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <rtabmap/core/stereo/StereoBM.h>
|
||||
#include <rtabmap/utilite/ULogger.h>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/stereo.hpp>
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -88,7 +92,7 @@ cv::Mat StereoBM::computeDisparity(
|
||||
cv::Mat leftMono;
|
||||
if(leftImage.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(leftImage, leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(leftImage, leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -98,7 +102,7 @@ cv::Mat StereoBM::computeDisparity(
|
||||
cv::Mat rightMono;
|
||||
if(rightImage.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(rightImage, rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(rightImage, rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -27,9 +27,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <rtabmap/core/stereo/StereoSGBM.h>
|
||||
#include <rtabmap/utilite/ULogger.h>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/stereo.hpp>
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -77,7 +81,7 @@ cv::Mat StereoSGBM::computeDisparity(
|
||||
cv::Mat leftMono;
|
||||
if(leftImage.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(leftImage, leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(leftImage, leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,7 +91,7 @@ cv::Mat StereoSGBM::computeDisparity(
|
||||
cv::Mat rightMono;
|
||||
if(rightImage.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(rightImage, rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(rightImage, rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,11 +34,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
#include <rtabmap/core/util3d_transforms.h>
|
||||
#include <rtabmap/core/StereoDense.h>
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/video/tracking.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <map>
|
||||
#include <Eigen/Core>
|
||||
|
||||
@@ -46,6 +44,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <opencv2/photo/photo.hpp>
|
||||
#endif
|
||||
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
namespace rtabmap
|
||||
{
|
||||
|
||||
@@ -747,7 +751,7 @@ cv::Mat disparityFromStereoImages(
|
||||
cv::Mat leftMono;
|
||||
if(leftImage.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(leftImage, leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(leftImage, leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2042,8 +2046,8 @@ cv::Mat brightnessAndContrastAuto(const cv::Mat &src, const cv::Mat & mask, floa
|
||||
//to calculate grayscale histogram
|
||||
cv::Mat gray;
|
||||
if (src.type() == CV_8UC1) gray = src;
|
||||
else if (src.type() == CV_8UC3) cvtColor(src, gray, CV_BGR2GRAY);
|
||||
else if (src.type() == CV_8UC4) cvtColor(src, gray, CV_BGRA2GRAY);
|
||||
else if (src.type() == CV_8UC3) cvtColor(src, gray, cv::COLOR_BGR2GRAY);
|
||||
else if (src.type() == CV_8UC4) cvtColor(src, gray, cv::COLOR_BGRA2GRAY);
|
||||
if (clipLowHistPercent == 0 && clipHighHistPercent == 0)
|
||||
{
|
||||
// keep full available range
|
||||
|
||||
@@ -41,7 +41,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <pcl/common/transforms.h>
|
||||
#include <pcl/common/common.h>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
|
||||
namespace rtabmap
|
||||
{
|
||||
@@ -892,7 +891,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
|
||||
cv::Mat leftMono;
|
||||
if(leftColor.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(leftColor, leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(leftColor, leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -902,7 +901,7 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudFromStereoImages(
|
||||
cv::Mat rightMono;
|
||||
if(rightColor.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(rightColor, rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(rightColor, rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1038,7 +1037,7 @@ std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> cloudsFromSensorData(
|
||||
cv::Mat leftMono;
|
||||
if(sensorData.imageRaw().channels() == 3)
|
||||
{
|
||||
cv::cvtColor(sensorData.imageRaw(), leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(sensorData.imageRaw(), leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1048,7 +1047,7 @@ std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> cloudsFromSensorData(
|
||||
cv::Mat rightMono;
|
||||
if(sensorData.rightRaw().channels() == 3)
|
||||
{
|
||||
cv::cvtColor(sensorData.rightRaw(), rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(sensorData.rightRaw(), rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -30,7 +30,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
#include <rtabmap/core/EpipolarGeometry.h>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include <pcl/search/kdtree.h>
|
||||
#include <pcl/common/point_tests.h>
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UConversion.h"
|
||||
#include "rtabmap/utilite/UMath.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
#include <opencv2/core/core_c.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <pcl/search/kdtree.h>
|
||||
#include <pcl/surface/gp3.h>
|
||||
#include <pcl/features/normal_3d_omp.h>
|
||||
@@ -1745,7 +1743,7 @@ cv::Mat mergeTextures(
|
||||
if(resizedImage.type() == CV_8UC1)
|
||||
{
|
||||
cv::Mat resizedImageColor;
|
||||
cv::cvtColor(resizedImage, resizedImageColor, CV_GRAY2BGR);
|
||||
cv::cvtColor(resizedImage, resizedImageColor, cv::COLOR_GRAY2BGR);
|
||||
resizedImage = resizedImageColor;
|
||||
}
|
||||
UASSERT(resizedImage.type() == globalTextures.type());
|
||||
@@ -2609,7 +2607,7 @@ bool multiBandTexturing(
|
||||
if(imageRoi.channels() == 1)
|
||||
{
|
||||
cv::Mat imageRoiColor;
|
||||
cv::cvtColor(imageRoi, imageRoiColor, CV_GRAY2BGR);
|
||||
cv::cvtColor(imageRoi, imageRoiColor, cv::COLOR_GRAY2BGR);
|
||||
imageRoi = imageRoiColor;
|
||||
}
|
||||
|
||||
@@ -3218,7 +3216,7 @@ float computeNormalsComplexity(
|
||||
}
|
||||
if(oi>1)
|
||||
{
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), CV_PCA_DATA_AS_ROW);
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), cv::PCA::DATA_AS_ROW);
|
||||
|
||||
if(pcaEigenVectors)
|
||||
{
|
||||
@@ -3279,7 +3277,7 @@ float computeNormalsComplexity(
|
||||
}
|
||||
if(oi>1)
|
||||
{
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), CV_PCA_DATA_AS_ROW);
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), cv::PCA::DATA_AS_ROW);
|
||||
|
||||
if(pcaEigenVectors)
|
||||
{
|
||||
@@ -3335,7 +3333,7 @@ float computeNormalsComplexity(
|
||||
}
|
||||
if(oi>1)
|
||||
{
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), CV_PCA_DATA_AS_ROW);
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), cv::PCA::DATA_AS_ROW);
|
||||
|
||||
if(pcaEigenVectors)
|
||||
{
|
||||
@@ -3391,7 +3389,7 @@ float computeNormalsComplexity(
|
||||
}
|
||||
if(oi>1)
|
||||
{
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), CV_PCA_DATA_AS_ROW);
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), cv::PCA::DATA_AS_ROW);
|
||||
|
||||
if(pcaEigenVectors)
|
||||
{
|
||||
@@ -3447,7 +3445,7 @@ float computeNormalsComplexity(
|
||||
}
|
||||
if(oi>1)
|
||||
{
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), CV_PCA_DATA_AS_ROW);
|
||||
cv::PCA pca_analysis(cv::Mat(data_normals, cv::Range(0, oi*2)), cv::Mat(), cv::PCA::DATA_AS_ROW);
|
||||
|
||||
if(pcaEigenVectors)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtCore/QSet>
|
||||
#include <QtGui/QImage>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <pcl/point_cloud.h>
|
||||
|
||||
@@ -34,7 +34,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtCore/QRectF>
|
||||
#include <QtCore/QMultiMap>
|
||||
#include <QtCore/QSettings>
|
||||
#include <opencv2/core/version.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
#include <map>
|
||||
#include "rtabmap/utilite/UCv2Qt.h"
|
||||
#include <rtabmap/core/CameraModel.h>
|
||||
|
||||
@@ -34,7 +34,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QGraphicsTextItem>
|
||||
#include <QtGui/QPen>
|
||||
#include <QtGui/QBrush>
|
||||
#include <opencv2/core/version.hpp>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#else
|
||||
#include <opencv2/features.hpp>
|
||||
#endif
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
|
||||
@@ -30,13 +30,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/imgproc/imgproc_c.h>
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#include <opencv2/calib.hpp>
|
||||
#include <opencv2/geometry.hpp>
|
||||
#else
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#if CV_MAJOR_VERSION >= 3
|
||||
#include <opencv2/calib3d/calib3d_c.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#if CV_MAJOR_VERSION > 2 or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10)))
|
||||
#if (CV_MAJOR_VERSION > 2 and CV_MAJOR_VERSION < 5) or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10)))
|
||||
#include <rtabmap/core/stereo/stereoRectifyFisheye.h>
|
||||
#endif
|
||||
|
||||
@@ -737,7 +741,7 @@ void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat &
|
||||
cv::Size boardSize(ui_->spinBox_boardWidth->value(), ui_->spinBox_boardHeight->value());
|
||||
if(!viewGray.empty())
|
||||
{
|
||||
int flags = CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_NORMALIZE_IMAGE;
|
||||
int flags = cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_NORMALIZE_IMAGE;
|
||||
|
||||
if(!viewGray.empty())
|
||||
{
|
||||
@@ -748,7 +752,7 @@ void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat &
|
||||
if( scale == 1 )
|
||||
timg = viewGray;
|
||||
else
|
||||
cv::resize(viewGray, timg, cv::Size(), scale, scale, CV_INTER_CUBIC);
|
||||
cv::resize(viewGray, timg, cv::Size(), scale, scale, cv::INTER_CUBIC);
|
||||
|
||||
#ifdef HAVE_CHARUCO
|
||||
if(ui_->comboBox_board_type->currentIndex() >= 1 )
|
||||
@@ -833,7 +837,7 @@ void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat &
|
||||
float ratio = ui_->comboBox_board_type->currentIndex() >= 1 ?6.0f:2.0f;
|
||||
float radius = minSquareDistance==-1.0f?5.0f:(minSquareDistance/ratio);
|
||||
cv::cornerSubPix( viewGray, pointBuf[id], cv::Size(radius, radius), cv::Size(-1,-1),
|
||||
cv::TermCriteria( CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1 ));
|
||||
cv::TermCriteria( cv::TermCriteria::EPS + cv::TermCriteria::MAX_ITER, 30, 0.1 ));
|
||||
|
||||
// Filter points that drifted to far (caused by reflection or bad subpixel gradient)
|
||||
float threshold = ui_->doubleSpinBox_subpixel_error->value();
|
||||
@@ -1473,7 +1477,7 @@ void CalibrationDialog::calibrate()
|
||||
{
|
||||
cv::projectPoints( cv::Mat(objectPoints_[id][i]), rvecs[i], tvecs[i], K, D, imagePoints2);
|
||||
}
|
||||
err = cv::norm(cv::Mat(imagePoints_[id][i]), cv::Mat(imagePoints2), CV_L2);
|
||||
err = cv::norm(cv::Mat(imagePoints_[id][i]), cv::Mat(imagePoints2), cv::NORM_L2);
|
||||
|
||||
int n = (int)objectPoints_[id][i].size();
|
||||
reprojErrs[i] = (float) std::sqrt(err*err/n);
|
||||
@@ -1750,19 +1754,21 @@ StereoCameraModel CalibrationDialog::stereoCalibration(const CameraModel & left,
|
||||
UINFO("Compute stereo rectification");
|
||||
|
||||
cv::Mat R1, R2, P1, P2, Q;
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
stereoRectifyFisheye(
|
||||
left.K_raw(), D_left,
|
||||
right.K_raw(), D_right,
|
||||
imageSize, R, Tvec, R1, R2, P1, P2, Q,
|
||||
cv::CALIB_ZERO_DISPARITY, 0, imageSize);
|
||||
|
||||
// Very hard to get good results with this one:
|
||||
/*double balance = 0.0, fov_scale = 1.0;
|
||||
#else
|
||||
// Very hard to get good results with this one, however we cannot use the previous one anymore in opencv5
|
||||
double balance = 0.0, fov_scale = 1.0;
|
||||
cv::fisheye::stereoRectify(
|
||||
left.K_raw(), D_left,
|
||||
right.K_raw(), D_right,
|
||||
imageSize, R, Tvec, R1, R2, P1, P2, Q,
|
||||
cv::CALIB_ZERO_DISPARITY, imageSize, balance, fov_scale);*/
|
||||
cv::CALIB_ZERO_DISPARITY, imageSize, balance, fov_scale);
|
||||
#endif
|
||||
|
||||
std::cout << "R1 = " << R1 << std::endl;
|
||||
std::cout << "R2 = " << R2 << std::endl;
|
||||
|
||||
@@ -46,8 +46,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/ULogger.h>
|
||||
#include <rtabmap/utilite/UDirectory.h>
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <opencv2/core/core_c.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UFile.h>
|
||||
@@ -5980,7 +5978,7 @@ void DatabaseViewer::updateStereo(const SensorData * data)
|
||||
cv::Mat leftMono;
|
||||
if(data->imageRaw().channels() == 3)
|
||||
{
|
||||
cv::cvtColor(data->imageRaw(), leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(data->imageRaw(), leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5989,7 +5987,7 @@ void DatabaseViewer::updateStereo(const SensorData * data)
|
||||
cv::Mat rightMono;
|
||||
if(data->rightRaw().channels() == 3)
|
||||
{
|
||||
cv::cvtColor(data->rightRaw(), rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(data->rightRaw(), rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -93,6 +93,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QInputDialog>
|
||||
#include <QToolButton>
|
||||
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
|
||||
//RGB-D stuff
|
||||
#include "rtabmap/core/CameraRGBD.h"
|
||||
#include "rtabmap/core/Odometry.h"
|
||||
|
||||
@@ -2639,19 +2639,19 @@ void PreferencesDialog::restoreConfigOwnership(const QString & filePath)
|
||||
gid_t gid = (gid_t)atoi(sudoGid);
|
||||
// Restore the config file and its containing directory so the user
|
||||
// can still write preferences without sudo afterwards.
|
||||
if(!filePath.isEmpty() && QFile::exists(filePath))
|
||||
auto restoreOwnership = [uid, gid](const QString & path)
|
||||
{
|
||||
if(chown(filePath.toStdString().c_str(), uid, gid) != 0)
|
||||
if(!path.isEmpty() && QFile::exists(path))
|
||||
{
|
||||
UWARN("Could not restore ownership of \"%s\" to uid=%d (%s).",
|
||||
filePath.toStdString().c_str(), (int)uid, strerror(errno));
|
||||
if(chown(path.toStdString().c_str(), uid, gid) != 0)
|
||||
{
|
||||
UWARN("Could not restore ownership of \"%s\" to uid=%d (%s).",
|
||||
path.toStdString().c_str(), (int)uid, strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
QString dir = QFileInfo(filePath).absolutePath();
|
||||
if(!dir.isEmpty())
|
||||
{
|
||||
chown(dir.toStdString().c_str(), uid, gid);
|
||||
}
|
||||
};
|
||||
restoreOwnership(filePath);
|
||||
restoreOwnership(QFileInfo(filePath).absolutePath());
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -32,7 +32,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UDirectory.h"
|
||||
#include "rtabmap/utilite/UConversion.h"
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/highgui/highgui_c.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void showUsage()
|
||||
@@ -178,7 +177,7 @@ int main(int argc, char * argv[])
|
||||
|
||||
cv::Mat rgb;
|
||||
rgb = camera->takeImage().imageRaw();
|
||||
cv::namedWindow("Video", CV_WINDOW_AUTOSIZE); // create window
|
||||
cv::namedWindow("Video", cv::WINDOW_AUTOSIZE); // create window
|
||||
while(!rgb.empty())
|
||||
{
|
||||
cv::imshow("Video", rgb); // show frame
|
||||
|
||||
@@ -40,8 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/utilite/UEventsManager.h"
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#if CV_MAJOR_VERSION >= 3
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#include <opencv2/videoio.hpp>
|
||||
#elif CV_MAJOR_VERSION >= 3
|
||||
#include <opencv2/videoio/videoio_c.h>
|
||||
#endif
|
||||
#include <pcl/visualization/cloud_viewer.h>
|
||||
@@ -470,7 +471,7 @@ int main(int argc, char * argv[])
|
||||
{
|
||||
if(right.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(right, right, CV_BGR2GRAY);
|
||||
cv::cvtColor(right, right, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud = rtabmap::util3d::cloudFromStereoImages(
|
||||
rgb, right,
|
||||
|
||||
@@ -26,7 +26,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core/types_c.h>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <iostream>
|
||||
@@ -36,7 +35,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UDirectory.h>
|
||||
#include <rtabmap/utilite/UStl.h>
|
||||
#include <rtabmap/utilite/UMath.h>
|
||||
#if CV_MAJOR_VERSION < 5
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#else
|
||||
#include <opencv2/geometry.hpp>
|
||||
#endif
|
||||
#include "rtabmap/core/Features2d.h"
|
||||
#include "rtabmap/core/EpipolarGeometry.h"
|
||||
#include "rtabmap/core/VWDictionary.h"
|
||||
|
||||
@@ -37,7 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/utilite/UConversion.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
#include <rtabmap/utilite/UMath.h>
|
||||
#include <opencv2/imgproc/types_c.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
@@ -222,7 +221,7 @@ int main(int argc, char * argv[])
|
||||
cv::Mat leftMono;
|
||||
if(left.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(left, leftMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(left, leftMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -231,7 +230,7 @@ int main(int argc, char * argv[])
|
||||
cv::Mat rightMono;
|
||||
if(right.channels() == 3)
|
||||
{
|
||||
cv::cvtColor(right, rightMono, CV_BGR2GRAY);
|
||||
cv::cvtColor(right, rightMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -266,7 +265,7 @@ int main(int argc, char * argv[])
|
||||
cv::cornerSubPix(leftMono, leftCorners,
|
||||
cv::Size( subPixWinSize, subPixWinSize ),
|
||||
cv::Size( -1, -1 ),
|
||||
cv::TermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, subPixIterations, subPixEps ) );
|
||||
cv::TermCriteria( cv::TermCriteria::MAX_ITER | cv::TermCriteria::EPS, subPixIterations, subPixEps ) );
|
||||
UDEBUG("cv::cornerSubPix() end");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user