15 #ifndef VISIONTRANSFER_IMAGEPAIR_H 16 #define VISIONTRANSFER_IMAGEPAIR_H 20 #include "visiontransfer/common.h" 47 ImagePair(): width(0), height(0), qMatrix(NULL), timeSec(0), timeMicrosec(0),
48 seqNum(0), minDisparity(0), maxDisparity(0), disparityPair(false) {
49 formats[0] = FORMAT_8_BIT;
50 formats[1] = FORMAT_8_BIT;
75 assert(imageNumber >= 0 && imageNumber <=1);
76 rowStride[imageNumber] = stride;
87 assert(imageNumber >= 0 && imageNumber <=1);
88 formats[imageNumber] = format;
99 assert(imageNumber >= 0 && imageNumber <=1);
100 data[imageNumber] = pixelData;
129 timeMicrosec = microsec;
140 minDisparity = minimum;
141 maxDisparity = maximum;
149 disparityPair = dispPair;
169 assert(imageNumber >= 0 && imageNumber <=1);
170 return rowStride[imageNumber];
180 assert(imageNumber >= 0 && imageNumber <=1);
181 return formats[imageNumber];
191 assert(imageNumber >= 0 && imageNumber <=1);
192 return data[imageNumber];
216 microsec = timeMicrosec;
228 minimum = minDisparity;
229 maximum = maxDisparity;
238 void writePgmFile(
int imageNumber,
const char* fileName);
245 return disparityPair;
255 unsigned char* data[2];
256 const float* qMatrix;
bool isImageDisparityPair() const
Returns true if this is a left camera image and disparity map pair.
void setTimestamp(int seconds, int microsec)
Sets the time at which this image pair has been captured.
void setHeight(int h)
Sets a new width for both images.
void setSequenceNumber(unsigned int num)
Sets the sequence number for this image pair.
void setPixelFormat(int imageNumber, ImageFormat format)
Sets the pixel format for the given image.
unsigned char * getPixelData(int imageNumber) const
Returns the pixel data for the given image.
const float * getQMatrix() const
Returns a pointer to the disparity-to-depth mapping matrix q.
int getWidth() const
Returns the width of each image.
void setDisparityRange(int minimum, int maximum)
Sets the value range for the disparity map contained in this image pair.
void setWidth(int w)
Sets a new width for both images.
void setQMatrix(const float *q)
Sets the pointer to the disparity-to-depth mapping matrix q.
void setRowStride(int imageNumber, int stride)
Sets a new row stride for the pixel data of one image.
ImagePair()
Default constructor creating an image pair with no pixel data.
void getTimestamp(int &seconds, int µsec) const
Returns the time at which this image pair has been captured.
void setPixelData(int imageNumber, unsigned char *pixelData)
Sets the pixel data for the given image.
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...
A set of two images, which are usually the left camera image and the disparity map.
ImageFormat getPixelFormat(int imageNumber) const
Returns the pixel format for the given image.
int getHeight() const
Returns the height of each image.
unsigned int getSequenceNumber() const
Returns the sequence number for this image pair.
int getRowStride(int imageNumber) const
Returns the row stride for the pixel data of one image.
void setImageDisparityPair(bool dispPair)
Sets whether this is a left camera image and disparity map pair, or two raw camera images...
ImageFormat
Image formats that can be transferred.