mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
SensorData: updated how compressed user_data is detected
This commit is contained in:
@@ -133,6 +133,13 @@ public:
|
|||||||
int getSignatureIdByLabel(const std::string & label, bool lookInDatabase = true) const;
|
int getSignatureIdByLabel(const std::string & label, bool lookInDatabase = true) const;
|
||||||
bool labelSignature(int id, const std::string & label);
|
bool labelSignature(int id, const std::string & label);
|
||||||
std::map<int, std::string> getAllLabels() const;
|
std::map<int, std::string> getAllLabels() const;
|
||||||
|
/**
|
||||||
|
* Set user data. Detect automatically if raw or compressed. If raw, the data is
|
||||||
|
* compressed too. A matrix of type CV_8UC1 with 1 row is considered as compressed.
|
||||||
|
* If you have one dimension unsigned 8 bits raw data, make sure to transpose it
|
||||||
|
* (to have multiple rows instead of multiple columns) in order to be detected as
|
||||||
|
* not compressed.
|
||||||
|
*/
|
||||||
bool setUserData(int id, const cv::Mat & data);
|
bool setUserData(int id, const cv::Mat & data);
|
||||||
int getDatabaseMemoryUsed() const; // in bytes
|
int getDatabaseMemoryUsed() const; // in bytes
|
||||||
std::string getDatabaseVersion() const;
|
std::string getDatabaseVersion() const;
|
||||||
|
|||||||
@@ -101,6 +101,13 @@ public:
|
|||||||
|
|
||||||
int triggerNewMap();
|
int triggerNewMap();
|
||||||
bool labelLocation(int id, const std::string & label);
|
bool labelLocation(int id, const std::string & label);
|
||||||
|
/**
|
||||||
|
* Set user data. Detect automatically if raw or compressed. If raw, the data is
|
||||||
|
* compressed too. A matrix of type CV_8UC1 with 1 row is considered as compressed.
|
||||||
|
* If you have one dimension unsigned 8 bits raw data, make sure to transpose it
|
||||||
|
* (to have multiple rows instead of multiple columns) in order to be detected as
|
||||||
|
* not compressed.
|
||||||
|
*/
|
||||||
bool setUserData(int id, const cv::Mat & data);
|
bool setUserData(int id, const cv::Mat & data);
|
||||||
void generateDOTGraph(const std::string & path, int id=0, int margin=5);
|
void generateDOTGraph(const std::string & path, int id=0, int margin=5);
|
||||||
void exportPoses(
|
void exportPoses(
|
||||||
|
|||||||
@@ -187,7 +187,14 @@ public:
|
|||||||
const StereoCameraModel & stereoCameraModel() const {return _stereoCameraModel;}
|
const StereoCameraModel & stereoCameraModel() const {return _stereoCameraModel;}
|
||||||
|
|
||||||
void setUserDataRaw(const cv::Mat & userDataRaw); // only set raw
|
void setUserDataRaw(const cv::Mat & userDataRaw); // only set raw
|
||||||
void setUserData(const cv::Mat & userData); // detect automatically if raw or compressed. If raw, the data is compressed too.
|
/**
|
||||||
|
* Set user data. Detect automatically if raw or compressed. If raw, the data is
|
||||||
|
* compressed too. A matrix of type CV_8UC1 with 1 row is considered as compressed.
|
||||||
|
* If you have one dimension unsigned 8 bits raw data, make sure to transpose it
|
||||||
|
* (to have multiple rows instead of multiple columns) in order to be detected as
|
||||||
|
* not compressed.
|
||||||
|
*/
|
||||||
|
void setUserData(const cv::Mat & userData);
|
||||||
const cv::Mat & userDataRaw() const {return _userDataRaw;}
|
const cv::Mat & userDataRaw() const {return _userDataRaw;}
|
||||||
const cv::Mat & userDataCompressed() const {return _userDataCompressed;}
|
const cv::Mat & userDataCompressed() const {return _userDataCompressed;}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ SensorData::SensorData(
|
|||||||
_imageRaw = image;
|
_imageRaw = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ SensorData::SensorData(
|
|||||||
_imageRaw = image;
|
_imageRaw = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ SensorData::SensorData(
|
|||||||
_depthOrRightRaw = depth;
|
_depthOrRightRaw = depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ SensorData::SensorData(
|
|||||||
_laserScanCompressed = laserScan;
|
_laserScanCompressed = laserScan;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,7 @@ SensorData::SensorData(
|
|||||||
_depthOrRightRaw = depth;
|
_depthOrRightRaw = depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -309,7 +309,7 @@ SensorData::SensorData(
|
|||||||
_laserScanCompressed = laserScan;
|
_laserScanCompressed = laserScan;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ SensorData::SensorData(
|
|||||||
_depthOrRightRaw = right;
|
_depthOrRightRaw = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -415,7 +415,7 @@ SensorData::SensorData(
|
|||||||
_laserScanCompressed = laserScan;
|
_laserScanCompressed = laserScan;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ void SensorData::setUserData(const cv::Mat & userData)
|
|||||||
|
|
||||||
if(!userData.empty())
|
if(!userData.empty())
|
||||||
{
|
{
|
||||||
if(userData.type() == CV_8UC1) // Bytes
|
if(userData.type() == CV_8UC1 && userData.rows == 1 && userData.cols > int(3*sizeof(int))) // Bytes
|
||||||
{
|
{
|
||||||
_userDataCompressed = userData; // assume compressed
|
_userDataCompressed = userData; // assume compressed
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user