mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Merge branch '0.11.0' of github.com:introlab/rtabmap into 0.11.0
This commit is contained in:
@@ -28,12 +28,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef REGISTRATION_H_
|
#ifndef REGISTRATION_H_
|
||||||
#define REGISTRATION_H_
|
#define REGISTRATION_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Parameters.h>
|
#include <rtabmap/core/Parameters.h>
|
||||||
#include <rtabmap/core/Signature.h>
|
#include <rtabmap/core/Signature.h>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class Registration
|
class RTABMAP_EXP Registration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Registration() {}
|
virtual ~Registration() {}
|
||||||
|
|||||||
@@ -28,13 +28,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef REGISTRATIONICP_H_
|
#ifndef REGISTRATIONICP_H_
|
||||||
#define REGISTRATIONICP_H_
|
#define REGISTRATIONICP_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Registration.h>
|
#include <rtabmap/core/Registration.h>
|
||||||
#include <rtabmap/core/Signature.h>
|
#include <rtabmap/core/Signature.h>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
// Geometrical registration
|
// Geometrical registration
|
||||||
class RegistrationIcp : public Registration
|
class RTABMAP_EXP RegistrationIcp : public Registration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegistrationIcp(const ParametersMap & parameters = ParametersMap());
|
RegistrationIcp(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -28,13 +28,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef REGISTRATIONVIS_H_
|
#ifndef REGISTRATIONVIS_H_
|
||||||
#define REGISTRATIONVIS_H_
|
#define REGISTRATIONVIS_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Registration.h>
|
#include <rtabmap/core/Registration.h>
|
||||||
#include <rtabmap/core/Signature.h>
|
#include <rtabmap/core/Signature.h>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
// Visual registration
|
// Visual registration
|
||||||
class RegistrationVis : public Registration
|
class RTABMAP_EXP RegistrationVis : public Registration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegistrationVis(const ParametersMap & parameters = ParametersMap());
|
RegistrationVis(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -376,9 +376,9 @@ void Feature2D::parseParameters(const ParametersMap & parameters)
|
|||||||
{
|
{
|
||||||
std::vector<float> tmpValues(4);
|
std::vector<float> tmpValues(4);
|
||||||
unsigned int i=0;
|
unsigned int i=0;
|
||||||
for(std::list<std::string>::iterator iter = strValues.begin(); iter!=strValues.end(); ++iter)
|
for(std::list<std::string>::iterator jter = strValues.begin(); jter!=strValues.end(); ++jter)
|
||||||
{
|
{
|
||||||
tmpValues[i] = uStr2Float(*iter);
|
tmpValues[i] = uStr2Float(*jter);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ bool importPoses(
|
|||||||
std::string str;
|
std::string str;
|
||||||
std::getline(file, str);
|
std::getline(file, str);
|
||||||
|
|
||||||
if(str.front() == '#' || str.empty())
|
if(str.at(0) == '#' || str.empty())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,11 +209,11 @@ Transform RegistrationVis::computeTransformationMod(
|
|||||||
// just some checks to make sure that input data are ok
|
// just some checks to make sure that input data are ok
|
||||||
UASSERT((fromSignature.getWords().empty() && fromSignature.getWords3().empty())||
|
UASSERT((fromSignature.getWords().empty() && fromSignature.getWords3().empty())||
|
||||||
(fromSignature.getWords().size() == fromSignature.getWords3().size()));
|
(fromSignature.getWords().size() == fromSignature.getWords3().size()));
|
||||||
UASSERT(fromSignature.sensorData().keypoints().size() == fromSignature.sensorData().descriptors().rows ||
|
UASSERT((int)fromSignature.sensorData().keypoints().size() == fromSignature.sensorData().descriptors().rows ||
|
||||||
fromSignature.sensorData().descriptors().rows == 0);
|
fromSignature.sensorData().descriptors().rows == 0);
|
||||||
UASSERT((toSignature.getWords().empty() && toSignature.getWords3().empty())||
|
UASSERT((toSignature.getWords().empty() && toSignature.getWords3().empty())||
|
||||||
(toSignature.getWords().size() == toSignature.getWords3().size()));
|
(toSignature.getWords().size() == toSignature.getWords3().size()));
|
||||||
UASSERT(toSignature.sensorData().keypoints().size() == toSignature.sensorData().descriptors().rows ||
|
UASSERT((int)toSignature.sensorData().keypoints().size() == toSignature.sensorData().descriptors().rows ||
|
||||||
toSignature.sensorData().descriptors().rows == 0);
|
toSignature.sensorData().descriptors().rows == 0);
|
||||||
UASSERT(fromSignature.sensorData().imageRaw().type() == CV_8UC1 ||
|
UASSERT(fromSignature.sensorData().imageRaw().type() == CV_8UC1 ||
|
||||||
fromSignature.sensorData().imageRaw().type() == CV_8UC3);
|
fromSignature.sensorData().imageRaw().type() == CV_8UC3);
|
||||||
@@ -405,7 +405,7 @@ Transform RegistrationVis::computeTransformationMod(
|
|||||||
UDEBUG("kptsTo=%d", (int)kptsTo.size());
|
UDEBUG("kptsTo=%d", (int)kptsTo.size());
|
||||||
cv::Mat descriptorsFrom;
|
cv::Mat descriptorsFrom;
|
||||||
cv::Mat descriptorsTo;
|
cv::Mat descriptorsTo;
|
||||||
if(fromSignature.getWords().empty() && fromSignature.sensorData().descriptors().rows == kptsFrom.size())
|
if(fromSignature.getWords().empty() && fromSignature.sensorData().descriptors().rows == (int)kptsFrom.size())
|
||||||
{
|
{
|
||||||
descriptorsFrom = fromSignature.sensorData().descriptors();
|
descriptorsFrom = fromSignature.sensorData().descriptors();
|
||||||
}
|
}
|
||||||
@@ -413,7 +413,7 @@ Transform RegistrationVis::computeTransformationMod(
|
|||||||
{
|
{
|
||||||
descriptorsFrom = detector->generateDescriptors(fromSignature.sensorData().imageRaw(), kptsFrom);
|
descriptorsFrom = detector->generateDescriptors(fromSignature.sensorData().imageRaw(), kptsFrom);
|
||||||
}
|
}
|
||||||
if(toSignature.getWords().empty() && toSignature.sensorData().descriptors().rows == kptsTo.size())
|
if(toSignature.getWords().empty() && toSignature.sensorData().descriptors().rows == (int)kptsTo.size())
|
||||||
{
|
{
|
||||||
descriptorsTo = toSignature.sensorData().descriptors();
|
descriptorsTo = toSignature.sensorData().descriptors();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ std::vector<cv::Point2f> calcStereoCorrespondences(
|
|||||||
{
|
{
|
||||||
int oi=0;
|
int oi=0;
|
||||||
float bestScore = -1.0f;
|
float bestScore = -1.0f;
|
||||||
float secondBest = -1.0f;
|
|
||||||
int bestScoreIndex = -1;
|
int bestScoreIndex = -1;
|
||||||
int tmpMinDisparity = minDisparity;
|
int tmpMinDisparity = minDisparity;
|
||||||
int tmpMaxDisparity = maxDisparity;
|
int tmpMaxDisparity = maxDisparity;
|
||||||
@@ -175,7 +174,6 @@ std::vector<cv::Point2f> calcStereoCorrespondences(
|
|||||||
|
|
||||||
oi=0;
|
oi=0;
|
||||||
bestScore = -1.0f;
|
bestScore = -1.0f;
|
||||||
secondBest = -1.0f;
|
|
||||||
bestScoreIndex = -1;
|
bestScoreIndex = -1;
|
||||||
int localMaxDisparity = -tmpMaxDisparity / (1<<level);
|
int localMaxDisparity = -tmpMaxDisparity / (1<<level);
|
||||||
int localMinDisparity = -tmpMinDisparity / (1<<level);
|
int localMinDisparity = -tmpMinDisparity / (1<<level);
|
||||||
@@ -214,7 +212,6 @@ std::vector<cv::Point2f> calcStereoCorrespondences(
|
|||||||
scores[oi] = ssdApproach?ssd(windowLeft, windowRight):sad(windowLeft, windowRight);
|
scores[oi] = ssdApproach?ssd(windowLeft, windowRight):sad(windowLeft, windowRight);
|
||||||
if(scores[oi] > 0 && (bestScore < 0.0f || scores[oi] < bestScore))
|
if(scores[oi] > 0 && (bestScore < 0.0f || scores[oi] < bestScore))
|
||||||
{
|
{
|
||||||
secondBest = bestScore;
|
|
||||||
bestScoreIndex = oi;
|
bestScoreIndex = oi;
|
||||||
bestScore = scores[oi];
|
bestScore = scores[oi];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ std::map<int, cv::Point3f> generateWords3DMono(
|
|||||||
int oi=0;
|
int oi=0;
|
||||||
for(unsigned int i=0; i<indexes.size(); ++i)
|
for(unsigned int i=0; i<indexes.size(); ++i)
|
||||||
{
|
{
|
||||||
std::multimap<int, cv::Point3f>::iterator iter = words3D.find(indexes[i]);
|
std::map<int, cv::Point3f>::iterator iter = words3D.find(indexes[i]);
|
||||||
if(util3d::isFinite(iter->second))
|
if(util3d::isFinite(iter->second))
|
||||||
{
|
{
|
||||||
iter->second.x *= scale;
|
iter->second.x *= scale;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#define PFMREADER_H_
|
#define PFMREADER_H_
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdio.h>
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
// taken from http://vision.middlebury.edu/stereo/ evaluation tool
|
// taken from http://vision.middlebury.edu/stereo/ evaluation tool
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ int main(int argc, char * argv[])
|
|||||||
// dymax=0.423
|
// dymax=0.423
|
||||||
// ---
|
// ---
|
||||||
std::string calibFile = argv[3];
|
std::string calibFile = argv[3];
|
||||||
std::ifstream stream(calibFile);
|
std::ifstream stream(calibFile.c_str());
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
// two first lines are camera intrinsics
|
// two first lines are camera intrinsics
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user