Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
pcl::ImageGrabberBase Class Reference

Base class for Image file grabber. More...

#include <image_grabber.h>

Inheritance diagram for pcl::ImageGrabberBase:
Inheritance graph
[legend]

List of all members.

Classes

struct  ImageGrabberImpl

Public Member Functions

bool atLastFrame () const
 Returns if the last frame is reached.
virtual void getCameraIntrinsics (double &focal_length_x, double &focal_length_y, double &principal_point_x, double &principal_point_y) const
 Get the current focal length and center pixel. If the intrinsics have been manually set with @, this will return those values. Else, if start () has been called and the grabber has found a frame_[timestamp].xml file, this will return the most recent values read. Else, returns factory defaults.
std::string getCurrentDepthFileName () const
 Returns the filename of the current indexed file.
std::string getDepthFileNameAtIndex (size_t idx) const
 Get the depth filename at a particular index.
virtual float getFramesPerSecond () const
 Returns the frames_per_second. 0 if grabber is trigger-based.
virtual std::string getName () const
std::string getPrevDepthFileName () const
 Returns the filename of the previous indexed file SDM: adding this back in, but is this useful, or confusing?
bool getTimestampAtIndex (size_t idx, uint64_t &timestamp) const
 Query only the timestamp of an index, if it exists.
 ImageGrabberBase (const std::string &directory, float frames_per_second, bool repeat, bool pclzf_mode)
 Constructor taking a folder of depth+[rgb] images.
 ImageGrabberBase (const std::string &depth_directory, const std::string &rgb_directory, float frames_per_second, bool repeat)
 ImageGrabberBase (const std::vector< std::string > &depth_image_files, float frames_per_second, bool repeat)
 Constructor taking a list of paths to PCD files, that are played in the order they appear in the list.
 ImageGrabberBase (const ImageGrabberBase &src)
 Copy constructor.
bool isRepeatOn () const
 Returns whether the repeat flag is on.
virtual bool isRunning () const
 whether the grabber is started (publishing) or not.
ImageGrabberBaseoperator= (const ImageGrabberBase &src)
 Copy operator.
virtual void rewind ()
 Rewinds to the first PCD file in the list.
virtual void setCameraIntrinsics (const double focal_length_x, const double focal_length_y, const double principal_point_x, const double principal_point_y)
 Define custom focal length and center pixel. This will override ANY other setting of parameters for the duration of the grabber's life, whether by factory defaults or explicitly read from a frame_[timestamp].xml file.
void setDepthImageUnits (float units)
 Define the units the depth data is stored in. Defaults to mm (0.001), meaning a brightness of 1000 corresponds to 1 m.
void setNumberOfThreads (unsigned int nr_threads=0)
 Set the number of threads, if we wish to use OpenMP for quicker cloud population. Note that for a standard (< 4 core) machine this is unlikely to yield a drastic speedup.
void setRGBImageFiles (const std::vector< std::string > &rgb_image_files)
 Manually set RGB image files.
virtual void start ()
 Starts playing the list of PCD files if frames_per_second is > 0. Otherwise it works as a trigger: publishes only the next PCD file in the list.
virtual void stop ()
 Stops playing the list of PCD files if frames_per_second is > 0. Otherwise the method has no effect.
virtual void trigger ()
 Triggers a callback with new data.
virtual ~ImageGrabberBase () throw ()
 Virtual destructor.

Protected Member Functions

