17 namespace registration {
25 if (correspondence_indices.
GetShape() !=
30 "Correspondences must be of same length as source point-cloud "
31 "positions. Expected correspondences of shape {} or {}, but "
48 {core::Float64, core::Float32});
57 correspondences.
IndexGet({valid}).Reshape({-1});
63 core::Tensor error_t = (source_points_indexed - target_points_indexed);
64 error_t.
Mul_(error_t);
66 return std::sqrt(
error /
67 static_cast<double>(neighbour_indices.
GetLength()));
75 const std::size_t iteration)
const {
81 {core::Float64, core::Float32});
118 correspondences.
IndexGet({valid}).Reshape({-1});
126 core::Tensor error_t = (source_points_indexed - target_points_indexed)
127 .Mul_(target_normals_indexed);
128 error_t.
Mul_(error_t);
130 return std::sqrt(
error /
131 static_cast<double>(neighbour_indices.
GetLength()));
139 const std::size_t iteration)
const {
148 {core::Float64, core::Float32});
176 "Source and/or Target pointcloud missing colors attribute.");
183 "Target pointcloud missing color_gradients attribute.");
202 double sqrt_lambda_photometric = sqrt(lambda_photometric);
206 correspondences.
IndexGet({valid}).Reshape({-1});
226 .IndexGet({neighbour_indices});
241 residual_geometric.
Mul(residual_geometric);
243 (is - is_proj).Mul(sqrt_lambda_photometric).Sum({1});
245 residual_photometric.
Mul(residual_photometric);
247 double residual = sq_residual_geometric.
Add_(sq_residual_photometric)
260 const std::size_t iteration)
const {
269 "Source and/or Target pointcloud missing colors attribute.");
276 "Target pointcloud missing color_gradients attribute.");
280 {core::Float64, core::Float32});
299 correspondences, this->kernel_, this->lambda_geometric_);
326 correspondences.
IndexGet({valid}).Reshape({-1});
334 core::Tensor error_t = (source_points_indexed - target_points_indexed)
335 .Mul_(target_normals_indexed);
336 error_t.
Mul_(error_t);
338 return std::sqrt(
error /
339 static_cast<double>(neighbour_indices.
GetLength()));
347 const std::size_t iteration)
const {
362 {core::Float64, core::Float32});
380 this->transform_vehicle_to_sensor_, iteration, this->period_,
381 this->lambda_doppler_, this->reject_dynamic_outliers_,
382 this->doppler_outlier_threshold_,
383 this->outlier_rejection_min_iteration_,
384 this->geometric_robust_loss_min_iteration_,
385 this->doppler_robust_loss_min_iteration_, this->geometric_kernel_,
386 this->doppler_kernel_);
void Add(const double in1[2], const double in2[2], double out[2])
#define AssertTensorDevice(tensor,...)
#define AssertTensorDtype(tensor,...)
#define AssertTensorDtypes(tensor,...)
#define AssertTensorShape(tensor,...)
std::string ToString() const
Tensor Sum(const SizeVector &dims, bool keepdim=false) const
int64_t GetLength() const
Tensor Ne(const Tensor &value) const
Element-wise not-equals-to of tensors, returning a new boolean tensor.
Tensor IndexGet(const std::vector< Tensor > &index_tensors) const
Advanced indexing getter. This will always allocate a new Tensor.
Tensor Mul_(const Tensor &value)
Tensor Add_(const Tensor &value)
Device GetDevice() const override
Tensor Reshape(const SizeVector &dst_shape) const
Tensor Mean(const SizeVector &dims, bool keepdim=false) const
SizeVector GetShape() const
Tensor Mul(const Tensor &value) const
Multiplies a tensor and returns the resulting tensor.
A point cloud contains a list of 3D points.
core::Tensor & GetPointNormals()
Get the value of the "normals" attribute. Convenience function.
bool HasPointPositions() const
bool HasPointAttr(const std::string &key) const
core::Tensor & GetPointPositions()
Get the value of the "positions" attribute. Convenience function.
core::Device GetDevice() const override
Returns the device attribute of this PointCloud.
bool HasPointNormals() const
const TensorMap & GetPointAttr() const
Getter for point_attr_ TensorMap. Used in Pybind.
core::Tensor & GetPointColors()
Get the value of the "colors" attribute. Convenience function.
bool HasPointColors() const
static void error(char *msg)
void To(const core::Tensor &src, core::Tensor &dst, double scale, double offset)
core::Tensor RtToTransformation(const core::Tensor &R, const core::Tensor &t)
Convert rotation and translation to the transformation matrix.
core::Tensor ComputePoseDopplerICP(const core::Tensor &source_points, const core::Tensor &source_dopplers, const core::Tensor &source_directions, const core::Tensor &target_points, const core::Tensor &target_normals, const core::Tensor &correspondence_indices, const core::Tensor ¤t_transform, const core::Tensor &transform_vehicle_to_sensor, const std::size_t iteration, const double period, const double lambda_doppler, const bool reject_dynamic_outliers, const double doppler_outlier_threshold, const std::size_t outlier_rejection_min_iteration, const std::size_t geometric_robust_loss_min_iteration, const std::size_t doppler_robust_loss_min_iteration, const registration::RobustKernel &geometric_kernel, const registration::RobustKernel &doppler_kernel)
Computes pose for DopplerICP registration method.
std::tuple< core::Tensor, core::Tensor > ComputeRtPointToPoint(const core::Tensor &source_points, const core::Tensor &target_points, const core::Tensor &correspondence_indices)
Computes (R) Rotation {3,3} and (t) translation {3,} for point to point registration method.
core::Tensor ComputePosePointToPlane(const core::Tensor &source_points, const core::Tensor &target_points, const core::Tensor &target_normals, const core::Tensor &correspondence_indices, const registration::RobustKernel &kernel)
Computes pose for point to plane registration method.
core::Tensor ComputePoseColoredICP(const core::Tensor &source_points, const core::Tensor &source_colors, const core::Tensor &target_points, const core::Tensor &target_normals, const core::Tensor &target_colors, const core::Tensor &target_color_gradients, const core::Tensor &correspondence_indices, const registration::RobustKernel &kernel, const double &lambda_geometric)
Computes pose for colored-icp registration method.
core::Tensor PoseToTransformation(const core::Tensor &pose)
Convert pose to the transformation matrix.
static void AssertValidCorrespondences(const core::Tensor &correspondence_indices, const core::Tensor &source_points)
Generic file read and write utility for python interface.