本文整理汇总了C++中eigen::Matrix::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::empty方法的具体用法?C++ Matrix::empty怎么用?C++ Matrix::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Matrix
的用法示例。
在下文中一共展示了Matrix::empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remainingPoints
void mrpt::math::ransac_detect_3D_planes(
const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &x,
const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &y,
const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &z,
vector<pair<size_t,TPlane> > &out_detected_planes,
const double threshold,
const size_t min_inliers_for_valid_plane
)
{
MRPT_START
ASSERT_(x.size()==y.size() && x.size()==z.size())
out_detected_planes.clear();
if (x.empty())
return;
// The running lists of remaining points after each plane, as a matrix:
CMatrixTemplateNumeric<NUMTYPE> remainingPoints( 3, x.size() );
remainingPoints.insertRow(0,x);
remainingPoints.insertRow(1,y);
remainingPoints.insertRow(2,z);
// ---------------------------------------------
// For each plane:
// ---------------------------------------------
for (;;)
{
mrpt::vector_size_t this_best_inliers;
CMatrixTemplateNumeric<NUMTYPE> this_best_model;
math::RANSAC_Template<NUMTYPE>::execute(
remainingPoints,
ransac3Dplane_fit,
ransac3Dplane_distance,
ransac3Dplane_degenerate,
threshold,
3, // Minimum set of points
this_best_inliers,
this_best_model,
true, // Verbose
0.999 // Prob. of good result
);
// Is this plane good enough?
if (this_best_inliers.size()>=min_inliers_for_valid_plane)
{
// Add this plane to the output list:
out_detected_planes.push_back(
std::make_pair<size_t,TPlane>(
this_best_inliers.size(),
TPlane( this_best_model(0,0), this_best_model(0,1),this_best_model(0,2),this_best_model(0,3) )
) );
out_detected_planes.rbegin()->second.unitarize();
// Discard the selected points so they are not used again for finding subsequent planes:
remainingPoints.removeColumns(this_best_inliers);
}
else
{
break; // Do not search for more planes.
}
}
MRPT_END
}