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) {
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;
161 assert(imageNumber >= 0 && imageNumber <=1);
162 return rowStride[imageNumber];
172 assert(imageNumber >= 0 && imageNumber <=1);
173 return formats[imageNumber];
183 assert(imageNumber >= 0 && imageNumber <=1);
184 return data[imageNumber];
208 microsec = timeMicrosec;
220 minimum = minDisparity;
221 maximum = maxDisparity;
230 void writePgmFile(
int imageNumber,
const char* fileName);
239 unsigned char* data[2];
240 const float* qMatrix;
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.
ImageFormat
Image formats that can be transferred.