libvisiontransfer
4.1.2
|
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 µsec) 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... | |
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.
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.
|
inline |
Default constructor creating an image pair with no pixel data.
Definition at line 47 of file imagepair.h.
|
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.
minimum | Minimum disparity value. |
maximum | Maximum disparity value. |
Definition at line 219 of file imagepair.h.
|
inline |
Returns the height of each image.
Definition at line 152 of file imagepair.h.
|
inline |
Returns the pixel data for the given image.
imageNumber | Number of the image for which to receive the pixel data (0 or 1). |
Definition at line 182 of file imagepair.h.
|
inline |
Returns the pixel format for the given image.
imageNumber | Number of the image for which to receive the pixel format (0 or 1). |
Definition at line 171 of file imagepair.h.
|
inline |
Returns a pointer to the disparity-to-depth mapping matrix q.
Definition at line 190 of file imagepair.h.
|
inline |
Returns the row stride for the pixel data of one image.
imageNumber | Number of the image for which to receive the row stride (0 or 1). |
Definition at line 160 of file imagepair.h.
|
inline |
Returns the sequence number for this image pair.
Definition at line 197 of file imagepair.h.
|
inline |
Returns the time at which this image pair has been captured.
seconds | The time stamp with a resolution of one second. |
microsec | The fractional seconds part of the time stamp with a resolution of 1 microsecond. |
Definition at line 206 of file imagepair.h.
|
inline |
Returns the width of each image.
Definition at line 147 of file imagepair.h.
|
inline |
Sets the value range for the disparity map contained in this image pair.
minimum | Minimum disparity value. |
maximum | Maximum disparity value. |
Definition at line 139 of file imagepair.h.
|
inline |
Sets a new width for both images.
Definition at line 65 of file imagepair.h.
|
inline |
Sets the pixel data for the given image.
imageNumber | Number of the image for which to set the pixel data (0 or 1). |
pixelData | The pixel data that shall be set. |
Definition at line 98 of file imagepair.h.
|
inline |
Sets the pixel format for the given image.
imageNumber | Number of the image for which to set the pixel format (0 or 1). |
format | The pixel format that shall be set. |
Definition at line 86 of file imagepair.h.
|
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.
|
inline |
Sets a new row stride for the pixel data of one image.
imageNumber | Number of the image for which to set the row stride (0 or 1). |
stride | The row stride that shall be set. |
Definition at line 74 of file imagepair.h.
|
inline |
Sets the sequence number for this image pair.
Definition at line 116 of file imagepair.h.
|
inline |
Sets the time at which this image pair has been captured.
seconds | The time stamp with a resolution of one second. |
microsec | The fractional seconds part of the time stamp with a resolution of 1 microsecond. |
Definition at line 127 of file imagepair.h.
|
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.
imageNumber | The number of the image that shall be written. |
File | name of the PGM file that shall be created. |
Definition at line 26 of file imagepair.cpp.