41 #include <pcl/pcl_config.h>
68 constexpr std::size_t table_size = 1 << 10;
71 lookupTable_.resize(table_size);
74 constexpr std::int16_t nConstShift = 800;
75 constexpr
double nParamCoeff = 4.000000;
76 constexpr
double dPlanePixelSize = 0.104200;
77 constexpr
double nShiftScale = 10.000000;
78 constexpr
double dPlaneDsr = 120.000000;
79 constexpr
double dPlaneDcl = 7.500000;
81 for (std::size_t i=0; i<table_size; ++i)
84 double dFixedRefX = (
static_cast<double>(i - nConstShift) / nParamCoeff)-0.375;
85 double dMetric = dFixedRefX * dPlanePixelSize;
86 lookupTable_[i] =
static_cast<float>((nShiftScale * ((dMetric * dPlaneDsr / (dPlaneDcl - dMetric)) + dPlaneDsr) ) / 1000.0f);
99 constexpr
float bad_point = std::numeric_limits<float>::quiet_NaN ();
101 float ret = bad_point;
104 if (shift_val<lookupTable_.size())
105 ret = lookupTable_[shift_val];
This class provides conversion of the openni 11-bit shift data to depth;.
ShiftToDepthConverter()=default
Constructor.
float shiftToDepth(std::uint16_t shift_val)
Generate a look-up table for converting openni shift values to depth.
virtual ~ShiftToDepthConverter()=default
Destructor.
bool isInitialized() const
std::vector< float > lookupTable_
void generateLookupTable()
This method generates a look-up table to convert openni shift values to depth.