15 #ifndef VISIONTRANSFER_IMAGEPAIR_OPENCV_H 16 #define VISIONTRANSFER_IMAGEPAIR_OPENCV_H 18 #ifdef CV_MAJOR_VERSION 28 assert(imageNumber >= 0 && imageNumber <=1);
30 switch(formats[imageNumber]) {
32 dest= cv::Mat_<unsigned short>(height, width,
33 reinterpret_cast<unsigned short*
>(data[imageNumber]), rowStride[imageNumber]);
36 dest = cv::Mat_<unsigned char>(height, width,
37 data[imageNumber], rowStride[imageNumber]);
40 dest = cv::Mat_<cv::Vec3b>(height, width,
41 reinterpret_cast<cv::Vec3b*
>(data[imageNumber]), rowStride[imageNumber]);
43 cv::cvtColor(dest, dest, cv::COLOR_RGB2BGR);
void toOpenCVImage(int imageNumber, cv::Mat &dest, bool convertRgbToBgr=true)
Converts one image of the pair to an OpenCV image.