11 if (value ==
"none") {
14 if (value ==
"value_threshold") {
17 if (value ==
"min_max") {
20 if (value ==
"z_score") {
23 throw std::runtime_error(
"Unsupported point feature normalization type: " + value);
27 const bool in_range = (x >= config_.
x_min && x < config_.
x_max && !std::isnan(x) && y >= config_.
y_min && y < config_.
y_max &&
28 !std::isnan(y) && z >= config_.
z_min && z < config_.
z_max && !std::isnan(z));
34 const float delta_x = x - config_.
da_cx;
35 const float delta_y = y - config_.
da_cy;
36 const float squared_distance_to_center = delta_x * delta_x + delta_y * delta_y;
40 float angle_to_center = std::atan2(delta_y, delta_x);
42 while (angle_offset >
static_cast<float>(M_PI)) {
43 angle_offset -=
static_cast<float>(2.0 * M_PI);
45 while (angle_offset <
static_cast<float>(-M_PI)) {
46 angle_offset +=
static_cast<float>(2.0 * M_PI);
48 if (std::abs(angle_offset) > config_.
da_fov_rad * 0.5F + 1e-6F) {
65 z_score_std_ = std::abs(stddev) > config_.
epsilon ? stddev : config_.
epsilon;
76 const float clipped = std::min(std::max(intensity, 0.0F), config_.
value_threshold);
81 const float scaled = (intensity - config_.
min_value) / denom;
82 return std::min(std::max(scaled, 0.0F), 1.0F);
85 return (intensity - z_score_mean_) / std::max(z_score_std_, config_.
epsilon);
float NormalizePointFeature(float intensity) const
bool IsPointValid(float x, float y, float z) const
void SetZScoreStats(float mean, float stddev)
PointFeatureNormalizationType ParsePointFeatureNormalizationType(const std::string &value)
PointFeatureNormalizationType
bool remove_points_in_zone
Enable rectangular no-detection-zone filtering.
float min_value
Minimum for min-max normalization.
float da_cy
Detection-area center Y.
float x_max
Maximum accepted X coordinate.
float value_threshold
Divisor for value-threshold normalization.
bool det_area_remove_outside
Enable radial field-of-view filtering.
float y_min
Minimum accepted Y coordinate.
float epsilon
Lower bound for unsafe normalization divisors.
float z_min
Minimum accepted Z coordinate.
float nd_x_min
No-detection-zone minimum X.
float x_min
Minimum accepted X coordinate.
float da_radius
Detection-area radius.
float z_max
Maximum accepted Z coordinate.
float da_fov_rad
Detection-area angular width in radians.
float nd_y_max
No-detection-zone maximum Y.
float da_bearing_rad
Detection-area center bearing in radians.
float y_max
Maximum accepted Y coordinate.
float da_cx
Detection-area center X.
float max_value
Maximum for min-max normalization.
PointFeatureNormalizationType normalization_type
Feature transform.
float nd_x_max
No-detection-zone maximum X.
float nd_y_min
No-detection-zone minimum Y.