34 const float bad_point = std::numeric_limits<float>::quiet_NaN();
49 std::transform(dataType.begin(), dataType.end(), dataType.begin(), ::tolower);
51 if (dataType ==
"uint8")
55 else if (dataType ==
"uint16")
59 else if (dataType ==
"uint32")
63 else if (dataType ==
"uint64")
93 const double r2 = xp * xp + yp2;
94 const double r4 = r2 * r2;
98 const float x =
static_cast<float>(xp * k);
99 const float y =
static_cast<float>(yp * k);
100 const float z = 1.0f;
104 s0 = std::sqrt(x * x + y * y + z * z) * 1000;
106 else if (
PLANAR == imgType)
112 assert(!
"Unknown image type for the point cloud transformation");
115 point.
x =
static_cast<float>(x / s0);
116 point.
y =
static_cast<float>(y / s0);
117 point.
z =
static_cast<float>(z / s0);
127 std::vector<PointXYZ>& pointCloud)
134 size_t cloudSize = map.size();
135 pointCloud.resize(cloudSize);
144 std::vector<uint16_t>::const_iterator itMap = map.begin();
146 std::vector<PointXYZ>::iterator itPC = pointCloud.begin();
147 for (uint32_t i = 0; i < cloudSize; ++i, ++itPC, ++itMap, ++itUndistorted)
153 if (*itMap == 0 || *itMap == uint16_t(0xFFFF))
162 float distance =
static_cast<float>((*itMap)) * pixelSizeZ;
163 point.
x = itUndistorted->x * distance;
164 point.
y = itUndistorted->y * distance;
165 point.
z = itUndistorted->z * distance - f2rc;
179 for (std::vector<PointXYZ>::iterator it = pointCloud.begin(), itEnd = pointCloud.end();
183 const double x = it->x;
184 const double y = it->y;
185 const double z = it->z;
228 auto tp = std::chrono::system_clock::from_time_t(std::mktime(&tm));
230 std::chrono::duration_cast<std::chrono::milliseconds>(tp.time_since_epoch()).count() +
245 auto tp = std::chrono::system_clock::from_time_t(std::mktime(&tm));
246 uint64_t segTimestamp =
247 std::chrono::duration_cast<std::chrono::milliseconds>(tp.time_since_epoch()).count() +