PCL函数库摘要——IO模块

1.Class pcl::FileReader

类FileReader定义了PCD文件的读取接口,主要用做其他读取类的父类。

#include <pcl/io/file_io.h>
virtual int pcl::FileReader::read  ( const std::string &  file_name,  
  pcl::PCLPointCloud2 &  cloud,  
  Eigen::Vector4f &  origin,  
  Eigen::Quaternionf &  orientation,  
  int &  file_version,  
  const int  offset = 0  
 ) 
int pcl::FileReader::read  ( const std::string &  file_name,  
  pcl::PCLPointCloud2 &  cloud,  
  const int  offset = 0  
 )  //从文件文件中读取点云数据(仅限FILE_V6!)。并将其存储到PCL/PCLPointCloud2中
int pcl::FileReader::read  ( const std::string &  file_name,  
  pcl::PointCloud< PointT > &  cloud,  
  const int  offset = 0  
 ) //从任何文件文件中读取点云数据,并将其转换为给定的样板格式。
virtual int pcl::FileReader::readHeader  ( const std::string &  file_name,  
  pcl::PCLPointCloud2 &  cloud,  
  Eigen::Vector4f &  origin,  
  Eigen::Quaternionf &  orientation,  
  int &  file_version,  
  int &  data_type,  
  unsigned int &  data_idx,  
  const int  offset = 0  
 ) 

 /*
 file_name:读取文件的文件名。
 cloud:存储读取后的点云数据,但只填充文件头。
 origin:点云获取原点,该参数只有在文件版本大于FILE_V7才存在v否则为NULL。
 orientation:点云获取方向,该参数只有在文件版本大于FILE_V7才存在,否则为NULL。
 file_version:文件版本(FILE_V7或者FILE_V6)。
 data_type:数据类型(二进制置为1,ASCII 码置为0)。
 data_idx:数据偏移文件头末尾的偏移量。
 offset:文件头偏移文件开始的偏移量。
 */

2.Class pcl::FileWriter

类FileWriter 与 FileReader对应,是写人PCD文件的类接口定义,可以作为其它写入类的父类。

#include <pcl/io/file_io.h>
virtual int pcl::FileWriter::write  ( const std::string &  file_name,  
  const pcl::PCLPointCloud2 &  cloud,  
  const Eigen::Vector4f &  origin = Eigen::Vector4f::Zero(),  
  const Eigen::Quaternionf &  orientation = Eigen::Quaternionf::Identity(),  
  const bool  binary = false  
 ) 
int pcl::FileWriter::write  ( const std::string &  file_name,  
  const pcl::PCLPointCloud2::ConstPtr &  cloud,  
  const Eigen::Vector4f &  origin = Eigen::Vector4f::Zero (),  
  const Eigen::Quaternionf &  orientation = Eigen::Quaternionf::Identity (),  
  const bool  binary = false  
 ) 
int pcl::FileWriter::write  ( const std::string &  file_name,  
  const pcl::PointCloud< PointT > &  cloud,  
  const bool  binary = false  
 ) 

  /*
 file_name:写入文件的文件名。
 cloud:需要写入的点云对象。
 origin:写入文件头的点云获取原点﹐默认为(0,0,0,0)。
 orientation:写入文件头的点云获取方向。
 binary:设置写人时的类型(true为二进制,false 为 ASCII 码,默认为ASCII码)。
 */

3.Class pcl::Grabber

类Grabber为PCL1.X对应的设备驱动接口的基类定义。

#include <pcl/io/grabber.h>
//关键成员函数
Grabber () //  构造函数。 
virtual  ~Grabber () throw () //虚拟构造函数
template<typename T >  
boost::signals2::connection  registerCallback (const boost::function< T > &callback) 
//提供回调函数指针,当获取每帧图像或点云数据时都会启动回调函数。
template<typename T >  
bool  providesCallback () const 
//判断是否提供回调函数。
virtual void  start ()=0 
//启动设备,开始传输数据流。
virtual void  stop ()=0     
//停止设备上的数据流传输。
virtual std::string  getName () const =0     
//返回明确的子类名字。
virtual bool  isRunning () const =0 
//判断是否在传输数据流。
virtual float  getFramesPerSecond () const =0     
//获取FPS帧率,即每秒多少帧数据。    

4.Class openni_wrapper::OpenNIDevice

类OpenNIDevice定义OpenNI设备的基类,继承该基类可以实现不同的OpenNI设备子类,用于获取包括红外数据、RGB数据、深度图像数据等。

#include <pcl/io/openni_camera/openni_device.h>
virtual  ~OpenNIDevice () throw () 
//  虚拟析构函数。  
bool  findCompatibleImageMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const throw 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值