61 UFATAL(
"Unhandled type %d!", (
int)format);
86 if(!oldScanFormat.empty())
88 if(oldScanFormat.channels() == 2)
90 return LaserScan(oldScanFormat, maxPoints, maxRange,
kXY, localTransform);
92 else if(oldScanFormat.channels() == 3)
94 return LaserScan(oldScanFormat, maxPoints, maxRange,
kXYZ, localTransform);
96 else if(oldScanFormat.channels() == 4)
98 return LaserScan(oldScanFormat, maxPoints, maxRange,
kXYZRGB, localTransform);
100 else if(oldScanFormat.channels() == 5)
104 else if(oldScanFormat.channels() == 6)
108 else if(oldScanFormat.channels() == 7)
131 UASSERT(data.empty() || data.rows == 1);
132 UASSERT(data.empty() || data.type() == CV_8UC1 || data.type() == CV_32FC2 || data.type() == CV_32FC3 || data.type() == CV_32FC(4) || data.type() == CV_32FC(5) || data.type() == CV_32FC(6) || data.type() == CV_32FC(7));
143 UASSERT_MSG(data.channels() != 2 || (data.channels() == 2 && format ==
kXY),
uFormat(
"format=%d", format).c_str());
144 UASSERT_MSG(data.channels() != 3 || (data.channels() == 3 && (format ==
kXYZ || format ==
kXYI)),
uFormat(
"format=%d", format).c_str());
const cv::Mat & data() const
static int channels(Format format)
Some conversion functions.
static bool isScanHasNormals(const Format &format)
#define UASSERT(condition)
#define UASSERT_MSG(condition, msg_str)
static bool isScanHasRGB(const Format &format)
bool isCompressed() const
Transform localTransform() const
ULogger class and convenient macros.
static bool isScan2d(const Format &format)
Transform localTransform_
static bool isScanHasIntensity(const Format &format)
std::string UTILITE_EXP uFormat(const char *fmt,...)
static LaserScan backwardCompatibility(const cv::Mat &oldScanFormat, int maxPoints=0, int maxRange=0, const Transform &localTransform=Transform::getIdentity())