OpenCV 2.4.3

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

    imageimage

    Hello, Habr!

    We are pleased to announce that on November 2, a new version of OpenCV, a free computer vision library, was released. This post was written by library developers working at Itseez.. We will list the main innovations since 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, integration and testing process, 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, extension of existing functionality.

    But first things first.


    Web Resources


    OpenCV has finally got its own 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 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 releases of the library or about the decisions made by the developers during the weekly meetings. Information is created and edited in wiki mode, so it is most often the most relevant. Also, the main git OpenCV repository lives here (but we recommend using a mirror on the github, more on that below) and a bug tracker. Therefore, if you have problems using the library, do not hesitate to inform us through this resource.

    Also, more recently, we opened another site aimed at user support. This is a StackOverflow-style forum dedicated to solving problems with OpenCV and computer vision in general. Despite its short history, more than a thousand issues have already been discussed on the resource.

    Do not forget about the site with online library documentation , which contains all the necessary information for the latest released versions.

    Integrated multithreading support


    Now it’s more convenient to write parallel code thanks to the new universal parallel_for_ primitive , which can use various backends:

    Thus, it became 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 don’t need to install something additionally, because it uses standard technologies that come with the development environment. A number of OpenCV algorithms that used TBB were cast to the new parallel_for_ or parallelized for the first time.

    Opencl


    An experimental ocl module has been added to the library , which implements computer vision algorithms using OpenCL technology . Currently, the following algorithms are available, run so far only on the GPU:
    • arithmetic operations;
    • various filters (Sobel, Scharr, GaussianBlur, boxFilter, bilateralFilter);
    • various types of geometric transformations (resize, remap, etc.);
    • cascading classifier (for detecting faces 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 - the implementation is not fast, but fully follows the original article;
      • Fast Non Local Means - in this implementation, Gauss weighting was omitted, which allowed us to use the running sum approach and speed up the algorithm by tens of times.
    • Background selection algorithms: ViBe , GMG, FGD, MOG (Mixture of Gaussians).
    • Support for cascades with LBP features (Local Binary Patterns), which have long been present on the CPU, 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 in CUDA themselves. Now, combining the functionality of the device layer with its code, it is easier for the user to implement new image processing algorithms on CUDA.

    Android


    The OpenCV for Android team, supported by NVIDIA, 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 to significantly improve the performance of end applications.
    • A number of articles have been published regarding OpenCV for Android. Among them:
    • In the new version, OpenCV Manager requires much less clicks from the end user, in addition, restarting OpenCV-dependent applications is not required. Now OpenCV Manager comes with dynamic libraries, so we got rid of installing additional binary packages from Google Play. For compatibility reasons, older packages will remain on Google Play until version 2.5, however, Android developers are advised to switch to OpenCV 2.4.3;
    • The latest version of Android, Jelly Bean, is now on the list of supported ones. OpenCV camera, operating at the native OS level, began to support a larger number of devices;
    • New framework for Java applications. We recommend that you familiarize yourself with the new architecture and updated application examples. The new framework provides a single base for Computer Vision applications, including: Java and native camera, code for visualizing images on the device’s screen, simple initialization of OpenCV Manager, proper event handling: pause, continue, rotate, etc;
    • A lot of work has been done to optimize performance for the NVIDIA Tegra 3 platform. You can verify this yourself by downloading the OpenCV Tegra Demo application from Google Play. The full list of optimizations is available in the document at the link , Chapter 17. OpenCV for Tegra is included in the NVIDIA Tegra Android Development Pack , so if you are just starting development for Android, we recommend that you use it, since this will free you from the long installation of all necessary packages.


    iOS


    OpenCV for iOS 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 the camcorder has significantly changed. Now it is part of the highgui module and is available as the CvVideoCamera class;
    • There have been changes and scripts to create the OpenCV framework for iOS, so now OpenCV supports iOS 6.0 and the new architecture armv7s (iPhone 5);
    • When building OpenCV for iOS, the “forgotten” optimization key “O3” is included in 2.4.2, so your applications will run even faster;
    • Thanks to the new multithreading mechanism that supports GCD , several important algorithms work faster on dual-core chips ( A5 , A5X , ...);
    • In addition, we added training materials on the basics of using OpenCV for Apple mobile devices and conducted detailed training on all the innovations for iOS in the framework of ECCV2012 .


    Python


    As part of the Google Summer of Code 2012, Alexander Mordvintsev from St. Petersburg added some great examples of advanced Python use with OpenCV:


    Buildbot


    OpenCV uses Buildbot as a continuous integration system . More than fifty different configurations are assembled daily: for 32- and 64-bit platforms for Windows, Linux, Mac OS, Android, iOS, using TBB, SSE and GPU optimizations. About five thousand different tests are launched on each configuration. Fifteen of the most popular configurations are collected twice a day. Tarball, the installer for Windows and the framework for iOS are automatically collected, code coverage is calculated and binary compatibility is checked. As you can see, we have done a great job to ensure the high stability of the library :)

    Any change that falls into the repository causes several quick builds to run. In the event of a successful outcome, a fairly reliable assumption is made that the code will compile and pass the majority of tests on other configurations.

    After the release of OpenCV 2.4.2, as promised, we changed the version control system. Now our repository is running git. The logical consequence of this step was the creation of a mirror on github , which allowed to attract even more third-party developers to the development of the library. Github provides a convenient pull request mechanismso that any user of the service can become a co-author of OpenCV. Each pull request goes through automatic assembly and, if successful, gets to the developer from the OpenCV team for review. He checks the code, asks the author the necessary questions and decides whether to make or reject the proposed changes.

    Note that a few weeks before the release of this release, all full-time developers also made their changes through pull request in order to assess the advantages and disadvantages of such practice from the point of view of third-party developers. In one of the posts we plan to talk in detail about the continuous integration in the OpenCV project. You can ask your questions on this topic in the comments, and we will try to answer them as detailed as possible.

    Plans


    The next release under number 2.5 is expected in the spring of 2013. Compared to 2.4.3, significant changes will occur in it, and binary compatibility will be compromised in order to modernize the architecture and API of the library.
    Among the planned work, we highlight the following:
    • dividing functionality into “micromodules”, support for custom micromodules;
    • removal of obsolete code (transfer to separate unsupported modules);
    • continuation of work on parallelization and optimization;
    • new algorithms for working with Kinect, 3D recovery, computational photography, tracking, etc .;
    • Improved documentation and navigation for OpenCV use cases.


    Conclusion


    In the end, we would like to thank the entire community of developers who contributed to the release, especially the participants of Google Summer of Code 2012. 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



    Also popular now: