Function ouster::sdk::core::normals(const Eigen::Ref<const PointCloudXYZd>, const Eigen::Ref<const img_t<uint32_t>>, const Eigen::Ref<const MatrixX3dR>, size_t, double, double)
Defined in File normals.h
Function Documentation
-
MatrixX3dR ouster::sdk::core::normals(const Eigen::Ref<const PointCloudXYZd> xyz, const Eigen::Ref<const img_t<uint32_t>> range, const Eigen::Ref<const MatrixX3dR> sensor_origins_xyz, size_t pixel_search_range = 1, double min_angle_of_incidence_rad = DEFAULT_MIN_ANGLE_INCIDENCE_RAD, double target_distance_m = DEFAULT_TARGET_DISTANCE_METER)
Compute normal values for a single return of a destaggered point cloud.
xyz and sensor_origins_xyz must all be expressed in the same coordinate frame (commonly world) so normals stay consistent frame to frame.
- Parameters:
xyz[in] – Destaggered XYZ coordinates for the return (H, W, 3).
range[in] – Destaggered range image for the return (H, W).
sensor_origins_xyz[in] – Per-column sensor origins in the same frame as the points (W, 3). Used to derive per-beam direction vectors.
World-frame xyz: sensor_origins_xyz can be computed with an Eigen matrix of shape (W, 3), e.g.:
Eigen::MatrixXd sensor_origins(W, 3);thenfor (int c = 0; c < scan.w; ++c)setsensor_origins.row(c) = (scan.get_column_pose(c) * scan.sensor_info->extrinsic).block<3, 1>(0, 3).transpose();.Sensor-frame xyz: pass zeros with shape (W, 3) (e.g.
Eigen::MatrixXd::Zero(W, 3)).
pixel_search_range[in] – Axial pixel radius used to find neighbouring points (default: 1 px).
min_angle_of_incidence_rad[in] – Minimum allowable incidence angle between a beam and surface (default: 1 deg, ~0.01745 rad).
target_distance_m[in] – Target neighbour distance used when selecting candidate points (default: 0.025 m).
- Throws:
std::runtime_error – if xyz shape is not (H * W, 3).
std::runtime_error – if sensor_origins_xyz width does not match W.
std::runtime_error – if min_angle_of_incidence_rad or target_distance_m is non-positive.
- Returns:
Flattened row-major matrix (H * W, 3) storing normal vectors.