Authors: Anatoly Baksheev, Kirill Kornyakov ( kirillkornyakov ), Andrei Morozov ( aod314 ), Vadim Pisarevsky, Oleg Sklyarov ( olegsklyarov ), Evgeny Talanin, Alexander Shishkov ( AlexanderShishkov ).

Hi, Habr!
')
We are pleased to announce that on November 2, a new version of OpenCV, a free library of computer vision, was released. This post is written by library developers working for
Itseez . We will list the main innovations since the release of the previous version, it is worth noting that there are a lot of them: new algorithms, acceleration of existing ones, support for new platforms, updating the development process, integration and testing, as well as updated documentation. During the preparation of the release, more than 210 tasks on the tracker (
hackathon ,
release candidate ,
release ) were closed: patches, bug fixes, expansion of the existing functionality.
But first things first.
Web resources
OpenCV has finally got its home on the Internet at
opencv.org . On this site you can find out the latest events in the life of the library and find links to all other web resources related to it. To automatically subscribe to the news, you can use our public
RSS feed or
twitter .
More specialized information for library developers is concentrated on the
code.opencv.org website, created on the basis of
ChiliProject . Here you can find all the information about the schedule of the next library releases or about the decisions taken by the developers during the weekly rallies. Information is created and edited in wiki mode, so most often is the most relevant. Also here lives the main git repository of OpenCV (but we recommend using a mirror on the githabe, see below) and a bug tracker. Therefore, if you have problems using the library, feel free to let us know through this resource.
Also, quite recently we opened another site aimed at supporting users. This is a
forum created in the style of StackOverflow and dedicated to solving problems when working with OpenCV and computer vision in general. Despite its short history, over a thousand questions have already been discussed on the resource.
Do not forget about the site with the
online documentation of the library, which contains all the necessary information for the latest released versions.
Integrated multithreading support
Now it became more convenient to write parallel code thanks to the new universal primitive
parallel_for_ , which is able to use various backends:
Thus, it is possible to enjoy improved performance even if you do not have TBB, but another framework of the above is supported. So for example on
Windows and Mac OSX, you do not need to install something extra, because they use the standard technologies that come with the development environment. A number of OpenCV algorithms using TBB were brought to a new
parallel_for_ or parallelized for the first time.
Opencl
The library added an experimental module
ocl , which implements computer vision algorithms using
OpenCL technology. At the moment, the following algorithms are available, running so far only on the GPU:
- arithmetic operations;
- various filters (Sobel, Scharr, GaussianBlur, boxFilter, bilateralFilter);
- various types of geometric transformations (resize, remap, etc.);
- cash classifier (for the detection of persons in the first place);
- optical flow algorithm (Pyramidal Lucas-Kanade method).
Documentation is already available for the module, we suggest contacting it for details.
CUDA / GPU
This time many useful algorithms have been added to the GPU module:
- Image noise reduction:
- Bilateral Filter;
- Non Local Means Brute Force - implementation is not fast, but follows the original article completely;
- Fast Non Local Means - in this implementation, Gauss weighting was omitted, which allowed using the approach with running sums and speeding up the algorithm tenfold.
- Background selection algorithms: ViBe , GMG, FGD, MOG (Mixture of Gaussians).
- Support for cascades with LBP features (Local Binary Patterns), which have been present on the CPU for a long time, has been added to the cascade classifier;
- Hough Lines, Hough Circles and Generalized Hough Transform;
- Connected Components Labeling / Generalized Floating Range FloodFill.
Also in this release, we made public the so-called “device layer”, a set of header files containing template functions and classes written in CUDA and intended for the nvcc compiler. This will be useful for developers who write on CUDA themselves. Now, combining the device layer functionality with its code, it is easier for the user to implement new image processing algorithms on CUDA.
Android
The NVIDIA-supported OpenCV for Android team has significantly updated the library, making it more convenient and providing more complete documentation. In addition, the Tegra 3 platform now uses a number of optimizations that can significantly improve the performance of final applications.
- A number of materials has been published regarding OpenCV for Android. Among them:
- The new version of OpenCV Manager requires far fewer clicks from the end user, and besides, there is no need to restart OpenCV-dependent applications. Now OpenCV Manager comes with dynamic libraries, so we got rid of installing additional binary packages with Google Play. For compatibility reasons, old packages will remain on Google Play until version 2.5 is released, but Android developers are encouraged to switch to OpenCV 2.4.3;
- The latest version of Android, Jelly Bean, is now included in the list of supported. OpenCV camera operating on the native OS level began to support more devices;
- A new framework for Java applications. We recommend to get acquainted with the new architecture and updated examples of applications. The new framework provides a single base for Computer Vision applications, including: Java and native camera, code for visualizing images on the device screen, simple initialization of OpenCV Manager, correct event handling: pause, continue, rotate, etc;
- Much work has been done on optimizing performance for the NVIDIA Tegra 3 platform. You can see this for yourself by downloading the OpenCV Tegra Demo application from Google Play. A full list of optimizations is available in the document at the link , Chapter 17. OpenCV for Tegra was included in the NVIDIA Tegra Android Development Pack , so if you are just starting to develop for Android, we recommend that you use it, since it will release all the necessary packages from a lengthy installation.
iOS
OpenCV for iOS has received a number of long-awaited innovations:
- Thanks to the work of Eduard Feicho in the framework of Google Summer of Code 2012 , the code for working with a video camera has changed significantly. It is now part of the highgui module and is available as a class CvVideoCamera;
- Have undergone changes and scripts to create the OpenCV framework for iOS, so now OpenCV supports iOS 6.0 and the new architecture of armv7s (iPhone 5);
- When building OpenCV for iOS, the “O3” optimization key is “forgotten” in 2.4.2, so your applications will run even faster;
- Thanks to the new multi-threading mechanism supporting GCD , several important algorithms work faster on dual-core chips ( A5 , A5X , ...);
- In addition, we added educational materials on the basics of using OpenCV for Apple's mobile devices and conducted a detailed training on all the innovations for iOS within ECCV2012 .
Python
As part of
Google Summer of Code 2012, Alexander Mordvintsev from St. Petersburg added some great examples of advanced use of Python with OpenCV:
Buildbot
Buildbot is used as a continuous integration system in OpenCV. More than fifty different configurations are collected daily: for 32-bit and 64-bit platforms under Windows, Linux, Mac OS, Android, iOS, using TBB, SSE and GPU optimizations. Each configuration runs about five thousand different tests. Fifteen most popular configurations are assembled twice a day. A tarball, an installer for Windows and a framework for iOS are automatically built, the code coverage is calculated and binary compatibility is checked. As you can see, we have done a lot of work to ensure the high stability of the library :)
Any change that enters the repository will trigger the launch of several quick builds. In the case of a successful outcome, a fairly reliable assumption is made that in other configurations the code will be compiled and pass most of the tests.
After the release of OpenCV 2.4.2, as promised, we changed the version control system. Now our repository lives under the control of git. The logical consequence of this step was the creation of a
mirror on github , which made it possible to attract even more third-party developers to the development of the library. Github provides a convenient
pull request mechanism, so that any user of the service can co-author OpenCV. Each pull request passes through an automatic build and, if successful, gets to the developer from the OpenCV team for review. He checks the code, asks the necessary questions to the author and decides whether to make or reject the proposed changes.
Note that a few weeks before the release of the described release, all staff developers also made their changes through a pull request in order to assess the advantages and disadvantages of such practices from the point of view of third-party developers. In one of the posts we plan to tell in detail about the continuous integration in the project OpenCV. You can ask your questions on this topic in the comments, and we will try to answer them in as much detail as possible.
Plans
The next release number 2.5 is expected in spring 2013. Compared to 2.4.3, there will be significant changes in it, and binary compatibility will be broken in order to upgrade the architecture and library API.
Among the planned works we will highlight the following:
- splitting functionality into “micromodules”, support for custom micromodules;
- deletion of outdated code (transfer to separate unsupported modules);
- continuation of works on parallelization and optimization;
- New algorithms for working with Kinect, 3D recovery, computational photography, tracking, etc .;
- improved documentation and navigation on OpenCV usage examples.
Conclusion
In the end, we would like to thank the entire developer community that contributed to the release, especially the Google Summer of Code 2012 participants. Together, we tried to make the library really convenient and useful. Join the development process, now it has become more convenient than ever before!
useful links