[Matlab/C++] VirCam Server To Matlab

This post will illustrate how to use a virtual camera server (in this case one over ethernet) with Matlab. This example makes use of the VirCam server and VirCam SDK for usage with FLIR infrared (thermal) camera’s. Only in this way is it possible to control and observe the camera live through Matlab. It makes use of shared memory.

Framework

What you do, is you take the SDK and compile it in VisualCPP. This will be your ‘server’. When you run this program, it will connect to the camera and, for example, obtain images. These will then be put into virtual memory, making use of the OpenCV framework for digital images.
Then, in Matlab, you will compile a ‘MEX’ file that then obtains these images from the shared memory that were created in your own ‘server’ that you just compiled and started. Then the MEX function returns this image to Matlab. Put this in a loop, and you can view your live feed from the camera through your interface with 0 lag and no speed limitations.

VirCam

“VCamServer is a COM interface Server allowing third part software to manage a Cedip camera through the
distributed object. VCamServer is a synchronised and multi-threaded process so several client can connect to the
camera in parallel.”

Dependencies

This is made for the Windows OS, because that’s what the VirCam SDK works with.
You need the VirCam SDK (this can be bought with FLIR).
You need to install OpenCV (Free, google it.)
You need VisualC++ (Express for example) (Free, google it)

The Code

Below is all the code. You will probably figure it out, given you have some programming knowledge. If not, don’t bother or contact me.