For adding colour camera support for ViewportSaver, learnt from the example code here that I had to add the crucial function which does de-bayering for QHY cameras.
SetQHYCCDDebayerOnOff(camhandle,true);
Without that, the output image was distorted, interleaved, greyscale. Further, we have to remember that OpenCV uses BGR as the colour order. So does QHY, so no issues with that. Because of this,
split(mraw, BGR);
//by default opencv puts channels in BGR order
BGR[1] = Mat::zeros(mraw.rows, mraw.cols, CV_8UC1); // green channel is set to 0
BGR[0] = Mat::zeros(mraw.rows, mraw.cols, CV_8UC1); // blue channel is set to 0
// and so on.
SetQHYCCDDebayerOnOff(camhandle,true);
Without that, the output image was distorted, interleaved, greyscale. Further, we have to remember that OpenCV uses BGR as the colour order. So does QHY, so no issues with that. Because of this,
split(mraw, BGR);
//by default opencv puts channels in BGR order
BGR[1] = Mat::zeros(mraw.rows, mraw.cols, CV_8UC1); // green channel is set to 0
BGR[0] = Mat::zeros(mraw.rows, mraw.cols, CV_8UC1); // blue channel is set to 0
// and so on.
No comments:
Post a Comment