bool getCloudAt (size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const
 Gets the cloud in ROS form at location idx.
size_t numFrames () const
 Convenience function to see how many frames this consists of.

Private Member Functions

virtual void publish (const pcl::PCLPointCloud2 &blob, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) const =0

Private Attributes

ImageGrabberImplimpl_

Detailed Description

Base class for Image file grabber.

Definition at line 58 of file image_grabber.h.


Constructor & Destructor Documentation

pcl::ImageGrabberBase::ImageGrabberBase ( const std::string directory,
float  frames_per_second,
bool  repeat,
bool  pclzf_mode 
)

Constructor taking a folder of depth+[rgb] images.

Parameters:
[in]directoryDirectory which contains an ordered set of images corresponding to an [RGB]D video, stored as TIFF, PNG, JPG, or PPM files. The naming convention is: frame_[timestamp]_["depth"/"rgb"].[extension]
[in]frames_per_secondframes per second. If 0, start() functions like a trigger, publishing the next PCD in the list.
[in]repeatwhether to play PCD file in an endless loop or not.

Definition at line 876 of file image_grabber.cpp.

pcl::ImageGrabberBase::ImageGrabberBase ( const std::string depth_directory,
const std::string rgb_directory,
float  frames_per_second,
bool  repeat 
)

Definition at line 882 of file image_grabber.cpp.

pcl::ImageGrabberBase::ImageGrabberBase ( const std::vector< std::string > &  depth_image_files,
float  frames_per_second,
bool  repeat 
)

Constructor taking a list of paths to PCD files, that are played in the order they appear in the list.

Parameters:
[in]depth_image_filesPath to the depth image files files.
[in]frames_per_secondframes per second. If 0, start() functions like a trigger, publishing the next PCD in the list.
[in]repeatwhether to play PCD file in an endless loop or not.

Definition at line 888 of file image_grabber.cpp.

Copy constructor.

Parameters:
[in]srcthe Image Grabber base object to copy into this

Definition at line 79 of file image_grabber.h.

Virtual destructor.

Definition at line 894 of file image_grabber.cpp.


Member Function Documentation

Returns if the last frame is reached.

Definition at line 1037 of file image_grabber.cpp.

void pcl::ImageGrabberBase::getCameraIntrinsics ( double &  focal_length_x,
double &  focal_length_y,
double &  principal_point_x,
double &  principal_point_y 
) const [virtual]

Get the current focal length and center pixel. If the intrinsics have been manually set with @, this will return those values. Else, if start () has been called and the grabber has found a frame_[timestamp].xml file, this will return the most recent values read. Else, returns factory defaults.

Parameters:
[out]focal_length_xHorizontal focal length (fx)
[out]focal_length_yVertical focal length (fy)
[out]principal_point_xHorizontal coordinates of the principal point (cx)
[out]principal_point_yVertical coordinates of the principal point (cy)

Definition at line 998 of file image_grabber.cpp.

bool pcl::ImageGrabberBase::getCloudAt ( size_t  idx,
pcl::PCLPointCloud2 blob,
Eigen::Vector4f &  origin,
Eigen::Quaternionf &  orientation 
) const [protected]

Gets the cloud in ROS form at location idx.

Definition at line 1026 of file image_grabber.cpp.

Returns the filename of the current indexed file.

Definition at line 1047 of file image_grabber.cpp.

Get the depth filename at a particular index.

Definition at line 1072 of file image_grabber.cpp.

float pcl::ImageGrabberBase::getFramesPerSecond ( ) const [virtual]

Returns the frames_per_second. 0 if grabber is trigger-based.

Implements pcl::Grabber.

Definition at line 956 of file image_grabber.cpp.

Returns:
The name of the grabber

Implements pcl::Grabber.

Definition at line 942 of file image_grabber.cpp.

Returns the filename of the previous indexed file SDM: adding this back in, but is this useful, or confusing?

Definition at line 1059 of file image_grabber.cpp.

bool pcl::ImageGrabberBase::getTimestampAtIndex ( size_t  idx,
uint64_t &  timestamp 
) const

Query only the timestamp of an index, if it exists.

Definition at line 1085 of file image_grabber.cpp.

Returns whether the repeat flag is on.

Definition at line 963 of file image_grabber.cpp.

bool pcl::ImageGrabberBase::isRunning ( ) const [virtual]

whether the grabber is started (publishing) or not.

Returns:
true only if publishing.

Implements pcl::Grabber.

Definition at line 935 of file image_grabber.cpp.

size_t pcl::ImageGrabberBase::numFrames ( ) const [protected]

Convenience function to see how many frames this consists of.

Definition at line 1019 of file image_grabber.cpp.

ImageGrabberBase& pcl::ImageGrabberBase::operator= ( const ImageGrabberBase src) [inline]

Copy operator.

Parameters:
[in]srcthe Image Grabber base object to copy into this

Definition at line 88 of file image_grabber.h.

virtual void pcl::ImageGrabberBase::publish ( const pcl::PCLPointCloud2 blob,
const Eigen::Vector4f &  origin,
const Eigen::Quaternionf &  orientation 
) const [private, pure virtual]

Implemented in pcl::ImageGrabber< PointT >.

void pcl::ImageGrabberBase::rewind ( ) [virtual]

Rewinds to the first PCD file in the list.

Definition at line 949 of file image_grabber.cpp.

void pcl::ImageGrabberBase::setCameraIntrinsics ( const double  focal_length_x,
const double  focal_length_y,
const double  principal_point_x,
const double  principal_point_y 
) [virtual]

Define custom focal length and center pixel. This will override ANY other setting of parameters for the duration of the grabber's life, whether by factory defaults or explicitly read from a frame_[timestamp].xml file.

Parameters:
[in]focal_length_xHorizontal focal length (fx)
[in]focal_length_yVertical focal length (fy)
[in]principal_point_xHorizontal coordinates of the principal point (cx)
[in]principal_point_yVertical coordinates of the principal point (cy)

Definition at line 979 of file image_grabber.cpp.

Define the units the depth data is stored in. Defaults to mm (0.001), meaning a brightness of 1000 corresponds to 1 m.

Definition at line 1013 of file image_grabber.cpp.

void pcl::ImageGrabberBase::setNumberOfThreads ( unsigned int  nr_threads = 0)

Set the number of threads, if we wish to use OpenMP for quicker cloud population. Note that for a standard (< 4 core) machine this is unlikely to yield a drastic speedup.

Definition at line 1097 of file image_grabber.cpp.

void pcl::ImageGrabberBase::setRGBImageFiles ( const std::vector< std::string > &  rgb_image_files)

Manually set RGB image files.

Parameters:
[in]rgb_image_filesA vector of [tiff/png/jpg/ppm] files to use as input. There must be a 1-to-1 correspondence between these and the depth images you set

Definition at line 970 of file image_grabber.cpp.

void pcl::ImageGrabberBase::start ( ) [virtual]

Starts playing the list of PCD files if frames_per_second is > 0. Otherwise it works as a trigger: publishes only the next PCD file in the list.

Implements pcl::Grabber.

Definition at line 902 of file image_grabber.cpp.

void pcl::ImageGrabberBase::stop ( ) [virtual]

Stops playing the list of PCD files if frames_per_second is > 0. Otherwise the method has no effect.

Implements pcl::Grabber.

Definition at line 915 of file image_grabber.cpp.

void pcl::ImageGrabberBase::trigger ( ) [virtual]

Triggers a callback with new data.

Definition at line 926 of file image_grabber.cpp.


Member Data Documentation

Definition at line 208 of file image_grabber.h.


The documentation for this class was generated from the following files:


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:41:53