mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
fixed windows build
This commit is contained in:
@@ -89,7 +89,7 @@ private:
|
||||
cv::Mat mapY_;
|
||||
};
|
||||
|
||||
class StereoCameraModel
|
||||
class RTABMAP_EXP StereoCameraModel
|
||||
{
|
||||
public:
|
||||
StereoCameraModel() {}
|
||||
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr refCorners3D_;
|
||||
};
|
||||
|
||||
class OdometryMono : public Odometry
|
||||
class RTABMAP_EXP OdometryMono : public Odometry
|
||||
{
|
||||
public:
|
||||
OdometryMono(const rtabmap::ParametersMap & parameters = rtabmap::ParametersMap());
|
||||
|
||||
@@ -204,14 +204,14 @@ cv::Mat CameraModel::rectifyDepth(const cv::Mat & raw) const
|
||||
int yH = (int)ceil(pt.y);
|
||||
if(xL >= 0 && yL >= 0 && xH < raw.cols && yH < raw.rows)
|
||||
{
|
||||
const uint16_t & pLT = raw.at<uint16_t>(yL, xL);
|
||||
const uint16_t & pRT = raw.at<uint16_t>(yL, xH);
|
||||
const uint16_t & pLB = raw.at<uint16_t>(yH, xL);
|
||||
const uint16_t & pRB = raw.at<uint16_t>(yH, xH);
|
||||
const unsigned short & pLT = raw.at<unsigned short>(yL, xL);
|
||||
const unsigned short & pRT = raw.at<unsigned short>(yL, xH);
|
||||
const unsigned short & pLB = raw.at<unsigned short>(yH, xL);
|
||||
const unsigned short & pRB = raw.at<unsigned short>(yH, xH);
|
||||
if(pLT > 0 && pRT > 0 && pLB > 0 && pRB > 0)
|
||||
{
|
||||
uint16_t avg = (pLT + pRT + pLB + pRB) / 4;
|
||||
uint16_t thres = 0.01 * avg;
|
||||
unsigned short avg = (pLT + pRT + pLB + pRB) / 4;
|
||||
unsigned short thres = 0.01 * avg;
|
||||
if( abs(pLT - avg) < thres &&
|
||||
abs(pRT - avg) < thres &&
|
||||
abs(pLB - avg) < thres &&
|
||||
@@ -223,8 +223,8 @@ cv::Mat CameraModel::rectifyDepth(const cv::Mat & raw) const
|
||||
|
||||
//http://stackoverflow.com/questions/13299409/how-to-get-the-image-pixel-at-real-locations-in-opencv
|
||||
rectified.at<unsigned short>(y,x) =
|
||||
(raw.at<uint16_t>(yL, xL) * (1.f - a) + raw.at<uint16_t>(yL, xH) * a) * (1.f - c) +
|
||||
(raw.at<uint16_t>(yH, xL) * (1.f - a) + raw.at<uint16_t>(yH, xH) * a) * c;
|
||||
(raw.at<unsigned short>(yL, xL) * (1.f - a) + raw.at<unsigned short>(yL, xH) * a) * (1.f - c) +
|
||||
(raw.at<unsigned short>(yH, xL) * (1.f - a) + raw.at<unsigned short>(yH, xH) * a) * c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,8 +658,8 @@ Transform OdometryMono::computeTransform(const SensorData & data, OdometryInfo *
|
||||
cv::Mat E = K.t()*F*K;
|
||||
|
||||
//normalize coordinates
|
||||
cv::Mat x(3, refCorners.size(), CV_64FC1);
|
||||
cv::Mat xp(3, refCorners.size(), CV_64FC1);
|
||||
cv::Mat x(3, (int)refCorners.size(), CV_64FC1);
|
||||
cv::Mat xp(3, (int)refCorners.size(), CV_64FC1);
|
||||
for(unsigned int i=0; i<refCorners.size(); ++i)
|
||||
{
|
||||
x.at<double>(0, i) = refCorners[i].x;
|
||||
|
||||
@@ -465,8 +465,8 @@ std::multimap<int, pcl::PointXYZ> generateWords3DMono(
|
||||
refCorners = refCornersRefined;
|
||||
newCorners = newCornersRefined;
|
||||
|
||||
cv::Mat x(3, refCorners.size(), CV_64FC1);
|
||||
cv::Mat xp(3, refCorners.size(), CV_64FC1);
|
||||
cv::Mat x(3, (int)refCorners.size(), CV_64FC1);
|
||||
cv::Mat xp(3, (int)refCorners.size(), CV_64FC1);
|
||||
for(unsigned int i=0; i<refCorners.size(); ++i)
|
||||
{
|
||||
x.at<double>(0, i) = refCorners[i].x;
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>-368</y>
|
||||
<width>760</width>
|
||||
<height>1009</height>
|
||||
<y>0</y>
|
||||
<width>759</width>
|
||||
<height>800</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
@@ -86,7 +86,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>26</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_22">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29">
|
||||
@@ -7321,21 +7321,19 @@ Lower the ratio -> higher the precision. 0 means disabled, matching the neare
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_88">
|
||||
<spacer name="verticalSpacer_30">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>774</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>groupBox_odometryMono2</zorder>
|
||||
<zorder>verticalSpacer_88</zorder>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user