Ask Your Question

Revision history [back]

Sorry, I cannot post the complete working code (I wrote it in office and I'm not allowed to post it here and at home, I only have a simple webcam), but here's how I done it:

I made a DLL with the most important functions (so I can switch the SDK if I have to).

Opening the camera is pretty easy (one call with Vimba SDK, openCamera or s.th. like that).

When you aquire the image (acquireImage), you get a pointer to the frame. I used 8bit gray and BayerRG, both are well formatted for use with OpenCV.

Make an IplImage with the appropriate resolution and set the data with imagedata to the memory region the frame pointer points. setData did not work for me! Don't listen to the docs!

Generate your Mat out of the IplImage. If you like RGB use cvtColor() to convert it.

Remember to .clone() your Mat if your frame can come out of scope, elsewise your program will crash.

Hope, it'll help someone!