20 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39 if (points.size() < 3)
40 throw std::runtime_error(
"Point measurement vector should contain at least 3 entries!");
42 Eigen::MatrixXd A(points.size(), 3);
43 Eigen::MatrixXd d(points.size(), 1);
46 for (
size_t i = 0;
i < points.size();
i++)
51 Eigen::Matrix<double, 4, 1> coefficients;
52 coefficients.head<3>() = A.colPivHouseholderQr().solve(d);
53 coefficients(3) = 1.0;
55 return Plane(coefficients);
Estimates a Plane from a number of 3D points using least squares.
Definition: PlaneEstimator.h:17
PlaneEstimator()
constructor
Definition: PlaneEstimator.h:25
Plane estimate(const point_measurements_t &points)
estimate the plane
Definition: PlaneEstimator.h:37
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::vector< Eigen::Vector3d, Eigen::aligned_allocator< Eigen::Vector3d > > point_measurements_t
Definition: PlaneEstimator.h:22
Implements a geometrical 3D plane of type .
Definition: Plane.h:12
~PlaneEstimator()
destructor
Definition: PlaneEstimator.h:27