Software Implementation - NickRowell/asteria GitHub Wiki
This page contains notes related to the software implementation of MeteorCapture, and some of the main technologies used.
Programming language
I chose C++ as the main programming language for MeteorCapture. This was a trade off based on the following features:
Advantages:
- Native support for camera integration using Video4Linux
- Enables fast and efficient code, which is necessary for real-time processing
- Recent C++ versions (e.g. C++11) provide multithreading capabilities
- Good GUI integration using Qt
Disadvantages:
- Not platform independent; binds MeteorCapture to Linux
- Challenging development
Video4Linux
Video4Linux is part of the Linux kernel and doesn't need to be separately installed. The current version number is 2 (V4L2).
V4L2 elements can be included in source code by including the V4L2 header file:
#include <linux/videodev2.h>
The package v4l-utils provides some additional command line tools that can be useful. This is installed using
sudo apt-get install v4l-utils
For example, the program v4l2-ctl can be used to retrieve information on the image and pixel formats supported by connected camera devices:
$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
...
OpenCV
The OpenCV (Computer Vision) library provides implementations of many image processing algorithms. It also provides some good infrastructure for handling images in different formats. OpenCV can be installed from the Ubuntu or Debian repositories using
sudo apt-get install libopencv-dev python-opencv
OpenCV elements can be included in source code using include statements like
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/imgproc/imgproc.hpp>
Boost
The Boost C++ libraries provide support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains over eighty individual libraries. It can be installed using:
sudo apt-get install libboost-all-dev
GUI building
Qt is probably the best GUI toolkit.
Code commenting and documentation using Doxygen
The Doxygen program provides automated documentation for C++ projects, much in the same way that Javadoc does for Java.