基于PCL拾取屏幕上三维点坐标(可显示点云颜色)

本文介绍了如何使用PCL库修改代码,实现在屏幕上拾取三维点的同时,显示点云的颜色信息。详细步骤和源代码来源于CSDN博主的文章,通过调整原代码实现了颜色显示功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

代码出处:https://blog.csdn.net/wokaowokaowokao12345/article/details/51318859#comments_17826962
原代码不能显示点云颜色,做了小小修改

#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>

typedef pcl::PointXYZRGBA PointT;
typedef pcl::PointCloud<PointT> PointCloudT;

// Mutex: //
std::mutex cloud_mutex;

struct callback_args {
   
   
    // structure used to pass arguments to the callback function
    PointCloudT::Ptr clicked_points_3d;
    pcl::visualization::PCLVisualizer::Ptr viewerPtr;
};

void
pp_callback(const pcl::visualization::PointPickingEvent& event, void* args)
{
   
   
    struct callback_args* data = (struct callback_args*)args;
    if (event
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值