本文整理汇总了C++中pointcloudt::Ptr::at方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::at方法的具体用法?C++ Ptr::at怎么用?C++ Ptr::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pointcloudt::Ptr
的用法示例。
在下文中一共展示了Ptr::at方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeLowConfidencePoints
void removeLowConfidencePoints(cv::Mat& confidence_image, int threshold, PointCloudT::Ptr& cloud)
{
for (int i=0;i<cloud->height;i++)
{
for (int j=0;j<cloud->width;j++)
{
if (confidence_image.at<unsigned char>(i,j) < threshold)
{
cloud->at(j,i).x = std::numeric_limits<float>::quiet_NaN();
cloud->at(j,i).y = std::numeric_limits<float>::quiet_NaN();
cloud->at(j,i).z = std::numeric_limits<float>::quiet_NaN();
confidence_image.at<unsigned char>(i,j) = 0; // just for visualization
}
else
confidence_image.at<unsigned char>(i,j) = 255; // just for visualization
}
}
cloud->is_dense = false;
}
示例2: filter_PC_from_BB
void filter_PC_from_BB(PointCloudT::Ptr &cloud, cv::Mat &result, int x, int y, int width, int height){
const float bad_point = std::numeric_limits<float>::quiet_NaN();
if (cloud->isOrganized()) {
std::cout << "PointCloud is organized..." << std::endl;
result = cv::Mat(cloud->height, cloud->width, CV_8UC3);
if (!cloud->empty()) {
for (int h=0; h<result.rows; h++) {
for (int w=0; w<result.cols; w++) {
// Check if in bounding window
if ( (h>y && h<(y+height)) && ((w > x) && w < (x+width)) ){
// do nothing
} else {
// remove point
//PointT point = cloud->at(w, h);
//cloud->at(w, h);
cloud->at(w, h).x = bad_point;
cloud->at(w, h).y = bad_point;
cloud->at(w, h).z = bad_point;
cloud->at(w, h).r = bad_point;
cloud->at(w, h).g = bad_point;
cloud->at(w, h).b = bad_point;
}
}
}
}
}
}
示例3: PC_to_Mat
void PC_to_Mat(PointCloudT::Ptr &cloud, cv::Mat &result){
if (cloud->isOrganized()) {
std::cout << "PointCloud is organized..." << std::endl;
result = cv::Mat(cloud->height, cloud->width, CV_8UC3);
if (!cloud->empty()) {
for (int h=0; h<result.rows; h++) {
for (int w=0; w<result.cols; w++) {
PointT point = cloud->at(w, h);
Eigen::Vector3i rgb = point.getRGBVector3i();
result.at<cv::Vec3b>(h,w)[0] = rgb[2];
result.at<cv::Vec3b>(h,w)[1] = rgb[1];
result.at<cv::Vec3b>(h,w)[2] = rgb[0];
}
}
}
}
}