12 #include <gtest/gtest.h> 17 #define TEST_RANGEIMG_WIDTH 32 18 #define TEST_RANGEIMG_HEIGHT 24 29 for (
int r = 10;
r < 16;
r++)
38 TEST(CObservation3DRangeScan, Project3D_noFilter)
43 for (
int i = 0; i < 8; i++)
49 EXPECT_EQ(o.
points3D_x.size(), 21U) <<
" testcase flags: i=" << i
54 TEST(CObservation3DRangeScan, Project3D_filterMinMax1)
69 for (
int i = 0; i < 16; i++)
76 EXPECT_EQ(o.
points3D_x.size(), 20U) <<
" testcase flags: i=" << i
81 TEST(CObservation3DRangeScan, Project3D_filterMinMaxAllBetween)
86 for (
int r = 10;
r < 16;
r++)
87 for (
int c = 10;
c < 16;
c++)
89 fMin(
r,
c) =
r - 0.1f;
90 fMax(
r,
c) =
r + 0.1f;
98 for (
int i = 0; i < 16; i++)
106 <<
" testcase flags: i=" << i << std::endl;
110 TEST(CObservation3DRangeScan, Project3D_filterMinMaxNoneBetween)
115 for (
int r = 10;
r < 16;
r++)
116 for (
int c = 10;
c < 16;
c++)
118 fMin(
r,
c) =
r + 1.1f;
119 fMax(
r,
c) =
r + 1.2f;
127 for (
int i = 0; i < 16; i++)
135 <<
" testcase flags: i=" << i << std::endl;
139 TEST(CObservation3DRangeScan, Project3D_filterMin)
143 for (
int r = 10;
r < 16;
r++)
144 for (
int c = 10;
c < 16;
c++)
152 for (
int i = 0; i < 8; i++)
158 EXPECT_EQ(o.
points3D_x.size(), 6U) <<
" testcase flags: i=" << i
163 TEST(CObservation3DRangeScan, Project3D_filterMax)
167 for (
int r = 10;
r < 16;
r++)
168 for (
int c = 10;
c < 16;
c++)
176 for (
int i = 0; i < 8; i++)
182 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
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
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.