15 #ifndef VISIONTRANSFER_IMAGEPAIR_H 16 #define VISIONTRANSFER_IMAGEPAIR_H 20 #include "visiontransfer/common.h" 54 FORMAT_8_BIT = FORMAT_8_BIT_MONO,
55 FORMAT_12_BIT = FORMAT_12_BIT_MONO
89 assert(imageNumber >= 0 && imageNumber <=1);
90 rowStride[imageNumber] = stride;
101 assert(imageNumber >= 0 && imageNumber <=1);
102 formats[imageNumber] = format;
105 #ifndef DOXYGEN_SHOULD_SKIP_THIS 107 setPixelFormat(imageNumber, static_cast<ImageFormat>(format));
119 assert(imageNumber >= 0 && imageNumber <=1);
120 data[imageNumber] = pixelData;
149 timeMicrosec = microsec;
160 minDisparity = minimum;
161 maxDisparity = maximum;
168 subpixelFactor = subpixFact;
176 disparityPair = dispPair;
196 assert(imageNumber >= 0 && imageNumber <=1);
197 return rowStride[imageNumber];
207 assert(imageNumber >= 0 && imageNumber <=1);
208 return formats[imageNumber];
218 assert(imageNumber >= 0 && imageNumber <=1);
219 return data[imageNumber];
243 microsec = timeMicrosec;
255 minimum = minDisparity;
256 maximum = maxDisparity;
263 return subpixelFactor;
272 void writePgmFile(
int imageNumber,
const char* fileName)
const;
279 return disparityPair;
294 assert(imageNumber >= 0 && imageNumber <=1);
295 return getBytesPerPixel(formats[imageNumber]);
304 #ifdef CV_MAJOR_VERSION 318 inline void toOpenCVImage(
int imageNumber, cv::Mat& dest,
bool convertRgbToBgr =
true);
328 unsigned char* data[2];
329 const float* qMatrix;
337 int* referenceCounter;
340 void decrementReference();
345 #include "visiontransfer/imagepair-opencv.h"
int getHeight() const
Returns the height of each image.
void setImageDisparityPair(bool dispPair)
Sets whether this is a left camera image and disparity map pair, or two raw camera images...
void setPixelFormat(int imageNumber, ImageFormat format)
Sets the pixel format for the given image.
void setSubpixelFactor(int subpixFact)
Sets the subpixel factor for this image pair.
void setPixelData(int imageNumber, unsigned char *pixelData)
Sets the pixel data for the given image.
void setRowStride(int imageNumber, int stride)
Sets a new row stride for the pixel data of one image.
unsigned int getSequenceNumber() const
Returns the sequence number for this image pair.
void setQMatrix(const float *q)
Sets the pointer to the disparity-to-depth mapping matrix q.
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 c...
void setDisparityRange(int minimum, int maximum)
Sets the value range for the disparity map contained in this image pair.
ImageFormat getPixelFormat(int imageNumber) const
Returns the pixel format for the given image.
int getRowStride(int imageNumber) const
Returns the row stride for the pixel data of one image.
ImageFormat
Image formats that can be transferred.
void setWidth(int w)
Sets a new width for both images.
void setSequenceNumber(unsigned int num)
Sets the sequence number for this image pair.
void setTimestamp(int seconds, int microsec)
Sets the time at which this image pair has been captured.
const float * getQMatrix() const
Returns a pointer to the disparity-to-depth mapping matrix q.
int getWidth() const
Returns the width of each image.
int getSubpixelFactor() const
Gets the subpixel factor for this image pair.
bool isImageDisparityPair() const
Returns true if this is a left camera image and disparity map pair.
void getTimestamp(int &seconds, int µsec) const
Returns the time at which this image pair has been captured.
unsigned char * getPixelData(int imageNumber) const
Returns the pixel data for the given image.
void setHeight(int h)
Sets a new width for both images.
A set of two images, which are usually the left camera image and the disparity map.
int getBytesPerPixel(int imageNumber) const
Returns the number of bytes that are required to store one image pixel.