libvisiontransfer  4.1.5
Public Types | Public Member Functions | List of all members
ImagePair Class Reference

A set of two images, which are usually the left camera image and the disparity map. More...

#include <visiontransfer/imagepair.h>

Public Types

enum  ImageFormat { FORMAT_8_BIT, FORMAT_12_BIT }
 Image formats that can be transferred. More...
 

Public Member Functions

 ImagePair ()
 Default constructor creating an image pair with no pixel data. More...
 
void setWidth (int w)
 Sets a new width for both images. More...
 
void setHeight (int h)
 Sets a new width for both images. More...
 
void setRowStride (int imageNumber, int stride)
 Sets a new row stride for the pixel data of one image. More...
 
void setPixelFormat (int imageNumber, ImageFormat format)
 Sets the pixel format for the given image. More...
 
void setPixelData (int imageNumber, unsigned char *pixelData)
 Sets the pixel data for the given image. More...
 
void setQMatrix (const float *q)
 Sets the pointer to the disparity-to-depth mapping matrix q. More...
 
void setSequenceNumber (unsigned int num)
 Sets the sequence number for this image pair. More...
 
void setTimestamp (int seconds, int microsec)
 Sets the time at which this image pair has been captured. More...
 
void setDisparityRange (int minimum, int maximum)
 Sets the value range for the disparity map contained in this image pair. More...
 
int getWidth () const
 Returns the width of each image. More...
 
int getHeight () const
 Returns the height of each image. More...
 
int getRowStride (int imageNumber) const
 Returns the row stride for the pixel data of one image. More...
 
ImageFormat getPixelFormat (int imageNumber) const
 Returns the pixel format for the given image. More...
 
unsigned char * getPixelData (int imageNumber) const
 Returns the pixel data for the given image. More...
 
const float * getQMatrix () const
 Returns a pointer to the disparity-to-depth mapping matrix q. More...
 
unsigned int getSequenceNumber () const
 Returns the sequence number for this image pair. More...
 
void getTimestamp (int &seconds, int &microsec) const
 Returns the time at which this image pair has been captured. More...
 
void getDisparityRange (int &minimum, int &maximum) const
 Gets the value range for the disparity map contained in this image pair. If the image pair does not contain any disparity data then the disparity range is undefined. More...
 
void writePgmFile (int imageNumber, const char *fileName)
 Writes one image of the pair to a PGM file. More...
 

Detailed Description

A set of two images, which are usually the left camera image and the disparity map.

Both images must be of equal width and height, but are allowed to have a different pixel formats. Please note that the class does not manage the pixel data but only keeps pointers. You thus need to ensure that the pixel data remains valid for as long as this object persists.

Definition at line 30 of file imagepair.h.

Member Enumeration Documentation

Image formats that can be transferred.

Enumerator
FORMAT_8_BIT 

8-bit greyscale format

FORMAT_12_BIT 

12-bit greyscale format plus 4 bits of padding (hence a total of 16 bits).

Definition at line 35 of file imagepair.h.

Constructor & Destructor Documentation

ImagePair::ImagePair ( )
inline

Default constructor creating an image pair with no pixel data.

Definition at line 47 of file imagepair.h.

Member Function Documentation

void ImagePair::getDisparityRange ( int &  minimum,
int &  maximum 
) const
inline

Gets the value range for the disparity map contained in this image pair. If the image pair does not contain any disparity data then the disparity range is undefined.

Parameters
minimumMinimum disparity value.
maximumMaximum disparity value.

Definition at line 219 of file imagepair.h.

int ImagePair::getHeight ( ) const
inline

Returns the height of each image.

Definition at line 152 of file imagepair.h.

unsigned char* ImagePair::getPixelData ( int  imageNumber) const
inline

Returns the pixel data for the given image.

Parameters
imageNumberNumber of the image for which to receive the pixel data (0 or 1).

Definition at line 182 of file imagepair.h.

ImageFormat ImagePair::getPixelFormat ( int  imageNumber) const
inline

Returns the pixel format for the given image.

Parameters
imageNumberNumber of the image for which to receive the pixel format (0 or 1).

Definition at line 171 of file imagepair.h.

const float* ImagePair::getQMatrix ( ) const
inline

Returns a pointer to the disparity-to-depth mapping matrix q.

Definition at line 190 of file imagepair.h.

int ImagePair::getRowStride ( int  imageNumber) const
inline

Returns the row stride for the pixel data of one image.

Parameters
imageNumberNumber of the image for which to receive the row stride (0 or 1).

Definition at line 160 of file imagepair.h.

unsigned int ImagePair::getSequenceNumber ( ) const
inline

Returns the sequence number for this image pair.

Definition at line 197 of file imagepair.h.

void ImagePair::getTimestamp ( int &  seconds,
int &  microsec 
) const
inline

Returns the time at which this image pair has been captured.

Parameters
secondsThe time stamp with a resolution of one second.
microsecThe fractional seconds part of the time stamp with a resolution of 1 microsecond.

Definition at line 206 of file imagepair.h.

int ImagePair::getWidth ( ) const
inline

Returns the width of each image.

Definition at line 147 of file imagepair.h.

void ImagePair::setDisparityRange ( int  minimum,
int  maximum 
)
inline

Sets the value range for the disparity map contained in this image pair.

Parameters
minimumMinimum disparity value.
maximumMaximum disparity value.

Definition at line 139 of file imagepair.h.

void ImagePair::setHeight ( int  h)
inline

Sets a new width for both images.

Definition at line 65 of file imagepair.h.

void ImagePair::setPixelData ( int  imageNumber,
unsigned char *  pixelData 
)
inline

Sets the pixel data for the given image.

Parameters
imageNumberNumber of the image for which to set the pixel data (0 or 1).
pixelDataThe pixel data that shall be set.

Definition at line 98 of file imagepair.h.

void ImagePair::setPixelFormat ( int  imageNumber,
ImageFormat  format 
)
inline

Sets the pixel format for the given image.

Parameters
imageNumberNumber of the image for which to set the pixel format (0 or 1).
formatThe pixel format that shall be set.

Definition at line 86 of file imagepair.h.

void ImagePair::setQMatrix ( const float *  q)
inline

Sets the pointer to the disparity-to-depth mapping matrix q.

No data is copied. The data which q is pointing to has to remain valid for as long as this object exists.

Definition at line 109 of file imagepair.h.

void ImagePair::setRowStride ( int  imageNumber,
int  stride 
)
inline

Sets a new row stride for the pixel data of one image.

Parameters
imageNumberNumber of the image for which to set the row stride (0 or 1).
strideThe row stride that shall be set.

Definition at line 74 of file imagepair.h.

void ImagePair::setSequenceNumber ( unsigned int  num)
inline

Sets the sequence number for this image pair.

Definition at line 116 of file imagepair.h.

void ImagePair::setTimestamp ( int  seconds,
int  microsec 
)
inline

Sets the time at which this image pair has been captured.

Parameters
secondsThe time stamp with a resolution of one second.
microsecThe fractional seconds part of the time stamp with a resolution of 1 microsecond.

Definition at line 127 of file imagepair.h.

void ImagePair::setWidth ( int  w)
inline

Sets a new width for both images.

Definition at line 60 of file imagepair.h.

void ImagePair::writePgmFile ( int  imageNumber,
const char *  fileName 
)

Writes one image of the pair to a PGM file.

Parameters
imageNumberThe number of the image that shall be written.
Filename of the PGM file that shall be created.

Definition at line 26 of file imagepair.cpp.


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