12 #include <gtest/gtest.h> 18 namespace mrpt {
namespace utils {
23 #define TEST_RANGEIMG_WIDTH 32 24 #define TEST_RANGEIMG_HEIGHT 24 33 for (
int r=10;
r<16;
r++)
34 for (
int c=10;
c<=
r;
c++)
44 TEST(CObservation3DRangeScan, Project3D_noFilter)
55 EXPECT_EQ(o.
points3D_x.size(),21U) <<
" testcase flags: i=" << i << std::endl;
59 TEST(CObservation3DRangeScan, Project3D_filterMinMax1)
62 fMin(12,12) = 11.5f; fMax(12,12) = 12.5f;
63 fMin(14,14) = 15.5f; fMax(14,14) = 16.5f;
71 for (
int i=0;i<16;i++)
78 EXPECT_EQ(o.
points3D_x.size(),20U) <<
" testcase flags: i=" << i << std::endl;
82 TEST(CObservation3DRangeScan, Project3D_filterMinMaxAllBetween)
86 for (
int r=10;
r<16;
r++)
87 for (
int c=10;
c<16;
c++)
98 for (
int i=0;i<16;i++)
110 TEST(CObservation3DRangeScan, Project3D_filterMinMaxNoneBetween)
114 for (
int r=10;
r<16;
r++)
115 for (
int c=10;
c<16;
c++)
126 for (
int i=0;i<16;i++)
137 TEST(CObservation3DRangeScan, Project3D_filterMin)
141 for (
int r=10;
r<16;
r++)
142 for (
int c=10;
c<16;
c++)
149 for (
int i=0;i<8;i++)
155 EXPECT_EQ(o.
points3D_x.size(), 6U ) <<
" testcase flags: i=" << i << std::endl;
159 TEST(CObservation3DRangeScan, Project3D_filterMax)
163 for (
int r=10;
r<16;
r++)
164 for (
int c=10;
c<16;
c++)
171 for (
int i=0;i<8;i++)
177 EXPECT_EQ(o.
points3D_x.size(), 3U ) <<
" testcase flags: i=" << i << std::endl;
void fillSampleObs(mrpt::obs::CObservation3DRangeScan &obs, mrpt::obs::T3DPointsProjectionParams &pp, int test_case)
#define TEST_RANGEIMG_WIDTH
std::string MRPT_GLOBAL_UNITTEST_SRC_DIR
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement, as from a time-of-flight range camera or any other RGBD sensor.
const mrpt::math::CMatrix * rangeMask_min
(Default: NULL) If provided, each data range will be tested to be greater-than (rangeMask_min) or les...
Used in CObservation3DRangeScan::project3DPointsFromDepthImageInto()
TEST(CObservation3DRangeScan, Project3D_noFilter)
mrpt::math::CMatrix rangeImage
If hasRangeImage=true, a matrix of floats with the range data as captured by the camera (in meters) ...
#define TEST_RANGEIMG_HEIGHT
bool hasRangeImage
true means the field rangeImage contains valid data
GLsizei const GLchar ** string
bool USE_SSE2
(Default:true) If possible, use SSE2 optimized code.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLdouble GLdouble GLdouble r
const mrpt::math::CMatrix * rangeMask_max
Used in CObservation3DRangeScan::project3DPointsFromDepthImageInto()
std::vector< float > points3D_x
void rangeImage_setSize(const int HEIGHT, const int WIDTH)
Similar to calling "rangeImage.setSize(H,W)" but this method provides memory pooling to speed-up the ...
void project3DPointsFromDepthImageInto(POINTMAP &dest_pointcloud, const T3DPointsProjectionParams &projectParams, const TRangeImageFilterParams &filterParams=TRangeImageFilterParams())
Project the RGB+D images into a 3D point cloud (with color if the target map supports it) and optiona...
bool PROJ3D_USE_LUT
(Default:true) [Only used when range_is_depth=true] Whether to use a Look-up-table (LUT) to speed up ...
This class is a "CSerializable" wrapper for "CMatrixFloat".
bool takeIntoAccountSensorPoseOnRobot
(Default: false) If false, local (sensor-centric) coordinates of points are generated. Otherwise, points are transformed with sensorPose. Furthermore, if provided, those coordinates are transformed with robotPoseInTheWorld
bool rangeCheckBetween
Only used if both rangeMask_min and rangeMask_max are present.