31#include <rtabmap/core/rtabmap_core_export.h>
33#include <opencv2/core/core.hpp>
34#include <rtabmap/core/Transform.h>
35#include <rtabmap/core/Parameters.h>
36#include <rtabmap/core/CameraModel.h>
71float RTABMAP_CORE_EXPORT
ssd(
const cv::Mat & windowLeft,
const cv::Mat & windowRight);
91float RTABMAP_CORE_EXPORT
sad(
const cv::Mat & windowLeft,
const cv::Mat & windowRight);
126 const cv::Mat & leftImage,
127 const cv::Mat & rightImage,
128 const std::vector<cv::Point2f> & leftCorners,
129 std::vector<unsigned char> & status,
130 cv::Size winSize = cv::Size(6,3),
133 float minDisparity = 0.0f,
134 float maxDisparity = 64.0f,
135 bool ssdApproach =
true);
177 cv::InputArray _prevPts, cv::InputOutputArray _nextPts,
178 cv::OutputArray _status, cv::OutputArray _err,
179 cv::Size winSize = cv::Size(15,3),
int maxLevel = 3,
180 cv::TermCriteria criteria = cv::TermCriteria(cv::TermCriteria::COUNT+cv::TermCriteria::EPS, 30, 0.01),
181 int flags = 0,
double minEigThreshold = 1e-4 );
213 const cv::Mat & leftImage,
214 const cv::Mat & rightImage,
238 float fx,
float baseline,
239 int type = CV_32FC1);
264 const cv::Mat & leftImage,
265 const cv::Mat & rightImage,
266 const std::vector<cv::Point2f> & leftCorners,
270 int flowMaxLevel = 4,
271 int flowIterations = 20,
272 double flowEps = 0.02);
299 const cv::Size & disparitySize,
300 const std::vector<cv::Point2f> & leftCorners,
301 const std::vector<cv::Point2f> & rightCorners,
302 const std::vector<unsigned char> & mask);
327 const cv::Mat & leftImage,
328 const std::vector<cv::Point2f> & leftCorners,
329 const std::vector<cv::Point2f> & rightCorners,
330 const std::vector<unsigned char> & mask,
331 float fx,
float baseline);
401 const cv::Mat & depthImage,
404 float depthErrorRatio = 0.02f,
405 bool estWithNeighborsIfNull =
false);
423cv::Rect RTABMAP_CORE_EXPORT
computeRoi(
const cv::Mat & image,
const std::string & roiRatios);
433cv::Rect RTABMAP_CORE_EXPORT
computeRoi(
const cv::Size & imageSize,
const std::string & roiRatios);
443cv::Rect RTABMAP_CORE_EXPORT
computeRoi(
const cv::Mat & image,
const std::vector<float> & roiRatios);
454cv::Rect RTABMAP_CORE_EXPORT
computeRoi(
const cv::Size & imageSize,
const std::vector<float> & roiRatios);
472cv::Mat RTABMAP_CORE_EXPORT
decimate(
const cv::Mat & image,
int d);
490cv::Mat RTABMAP_CORE_EXPORT
interpolate(
const cv::Mat & image,
int factor,
float depthErrorRatio = 0.02f);
516 const cv::Mat & depth,
517 const cv::Mat & depthK,
518 const cv::Size & colorSize,
519 const cv::Mat & colorK,
522 const cv::Mat & depth,
523 const cv::Mat & confidence,
524 const cv::Mat & depthK,
525 const cv::Size & colorSize,
526 const cv::Mat & colorK,
528 cv::Mat & registeredConfidence);
548 const cv::Mat & depth,
549 int maximumHoleSize = 1,
550 float errorRatio = 0.02f);
580 cv::Mat & depthRegistered,
583 bool fillDoubleHoles =
false);
609 const cv::Mat & depth,
610 float sigmaS = 15.0f,
611 float sigmaR = 0.05f,
612 bool earlyDivision =
false);
631 float maxDepthError);
656 const cv::Mat & mask,
657 float clipLowHistPercent=0,
658 float clipHighHistPercent=0,
659 float * alphaOut = 0,
660 float * betaOut = 0);
681 const std::vector<cv::Mat> & images);
701void RTABMAP_CORE_EXPORT
HSVtoRGB(
float *r,
float *g,
float *b,
float h,
float s,
float v );
722void RTABMAP_CORE_EXPORT
NMS(
723 const std::vector<cv::KeyPoint> & ptsIn,
724 const cv::Mat & descriptorsIn,
725 std::vector<cv::KeyPoint> & ptsOut,
726 cv::Mat & descriptorsOut,
727 int dist_thresh,
int img_width,
int img_height);
757std::vector<int> RTABMAP_CORE_EXPORT
SSC(
758 const std::vector<cv::KeyPoint> & keypoints,
763 const std::vector<int> & indx = {});
Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...
cv::Rect RTABMAP_CORE_EXPORT computeRoi(const cv::Mat &image, const std::string &roiRatios)
Computes a region of interest (ROI) in the image using string-defined ratios.
cv::Mat RTABMAP_CORE_EXPORT fastBilateralFiltering(const cv::Mat &depth, float sigmaS=15.0f, float sigmaR=0.05f, bool earlyDivision=false)
Applies a 2D fast bilateral filter to a depth image.
cv::Mat RTABMAP_CORE_EXPORT decimate(const cv::Mat &image, int d)
Downsamples an image by a given decimation factor.
cv::Mat RTABMAP_CORE_EXPORT cvtDepthToFloat(const cv::Mat &depth16U)
Converts a 16-bit unsigned depth image (in millimeters) to a 32-bit float depth image (in meters).
cv::Mat RTABMAP_CORE_EXPORT depthFromDisparity(const cv::Mat &disparity, float fx, float baseline, int type=CV_32FC1)
Converts a disparity map to a depth map using stereo camera parameters.
bool RTABMAP_CORE_EXPORT rotateImagesUpsideUpIfNecessary(CameraModel &model, cv::Mat &rgb, cv::Mat &depth)
Rotates the input RGB and depth images to make them appear upright based on the camera's roll angle.
float RTABMAP_CORE_EXPORT ssd(const cv::Mat &windowLeft, const cv::Mat &windowRight)
Computes the Sum of Squared Differences (SSD) between two image patches.
void RTABMAP_CORE_EXPORT calcOpticalFlowPyrLKStereo(cv::InputArray _prevImg, cv::InputArray _nextImg, cv::InputArray _prevPts, cv::InputOutputArray _nextPts, cv::OutputArray _status, cv::OutputArray _err, cv::Size winSize=cv::Size(15, 3), int maxLevel=3, cv::TermCriteria criteria=cv::TermCriteria(cv::TermCriteria::COUNT+cv::TermCriteria::EPS, 30, 0.01), int flags=0, double minEigThreshold=1e-4)
Computes sparse optical flow using a pyramidal Lucas-Kanade method constrained to the x-axis.
cv::Mat RTABMAP_CORE_EXPORT registerDepth(const cv::Mat &depth, const cv::Mat &depthK, const cv::Size &colorSize, const cv::Mat &colorK, const rtabmap::Transform &transform)
Registers a depth image to a different camera frame (typically RGB).
float RTABMAP_CORE_EXPORT getDepth(const cv::Mat &depthImage, float x, float y, bool smoothing, float depthErrorRatio=0.02f, bool estWithNeighborsIfNull=false)
Retrieves a depth value from a depth image at a subpixel coordinate.
float RTABMAP_CORE_EXPORT sad(const cv::Mat &windowLeft, const cv::Mat &windowRight)
Computes the Sum of Absolute Differences (SAD) between two image patches.
cv::Mat RTABMAP_CORE_EXPORT disparityFromStereoCorrespondences(const cv::Size &disparitySize, const std::vector< cv::Point2f > &leftCorners, const std::vector< cv::Point2f > &rightCorners, const std::vector< unsigned char > &mask)
Computes a disparity map from stereo correspondences between two images.
std::vector< cv::Point2f > RTABMAP_CORE_EXPORT calcStereoCorrespondences(const cv::Mat &leftImage, const cv::Mat &rightImage, const std::vector< cv::Point2f > &leftCorners, std::vector< unsigned char > &status, cv::Size winSize=cv::Size(6, 3), int maxLevel=3, int iterations=5, float minDisparity=0.0f, float maxDisparity=64.0f, bool ssdApproach=true)
Computes stereo correspondences between left and right images using a pyramidal window-based matching...
cv::Mat RTABMAP_CORE_EXPORT cvtDepthFromFloat(const cv::Mat &depth32F)
Converts a 32-bit float depth image (in meters) to a 16-bit unsigned depth image (in millimeters).
void RTABMAP_CORE_EXPORT depthBleedingFiltering(cv::Mat &depth, float maxDepthError)
Filters out depth bleeding artifacts in a depth image.
cv::Mat RTABMAP_CORE_EXPORT brightnessAndContrastAuto(const cv::Mat &src, const cv::Mat &mask, float clipLowHistPercent=0, float clipHighHistPercent=0, float *alphaOut=0, float *betaOut=0)
Automatic brightness and contrast optimization with optional histogram clipping.
std::vector< int > RTABMAP_CORE_EXPORT SSC(const std::vector< cv::KeyPoint > &keypoints, int maxKeypoints, float tolerance, int cols, int rows, const std::vector< int > &indx={})
Applies the SSC (Suppression via Square Covering) algorithm to spatially select keypoints.
cv::Mat RTABMAP_CORE_EXPORT depthFromStereoImages(const cv::Mat &leftImage, const cv::Mat &rightImage, const std::vector< cv::Point2f > &leftCorners, float fx, float baseline, int flowWinSize=9, int flowMaxLevel=4, int flowIterations=20, double flowEps=0.02)
Computes a depth map from stereo image pairs using optical flow tracking.
void RTABMAP_CORE_EXPORT NMS(const std::vector< cv::KeyPoint > &ptsIn, const cv::Mat &descriptorsIn, std::vector< cv::KeyPoint > &ptsOut, cv::Mat &descriptorsOut, int dist_thresh, int img_width, int img_height)
Applies Non-Maximum Suppression (NMS) to a set of keypoints.
void RTABMAP_CORE_EXPORT HSVtoRGB(float *r, float *g, float *b, float h, float s, float v)
Converts a color from HSV (Hue, Saturation, Value) to RGB.
cv::Mat RTABMAP_CORE_EXPORT exposureFusion(const std::vector< cv::Mat > &images)
Performs exposure fusion on a set of input images.
cv::Mat RTABMAP_CORE_EXPORT disparityFromStereoImages(const cv::Mat &leftImage, const cv::Mat &rightImage, const ParametersMap ¶meters=ParametersMap())
Computes the disparity map from a pair of stereo images.
cv::Mat RTABMAP_CORE_EXPORT depthFromStereoCorrespondences(const cv::Mat &leftImage, const std::vector< cv::Point2f > &leftCorners, const std::vector< cv::Point2f > &rightCorners, const std::vector< unsigned char > &mask, float fx, float baseline)
Computes a sparse depth map from corresponding stereo feature points.
cv::Mat RTABMAP_CORE_EXPORT fillDepthHoles(const cv::Mat &depth, int maximumHoleSize=1, float errorRatio=0.02f)
Fills holes in the depth image using linear interpolation.
cv::Mat RTABMAP_CORE_EXPORT interpolate(const cv::Mat &image, int factor, float depthErrorRatio=0.02f)
Upsamples a depth image using bilinear interpolation with depth consistency check.
void RTABMAP_CORE_EXPORT fillRegisteredDepthHoles(cv::Mat &depthRegistered, bool vertical, bool horizontal, bool fillDoubleHoles=false)
Fill holes in a registered depth image using linear interpolation.
std::map< std::string, std::string > ParametersMap
Parameter keys mapped to their values, as used by every configurable class (see Parameters).