Using the code below, I am getting images from a Leopard Imaging USB 3.0 camera. When I first tested the camera, the images were green. I looked on several forums and found that I needed to convert from Bayer images to BGR images. Now, I get what is in the attached image. Does anyone know what I can do to fix this?
cv::VideoCapture (cam1);
cam1.grab();
cam1.read(data);
....
cv::Mat changed;
cv::Mat bayer16(data.rows, data.cols, CV_16UC1,data.data,data.step);
cv::Mat bayer8 = bayer16.clone();
bayer8.convertTo(bayer8, CV_8UC1, 0.0625);
cv::cvtColor(bayer8, changed, CV_BayerGB2BGR);
imshow("", changed);