GUI:fixed reversed source images/usb. CameraImages: added auto conversion of 4 channels images

This commit is contained in:
Mathieu Labbe
2015-03-02 14:59:24 -05:00
parent 1d33b43ee7
commit c93460aadb
2 changed files with 16 additions and 4 deletions

View File

@@ -296,6 +296,14 @@ cv::Mat CameraImages::captureImage()
img = cv::Mat(i, true);
cvReleaseImage(&i);
}
if(img.channels()>3)
{
UWARN("Conversion from 4 channels to 3 channels (file=%s)", fullPath.c_str());
cv::Mat out;
cv::cvtColor(img, out, CV_BGRA2BGR);
img = out;
}
}
}
}