How to Acquire Images with GigE Cameras on Linux with Plain C

24,705

Solution 1

"GigE Vision" is actually a computer vision camera standard, and most cameras also implement the Genicam standard for adjusting parameters. At least that is the theory - I have a high-speed GigE camera that is not found by Pylon or AVT for some unknown reason (officially it's only supported by eBus from Pleora). You might be able to get the specifications for those standards, but I'm not sure if they are freely available.

Regarding a library, I just tried Aravis under Ubuntu12.04 and it worked for my camera (streaming 512x512 pixel at 190 frames/second). It's written in C as far as I can tell. As a hint, to compile the Viewer that is included you have to install all the gstreamer-dev packages, including libgstreamer-plugins-base0.10-dev.

Solution 2

Most implementations will use C++ and at best expose a c-api building on that because GenICam is a very complicated thing to implement - and the reference implementation works, is free and is used by nearly all SDK vendors. You can implement alot of the acquisition without that much in C but it is very difficult to cut GenICam out of the loop - this is because vendors have used GenICam XML documents as a sort of domain specific programming language/environment - the effort is comparable to implementing a web-browser from scratch.

Aravis does exist but depends on gstreamer and does seem to be mainly in C but it will only go so far on the complex XML support needed for many cameras. I'd never use gstreamer in a mission critical setting or where reliable operation is required in addition to where high performance or high efficiency is required. I believe the best option on the market is Pleora's SDK FYI - no relation. Having said that - I've written such a library (with C++ :-) which I cannot share to address problems I've mentioned.

Solution 3

The GigE standard isn't very open-source friendly - you have to pay annual license fees to the standards organization, which is why most of the software that uses GigE Vision costs a substantial amount of money. A group of companies came together to make the standard and they're not likely to publish it to the world anytime soon.

So here are some of your options (that I can think of)...

1) Reverse engineer the protocol yourself. It's pretty complicated so that would be a big project.

2) Maybe you'll get lucky and find a company that has a C-version of the SDK they can sell you?

3) Use C++ :-) (jk...)

4) Pay the standards organization to give you access or partner with a company that is on it.

5) Use open-source projects that are attempting to reverse-engineer the standard. (I don't know what the legality rules are on that). Examples: Aravis, and OpenGigEVision. These solutions will probably be incomplete for a while, but they should at least support the basics.

I think #5 is your best bet if you don't have a lot of time or money to spend.

Share:
24,705

Related videos on Youtube

Bitterblue
Author by

Bitterblue

Since Stackoverflow sucks, I'm gonna be egoistic and only look for answers. No more help from me. Thanks! Bye!

Updated on April 29, 2020

Comments

  • Bitterblue
    Bitterblue over 3 years

    Is there a library that I can use for acquiring images from a GigE camera with plain C on Linux ? To be more specific I have a Basler GigE camera and the pylon software installed. There is also sample code in C++. But I want and need to use C (in my job this is actually THE right thing to do to use C). It would be great if there was something useful as libdc1394 just for GigE.