Function ouster::sdk::core::normals(const Eigen::Ref<const PointCloudXYZd>, const Eigen::Ref<const img_t<uint32_t>>, 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
-
std::pair<MatrixX3dR, MatrixX3dR> ouster::sdk::core::normals(const Eigen::Ref<const PointCloudXYZd> xyz, const Eigen::Ref<const img_t<uint32_t>> range, const Eigen::Ref<const PointCloudXYZd> xyz2, const Eigen::Ref<const img_t<uint32_t>> range2, 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 both returns of a destaggered point cloud.
xyz, xyz2 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 first return (H, W, 3).
range[in] – Destaggered range image for the first return (H, W).
xyz2[in] – Destaggered XYZ coordinates for the second return (H, W, 3).
range2[in] – Destaggered range image for the second 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 or xyz2 shape is not (H * W, 3).
std::runtime_error – if range2 dimensions differ from range.
std::runtime_error – if sensor_origins_xyz width does not match W.
- Returns:
Pair of flattened row-major matrices (first_return_normals, second_return_normals).