[Imtoolkit-users] im_capture doubt
Brought to you by:
scuri
From: cykt <cy...@aj...> - 2010-07-28 21:23:17
|
Hi, Im trying to use im_capture library in order to capture one frame from USB 2.0 webcam (640x480 resolution). I have followed capture guide basic program exactly the same way is written in the document. I mean: void capturaCamera(unsigned char *pImage) { imVideoCapture* vc = imVideoCaptureCreate(); if (vc == NULL) printf ("\nCreation error"); if (!imVideoCaptureConnect(vc, 0)){ printf ("\nConnection Error"); } int width=0, height=0; imVideoCaptureGetImageSize(vc, &width, &height); printf ("\n width = %d, height = %d", width, height ); if (!imVideoCaptureOneFrame(vc, pImage, 1)) printf ("\nCapture Error"); imVideoCaptureDisconnect(vc); imVideoCaptureDestroy(vc); } It works until imVideoCaptureOneFrame() procedure. But here, it returns a NULL value. Im using Windows Vista Home, Eclipse CDT, MingW 3.4.5. The program is written in C language. I have already tested imVideoCaptureLive() and imVideoCaptureFrame() functions, but the results was the same. Also, I have tested imVideoCaptureReloadDevices(), aiming to clear device, but no result. I have tested webcam using the following applications: AMcap and ÑAUSA (which uses im library). And it works well. What is wrong ? Thanks in advance Luiz |