|
libvisiontransfer
6.0.0
|
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_MONO, FORMAT_8_BIT_RGB, FORMAT_12_BIT_MONO } |
| Image formats that can be transferred. More... | |
| enum | ImageFormat_Deprecated { FORMAT_8_BIT = ImageFormat::FORMAT_8_BIT_MONO, FORMAT_12_BIT = ImageFormat::FORMAT_12_BIT_MONO } |
Public Member Functions | |
| ImagePair () | |
| Default constructor creating an image pair with no pixel data. More... | |
| ImagePair (const ImagePair &other) | |
| Copy constructor creating a shallow copy of the image pair. More... | |
| ImagePair & | operator= (ImagePair const &other) |
| 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... | |
| void | setImageDisparityPair (bool dispPair) |
| Sets whether this is a left camera image and disparity map pair, or two raw camera images. 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) const |
| Writes one image of the pair to a PGM or PPM file. More... | |
| bool | isImageDisparityPair () const |
| Returns true if this is a left camera image and disparity map pair. More... | |
| void | copyTo (ImagePair &dest) |
| Makes a deep copy of this image pair. More... | |
| int | getBytesPerPixel (int imageNumber) const |
| Returns the number of bytes that are required to store one image pixel. More... | |
Static Public Member Functions | |
| static int | getBytesPerPixel (ImageFormat format) |
| Returns the number of bytes that are required to store one image pixel with the given pixel format. 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 31 of file imagepair.h.
Image formats that can be transferred.
| Enumerator | |
|---|---|
| FORMAT_8_BIT_MONO |
8-bit greyscale format |
| FORMAT_8_BIT_RGB |
8-bit RGB format |
| FORMAT_12_BIT_MONO |
12-bit greyscale format plus 4 bits of padding (hence a total of 16 bits). |
Definition at line 36 of file imagepair.h.
ImageFormat. Definition at line 51 of file imagepair.h.
| ImagePair::ImagePair | ( | ) |
Default constructor creating an image pair with no pixel data.
Definition at line 27 of file imagepair.cpp.
| ImagePair::ImagePair | ( | const ImagePair & | other | ) |
Copy constructor creating a shallow copy of the image pair.
Definition at line 39 of file imagepair.cpp.
| void ImagePair::copyTo | ( | ImagePair & | dest | ) |
Makes a deep copy of this image pair.
Definition at line 142 of file imagepair.cpp.
|
inline |
Returns the number of bytes that are required to store one image pixel.
Definition at line 275 of file imagepair.h.
|
static |
Returns the number of bytes that are required to store one image pixel with the given pixel format.
Definition at line 166 of file imagepair.cpp.
|
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 245 of file imagepair.h.
|
inline |
Returns the height of each image.
Definition at line 178 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 208 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 197 of file imagepair.h.
|
inline |
Returns a pointer to the disparity-to-depth mapping matrix q.
Definition at line 216 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 186 of file imagepair.h.
|
inline |
Returns the sequence number for this image pair.
Definition at line 223 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 232 of file imagepair.h.
|
inline |
Returns the width of each image.
Definition at line 173 of file imagepair.h.
|
inline |
Returns true if this is a left camera image and disparity map pair.
Definition at line 262 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 157 of file imagepair.h.
|
inline |
Sets a new width for both images.
Definition at line 77 of file imagepair.h.
|
inline |
Sets whether this is a left camera image and disparity map pair, or two raw camera images.
Definition at line 166 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 116 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 98 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 127 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 86 of file imagepair.h.
|
inline |
Sets the sequence number for this image pair.
Definition at line 134 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 145 of file imagepair.h.
|
inline |
Sets a new width for both images.
Definition at line 72 of file imagepair.h.
| void ImagePair::writePgmFile | ( | int | imageNumber, |
| const char * | fileName | ||
| ) | const |
Writes one image of the pair to a PGM or PPM file.
| imageNumber | The number of the image that shall be written. |
| File | name of the PGM or PPM file that shall be created. |
Definition at line 93 of file imagepair.cpp.