The flyCapture SDK is a Point Gray SDK for CCD cameras. It officially supports windows and linux, and seems to support C / C ++ / C # as the language. This time, I didn't want to use C ++ because of my personal taste, so I aimed to build an environment in a language other than C ++. Writing first from the results, C # wrestled for about an hour and gave up. python was able to run on ubuntu by using an unofficial library. The following is a memorandum of environment construction.
This time, the camera is connected to the windows computer. As for ubuntu, I prepared it on VMWare because I couldn't use another PC because of the IEEE1394 card. ** However, VMWare cannot handle IEEE1394 connected cameras. ** So, I finally used the Flea3 camera (I should have used another ubuntu PC, but as a result, ubuntu on VMWare could also handle it).
The following is the method that failed. I would appreciate it if you could comment.
It should be officially supported by the SDK, so I thought it would be easy to handle, but it didn't work.
The installation itself drops .exe and installs it. The problem is that I didn't know which DLL to add to the reference to work.
When I added FlyCapture2Managed_v140.dll
, the sample code was built, but when I executed it, I got a ??? error like "The dependent dll cannot be loaded". I tried adding it to the PATH and adding it to the reference, but I gave up. Apparently, I can't find much documentation even if I check it with "FlyCapture C #". Can you write it in C ++ obediently? ??
** But C # should definitely work. Because it should be officially supported.
Please let me know ... **
python on Windows
In order, after succeeding in ubuntu, I tried to run it on windows. At that time, it was a fact that I was thinking "Well, can I move with ubuntu?" ()
First, the SDK does not officially support python. I decided to use the unofficial wrapper library published there. There are several libraries (described later), but the one that seemed to work on windows was pyFly2
. The reason is that there is a description for windows in setup.py
.
So I introduced it according to the README, but I got caught in the error `ʻerror: Unable to find vcvarsall.bat. This is an error that occurs in a library that needs to be compiled, regardless of flyCapture. So I put
VC ++ 9.0and tried various things, but I gave up on the error
ValueError: [u’path ’] ``. This problem will come up a lot if you look it up, so it seems that you can solve it if you do your best, but it is useless to spend time here because it is another step ahead whether the library works even if it can be compiled (tell yourself) I did).
This is the method I adopted. We have introduced a wrapper library for python on ubuntu. I've just run / read the sample, but it seems easy to handle.
As soon as you google with "python flyCapture" you will find the following two libraries.
I tried pyflycapture2 first, but where to transfer the camera settings in the sample code? I got an error. I wasn't sure, but pyfly2 worked well, so I decided to use it for the time being.
Basically, it is easy if you follow the Installation procedure. The points to note are as follows.
For specific details about using FlyCapture and Linux with a USB 3.0 camera, see TAN2012007 Using Linux with USB 3.0.
It is written to change the USB buffer size? From 2MB to 1000MB, but if you try to capture with a setting exceeding a certain resolution (transfer data size) without doing this, the program will terminate abnormally. I struggled without noticing this (although it was written at the very beginning of the page ...) Probably there is no problem with an IEEE1394 camera (but I have not tried it due to the above circumstances)
If you can capture properly with $ flycap
, it is successful. By the way, I was able to capture properly even with a USB device mounted (?) With VMWare.
Installation on ubuntu worked if I cloned it with git and followed the README.
By the way, it seems that the SDK path described in setup.py
does not need to be modified if it is inserted normally. Also, did the DLL copy make sense? It seems that it was working without doing it ...?
I read a little sample of pyfly2, but it feels like I want `ʻexample_opencv_integration.py`` in Don Pisha. If you can get it with numpy, you can do anything else. Another problem is how to change settings and synchronize. I'm curious about how much pyfly2 wraps the API (wraps all C APIs ??) ...
It was possible to set parameters such as gain, but there is a problem with setting the resolution (and probably the frame rate). It is specified by enum type, but the maximum resolution is _1600x1200Y16
. I am currently using a flea3 series camera with a maximum resolution of 2000x2000
or higher, so I cannot specify it. I wish there was a method that could be specified directly as a number ...
Probably the SDK version at the time of wrapper development is old and I feel that I can handle it if I change it a little, but I have the energy to do my best ... Well, I think that there are not many situations where it is necessary to dynamically change the resolution. I wonder if I should change it from the official sample application.
Recommended Posts