90 std::vector<std::pair<unsigned, unsigned>>
intervals;
91 std::pair<unsigned, unsigned>
interval(0, 0);
95 for (std::size_t idx = 1; idx <
polygon.
size(); ++idx) {
106 for (std::size_t idx = 1; idx <
polygon.
size(); ++idx) {
131 std::vector<unsigned>
result;
186 std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f>>
lines(
194 Eigen::Vector2f centroid = Eigen::Vector2f::Zero();
195 Eigen::Matrix2f covariance = Eigen::Matrix2f::Zero();
219 covariance.coeffRef(2) = covariance.coeff(1);
224 covariance.coeffRef(0) -= centroid[0] * centroid[0];
225 covariance.coeffRef(1) -= centroid[0] * centroid[1];
226 covariance.coeffRef(3) -= centroid[1] * centroid[1];
229 Eigen::Vector2f normal;
233 Eigen::Vector2f direction;
236 direction.normalize();
238 if (std::abs(direction.dot(normal)) >
float(
M_SQRT1_2)) {
239 std::swap(normal[0], normal[1]);
240 normal[0] = -normal[0];
244 if (direction[0] * normal[1] < direction[1] * normal[0])
267 float distance =
pq.squaredNorm();
286 point.getVector3fMap() =
vertex;
292 for (std::vector<unsigned>::reverse_iterator
it =
result.rbegin();
void eigen22(const Matrix &mat, typename Matrix::Scalar &eigenvalue, Vector &eigenvector)
determine the smallest eigenvalue and its corresponding eigenvector
void approximatePolygon2D(const typename PointCloud< PointT >::VectorType &polygon, typename PointCloud< PointT >::VectorType &approx_polygon, float threshold, bool refine=false, bool closed=true)
returns an approximate polygon to given 2D contour.
void approximatePolygon(const PlanarPolygon< PointT > &polygon, PlanarPolygon< PointT > &approx_polygon, float threshold, bool refine=false, bool closed=true)
see approximatePolygon2D