voidexp/cap2re
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
==== 1. DESCRIPTION ====
Cap2re is a library for working with digital cameras on Linux/UNIX systems. It
can be used to get images from camera, query and set camera options in a
unified, backend and camera model independent manner.
It is written to be easy to use and extend, with a polite design and clean, easy
to understand API.
The library is written in C++, but a Python wrapper is provided as well.
Cap2re is licensed under the terms of GNU LGPL v3, which allows you to copy,
modify and redistribute it under few restrictions:
- If you do some modifications, you must make them available under same
terms when you distribute a software which makes use of the modified
version of cap2re.
- If you plan to use Cap2re in a commercial closed-source project, you can
do it, as long as you link dynamically and explicitly declare somewhere
that your software uses LGPL-ed libraries.
==== 2. REQUIREMENTS ====
Cap2re makes use of several libraries, in order to build it you must have the
folowing libs and tools installed:
- C++ compiler and standard libraries
- Boost.Thread for simultaneous acquisition from multiple cameras
- Python headers if you want the wrapper
The actual functionality and camera support is provided by backends, currently
these backends are available:
- Gphoto2 backend. Supports a wide range of cameras, both serial and USB,
proprietary and PTP-compatible.
Requires:
- libgphoto2
- Boost.Regex
- Basler backend. Provides support for Basler GiGE Vision cameras, which are
industrial quality high speed and resolution devices, connected via Giga
Ethernet port.
Requires:
- Pylon SDK V2.0 or later
- libjpeg
==== 3. BUILDING ====
To compile the library, check if you've met all the requirements and then just
type from top directory:
$ ./waf configure
Now run:
$ ./waf build
On success, you'll have a 'build' directory which contains libcap2re.so and
libpycap2re.so.
To use Cap2re in your C++ project, grab the headers and libcap2re.so and place
them in your project.
To use Cap2re in your Python project, make a copy of libpycap2re.so, rename it
to cap2re.so and place it into your Python modules path. It's then sufficient
just to import the module.
For additional build options and actions, check out:
$ waf --help
==== 4. USAGE ====
Regardless of which language you use, the common way to use the library looks
like follows:
- Initialize the library by calling cap2re::initialize()
- Check which backends are available with cap2re::getAvailableBackends().
This function returns a list of backend names.
- Retrieve the instance of CameraManager for the backend you intend to use
with cap2re::getBackend()
- Detect cameras by calling CameraManager's detectCameras() method
- Capture images via CameraManager or directly from Camera objects
- Clean-up by calling cap2re::shutdown() when you've finished.