12 #include <gtest/gtest.h> 26 #define TEST_RANGEIMG_WIDTH 32 27 #define TEST_RANGEIMG_HEIGHT 24 38 for (
int r = 10;
r < 16;
r++)
47 TEST(CObservation3DRangeScan, Project3D_noFilter)
52 for (
int i = 0; i < 8; i++)
58 EXPECT_EQ(o.
points3D_x.size(), 21U) <<
" testcase flags: i=" << i
63 TEST(CObservation3DRangeScan, Project3D_filterMinMax1)
78 for (
int i = 0; i < 16; i++)
85 EXPECT_EQ(o.
points3D_x.size(), 20U) <<
" testcase flags: i=" << i
90 TEST(CObservation3DRangeScan, Project3D_filterMinMaxAllBetween)
95 for (
int r = 10;
r < 16;
r++)
96 for (
int c = 10;
c < 16;
c++)
98 fMin(
r,
c) =
r - 0.1f;
99 fMax(
r,
c) =
r + 0.1f;
107 for (
int i = 0; i < 16; i++)
115 <<
" testcase flags: i=" << i << std::endl;
119 TEST(CObservation3DRangeScan, Project3D_filterMinMaxNoneBetween)
124 for (
int r = 10;
r < 16;
r++)
125 for (
int c = 10;
c < 16;
c++)
127 fMin(
r,
c) =
r + 1.1f;
128 fMax(
r,
c) =
r + 1.2f;
136 for (
int i = 0; i < 16; i++)
144 <<
" testcase flags: i=" << i << std::endl;
148 TEST(CObservation3DRangeScan, Project3D_filterMin)
152 for (
int r = 10;
r < 16;
r++)
153 for (
int c = 10;
c < 16;
c++)
161 for (
int i = 0; i < 8; i++)
167 EXPECT_EQ(o.
points3D_x.size(), 6U) <<
" testcase flags: i=" << i
172 TEST(CObservation3DRangeScan, Project3D_filterMax)
176 for (
int r = 10;
r < 16;
r++)
177 for (
int c = 10;
c < 16;
c++)
185 for (
int i = 0; i < 8; i++)
191 EXPECT_EQ(o.
points3D_x.size(), 3U) <<
" testcase flags: i=" << i
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: nullptr) If provided, each data range will be tested to be greater-than (rangeMask_min) or ...
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
If hasPoints3D=true, the (X,Y,Z) coordinates of the 3D point cloud detected by the camera...
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.
bool rangeCheckBetween
Only used if both rangeMask_min and rangeMask_max are present.