minimal C example of MatrixVision camera library on Linux
Peter Apian-Bennewitz
back to my list of hardware bits , home page , June 2015
Hardware
- MatrixVision mvBlueFOX grey-scale USB camera
- Raspberry-B running Raspbian 8.0, "jessie" Debian
Software
- mvIMPACT_Acquire-ARMhf-2.13.x library by MatrixVision
Description
MatrixVision manufactures a broad range of cameras aimed for the scientific market,
which made them interesting for a specific project.
Their SDK include support for Linux and consists of a proprietary binary-only library, plus examples, mostly in C++ .
This page summarises some experience and my own example in plain ASCII C. I would have loved an example like this when starting the project, it
would have save me a couple of days figuring things out.
MatrixVision pros:
- MV offers wide selection of camera hardware, both 'boxed' and PCB
- Linux supported, including cross-compile for ARM
- documentation available
- well designed library with abstract data types, multi-camera support and multi-platform support
- the structure of demo source is an excellent role model for makefile/gcc usage on a multi-architecture base.
If you want to see an effective usage of doxygen, in-code-documentation and auto-generated doc pages, this is it.
- friendly and effective support by email
MatrixVision cons:
- HW not supported by standard Linux USB camera kernel driver (kernel 3.x, and probably 4.x)
- binary library causes potential conflicts with systems libs. Furthermore, future support of upcoming hardware and opsys
(operation system, e.g. Debian) releases may be supported or may not be supported by the then current MatrixVision library.
Binary-only libraries for low level hardware components are therefor a bad thing.
- demo source is a bad example to make starting in plain ASCII C quite difficult.
If you plan to start quickly, especially on an Arm platform (compiler directives for ARM are numerous in their
Makefiles, and you'll likely get an "no C compiler found" error), and hope to get libraries, opsys requirements and your test
code sorted out quickly, - allocate a few more days.
- documentation is extensive, but as web pages only, no PDF-per-product documentation (e.g. on hardware)
It takes a comparatively long time to sort things out, and you probably need to copy a large sub-tree of their support pages
to local disk in order to work offline (e.g. to avoid missing references during a network outage, wget is your friend).
My minimalist gets-you-started C example
My own minimal example of ANSI C usage of their lib, with setting of gain and exposure:
README,
makefile,
matrixvision_minimal.c.
See README for details.
No warranty for any part of the code. "Your mileage may vary", I'm not endorsing any specific product.
Peter Apian-Bennewitz, info[AT]pab-opto.de,
text and images are under the GNU_Free_Documentation_License,
reference to this text appreciated.