mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 00:57:46 +08:00
1725 lines
106 KiB
HTML
1725 lines
106 KiB
HTML
<!-- HTML header for doxygen 1.9.8-->
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||
<meta name="generator" content="Doxygen 1.9.8"/>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||
<title>RTAB-Map: rtabmap::util2d Namespace Reference</title>
|
||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||
<script type="text/javascript" src="jquery.js"></script>
|
||
<script type="text/javascript" src="dynsections.js"></script>
|
||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||
<script type="text/javascript" src="search/search.js"></script>
|
||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||
<script type="text/javascript">window.RTABMAP_DOC_ROOT="";</script>
|
||
<script type="text/javascript" src="../versions.js"></script>
|
||
<script type="text/javascript" src="version-switcher.js"></script>
|
||
</head>
|
||
<body>
|
||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||
<div id="titlearea">
|
||
<table cellspacing="0" cellpadding="0">
|
||
<tbody>
|
||
<tr id="projectrow">
|
||
<td id="projectalign">
|
||
<div id="projectname">RTAB-Map<span id="projectnumber"> 0.23.10</span>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<!-- end header part -->
|
||
<!-- Generated by Doxygen 1.9.8 -->
|
||
<script type="text/javascript">
|
||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||
/* @license-end */
|
||
</script>
|
||
<script type="text/javascript" src="menudata.js"></script>
|
||
<script type="text/javascript" src="menu.js"></script>
|
||
<script type="text/javascript">
|
||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||
$(function() {
|
||
initMenu('',true,false,'search.php','Search');
|
||
$(document).ready(function() { init_search(); });
|
||
});
|
||
/* @license-end */
|
||
</script>
|
||
<div id="main-nav"></div>
|
||
<!-- window showing the filter options -->
|
||
<div id="MSearchSelectWindow"
|
||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
</div>
|
||
|
||
<!-- iframe showing the search results (closed by default) -->
|
||
<div id="MSearchResultsWindow">
|
||
<div id="MSearchResults">
|
||
<div class="SRPage">
|
||
<div id="SRIndex">
|
||
<div id="SRResults"></div>
|
||
<div class="SRStatus" id="Loading">Loading...</div>
|
||
<div class="SRStatus" id="Searching">Searching...</div>
|
||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="nav-path" class="navpath">
|
||
<ul>
|
||
<li class="navelem"><a class="el" href="namespacertabmap.html">rtabmap</a></li><li class="navelem"><a class="el" href="namespacertabmap_1_1util2d.html">util2d</a></li> </ul>
|
||
</div>
|
||
</div><!-- top -->
|
||
<div class="header">
|
||
<div class="summary">
|
||
<a href="#func-members">Functions</a> </div>
|
||
<div class="headertitle"><div class="title">rtabmap::util2d Namespace Reference</div></div>
|
||
</div><!--header-->
|
||
<div class="contents">
|
||
|
||
<p>This namespace contains 2D image processing utilities.
|
||
<a href="namespacertabmap_1_1util2d.html#details">More...</a></p>
|
||
<table class="memberdecls">
|
||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||
Functions</h2></td></tr>
|
||
<tr class="memitem:a179e07ca5bc9581ff4782ae8f9d33521" id="r_a179e07ca5bc9581ff4782ae8f9d33521"><td class="memItemLeft" align="right" valign="top">float RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a179e07ca5bc9581ff4782ae8f9d33521">ssd</a> (const cv::Mat &windowLeft, const cv::Mat &windowRight)</td></tr>
|
||
<tr class="memdesc:a179e07ca5bc9581ff4782ae8f9d33521"><td class="mdescLeft"> </td><td class="mdescRight">Computes the Sum of Squared Differences (SSD) between two image patches. <br /></td></tr>
|
||
<tr class="separator:a179e07ca5bc9581ff4782ae8f9d33521"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a4cd865b8edc489f950b0c1b5e1a0c992" id="r_a4cd865b8edc489f950b0c1b5e1a0c992"><td class="memItemLeft" align="right" valign="top">float RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a4cd865b8edc489f950b0c1b5e1a0c992">sad</a> (const cv::Mat &windowLeft, const cv::Mat &windowRight)</td></tr>
|
||
<tr class="memdesc:a4cd865b8edc489f950b0c1b5e1a0c992"><td class="mdescLeft"> </td><td class="mdescRight">Computes the Sum of Absolute Differences (SAD) between two image patches. <br /></td></tr>
|
||
<tr class="separator:a4cd865b8edc489f950b0c1b5e1a0c992"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a53e2ae078c4c5c997fda9f1b6d1dda33" id="r_a53e2ae078c4c5c997fda9f1b6d1dda33"><td class="memItemLeft" align="right" valign="top">std::vector< cv::Point2f > RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a53e2ae078c4c5c997fda9f1b6d1dda33">calcStereoCorrespondences</a> (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)</td></tr>
|
||
<tr class="memdesc:a53e2ae078c4c5c997fda9f1b6d1dda33"><td class="mdescLeft"> </td><td class="mdescRight">Computes stereo correspondences between left and right images using a pyramidal window-based matching approach. <br /></td></tr>
|
||
<tr class="separator:a53e2ae078c4c5c997fda9f1b6d1dda33"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a3d01284751a6b46770a28a7f63576600" id="r_a3d01284751a6b46770a28a7f63576600"><td class="memItemLeft" align="right" valign="top">void RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a3d01284751a6b46770a28a7f63576600">calcOpticalFlowPyrLKStereo</a> (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)</td></tr>
|
||
<tr class="memdesc:a3d01284751a6b46770a28a7f63576600"><td class="mdescLeft"> </td><td class="mdescRight">Computes sparse optical flow using a pyramidal Lucas-Kanade method constrained to the x-axis. <br /></td></tr>
|
||
<tr class="separator:a3d01284751a6b46770a28a7f63576600"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ad7ea8d1905c7143d376c57c9e22dcea5" id="r_ad7ea8d1905c7143d376c57c9e22dcea5"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#ad7ea8d1905c7143d376c57c9e22dcea5">disparityFromStereoImages</a> (const cv::Mat &leftImage, const cv::Mat &rightImage, const ParametersMap &parameters=ParametersMap())</td></tr>
|
||
<tr class="memdesc:ad7ea8d1905c7143d376c57c9e22dcea5"><td class="mdescLeft"> </td><td class="mdescRight">Computes the disparity map from a pair of stereo images. <br /></td></tr>
|
||
<tr class="separator:ad7ea8d1905c7143d376c57c9e22dcea5"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a110359c4884579e1c7b68d8baa7acb6c" id="r_a110359c4884579e1c7b68d8baa7acb6c"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a110359c4884579e1c7b68d8baa7acb6c">depthFromDisparity</a> (const cv::Mat &disparity, float fx, float baseline, int type=CV_32FC1)</td></tr>
|
||
<tr class="memdesc:a110359c4884579e1c7b68d8baa7acb6c"><td class="mdescLeft"> </td><td class="mdescRight">Converts a disparity map to a depth map using stereo camera parameters. <br /></td></tr>
|
||
<tr class="separator:a110359c4884579e1c7b68d8baa7acb6c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:aacf89454b054d86b53a8038c8a404b50" id="r_aacf89454b054d86b53a8038c8a404b50"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#aacf89454b054d86b53a8038c8a404b50">depthFromStereoImages</a> (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)</td></tr>
|
||
<tr class="memdesc:aacf89454b054d86b53a8038c8a404b50"><td class="mdescLeft"> </td><td class="mdescRight">Computes a depth map from stereo image pairs using optical flow tracking. <br /></td></tr>
|
||
<tr class="separator:aacf89454b054d86b53a8038c8a404b50"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a4f10f8038c62a97d3a79bd2dc5bf2c58" id="r_a4f10f8038c62a97d3a79bd2dc5bf2c58"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a4f10f8038c62a97d3a79bd2dc5bf2c58">disparityFromStereoCorrespondences</a> (const cv::Size &disparitySize, const std::vector< cv::Point2f > &leftCorners, const std::vector< cv::Point2f > &rightCorners, const std::vector< unsigned char > &mask)</td></tr>
|
||
<tr class="memdesc:a4f10f8038c62a97d3a79bd2dc5bf2c58"><td class="mdescLeft"> </td><td class="mdescRight">Computes a disparity map from stereo correspondences between two images. <br /></td></tr>
|
||
<tr class="separator:a4f10f8038c62a97d3a79bd2dc5bf2c58"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ae6548e6246eceaff5dcc9ee30514eac5" id="r_ae6548e6246eceaff5dcc9ee30514eac5"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#ae6548e6246eceaff5dcc9ee30514eac5">depthFromStereoCorrespondences</a> (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)</td></tr>
|
||
<tr class="memdesc:ae6548e6246eceaff5dcc9ee30514eac5"><td class="mdescLeft"> </td><td class="mdescRight">Computes a sparse depth map from corresponding stereo feature points. <br /></td></tr>
|
||
<tr class="separator:ae6548e6246eceaff5dcc9ee30514eac5"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a6740b13198a2c437ab51d8e0503f2d33" id="r_a6740b13198a2c437ab51d8e0503f2d33"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a6740b13198a2c437ab51d8e0503f2d33">cvtDepthFromFloat</a> (const cv::Mat &depth32F)</td></tr>
|
||
<tr class="memdesc:a6740b13198a2c437ab51d8e0503f2d33"><td class="mdescLeft"> </td><td class="mdescRight">Converts a 32-bit float depth image (in meters) to a 16-bit unsigned depth image (in millimeters). <br /></td></tr>
|
||
<tr class="separator:a6740b13198a2c437ab51d8e0503f2d33"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a0e4631bed561b3a694a1a65853221f75" id="r_a0e4631bed561b3a694a1a65853221f75"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a0e4631bed561b3a694a1a65853221f75">cvtDepthToFloat</a> (const cv::Mat &depth16U)</td></tr>
|
||
<tr class="memdesc:a0e4631bed561b3a694a1a65853221f75"><td class="mdescLeft"> </td><td class="mdescRight">Converts a 16-bit unsigned depth image (in millimeters) to a 32-bit float depth image (in meters). <br /></td></tr>
|
||
<tr class="separator:a0e4631bed561b3a694a1a65853221f75"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a48b07b02efba21a914db10e832589aba" id="r_a48b07b02efba21a914db10e832589aba"><td class="memItemLeft" align="right" valign="top">float RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a48b07b02efba21a914db10e832589aba">getDepth</a> (const cv::Mat &depthImage, float x, float y, bool smoothing, float depthErrorRatio=0.02f, bool estWithNeighborsIfNull=false)</td></tr>
|
||
<tr class="memdesc:a48b07b02efba21a914db10e832589aba"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves a depth value from a depth image at a subpixel coordinate. <br /></td></tr>
|
||
<tr class="separator:a48b07b02efba21a914db10e832589aba"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ga79d3f93673fb236980f0be532695f478" id="r_ga79d3f93673fb236980f0be532695f478"><td class="memItemLeft" align="right" valign="top">cv::Rect RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__RoiComputation.html#ga79d3f93673fb236980f0be532695f478">computeRoi</a> (const cv::Mat &image, const std::string &roiRatios)</td></tr>
|
||
<tr class="memdesc:ga79d3f93673fb236980f0be532695f478"><td class="mdescLeft"> </td><td class="mdescRight">Computes a region of interest (ROI) in the image using string-defined ratios. <br /></td></tr>
|
||
<tr class="separator:ga79d3f93673fb236980f0be532695f478"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ga2f0ffb8f6882e28709b03446d50250bb" id="r_ga2f0ffb8f6882e28709b03446d50250bb"><td class="memItemLeft" align="right" valign="top">cv::Rect RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__RoiComputation.html#ga2f0ffb8f6882e28709b03446d50250bb">computeRoi</a> (const cv::Size &imageSize, const std::string &roiRatios)</td></tr>
|
||
<tr class="memdesc:ga2f0ffb8f6882e28709b03446d50250bb"><td class="mdescLeft"> </td><td class="mdescRight">Computes a region of interest (ROI) from an image size and a string of ratios. <br /></td></tr>
|
||
<tr class="separator:ga2f0ffb8f6882e28709b03446d50250bb"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ga81d9f49d117d02494c7ff57f5d426b15" id="r_ga81d9f49d117d02494c7ff57f5d426b15"><td class="memItemLeft" align="right" valign="top">cv::Rect RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__RoiComputation.html#ga81d9f49d117d02494c7ff57f5d426b15">computeRoi</a> (const cv::Mat &image, const std::vector< float > &roiRatios)</td></tr>
|
||
<tr class="memdesc:ga81d9f49d117d02494c7ff57f5d426b15"><td class="mdescLeft"> </td><td class="mdescRight">Computes a region of interest (ROI) in the image using float vector-defined ratios. <br /></td></tr>
|
||
<tr class="separator:ga81d9f49d117d02494c7ff57f5d426b15"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ga56fed8ce688e8e9eb3b1f74ad0febcef" id="r_ga56fed8ce688e8e9eb3b1f74ad0febcef"><td class="memItemLeft" align="right" valign="top">cv::Rect RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__RoiComputation.html#ga56fed8ce688e8e9eb3b1f74ad0febcef">computeRoi</a> (const cv::Size &imageSize, const std::vector< float > &roiRatios)</td></tr>
|
||
<tr class="memdesc:ga56fed8ce688e8e9eb3b1f74ad0febcef"><td class="mdescLeft"> </td><td class="mdescRight">Computes a region of interest (ROI) using float ratios and the image size. <br /></td></tr>
|
||
<tr class="separator:ga56fed8ce688e8e9eb3b1f74ad0febcef"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a0b545a9f852684afb0a6d8f835f9eaf2" id="r_a0b545a9f852684afb0a6d8f835f9eaf2"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a0b545a9f852684afb0a6d8f835f9eaf2">decimate</a> (const cv::Mat &image, int d)</td></tr>
|
||
<tr class="memdesc:a0b545a9f852684afb0a6d8f835f9eaf2"><td class="mdescLeft"> </td><td class="mdescRight">Downsamples an image by a given decimation factor. <br /></td></tr>
|
||
<tr class="separator:a0b545a9f852684afb0a6d8f835f9eaf2"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:afc241016af8396edf5228dbe9e80ee8d" id="r_afc241016af8396edf5228dbe9e80ee8d"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#afc241016af8396edf5228dbe9e80ee8d">interpolate</a> (const cv::Mat &image, int factor, float depthErrorRatio=0.02f)</td></tr>
|
||
<tr class="memdesc:afc241016af8396edf5228dbe9e80ee8d"><td class="mdescLeft"> </td><td class="mdescRight">Upsamples a depth image using bilinear interpolation with depth consistency check. <br /></td></tr>
|
||
<tr class="separator:afc241016af8396edf5228dbe9e80ee8d"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a48a7e15282f392e77561dd96ed3320f9" id="r_a48a7e15282f392e77561dd96ed3320f9"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a48a7e15282f392e77561dd96ed3320f9">registerDepth</a> (const cv::Mat &depth, const cv::Mat &depthK, const cv::Size &colorSize, const cv::Mat &colorK, const <a class="el" href="classrtabmap_1_1Transform.html">rtabmap::Transform</a> &transform)</td></tr>
|
||
<tr class="memdesc:a48a7e15282f392e77561dd96ed3320f9"><td class="mdescLeft"> </td><td class="mdescRight">Registers a depth image to a different camera frame (typically RGB). <br /></td></tr>
|
||
<tr class="separator:a48a7e15282f392e77561dd96ed3320f9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:aba2d4119a4d4b4b93b7b0c89b82cd3e6" id="r_aba2d4119a4d4b4b93b7b0c89b82cd3e6"><td class="memItemLeft" align="right" valign="top"><a id="aba2d4119a4d4b4b93b7b0c89b82cd3e6" name="aba2d4119a4d4b4b93b7b0c89b82cd3e6"></a>
|
||
cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><b>registerDepth</b> (const cv::Mat &depth, const cv::Mat &confidence, const cv::Mat &depthK, const cv::Size &colorSize, const cv::Mat &colorK, const <a class="el" href="classrtabmap_1_1Transform.html">rtabmap::Transform</a> &transform, cv::Mat &registeredConfidence)</td></tr>
|
||
<tr class="separator:aba2d4119a4d4b4b93b7b0c89b82cd3e6"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:aeb3dee2cf6484f0b224d4687899cb004" id="r_aeb3dee2cf6484f0b224d4687899cb004"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#aeb3dee2cf6484f0b224d4687899cb004">fillDepthHoles</a> (const cv::Mat &depth, int maximumHoleSize=1, float errorRatio=0.02f)</td></tr>
|
||
<tr class="memdesc:aeb3dee2cf6484f0b224d4687899cb004"><td class="mdescLeft"> </td><td class="mdescRight">Fills holes in the depth image using linear interpolation. <br /></td></tr>
|
||
<tr class="separator:aeb3dee2cf6484f0b224d4687899cb004"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:afc6c9b3442c64ef2061365ead3923228" id="r_afc6c9b3442c64ef2061365ead3923228"><td class="memItemLeft" align="right" valign="top">void RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#afc6c9b3442c64ef2061365ead3923228">fillRegisteredDepthHoles</a> (cv::Mat &depthRegistered, bool vertical, bool horizontal, bool fillDoubleHoles=false)</td></tr>
|
||
<tr class="memdesc:afc6c9b3442c64ef2061365ead3923228"><td class="mdescLeft"> </td><td class="mdescRight">Fill holes in a registered depth image using linear interpolation. <br /></td></tr>
|
||
<tr class="separator:afc6c9b3442c64ef2061365ead3923228"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a076914fde23d1323fccf71a794b9bc51" id="r_a076914fde23d1323fccf71a794b9bc51"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a076914fde23d1323fccf71a794b9bc51">fastBilateralFiltering</a> (const cv::Mat &depth, float sigmaS=15.0f, float sigmaR=0.05f, bool earlyDivision=false)</td></tr>
|
||
<tr class="memdesc:a076914fde23d1323fccf71a794b9bc51"><td class="mdescLeft"> </td><td class="mdescRight">Applies a 2D fast bilateral filter to a depth image. <br /></td></tr>
|
||
<tr class="separator:a076914fde23d1323fccf71a794b9bc51"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a7788d4dabf084959aa69162d5dbb2d2e" id="r_a7788d4dabf084959aa69162d5dbb2d2e"><td class="memItemLeft" align="right" valign="top">void RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a7788d4dabf084959aa69162d5dbb2d2e">depthBleedingFiltering</a> (cv::Mat &depth, float maxDepthError)</td></tr>
|
||
<tr class="memdesc:a7788d4dabf084959aa69162d5dbb2d2e"><td class="mdescLeft"> </td><td class="mdescRight">Filters out depth bleeding artifacts in a depth image. <br /></td></tr>
|
||
<tr class="separator:a7788d4dabf084959aa69162d5dbb2d2e"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a89ec90b2659c764ba22b5c36d729c8f8" id="r_a89ec90b2659c764ba22b5c36d729c8f8"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a89ec90b2659c764ba22b5c36d729c8f8">brightnessAndContrastAuto</a> (const cv::Mat &src, const cv::Mat &mask, float clipLowHistPercent=0, float clipHighHistPercent=0, float *alphaOut=0, float *betaOut=0)</td></tr>
|
||
<tr class="memdesc:a89ec90b2659c764ba22b5c36d729c8f8"><td class="mdescLeft"> </td><td class="mdescRight">Automatic brightness and contrast optimization with optional histogram clipping. <br /></td></tr>
|
||
<tr class="separator:a89ec90b2659c764ba22b5c36d729c8f8"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ac38e8ed586d24c4b9fe72d64afeb9583" id="r_ac38e8ed586d24c4b9fe72d64afeb9583"><td class="memItemLeft" align="right" valign="top">cv::Mat RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#ac38e8ed586d24c4b9fe72d64afeb9583">exposureFusion</a> (const std::vector< cv::Mat > &images)</td></tr>
|
||
<tr class="memdesc:ac38e8ed586d24c4b9fe72d64afeb9583"><td class="mdescLeft"> </td><td class="mdescRight">Performs exposure fusion on a set of input images. <br /></td></tr>
|
||
<tr class="separator:ac38e8ed586d24c4b9fe72d64afeb9583"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:ac29ac5b8bed26a5299d378708170dd11" id="r_ac29ac5b8bed26a5299d378708170dd11"><td class="memItemLeft" align="right" valign="top">void RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#ac29ac5b8bed26a5299d378708170dd11">HSVtoRGB</a> (float *r, float *g, float *b, float h, float s, float v)</td></tr>
|
||
<tr class="memdesc:ac29ac5b8bed26a5299d378708170dd11"><td class="mdescLeft"> </td><td class="mdescRight">Converts a color from HSV (Hue, Saturation, Value) to RGB. <br /></td></tr>
|
||
<tr class="separator:ac29ac5b8bed26a5299d378708170dd11"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:aafa9a426c8e7dd0359adf40e1b45ee1c" id="r_aafa9a426c8e7dd0359adf40e1b45ee1c"><td class="memItemLeft" align="right" valign="top">void RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#aafa9a426c8e7dd0359adf40e1b45ee1c">NMS</a> (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)</td></tr>
|
||
<tr class="memdesc:aafa9a426c8e7dd0359adf40e1b45ee1c"><td class="mdescLeft"> </td><td class="mdescRight">Applies Non-Maximum Suppression (NMS) to a set of keypoints. <br /></td></tr>
|
||
<tr class="separator:aafa9a426c8e7dd0359adf40e1b45ee1c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:aa6957971e17f27bb066efe036d80fd46" id="r_aa6957971e17f27bb066efe036d80fd46"><td class="memItemLeft" align="right" valign="top">std::vector< int > RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#aa6957971e17f27bb066efe036d80fd46">SSC</a> (const std::vector< cv::KeyPoint > &keypoints, int maxKeypoints, float tolerance, int cols, int rows, const std::vector< int > &indx={})</td></tr>
|
||
<tr class="memdesc:aa6957971e17f27bb066efe036d80fd46"><td class="mdescLeft"> </td><td class="mdescRight">Applies the SSC (Suppression via Square Covering) algorithm to spatially select keypoints. <br /></td></tr>
|
||
<tr class="separator:aa6957971e17f27bb066efe036d80fd46"><td class="memSeparator" colspan="2"> </td></tr>
|
||
<tr class="memitem:a1577494ad9730181d5b768ca8237d5dd" id="r_a1577494ad9730181d5b768ca8237d5dd"><td class="memItemLeft" align="right" valign="top">bool RTABMAP_CORE_EXPORT </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacertabmap_1_1util2d.html#a1577494ad9730181d5b768ca8237d5dd">rotateImagesUpsideUpIfNecessary</a> (<a class="el" href="classrtabmap_1_1CameraModel.html">CameraModel</a> &model, cv::Mat &rgb, cv::Mat &depth)</td></tr>
|
||
<tr class="memdesc:a1577494ad9730181d5b768ca8237d5dd"><td class="mdescLeft"> </td><td class="mdescRight">Rotates the input RGB and depth images to make them appear upright based on the camera's roll angle. <br /></td></tr>
|
||
<tr class="separator:a1577494ad9730181d5b768ca8237d5dd"><td class="memSeparator" colspan="2"> </td></tr>
|
||
</table>
|
||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||
<div class="textblock"><p>This namespace contains 2D image processing utilities. </p>
|
||
</div><h2 class="groupheader">Function Documentation</h2>
|
||
<a id="a179e07ca5bc9581ff4782ae8f9d33521" name="a179e07ca5bc9581ff4782ae8f9d33521"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a179e07ca5bc9581ff4782ae8f9d33521">◆ </a></span>ssd()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">float RTABMAP_CORE_EXPORT rtabmap::util2d::ssd </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>windowLeft</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>windowRight</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes the Sum of Squared Differences (SSD) between two image patches. </p>
|
||
<p>This function calculates the pixel-wise squared differences between corresponding elements in two input windows and accumulates the result into a single score. It supports grayscale 8-bit, 32-bit float, and 16-bit 2-channel short images (e.g., optical flow or stereo blocks).</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">windowLeft</td><td>Left input image patch. </td></tr>
|
||
<tr><td class="paramname">windowRight</td><td>Right input image patch (must be the same size and type as windowLeft). </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>The SSD score (a lower score indicates higher similarity).</dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if the input types or dimensions don't match.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<p>Supported types:</p><ul>
|
||
<li>CV_8UC1 (grayscale image)</li>
|
||
<li>CV_32FC1 (floating-point grayscale)</li>
|
||
<li>CV_16SC2 (2-channel signed short vectors; average of both channels used) </li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a4cd865b8edc489f950b0c1b5e1a0c992" name="a4cd865b8edc489f950b0c1b5e1a0c992"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a4cd865b8edc489f950b0c1b5e1a0c992">◆ </a></span>sad()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">float RTABMAP_CORE_EXPORT rtabmap::util2d::sad </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>windowLeft</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>windowRight</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes the Sum of Absolute Differences (SAD) between two image patches. </p>
|
||
<p>This function calculates the absolute pixel intensity difference between two windows and accumulates the result. It supports grayscale 8-bit, 32-bit float, and 16-bit 2-channel short images.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">windowLeft</td><td>Left input image patch. </td></tr>
|
||
<tr><td class="paramname">windowRight</td><td>Right input image patch (must match windowLeft in size and type). </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>The SAD score (a lower score indicates greater similarity).</dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if the input types or dimensions are incompatible.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<p>Supported types:</p><ul>
|
||
<li>CV_8UC1 (grayscale image)</li>
|
||
<li>CV_32FC1 (floating-point grayscale)</li>
|
||
<li>CV_16SC2 (2-channel signed short vectors; average of both channels used) </li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a53e2ae078c4c5c997fda9f1b6d1dda33" name="a53e2ae078c4c5c997fda9f1b6d1dda33"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a53e2ae078c4c5c997fda9f1b6d1dda33">◆ </a></span>calcStereoCorrespondences()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">std::vector< cv::Point2f > RTABMAP_CORE_EXPORT rtabmap::util2d::calcStereoCorrespondences </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>leftImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>rightImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< cv::Point2f > & </td>
|
||
<td class="paramname"><em>leftCorners</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">std::vector< unsigned char > & </td>
|
||
<td class="paramname"><em>status</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::Size </td>
|
||
<td class="paramname"><em>winSize</em> = <code>cv::Size(6, 3)</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>maxLevel</em> = <code>3</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>iterations</em> = <code>5</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>minDisparity</em> = <code>0.0f</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>maxDisparity</em> = <code>64.0f</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>ssdApproach</em> = <code>true</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes stereo correspondences between left and right images using a pyramidal window-based matching approach. </p>
|
||
<p>This function estimates the right image positions of a set of corners detected in the left image using block matching. It supports both Sum of Absolute Differences (SAD) and Sum of Squared Differences (SSD) as the matching criteria, and uses a coarse-to-fine strategy over an image pyramid for robustness and subpixel accuracy.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir"></td><td class="paramname">leftImage</td><td>The left image (grayscale 8 bits or CV_8UC1). </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">rightImage</td><td>The right image (same type and size as <code>leftImage</code>). </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">leftCorners</td><td>The list of 2D points in the left image for which correspondences are to be found. </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">status</td><td>Output status vector indicating the success of correspondence for each point. (1: valid correspondence found, 0: no valid match) </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">winSize</td><td>The size of the search window (should be odd). Will be made odd internally if not. Minimum size is 3. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">maxLevel</td><td>The maximum level of the image pyramid to use for coarse-to-fine search. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">iterations</td><td>Number of iterations for subpixel refinement (gradient descent-like search). </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">minDisparityF</td><td>Minimum allowed disparity (float). Defines search range. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">maxDisparityF</td><td>Maximum allowed disparity (float). Defines search range. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">ssdApproach</td><td>If true, uses SSD (Sum of Squared Differences) as matching cost. If false, uses SAD (Sum of Absolute Differences).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A vector of 2D points corresponding to <code>leftCorners</code> but in the right image. The size of the output matches the input <code>leftCorners</code>. Invalid or rejected points are flagged in <code>status</code>.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>- Both input images must be rectified (i.e., correspondences lie along epipolar lines).<ul>
|
||
<li>This function modifies the search window to ensure it is odd-sized (required for accurate matching).</li>
|
||
<li>Subpixel accuracy is achieved using iterative matching and local refinement.</li>
|
||
<li>The disparity range is adaptive and refined at each pyramid level.</li>
|
||
<li>For accurate results, ensure good quality corner detection and well-rectified input images.</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd>cv::buildOpticalFlowPyramid, cv::getRectSubPix </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a3d01284751a6b46770a28a7f63576600" name="a3d01284751a6b46770a28a7f63576600"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a3d01284751a6b46770a28a7f63576600">◆ </a></span>calcOpticalFlowPyrLKStereo()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void RTABMAP_CORE_EXPORT rtabmap::util2d::calcOpticalFlowPyrLKStereo </td>
|
||
<td>(</td>
|
||
<td class="paramtype">cv::InputArray </td>
|
||
<td class="paramname"><em>_prevImg</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::InputArray </td>
|
||
<td class="paramname"><em>_nextImg</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::InputArray </td>
|
||
<td class="paramname"><em>_prevPts</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::InputOutputArray </td>
|
||
<td class="paramname"><em>_nextPts</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::OutputArray </td>
|
||
<td class="paramname"><em>_status</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::OutputArray </td>
|
||
<td class="paramname"><em>_err</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::Size </td>
|
||
<td class="paramname"><em>winSize</em> = <code>cv::Size(15, 3)</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>maxLevel</em> = <code>3</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::TermCriteria </td>
|
||
<td class="paramname"><em>criteria</em> = <code>cv::TermCriteria(cv::TermCriteria::COUNT+cv::TermCriteria::EPS, 30, 0.01)</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>flags</em> = <code>0</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">double </td>
|
||
<td class="paramname"><em>minEigThreshold</em> = <code>1e-4</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes sparse optical flow using a pyramidal Lucas-Kanade method constrained to the x-axis. </p>
|
||
<p>This function is a customized version of OpenCV's <code>cv::calcOpticalFlowPyrLK</code>, modified specifically for stereo matching scenarios. It assumes that the <code>prevImg</code> is the left stereo image and <code>nextImg</code> is the right stereo image. The optical flow is computed only along the x-axis (i.e., horizontal direction), which is typically valid in rectified stereo image pairs.</p>
|
||
<dl class="section note"><dt>Note</dt><dd>The key modification to the original Lucas-Kanade implementation is the following: Instead of computing the flow in both x and y directions, the y-displacement is <b>forced to zero</b>: <div class="fragment"><div class="line"><span class="comment">// Original:</span></div>
|
||
<div class="line">cv::Point2f delta((<span class="keywordtype">float</span>)((A12*b2 - A22*b1) * D), (<span class="keywordtype">float</span>)((A12*b1 - A11*b2) * D));</div>
|
||
<div class="line"> </div>
|
||
<div class="line"><span class="comment">// Modified:</span></div>
|
||
<div class="line">cv::Point2f delta((<span class="keywordtype">float</span>)((A12*b2 - A22*b1) * D), 0);</div>
|
||
</div><!-- fragment --> This ensures that flow estimation is constrained along the epipolar lines (x-direction only).</dd></dl>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">_prevImg</td><td>Input image from the previous frame (or left stereo image). Supports pyramid or raw image. </td></tr>
|
||
<tr><td class="paramname">_nextImg</td><td>Input image from the next frame (or right stereo image). Supports pyramid or raw image. </td></tr>
|
||
<tr><td class="paramname">_prevPts</td><td>Vector of 2D points for which the flow needs to be found (in <code>prevImg</code>). </td></tr>
|
||
<tr><td class="paramname">_nextPts</td><td>Output vector of 2D points containing the calculated new positions (in <code>nextImg</code>). If <code>OPTFLOW_USE_INITIAL_FLOW</code> is passed, it should contain initial guesses. </td></tr>
|
||
<tr><td class="paramname">_status</td><td>Output status vector. Each element is set to 1 if flow for the corresponding features has been found, 0 otherwise. </td></tr>
|
||
<tr><td class="paramname">_err</td><td>Optional output vector. Contains error or min eigenvalue values (depending on flags). </td></tr>
|
||
<tr><td class="paramname">winSize</td><td>Size of the search window at each pyramid level. </td></tr>
|
||
<tr><td class="paramname">maxLevel</td><td>0-based maximal pyramid level number. If set to 0, pyramids are not used (single level). </td></tr>
|
||
<tr><td class="paramname">criteria</td><td>Termination criteria for iterative search algorithm (maxCount and/or epsilon). </td></tr>
|
||
<tr><td class="paramname">flags</td><td>Operation flags:<ul>
|
||
<li><code>OPTFLOW_USE_INITIAL_FLOW</code>: Use initial <code>nextPts</code> values.</li>
|
||
<li><code>OPTFLOW_LK_GET_MIN_EIGENVALS</code>: Output minimum eigenvalues instead of error. </li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">minEigThreshold</td><td>Minimum eigenvalue threshold for rejecting unstable flow vectors.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section see"><dt>See also</dt><dd>cv::calcOpticalFlowPyrLK </dd>
|
||
<dd>
|
||
<a href="https://github.com/opencv/opencv/blob/4.x/modules/video/src/lkpyramid.cpp">https://github.com/opencv/opencv/blob/4.x/modules/video/src/lkpyramid.cpp</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ad7ea8d1905c7143d376c57c9e22dcea5" name="ad7ea8d1905c7143d376c57c9e22dcea5"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ad7ea8d1905c7143d376c57c9e22dcea5">◆ </a></span>disparityFromStereoImages()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::disparityFromStereoImages </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>leftImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>rightImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const ParametersMap & </td>
|
||
<td class="paramname"><em>parameters</em> = <code>ParametersMap()</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes the disparity map from a pair of stereo images. </p>
|
||
<p>This function calculates a dense disparity map from the provided left and right stereo images. It assumes that the stereo pair is rectified and of the same size. The left image can be either grayscale (CV_8UC1) or color (CV_8UC3), while the right image must be grayscale (CV_8UC1).</p>
|
||
<p>If the left image is in color, it is first converted to grayscale before disparity computation. The actual disparity computation is delegated to a <code><a class="el" href="classrtabmap_1_1StereoDense.html" title="Abstract base class for dense stereo matching algorithms.">StereoDense</a></code> object created using the provided parameters.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">leftImage</td><td>The left image of the stereo pair. Can be grayscale or BGR color. </td></tr>
|
||
<tr><td class="paramname">rightImage</td><td>The right image of the stereo pair. Must be grayscale. </td></tr>
|
||
<tr><td class="paramname">parameters</td><td>A map of parameters used to configure the stereo matching algorithm.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A <code>cv::Mat</code> representing the computed disparity map. Some algorithms, like <a class="el" href="classrtabmap_1_1StereoBM.html" title="Block Matching algorithm for dense stereo matching.">StereoBM</a> or <a class="el" href="classrtabmap_1_1StereoSGBM.html" title="Semi-Global Block Matching algorithm for dense stereo matching.">StereoSGBM</a> compute 16-bit fixed-point disparity map (CV_16SC1) (where each disparity value has 4 fractional bits), whereas other algorithms output 32-bit floating-point (CV_32FC1) disparity map.</dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if:<ul>
|
||
<li>Either image is empty.</li>
|
||
<li>Image sizes do not match.</li>
|
||
<li>Image types are incompatible.</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The returned disparity map contains disparity values for each pixel in the left image. Pixels with no match may be set to 0 or a negative value depending on the stereo algorithm.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classrtabmap_1_1StereoDense.html" title="Abstract base class for dense stereo matching algorithms.">rtabmap::StereoDense</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a110359c4884579e1c7b68d8baa7acb6c" name="a110359c4884579e1c7b68d8baa7acb6c"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a110359c4884579e1c7b68d8baa7acb6c">◆ </a></span>depthFromDisparity()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::depthFromDisparity </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>disparity</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>fx</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>baseline</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>type</em> = <code>CV_32FC1</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Converts a disparity map to a depth map using stereo camera parameters. </p>
|
||
<p>This function takes a disparity map and computes a corresponding depth map using the formula: </p><p class="formulaDsp">
|
||
<picture><source srcset="form_5_dark.png" media="(prefers-color-scheme: dark)"/><img class="formulaDsp" alt="\[ \text{depth} = \frac{\text{baseline} \times \text{focal length}}{\text{disparity}} \]" src="form_5.png"/></picture>
|
||
</p>
|
||
<ul>
|
||
<li>Disparity values of 0 or less are ignored (depth is left as 0).</li>
|
||
<li>For CV_16UC1 depth type, depth is scaled to millimeters (i.e., multiplied by 1000).</li>
|
||
<li>Values that exceed the 16-bit unsigned max value (65535) are counted and ignored.</li>
|
||
</ul>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">disparity</td><td>The input disparity map (CV_32FC1 or CV_16SC1). </td></tr>
|
||
<tr><td class="paramname">fx</td><td>The focal length in pixels (typically from camera intrinsic parameters). </td></tr>
|
||
<tr><td class="paramname">baseline</td><td>The distance between the stereo cameras in meters. </td></tr>
|
||
<tr><td class="paramname">type</td><td>The desired output depth image type: CV_32FC1 (meters) or CV_16UC1 (millimeters). </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A depth image of the same resolution as the input disparity map.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>Logs a warning if any computed depth values exceed the maximum allowed by the CV_16UC1 format (65535 mm).</dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if the disparity map is empty, has unsupported type, or output type is invalid. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aacf89454b054d86b53a8038c8a404b50" name="aacf89454b054d86b53a8038c8a404b50"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aacf89454b054d86b53a8038c8a404b50">◆ </a></span>depthFromStereoImages()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::depthFromStereoImages </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>leftImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>rightImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< cv::Point2f > & </td>
|
||
<td class="paramname"><em>leftCorners</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>fx</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>baseline</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>flowWinSize</em> = <code>9</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>flowMaxLevel</em> = <code>4</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>flowIterations</em> = <code>20</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">double </td>
|
||
<td class="paramname"><em>flowEps</em> = <code>0.02</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes a depth map from stereo image pairs using optical flow tracking. </p>
|
||
<p>This function estimates the depth of features tracked between the left and right rectified stereo images by computing sparse optical flow (via Lucas-Kanade) between provided feature points in the left image. It uses stereo triangulation based on the tracked correspondences and known camera intrinsics.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">leftImage</td><td>Grayscale rectified left image (CV_8UC1). </td></tr>
|
||
<tr><td class="paramname">rightImage</td><td>Grayscale rectified right image (CV_8UC1), must be same size as leftImage. </td></tr>
|
||
<tr><td class="paramname">leftCorners</td><td>Feature points (e.g., corners) detected in the left image. </td></tr>
|
||
<tr><td class="paramname">fx</td><td>Focal length of the camera in pixels (must be > 0). </td></tr>
|
||
<tr><td class="paramname">baseline</td><td>Distance between the left and right camera centers in meters (must be > 0). </td></tr>
|
||
<tr><td class="paramname">flowWinSize</td><td>Window size used for optical flow (e.g., 15 for 15x15). </td></tr>
|
||
<tr><td class="paramname">flowMaxLevel</td><td>Maximum pyramid level for optical flow. </td></tr>
|
||
<tr><td class="paramname">flowIterations</td><td>Maximum number of iterations for the iterative search algorithm in optical flow. </td></tr>
|
||
<tr><td class="paramname">flowEps</td><td>Desired accuracy for optical flow termination criteria.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A depth map (CV_32FC1) with the same size as the input images. Pixels corresponding to successfully tracked features have valid depth values, while others are zero.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd>cv::calcOpticalFlowPyrLK, <a class="el" href="namespacertabmap_1_1util2d.html#ae6548e6246eceaff5dcc9ee30514eac5" title="Computes a sparse depth map from corresponding stereo feature points.">rtabmap::util2d::depthFromStereoCorrespondences</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a4f10f8038c62a97d3a79bd2dc5bf2c58" name="a4f10f8038c62a97d3a79bd2dc5bf2c58"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a4f10f8038c62a97d3a79bd2dc5bf2c58">◆ </a></span>disparityFromStereoCorrespondences()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::disparityFromStereoCorrespondences </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Size & </td>
|
||
<td class="paramname"><em>disparitySize</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< cv::Point2f > & </td>
|
||
<td class="paramname"><em>leftCorners</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< cv::Point2f > & </td>
|
||
<td class="paramname"><em>rightCorners</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< unsigned char > & </td>
|
||
<td class="paramname"><em>mask</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes a disparity map from stereo correspondences between two images. </p>
|
||
<p>This function calculates the disparity map based on the given stereo correspondences (the left and right corners of features) and stores the resulting disparity values in a matrix. The disparity for each point is computed as the horizontal difference between the corresponding points in the left and right images. The function also accepts a mask to specify which points to include in the disparity computation.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">disparitySize</td><td>The size of the output disparity map. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">leftCorners</td><td>The list of points in the left image where features are detected. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">rightCorners</td><td>The list of points in the right image corresponding to the points in <code>leftCorners</code>. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>A vector of flags indicating which correspondences to use for the disparity computation. An empty vector means all correspondences are included.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A <code>cv::Mat</code> of type <code>CV_32FC1</code> representing the computed disparity map. Each pixel value corresponds to the disparity (horizontal difference between left and right image points) at that location.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The disparity is computed as the horizontal difference between corresponding points in the left and right images, specifically the difference in the x-coordinates of the points. </dd>
|
||
<dd>
|
||
The disparity map is returned in floating point format, where the value represents the disparity in pixels.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The function checks that all points are within the bounds of the disparity map. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ae6548e6246eceaff5dcc9ee30514eac5" name="ae6548e6246eceaff5dcc9ee30514eac5"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ae6548e6246eceaff5dcc9ee30514eac5">◆ </a></span>depthFromStereoCorrespondences()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::depthFromStereoCorrespondences </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>leftImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< cv::Point2f > & </td>
|
||
<td class="paramname"><em>leftCorners</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< cv::Point2f > & </td>
|
||
<td class="paramname"><em>rightCorners</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< unsigned char > & </td>
|
||
<td class="paramname"><em>mask</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>fx</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>baseline</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Computes a sparse depth map from corresponding stereo feature points. </p>
|
||
<p>This function uses known corresponding 2D feature points from rectified stereo images to estimate depth via triangulation, using the disparity between matched points. The computed depth values are placed into a depth map at the locations of the left image points.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">leftImage</td><td>The left rectified grayscale image (used for image size reference). </td></tr>
|
||
<tr><td class="paramname">leftCorners</td><td>Feature points detected in the left image. </td></tr>
|
||
<tr><td class="paramname">rightCorners</td><td>Corresponding feature points in the right image (same size as leftCorners). </td></tr>
|
||
<tr><td class="paramname">mask</td><td>Optional binary mask indicating which correspondences are valid (1 = valid). If empty, all correspondences are considered valid. </td></tr>
|
||
<tr><td class="paramname">fx</td><td>Focal length of the camera in pixels (must be > 0). </td></tr>
|
||
<tr><td class="paramname">baseline</td><td>Distance between the stereo cameras in meters (must be > 0).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A sparse depth map (CV_32FC1) of the same size as the input image. Pixels corresponding to valid matches will contain depth values (in meters), while all others remain zero.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>It assumes stereo images are rectified and only x-axis disparity is present. </dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="namespacertabmap_1_1util2d.html#aacf89454b054d86b53a8038c8a404b50" title="Computes a depth map from stereo image pairs using optical flow tracking.">rtabmap::util2d::depthFromStereoImages</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a6740b13198a2c437ab51d8e0503f2d33" name="a6740b13198a2c437ab51d8e0503f2d33"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a6740b13198a2c437ab51d8e0503f2d33">◆ </a></span>cvtDepthFromFloat()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::cvtDepthFromFloat </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depth32F</em></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Converts a 32-bit float depth image (in meters) to a 16-bit unsigned depth image (in millimeters). </p>
|
||
<p>This function converts each valid depth value from meters to millimeters (by multiplying by 1000.0) and stores it as an unsigned 16-bit integer. Depth values outside the valid range (greater than 65535 mm) are clipped to zero and counted. A warning is printed if such values are found.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depth32F</td><td>Input depth image of type CV_32FC1, where depth is in meters. May be empty.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A 16-bit unsigned depth image (CV_16UC1) in millimeters. Returns an empty matrix if input is empty.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>If depth values exceed 65535 mm, they are ignored and a warning is issued.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>It's assumed that the input image is in meters (commonly used format for 32-bit depth maps). If it’s already in millimeters, do not use this function.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="namespacertabmap_1_1util2d.html#a0e4631bed561b3a694a1a65853221f75" title="Converts a 16-bit unsigned depth image (in millimeters) to a 32-bit float depth image (in meters).">rtabmap::util2d::cvtDepthToFloat()</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a0e4631bed561b3a694a1a65853221f75" name="a0e4631bed561b3a694a1a65853221f75"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a0e4631bed561b3a694a1a65853221f75">◆ </a></span>cvtDepthToFloat()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::cvtDepthToFloat </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depth16U</em></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Converts a 16-bit unsigned depth image (in millimeters) to a 32-bit float depth image (in meters). </p>
|
||
<p>This function converts each depth value from millimeters to meters by dividing by 1000.0. Useful when working with floating point depth operations or to standardize depth formats for computation or storage.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depth16U</td><td>Input depth image of type CV_16UC1, where depth is in millimeters. May be empty.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A 32-bit float depth image (CV_32FC1) with depth values in meters. Returns an empty matrix if input is empty.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Use this function when you want to convert from 16-bit mm format to floating point meter format.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="namespacertabmap_1_1util2d.html#a6740b13198a2c437ab51d8e0503f2d33" title="Converts a 32-bit float depth image (in meters) to a 16-bit unsigned depth image (in millimeters).">rtabmap::util2d::cvtDepthFromFloat()</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a48b07b02efba21a914db10e832589aba" name="a48b07b02efba21a914db10e832589aba"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a48b07b02efba21a914db10e832589aba">◆ </a></span>getDepth()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">float RTABMAP_CORE_EXPORT rtabmap::util2d::getDepth </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depthImage</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>x</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>y</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>smoothing</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>depthErrorRatio</em> = <code>0.02f</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>estWithNeighborsIfNull</em> = <code>false</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Retrieves a depth value from a depth image at a subpixel coordinate. </p>
|
||
<p>This function samples the depth value from a depth image (either in 16-bit unsigned integers representing millimeters or 32-bit floats representing meters) at a floating-point (x, y) coordinate. The value can be optionally smoothed using a weighted neighborhood, and fallback estimation from neighbors is possible if the depth at the target pixel is invalid or zero.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depthImage</td><td>Input depth image. Must be of type CV_16UC1 (depth in mm) or CV_32FC1 (depth in meters). </td></tr>
|
||
<tr><td class="paramname">x</td><td>The subpixel X-coordinate in the image. </td></tr>
|
||
<tr><td class="paramname">y</td><td>The subpixel Y-coordinate in the image. </td></tr>
|
||
<tr><td class="paramname">smoothing</td><td>If true, apply a weighted 3x3 smoothing around the pixel. </td></tr>
|
||
<tr><td class="paramname">depthErrorRatio</td><td>Maximum acceptable depth difference ratio used during smoothing and fallback estimation. </td></tr>
|
||
<tr><td class="paramname">estWithNeighborsIfNull</td><td>If true, and the target pixel has an invalid depth, estimate it from valid neighboring pixels.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>The depth value at the given (x, y) location (in meters), or 0 if it cannot be determined.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd><ul>
|
||
<li>The function applies bounds checking on the input coordinates.</li>
|
||
<li>If <code>smoothing</code> is enabled, a weighted average using a 3x3 kernel is computed.</li>
|
||
<li>If <code>estWithNeighborsIfNull</code> is enabled and the pixel has no valid depth, the value is estimated from 4-connected neighbors using consistency constraints based on <code>depthErrorRatio</code>.</li>
|
||
<li>Pixels with zero or invalid (NaN/Inf) depth are ignored in estimation and smoothing. </li>
|
||
</ul>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a0b545a9f852684afb0a6d8f835f9eaf2" name="a0b545a9f852684afb0a6d8f835f9eaf2"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a0b545a9f852684afb0a6d8f835f9eaf2">◆ </a></span>decimate()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::decimate </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>image</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>d</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Downsamples an image by a given decimation factor. </p>
|
||
<p>If the image is a depth image (CV_32FC1 or CV_16UC1), it ensures that decimation is done precisely without interpolation. For other types, OpenCV's <code>resize</code> with <code>INTER_AREA</code> is used.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">image</td><td>The input image to decimate. </td></tr>
|
||
<tr><td class="paramname">decimation</td><td>The downsampling factor (must be >= 1). </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>The decimated image. If the decimation factor is 1 or the image is empty, the original image is returned.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>For depth images, the image size must be divisible by the decimation factor. </dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if decimation is < 1 or size mismatch for depth images. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="afc241016af8396edf5228dbe9e80ee8d" name="afc241016af8396edf5228dbe9e80ee8d"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#afc241016af8396edf5228dbe9e80ee8d">◆ </a></span>interpolate()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::interpolate </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>image</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>factor</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>depthErrorRatio</em> = <code>0.02f</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Upsamples a depth image using bilinear interpolation with depth consistency check. </p>
|
||
<p>Performs a depth-aware interpolation for CV_32FC1 or CV_16UC1 types. It checks whether the surrounding four corner values are consistent within a <code>depthErrorRatio</code>, and if so, performs bilinear interpolation. For other image types, OpenCV's <code>resize</code> is used.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">image</td><td>The input image to interpolate. </td></tr>
|
||
<tr><td class="paramname">factor</td><td>The interpolation factor (must be >= 1). </td></tr>
|
||
<tr><td class="paramname">depthErrorRatio</td><td>Acceptable ratio of depth difference to allow interpolation. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>The interpolated image. If the factor is 1 or the image is empty, the original image is returned.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This function is intended for depth images. If corners have invalid or inconsistent depth values, interpolation is skipped at that patch. </dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if factor < 1 or invalid parameters. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a48a7e15282f392e77561dd96ed3320f9" name="a48a7e15282f392e77561dd96ed3320f9"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a48a7e15282f392e77561dd96ed3320f9">◆ </a></span>registerDepth()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::registerDepth </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depth</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depthK</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Size & </td>
|
||
<td class="paramname"><em>colorSize</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>colorK</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="classrtabmap_1_1Transform.html">rtabmap::Transform</a> & </td>
|
||
<td class="paramname"><em>transform</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Registers a depth image to a different camera frame (typically RGB). </p>
|
||
<p>This function aligns the given depth image to the coordinate frame of an RGB camera using the intrinsic parameters of both cameras and the extrinsic transformation between them. The output is a depth image aligned to the RGB image dimensions and field of view.</p>
|
||
<p>The function assumes the depth is either in meters (<code>CV_32FC1</code>) or in millimeters (<code>CV_16UC1</code>), and it returns a registered depth image in the same format.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depth</td><td>The input depth image (type <code>CV_16UC1</code> in mm or <code>CV_32FC1</code> in meters). </td></tr>
|
||
<tr><td class="paramname">depthK</td><td>Intrinsic matrix of the depth camera (3x3, type <code>CV_64FC1</code>). </td></tr>
|
||
<tr><td class="paramname">colorSize</td><td>Size of the target RGB image (the output will match this size). </td></tr>
|
||
<tr><td class="paramname">colorK</td><td>Intrinsic matrix of the RGB camera (3x3, type <code>CV_64FC1</code>). </td></tr>
|
||
<tr><td class="paramname">transform</td><td><a class="el" href="classrtabmap_1_1Transform.html" title="Represents a 3D rigid body transformation (rotation + translation).">Transform</a> from the RGB camera frame to depth camera frame.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A depth image registered to the RGB image space, with the same type as the input depth.</dd></dl>
|
||
<dl class="exception"><dt>Exceptions</dt><dd>
|
||
<table class="exception">
|
||
<tr><td class="paramname">Assertion</td><td>failure if input validation fails (e.g., empty image, incorrect types or sizes).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>If multiple depth points project to the same RGB pixel, the closest one is kept. This helps with occlusion handling when registering sparse/depth data. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aeb3dee2cf6484f0b224d4687899cb004" name="aeb3dee2cf6484f0b224d4687899cb004"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aeb3dee2cf6484f0b224d4687899cb004">◆ </a></span>fillDepthHoles()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::fillDepthHoles </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depth</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>maximumHoleSize</em> = <code>1</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>errorRatio</em> = <code>0.02f</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Fills holes in the depth image using linear interpolation. </p>
|
||
<p>This function iterates through the depth image and fills in holes (missing depth values) by interpolating from surrounding valid depth values. It considers both horizontal and vertical neighbors to interpolate missing data. The maximum hole size and the error ratio are used to control the filling process. The function works with both 16-bit (mm) and 32-bit (meters) depth images.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depth</td><td>The input depth image (CV_16UC1 or CV_32FC1). </td></tr>
|
||
<tr><td class="paramname">maximumHoleSize</td><td>The maximum size of a hole to be filled, in pixels. </td></tr>
|
||
<tr><td class="paramname">errorRatio</td><td>The ratio used to calculate the allowed depth error for interpolation.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A new depth image with holes filled.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The input depth image must be of type CV_16UC1 (depth in millimeters) or CV_32FC1 (depth in meters). The filled output is of the same type as the input. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="afc6c9b3442c64ef2061365ead3923228" name="afc6c9b3442c64ef2061365ead3923228"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#afc6c9b3442c64ef2061365ead3923228">◆ </a></span>fillRegisteredDepthHoles()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void RTABMAP_CORE_EXPORT rtabmap::util2d::fillRegisteredDepthHoles </td>
|
||
<td>(</td>
|
||
<td class="paramtype">cv::Mat & </td>
|
||
<td class="paramname"><em>depthRegistered</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>vertical</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>horizontal</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>fillDoubleHoles</em> = <code>false</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Fill holes in a registered depth image using linear interpolation. </p>
|
||
<p>This function attempts to fill invalid (zero-valued) pixels in a registered depth image by looking at neighboring pixels in vertical and/or horizontal directions. Optionally, it can also fill "double holes" (gaps of two consecutive pixels) if <code>fillDoubleHoles</code> is enabled.</p>
|
||
<p>The interpolation is only performed if the depth difference between the neighbors is within 1% of their average, to avoid introducing invalid depth values.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[in,out]</td><td class="paramname">registeredDepth</td><td>The input/output registered depth image (CV_16UC1). Modified in-place to fill in missing depth values. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">vertical</td><td>If true, the function tries to fill holes in vertical direction. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">horizontal</td><td>If true, the function tries to fill holes in horizontal direction. </td></tr>
|
||
<tr><td class="paramdir"></td><td class="paramname">fillDoubleHoles</td><td>If true, the function also attempts to fill two-pixel wide holes by linearly interpolating between values spaced by two pixels.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This function assumes that the depth image contains unsigned 16-bit values, where a value of 0 represents an invalid or missing depth value. Pixels on the contour are not interpolated.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The input matrix must be of type CV_16UC1, or the function will trigger an assertion failure.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="namespacertabmap_1_1util2d.html#a48a7e15282f392e77561dd96ed3320f9" title="Registers a depth image to a different camera frame (typically RGB).">rtabmap::util2d::registerDepth()</a>, <a class="el" href="namespacertabmap_1_1util2d.html#aeb3dee2cf6484f0b224d4687899cb004" title="Fills holes in the depth image using linear interpolation.">rtabmap::util2d::fillDepthHoles()</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a076914fde23d1323fccf71a794b9bc51" name="a076914fde23d1323fccf71a794b9bc51"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a076914fde23d1323fccf71a794b9bc51">◆ </a></span>fastBilateralFiltering()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::fastBilateralFiltering </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>depth</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>sigmaS</em> = <code>15.0f</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>sigmaR</em> = <code>0.05f</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool </td>
|
||
<td class="paramname"><em>earlyDivision</em> = <code>false</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Applies a 2D fast bilateral filter to a depth image. </p>
|
||
<p>This function is a 2D adaptation of the pcl::FastBilateralFiltering algorithm. It processes a depth image (either CV_32FC1 or CV_16UC1) using a bilateral filter with spatial and range standard deviations <code>sigmaS</code> and <code>sigmaR</code>. The method includes optimizations such as early division and efficient 3D grid accumulation with smoothing.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depth</td><td>Input depth image. Must be of type CV_32FC1 (meters) or CV_16UC1 (millimeters). </td></tr>
|
||
<tr><td class="paramname">sigmaS</td><td>Spatial standard deviation. Controls the amount of smoothing in the image plane. </td></tr>
|
||
<tr><td class="paramname">sigmaR</td><td>Range standard deviation. Controls the amount of smoothing in the depth (z) dimension. </td></tr>
|
||
<tr><td class="paramname">earlyDivision</td><td>If true, applies early normalization to improve performance.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Filtered depth image as a CV_32FC1 Mat. If the input image is empty or contains no valid depth, an empty Mat is returned.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This implementation relies on an auxiliary 3D data structure and uses trilinear interpolation for reconstructing smoothed values. Pixels with non-finite or invalid depths are ignored.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The result is always a CV_32FC1 image, even if the input is CV_16UC1. If input depth's valid pixels have all exact same value, the result will be retruned with all zeros (issue from the original implementation). </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a7788d4dabf084959aa69162d5dbb2d2e" name="a7788d4dabf084959aa69162d5dbb2d2e"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a7788d4dabf084959aa69162d5dbb2d2e">◆ </a></span>depthBleedingFiltering()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void RTABMAP_CORE_EXPORT rtabmap::util2d::depthBleedingFiltering </td>
|
||
<td>(</td>
|
||
<td class="paramtype">cv::Mat & </td>
|
||
<td class="paramname"><em>depth</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>maxDepthError</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Filters out depth bleeding artifacts in a depth image. </p>
|
||
<p>This function sets depth values to zero (invalid) if their value significantly differs from both neighboring pixels in either horizontal or vertical direction. It works on depth images of type <code>CV_32FC1</code> (32-bit float, in meters) or <code>CV_16UC1</code> (16-bit unsigned int, in millimeters).</p>
|
||
<p>The function also ignores the image border by setting the first and last rows and columns to zero.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">depth</td><td>Input/output depth image. Must be of type <code>CV_32FC1</code> or <code>CV_16UC1</code>. The filtering is done in-place. </td></tr>
|
||
<tr><td class="paramname">maxDepthError</td><td>Maximum allowed depth difference between a pixel and its neighbors before it is considered invalid and filtered out. For <code>CV_32FC1</code>, this value is in meters; for <code>CV_16UC1</code>, it's converted to millimeters. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a89ec90b2659c764ba22b5c36d729c8f8" name="a89ec90b2659c764ba22b5c36d729c8f8"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a89ec90b2659c764ba22b5c36d729c8f8">◆ </a></span>brightnessAndContrastAuto()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::brightnessAndContrastAuto </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>src</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>mask</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>clipLowHistPercent</em> = <code>0</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>clipHighHistPercent</em> = <code>0</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float * </td>
|
||
<td class="paramname"><em>alphaOut</em> = <code>0</code>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float * </td>
|
||
<td class="paramname"><em>betaOut</em> = <code>0</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Automatic brightness and contrast optimization with optional histogram clipping. </p>
|
||
<p>This function automatically adjusts the brightness and contrast of the input image based on its histogram. It optionally clips a percentage of the darkest and brightest parts of the histogram to reduce the influence of outliers (similar to "auto levels" in photo editors).</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>Input image. Must be of type CV_8UC1 (grayscale), CV_8UC3 (BGR), or CV_8UC4 (BGRA). </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Optional mask. Only non-zero mask pixels are considered in histogram computation. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">clipLowHistPercent</td><td>Percentage of the lowest histogram range to clip. Use 0 to disable. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">clipHighHistPercent</td><td>Percentage of the highest histogram range to clip. Use 0 to disable. </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">alphaOut</td><td>Optional pointer to store the computed alpha (contrast scale factor). </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">betaOut</td><td>Optional pointer to store the computed beta (brightness shift factor).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A new image with automatically adjusted brightness and contrast. The image will have the same size and number of channels as the input.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>For BGRA input images, the alpha (transparency) channel is preserved and not modified.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd>Original discussion: <a href="https://answers.opencv.org/question/75510/how-to-make-auto-adjustmentsbrightness-and-contrast-for-image-android-opencv-image-correction/">https://answers.opencv.org/question/75510/how-to-make-auto-adjustmentsbrightness-and-contrast-for-image-android-opencv-image-correction/</a> </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ac38e8ed586d24c4b9fe72d64afeb9583" name="ac38e8ed586d24c4b9fe72d64afeb9583"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ac38e8ed586d24c4b9fe72d64afeb9583">◆ </a></span>exposureFusion()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">cv::Mat RTABMAP_CORE_EXPORT rtabmap::util2d::exposureFusion </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const std::vector< cv::Mat > & </td>
|
||
<td class="paramname"><em>images</em></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Performs exposure fusion on a set of input images. </p>
|
||
<p>This function blends multiple images with different exposures into a single well-exposed image using the Mertens exposure fusion algorithm. It leverages OpenCV's <code>createMergeMertens()</code> method (available in OpenCV 3 and above).</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">images</td><td>A vector of input images (typically CV_8UC3) to be fused. All images should have the same size and type.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A fused color image (CV_8UC3) with enhanced exposure. If OpenCV version is below 3, the function returns a clone of the first image in the input vector.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The output image is normalized to 8-bit color (0–255). Exposure fusion requires OpenCV 3.0 or later.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>If OpenCV version is lower than 3, exposure fusion is not performed and a warning is issued. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ac29ac5b8bed26a5299d378708170dd11" name="ac29ac5b8bed26a5299d378708170dd11"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ac29ac5b8bed26a5299d378708170dd11">◆ </a></span>HSVtoRGB()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void RTABMAP_CORE_EXPORT rtabmap::util2d::HSVtoRGB </td>
|
||
<td>(</td>
|
||
<td class="paramtype">float * </td>
|
||
<td class="paramname"><em>r</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float * </td>
|
||
<td class="paramname"><em>g</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float * </td>
|
||
<td class="paramname"><em>b</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>h</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>s</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>v</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Converts a color from HSV (Hue, Saturation, Value) to RGB. </p>
|
||
<p>This function takes HSV color values and converts them to their corresponding RGB representation using standard sector-based color conversion.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>Pointer to a float where the resulting red component (0.0–1.0) will be stored. </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">g</td><td>Pointer to a float where the resulting green component (0.0–1.0) will be stored. </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">b</td><td>Pointer to a float where the resulting blue component (0.0–1.0) will be stored. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>Hue angle in degrees (0–360). Defines the color type. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">s</td><td>Saturation (0.0–1.0). 0 is grayscale, 1 is full color. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>Value (brightness) (0.0–1.0). 0 is black, 1 is full brightness.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This function assumes <code>h</code> is in degrees. If <code>s</code> is 0, the resulting color is grayscale, with R=G=B=V.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The output RGB values are in the 0.0 to 1.0 range, not 0–255. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aafa9a426c8e7dd0359adf40e1b45ee1c" name="aafa9a426c8e7dd0359adf40e1b45ee1c"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aafa9a426c8e7dd0359adf40e1b45ee1c">◆ </a></span>NMS()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void RTABMAP_CORE_EXPORT rtabmap::util2d::NMS </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const std::vector< cv::KeyPoint > & </td>
|
||
<td class="paramname"><em>ptsIn</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const cv::Mat & </td>
|
||
<td class="paramname"><em>descriptorsIn</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">std::vector< cv::KeyPoint > & </td>
|
||
<td class="paramname"><em>ptsOut</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::Mat & </td>
|
||
<td class="paramname"><em>descriptorsOut</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>dist_thresh</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>img_width</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>img_height</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Applies Non-Maximum Suppression (NMS) to a set of keypoints. </p>
|
||
<p>This function filters a set of input keypoints by applying a grid-based non-maximum suppression (NMS) algorithm. It retains only the strongest keypoints (based on response value) while ensuring that no two retained points are within a certain distance from each other.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">ptsIn</td><td>Input vector of keypoints. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">descriptorsIn</td><td>Corresponding descriptors for the input keypoints. Can be empty. </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">ptsOut</td><td>Output vector of keypoints after NMS filtering. </td></tr>
|
||
<tr><td class="paramdir">[out]</td><td class="paramname">descriptorsOut</td><td>Output descriptors corresponding to the filtered keypoints. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">dist_thresh</td><td>Minimum allowed distance between retained keypoints (suppression radius). </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">img_width</td><td>Width of the image on which the keypoints are based. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">img_height</td><td>Height of the image on which the keypoints are based.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Keypoints are suppressed if they are within <code>dist_thresh</code> pixels of a stronger keypoint. </dd>
|
||
<dd>
|
||
If <code>descriptorsIn</code> is empty, descriptor output will remain empty. </dd>
|
||
<dd>
|
||
Assumes all keypoints lie within the image dimensions provided. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aa6957971e17f27bb066efe036d80fd46" name="aa6957971e17f27bb066efe036d80fd46"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aa6957971e17f27bb066efe036d80fd46">◆ </a></span>SSC()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">std::vector< int > RTABMAP_CORE_EXPORT rtabmap::util2d::SSC </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const std::vector< cv::KeyPoint > & </td>
|
||
<td class="paramname"><em>keypoints</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>maxKeypoints</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">float </td>
|
||
<td class="paramname"><em>tolerance</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>cols</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">int </td>
|
||
<td class="paramname"><em>rows</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const std::vector< int > & </td>
|
||
<td class="paramname"><em>indx</em> = <code>{}</code> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Applies the SSC (Suppression via Square Covering) algorithm to spatially select keypoints. </p>
|
||
<p>This function selects a subset of keypoints that are uniformly distributed across the image using a square covering method and binary search optimization to achieve a desired number of keypoints.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">keypoints</td><td>Input vector of keypoints to select from. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">maxKeypoints</td><td>Desired upper bound on the number of output keypoints. The internal target is first reduced by <code>round(maxKeypoints * tolerance)</code> so the result is always less than or equal to this value. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">tolerance</td><td>Relative tolerance applied to the reduced target (e.g., 0.1 allows ±10% of the reduced target, not of <code>maxKeypoints</code>). </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">cols</td><td>Width of the image in pixels. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">rows</td><td>Height of the image in pixels. </td></tr>
|
||
<tr><td class="paramdir">[in]</td><td class="paramname">indx</td><td>Optional vector of indices to use instead of the original keypoints ordering. If provided, should be the same size as <code>keypoints</code>. This allows for applying SSC to a pre-sorted subset (e.g., top-N keypoints).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>A vector of indices corresponding to the selected keypoints in the input <code>keypoints</code> vector.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The algorithm operates by covering the image with a grid of cells and retaining the most confident keypoint in each uncovered cell while suppressing nearby keypoints within a computed square radius. </dd>
|
||
<dd>
|
||
Uses binary search to find the optimal suppression radius so the number of selected keypoints is within [effectiveMax * (1 - tolerance), effectiveMax * (1 + tolerance)], where effectiveMax = maxKeypoints - round(maxKeypoints * tolerance). </dd>
|
||
<dd>
|
||
Works best when <code>keypoints</code> are pre-sorted by response strength (e.g., strongest first). </dd>
|
||
<dd>
|
||
If the <code>indx</code> vector is provided, the returned indices refer to the original list, not just <code>indx</code>. </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a1577494ad9730181d5b768ca8237d5dd" name="a1577494ad9730181d5b768ca8237d5dd"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a1577494ad9730181d5b768ca8237d5dd">◆ </a></span>rotateImagesUpsideUpIfNecessary()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">bool RTABMAP_CORE_EXPORT rtabmap::util2d::rotateImagesUpsideUpIfNecessary </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="classrtabmap_1_1CameraModel.html">CameraModel</a> & </td>
|
||
<td class="paramname"><em>model</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::Mat & </td>
|
||
<td class="paramname"><em>rgb</em>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">cv::Mat & </td>
|
||
<td class="paramname"><em>depth</em> </td>
|
||
</tr>
|
||
<tr>
|
||
<td></td>
|
||
<td>)</td>
|
||
<td></td><td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Rotates the input RGB and depth images to make them appear upright based on the camera's roll angle. </p>
|
||
<p>This function uses the camera's extrinsic parameters to determine if the captured image is rotated (e.g., sideways or upside-down), and rotates it appropriately (by 90°, 180°, or 270°) to correct orientation. It also updates the associated camera model to reflect the new transformation and adjusted image size.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramdir">[in,out]</td><td class="paramname">model</td><td>The camera model associated with the images. It will be updated to reflect the new orientation. </td></tr>
|
||
<tr><td class="paramdir">[in,out]</td><td class="paramname">rgb</td><td>The RGB image to be rotated if necessary. </td></tr>
|
||
<tr><td class="paramdir">[in,out]</td><td class="paramname">depth</td><td>The depth image to be rotated if necessary.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>True if the images were rotated, false if no rotation was needed or the pitch angle is too large for a reliable decision.</dd></dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The function:<ul>
|
||
<li>Ignores rotation if pitch > π/4 (too ambiguous to determine "up").</li>
|
||
<li>Assumes roll is responsible for rotation (i.e., sideways capture).</li>
|
||
<li>Applies necessary rotation and updates the camera intrinsics accordingly.</li>
|
||
<li>Supports image types: RGB and depth must be valid OpenCV <code>cv::Mat</code>.</li>
|
||
<li>Respects image transparency and depth values during rotation.</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>This function assumes that the camera's local transform includes the standard optical rotation.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classrtabmap_1_1CameraModel.html" title="Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...">rtabmap::CameraModel</a>, cv::transpose, cv::flip </dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- contents -->
|
||
<!-- start footer part -->
|
||
<hr class="footer"/><address class="footer"><small>
|
||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
||
</small></address>
|
||
</body>
|
||
</html>
|