fixed windows build

This commit is contained in:
Mathieu Labbé
2015-04-24 13:56:16 -04:00
parent a16a2d65cf
commit 2e706ed01f
6 changed files with 20 additions and 22 deletions

View File

@@ -89,7 +89,7 @@ private:
cv::Mat mapY_; cv::Mat mapY_;
}; };
class StereoCameraModel class RTABMAP_EXP StereoCameraModel
{ {
public: public:
StereoCameraModel() {} StereoCameraModel() {}

View File

@@ -151,7 +151,7 @@ private:
pcl::PointCloud<pcl::PointXYZ>::Ptr refCorners3D_; pcl::PointCloud<pcl::PointXYZ>::Ptr refCorners3D_;
}; };
class OdometryMono : public Odometry class RTABMAP_EXP OdometryMono : public Odometry
{ {
public: public:
OdometryMono(const rtabmap::ParametersMap & parameters = rtabmap::ParametersMap()); OdometryMono(const rtabmap::ParametersMap & parameters = rtabmap::ParametersMap());

View File

@@ -204,14 +204,14 @@ cv::Mat CameraModel::rectifyDepth(const cv::Mat & raw) const
int yH = (int)ceil(pt.y); int yH = (int)ceil(pt.y);
if(xL >= 0 && yL >= 0 && xH < raw.cols && yH < raw.rows) if(xL >= 0 && yL >= 0 && xH < raw.cols && yH < raw.rows)
{ {
const uint16_t & pLT = raw.at<uint16_t>(yL, xL); const unsigned short & pLT = raw.at<unsigned short>(yL, xL);
const uint16_t & pRT = raw.at<uint16_t>(yL, xH); const unsigned short & pRT = raw.at<unsigned short>(yL, xH);
const uint16_t & pLB = raw.at<uint16_t>(yH, xL); const unsigned short & pLB = raw.at<unsigned short>(yH, xL);
const uint16_t & pRB = raw.at<uint16_t>(yH, xH); const unsigned short & pRB = raw.at<unsigned short>(yH, xH);
if(pLT > 0 && pRT > 0 && pLB > 0 && pRB > 0) if(pLT > 0 && pRT > 0 && pLB > 0 && pRB > 0)
{ {
uint16_t avg = (pLT + pRT + pLB + pRB) / 4; unsigned short avg = (pLT + pRT + pLB + pRB) / 4;
uint16_t thres = 0.01 * avg; unsigned short thres = 0.01 * avg;
if( abs(pLT - avg) < thres && if( abs(pLT - avg) < thres &&
abs(pRT - avg) < thres && abs(pRT - avg) < thres &&
abs(pLB - 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 //http://stackoverflow.com/questions/13299409/how-to-get-the-image-pixel-at-real-locations-in-opencv
rectified.at<unsigned short>(y,x) = 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<unsigned short>(yL, xL) * (1.f - a) + raw.at<unsigned short>(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>(yH, xL) * (1.f - a) + raw.at<unsigned short>(yH, xH) * a) * c;
} }
} }
} }

View File

@@ -658,8 +658,8 @@ Transform OdometryMono::computeTransform(const SensorData & data, OdometryInfo *
cv::Mat E = K.t()*F*K; cv::Mat E = K.t()*F*K;
//normalize coordinates //normalize coordinates
cv::Mat x(3, refCorners.size(), CV_64FC1); cv::Mat x(3, (int)refCorners.size(), CV_64FC1);
cv::Mat xp(3, refCorners.size(), CV_64FC1); cv::Mat xp(3, (int)refCorners.size(), CV_64FC1);
for(unsigned int i=0; i<refCorners.size(); ++i) for(unsigned int i=0; i<refCorners.size(); ++i)
{ {
x.at<double>(0, i) = refCorners[i].x; x.at<double>(0, i) = refCorners[i].x;

View File

@@ -465,8 +465,8 @@ std::multimap<int, pcl::PointXYZ> generateWords3DMono(
refCorners = refCornersRefined; refCorners = refCornersRefined;
newCorners = newCornersRefined; newCorners = newCornersRefined;
cv::Mat x(3, refCorners.size(), CV_64FC1); cv::Mat x(3, (int)refCorners.size(), CV_64FC1);
cv::Mat xp(3, refCorners.size(), CV_64FC1); cv::Mat xp(3, (int)refCorners.size(), CV_64FC1);
for(unsigned int i=0; i<refCorners.size(); ++i) for(unsigned int i=0; i<refCorners.size(); ++i)
{ {
x.at<double>(0, i) = refCorners[i].x; x.at<double>(0, i) = refCorners[i].x;

View File

@@ -63,9 +63,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-368</y> <y>0</y>
<width>760</width> <width>759</width>
<height>1009</height> <height>800</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
@@ -86,7 +86,7 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>26</number>
</property> </property>
<widget class="QWidget" name="page_22"> <widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29"> <layout class="QVBoxLayout" name="verticalLayout_29">
@@ -7321,21 +7321,19 @@ Lower the ratio -&gt; higher the precision. 0 means disabled, matching the neare
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_88"> <spacer name="verticalSpacer_30">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>774</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
<zorder>groupBox_odometryMono2</zorder>
<zorder>verticalSpacer_88</zorder>
</widget> </widget>
</widget> </widget>
</item> </item>