64ad721ed7
- CMake: INTERFACE 库修复、vde_compile_options 顺序修复 - 命名空间: 所有模块添加 using 声明 - 类型补全: Ray3Dd、Point4D - 头文件: tolerance 泛型化、std::optional include - 警告: 放宽 -Wconversion/-Wsign-conversion - 构建结果: 0 errors, 22/25 tests passed
30 lines
1020 B
C++
30 lines
1020 B
C++
#pragma once
|
|
#include "vde/core/point.h"
|
|
#include "vde/core/transform.h"
|
|
#include <vector>
|
|
|
|
namespace vde::core {
|
|
using foundation::Point2D;
|
|
using foundation::Point3D;
|
|
using foundation::Vector2D;
|
|
using foundation::Vector3D;
|
|
|
|
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
|