Search code examples
c++qtopencvftdid2xx

Capturing camera(USB) via D2XX library or OPENCV


I want to write an application(in c++) in order to capture images from a camera which is using in a acquisition system. The camera is connected to a box (acquisition system) and I've found that the chip that is used is FTDI. The chip is located in the box between camera and PC. The camera is connected to this box. A USB cable is connected to a PC and the box. Some other tools are connected to the box which are not important.

Moreover, there is a simple commercial application which is written by MFC and I want to do exactly the same. In the folder of the application there are D2XX driver files(ftd2xx.h, etc) and an information file(*.inf) of the camera.

Also, the camera is not recording video but taking photo in short intervals(<0.1s) and the interval is determined by the acquisition system not the commercial application(the acquisition system detect when camera has to take photo)

Here is my question:

Since the information file of the USB device is provided, could I just utilize the Open-CV lib to capture the camera OR do I have to only use D2XX library?

If I have to use D2XX library in order to read the data, how could I convert the raw data to Image format (in Qt)?

I can't simply write application and test on the device over and over to find the solution since the device is located far from my location and for every test I have to travel this distance. So, I want to make sure that my application will work.

A company from China made the device for us and they won't support it any more :(


Solution

  • The camera uses a custom communications protocol, it doesn't implement an imaging device class. OpenCV won't see it, neither will any other multimedia library. No matter what, you need to implement that protocol. You can then expose it to OpenCV if you wish.