32 if (source_points.
IsCPU()) {
36 correspondence_indices.
Contiguous(), pose, residual,
37 inlier_count, source_points.
GetDtype(), device, kernel);
38 }
else if (source_points.
IsCUDA()) {
42 correspondence_indices.
Contiguous(), pose, residual,
43 inlier_count, source_points.
GetDtype(), device, kernel);
49 residual, inlier_count);
62 const double &lambda_geometric) {
71 if (source_points.
IsCPU()) {
76 correspondence_indices.
Contiguous(), pose, residual,
77 inlier_count, source_points.
GetDtype(), device, kernel,
79 }
else if (source_points.
IsCUDA()) {
85 correspondence_indices.
Contiguous(), pose, residual,
86 inlier_count, source_points.
GetDtype(), device, kernel,
93 residual, inlier_count);
107 const std::size_t iteration,
109 const double lambda_doppler,
110 const bool reject_dynamic_outliers,
111 const double doppler_outlier_threshold,
112 const std::size_t outlier_rejection_min_iteration,
113 const std::size_t geometric_robust_loss_min_iteration,
114 const std::size_t doppler_robust_loss_min_iteration,
125 int inlier_count = 0;
130 const auto kernel_geometric =
131 (iteration >= geometric_robust_loss_min_iteration)
134 const auto kernel_doppler = (iteration >= doppler_robust_loss_min_iteration)
139 const bool reject_outliers = reject_dynamic_outliers &&
140 (iteration >= outlier_rejection_min_iteration);
144 transform_vehicle_to_sensor
151 transform_vehicle_to_sensor
178 correspondence_indices.
Contiguous(), output_pose, residual,
179 inlier_count, dtype, device, R_S_to_V.Contiguous(),
181 v_v_in_V.
Contiguous(), period, reject_outliers,
182 doppler_outlier_threshold, kernel_geometric, kernel_doppler,
188 correspondence_indices.
Contiguous(), output_pose, residual,
189 inlier_count, dtype, device, R_S_to_V.Contiguous(),
191 v_v_in_V.
Contiguous(), period, reject_outliers,
192 doppler_outlier_threshold, kernel_geometric, kernel_doppler,
199 "DopplerPointToPlane Transform: residual {}, inlier_count {}",
200 residual, inlier_count);
214 int inlier_count = 0;
216 if (source_points.
IsCPU()) {
220 correspondence_indices.
Contiguous(), R, t, inlier_count,
222 }
else if (source_points.
IsCUDA()) {
223 #ifdef BUILD_CUDA_MODULE
240 correspondence_indices.
IndexGet({valid}).Reshape({-1});
243 inlier_count = source_indices.
GetLength();
256 .
Matmul(source_select - mean_s)
257 .
Div_(
static_cast<float>(inlier_count))
264 std::tie(U, D, VT) = Sxy.
SVD();
266 if (U.
Det() * (VT.
T()).Det() < 0) {
277 return std::make_tuple(R, t);
288 if (target_points.
IsCPU()) {
291 information_matrix, target_points.
GetDtype(), device);
292 }
else if (target_points.
IsCUDA()) {
295 correspondence_indices.
Contiguous(), information_matrix,
301 return information_matrix;
#define CUDA_CALL(cuda_function,...)
When CUDA is not enabled, this is a dummy class.
DeviceType GetType() const
Returns type of the device, e.g. DeviceType::CPU, DeviceType::CUDA.
DeviceType
Type for device.
static const Dtype Float64
static TensorKey Slice(utility::optional< int64_t > start, utility::optional< int64_t > stop, utility::optional< int64_t > step)
double Det() const
Compute the determinant of a 2D square tensor.
Tensor Contiguous() const
Tensor Matmul(const Tensor &rhs) const
Tensor Neg() const
Element-wise negation of a tensor, returning a new tensor.
static Tensor Arange(const Scalar start, const Scalar stop, const Scalar step=1, const Dtype dtype=core::Int64, const Device &device=core::Device("CPU:0"))
Create a 1D tensor with evenly spaced values in the given interval.
int64_t GetLength() const
Tensor Ne(const Tensor &value) const
Element-wise not-equals-to of tensors, returning a new boolean tensor.
Tensor GetItem(const TensorKey &tk) const
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Tensor IndexGet(const std::vector< Tensor > &index_tensors) const
Advanced indexing getter. This will always allocate a new Tensor.
Device GetDevice() const override
Tensor Reshape(const SizeVector &dst_shape) const
Tensor Mean(const SizeVector &dims, bool keepdim=false) const
static Tensor Empty(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor with uninitialized values.
Tensor Div_(const Tensor &value)
SizeVector GetShape() const
std::tuple< Tensor, Tensor, Tensor > SVD() const
Tensor T() const
Expects input to be <= 2-D Tensor by swapping dimension 0 and 1.
Tensor To(Dtype dtype, bool copy=false) const
void Inverse(const Tensor &A, Tensor &output)
Computes A^{-1} with LU factorization, where A is a N x N square matrix.
void To(const core::Tensor &src, core::Tensor &dst, double scale, double offset)
void ComputePoseColoredICPCPU(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, core::Tensor &pose, float &residual, int &inlier_count, const core::Dtype &dtype, const core::Device &device, const registration::RobustKernel &kernel, const double &lambda_geometric)
void ComputePosePointToPlaneCPU(const core::Tensor &source_points, const core::Tensor &target_points, const core::Tensor &target_normals, const core::Tensor &correspondence_indices, core::Tensor &pose, float &residual, int &inlier_count, const core::Dtype &dtype, const core::Device &device, const registration::RobustKernel &kernel)
void ComputeRtPointToPointCPU(const core::Tensor &source_points, const core::Tensor &target_points, const core::Tensor &corres, core::Tensor &R, core::Tensor &t, int &inlier_count, const core::Dtype &dtype, const core::Device &device)
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.
void ComputePoseDopplerICPCPU(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, core::Tensor &output_pose, float &residual, int &inlier_count, const core::Dtype &dtype, const core::Device &device, const core::Tensor &R_S_to_V, const core::Tensor &r_v_to_s_in_V, const core::Tensor &w_v_in_V, const core::Tensor &v_v_in_V, const double period, const bool reject_dynamic_outliers, const double doppler_outlier_threshold, const registration::RobustKernel &kernel_geometric, const registration::RobustKernel &kernel_doppler, const double lambda_doppler)
void ComputeInformationMatrixCPU(const core::Tensor &target_points, const core::Tensor &correspondence_indices, core::Tensor &information_matrix, const core::Dtype &dtype, const core::Device &device)
core::Tensor ComputeInformationMatrix(const core::Tensor &target_points, const core::Tensor &correspondence_indices)
Computes Information Matrix of shape {6, 6}, of dtype Float64 on device CPU:0, from the target point ...
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 TransformationToPose(const core::Tensor &transformation)
Convert transformation matrix to pose.
Generic file read and write utility for python interface.