Files
ViewDesignEngine/include/vde/core/icp.h
T

26 lines
910 B
C++
Raw Normal View History

#pragma once
#include "vde/core/point.h"
#include "vde/core/transform.h"
#include <vector>
namespace vde::core {
struct ICPResult {
Transform3D transform; // Rigid transform aligning source to target
double rms_error; // Root-mean-square error
int iterations; // Number of iterations used
bool converged;
};
/// Iterative Closest Point (ICP) for rigid point cloud registration
/// @param source Source point cloud (moved)
/// @param target Target point cloud (fixed)
/// @param max_iter Maximum iterations
/// @param tolerance Convergence tolerance on RMS change
[[nodiscard]] ICPResult icp_register(const std::vector<Point3D>& source,
const std::vector<Point3D>& target,
int max_iter = 50,
double tolerance = 1e-6);
} // namespace vde::core