PDA

View Full Version : Using Imaging Source Cameras in OpenCV 2.0 (C/C++)



kankatee
August 3, 2010, 23:47:36
The issue I am having only manifests itself in OpenCV. The camera (DFK21AUC03) functions fine in IC Capture. In OpenCV (1.1, 2.0, and 2.1) the camera by default renders only black and white images (Y800). I am wondering, how can I resolve this in OpenCV?

kankatee
August 4, 2010, 00:28:55
The DFK produces both Y800 and RGB images. By default I was acquiring the Y800. To convert this to RGB in OpenCV I did the below:

imgFrame=cvQueryFrame(capture);
cvSetImageCOI(imgFrame,1);

bayer = cvCreateImage( cvGetSize(imgFrame), IPL_DEPTH_8U, 1);
cvCopy(imgFrame,bayer,NULL);

img=cvCreateImage(cvGetSize(imgFrame), IPL_DEPTH_8U, 3);
cvCvtColor(bayer,img,CV_BayerGB2RGB);

Stefan Geissler
August 16, 2010, 17:30:30
Hello

I do not know how to set the video format using OpenCV, thus I am very sorry, but I can not help you.

However, the solution you found is nice, but I wonder whether you can set white balance.

doliharahap
October 11, 2010, 10:29:25
The DFK produces both Y800 and RGB images. By default I was acquiring the Y800. To convert this to RGB in OpenCV I did the below:

imgFrame=cvQueryFrame(capture);
cvSetImageCOI(imgFrame,1);

bayer = cvCreateImage( cvGetSize(imgFrame), IPL_DEPTH_8U, 1);
cvCopy(imgFrame,bayer,NULL);

img=cvCreateImage(cvGetSize(imgFrame), IPL_DEPTH_8U, 3);
cvCvtColor(bayer,img,CV_BayerGB2RGB);


After using this, can it be convert again to another color space?
YUV maybe?



Hello

I do not know how to set the video format using OpenCV, thus I am very sorry, but I can not help you.

However, the solution you found is nice, but I wonder whether you can set white balance.

Few weeks ago, i've read something in this forums about combining IC SDK + OpenCV. Someone posted it, i'm not sure if it is you or not. But for now it is gone..