January 2016


My favourite

  • Opencv tutorial people detection
  • Head people cascade download
  • Opencv tutorial optical flow
  • Opencv Video stabilization
  • Opencv car dataset download
  • Opencv tutorial Transparent mask
  • Opencv videowriter
  • Opencv FFMPEG
  • Opencv Canny edge and hough lines
  • About Movidius

    Share this for more tutorials and computer vision post from me.. Thanks best Vladimir

    Movidius Computer Vision

    Movidius is interesting company which developed embedded machine vision technology for new segment of fast growing smartphones and IoT apps. Smart devices in internet of things needs smart processing units like this for 3D depth application, reconstruction, detection and Natural user interface. Near future brings challenging task like smart mirror and communication walls and many more "disturbing things". Movidius provides optimized library for algorithm in modern deep learning in combination with low-power visual processing units. 

    Target Computer vision app 

    • 3D modeling and reconstruction in smart devices of eye of thinks apps
    • In door navigation assistant
    • Visual analysis 
    • Augmented reality
    • Recognition and classification apps


    Movius Vision solutions

    Machine vision algorithms

    Deep learning algorithm is adapted to low power smart processor by low level matrix computation kernels, on chip memory flow management and native mixed precision floating point computation, which dramatically increase the unit performance.

    3D Depth, Depth sensor in common use started by Kinect and today it could be small as notebook integrated camera (Intel have one). Applications are in augmented reality, 3D reconstruction and also detection. 

    Tracking and Detection Object tracking and detection are great challenge in surveillance applications, indoor tracking and navigation and object detection. One of the interesting application is drones and autonomous robot navigation to catch target on cameras. 

    Dev support

    • Set of optimized computer vision and math libs
    • C, C++ and OpenCL
    • Eclipse graphical development
    • Posix RTOS

    Vision Processing Unit

    Processor is based on Streaming Hybrid Architecture Vector Engines (SHAVE). This processor achieve the hundreds of GFLOPS in matrix multiplication in deep learning networks of various topologies.

    There is some specifications of Myriad 2 SoC

    • Two trillion 16 bits operation with 500 mW of power usage
    • 12x 128-bit vector VLIW SHAVE type Processor for vision apps
    • 2x 32-bit RISC processor
    • 16 and 32 bit floating point operations
    • 8/16/32 bit integer operations
    • 2MB on chip memory


    Hough lines, Canny edges and Sobel derivatives

    HoughLines, Canny edges, for OpenCV line detection  edges detection in symple described C++ code, where all the steps are visualize and exmplayn. In this tutorial is used Visual studio 2015 instalation by nuget packages. Easy and fast without usual problems with version, dll, and environmental vatiables. Check this tutorial here

    HoughLines hough lines

    Sobel derivatives

    Sobel derivatives is convolution of image parts with kernel that represent sobel derivative approximation. The upper image is our sobel kernel. Simple 3 x 3 matrices with this parameters. This configurations can detect edges or changes which is vertically oriented. How? 
    Convolution of source image 3x3 part with this kernel generates a number.

    Kernel Convolution wiki

    Use this kernel with  3x3 image part 1. This image matrices has constant values 1. There is no edges in x direction. Number generates by convolution is 0. If you convolve kernel with image part 2. There is edges in x direction from 1 to 5. Convolution of the same kernel with this part generates number 16. See the example.

    Try to think how simple is this in all directions. 

    Sobel derivatives convolution

    Canny edges, sobel and hough lines code

    #include <Windows.h>
    #include "opencv2\highgui.hpp"
    #include "opencv2\imgproc.hpp"
    #include "opencv2/imgcodecs/imgcodecs.hpp"
    #include "opencv2/videoio/videoio.hpp"

    using namespace cv;
    using namespace std;

    int main(int argc, const char** argv)

    Mat image;

    // Load an image
    canny hough lines

    image = imread("1.jpg", 0);
    resize(image, image, Size(800, 600));

    cv::Mat edges;

    // Canny edge 
    cv::Canny(image, edges, 95, 100);

    imwrite("edges.jpg", edges);
    imshow("Canny edges", edges);
    Canny edges

    cv::Mat dx, dy;

    // sobel derivative approximation X direction of edges image
    cv::Sobel(edges, dx, CV_32F, 1, 0);

    // sobel derivative approximation Y direction of edges image
    cv::Sobel(edges, dy, CV_32F, 0, 1);

    imwrite("dx.jpg", dx);
    imshow("Sobel in x dirrection", dx);
    sobel derivatives

    imwrite("dy.jpg", dy);
    imshow("Sobel in y dirrection", dy);
    sobel derivatives

        vector<Vec4i> lines;
               // Find hough lines 
       HoughLinesP(edges, lines, 1, CV_PI / 180, 100, 100, 10);

               // Prepare blank mat with same sizes as image
       Mat Blank(image.rows, image.cols, CV_8UC3, Scalar(0, 0, 0));

           // Draw lines into image and Blank images
           for (size_t i = 0; i < lines.size(); i++)
          Vec4i l = lines[i];

          line(image, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0, 0, 0), 2, CV_AA);

          line(Blank, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(255, 255, 255), 2, CV_AA);


    imwrite("houg.jpg", image);
    imshow("Edges", image);

    Hough lines


    imwrite("houg2.jpg", Blank);
    imshow("Edges Structure", Blank);

    Hough lines


    NVIDIA DRIVE PX2, deep learning for automotive 

    NVIDIA Deep learning

    Capabilities NVIDIA DRIVE™ PX 2

    NVidia launched NVIDIA DRIVE™ PX 2 platform for in car AI deep learning. This processor is capable to  understand data from 4 x lidar detectors, 4 x fisheye cameras, 2 x narrow field cameras and GPS in real time. This NVIDIA's advanced GPUs are intended to handle 360 degree situations around the car from large amount of sensors data.
    As official sources remark, The Drive PX2 provides super power equivalent to 150 MacBook Pros, which is really something impressive.

    DRIVE™ PX 2 specifications

    Platform is based on two next-generation Tegra processors and two special discrete GPU Pascal architecture, which is optimized for deep learning math acceleration up to 24 trillion operation over neural net per second. This power is capable to handle data from all the sensors at the same time in real time critical applications. Those 24 teraflops power can handle surround 365 view, pedestrian detection, smart collision control, traffic monitoring and driver state monitoring at the same time.

    Brief about Pascal architecture

    smart car Deep learning This GPU unit is capable to operate with half precision floating point format at 16-bit floating point accuracy at twice the rate than in case of 32-bit floating point accuracy. This is beneficial for the two key neural network parts, classification and convolution.   

    3D memory is another key element of Pascal which provide 3x the bandwidth and the buffer capacity of previous Maxwell architecture. This feature is capable operate with deeper neural network. 

    The last big think is NVLink which is communication bus that transfer date between GPU and CPU 5x up to 12x faster than PCI-Express. 

    Read more Here Nvidia News

    Opencv 3.1 Visual studio 2015

    Share this for more tutorials and computer vision post from me.. Thanks best Vladimir

    Opencv 3.1 Visual Studio 2015

    Opencv 3.1 just released with prebuild VC14 libs for Visual Studio 2015. Installation is easy and you can follow standard tutorials on www.opencv.org

    Quick start with Visual Studio 2015 Opencv 3.1

    This process is exatly same as in other version with prebuild libs. 

    Install opencv 3.1 in visual studio

    Shortened procedure summary
    1. Download opencv 3.1 for windows
    2. extract to folder like c:/opencv
    3. Set enviroment varibales by setx -m
    This depends on your path
    setx -m OPENCV_DIR C:\opencv\build\x64\vc14
         4. In Path editor just set 

    This is important steps. If you include Opencv project without this Project in visual studio failed because the project can not find DLL library. 

     Set project in Visual Studio 2015

    Just create your new opencv project in Visual Studio 2015 and follow this steps. 

    1. Under Project setting C/C++/General set Additional Include Directories and Additional #using Directories. For example C:\opencv\build\include
    2. Under Linker/general set Additional library directories you can use your system path set in installation process or simple include this path for 64 bit versin for example C:\opencv\build\x64\vc14\lib
    3. Under Linker/Input set Additional Dependencies as opencv_world310.lib, opencv_world310d.lib

    Opencv 3.1 prebuild libs 

    This  opencv 3.1 comes with many version. This is a list of released parts here Github Source


    Prebuild framework for android development 


     for Windows development and Visual Studio 2015 support. 


    for iOS and Mac development prebuild framework

    Opencv source code

    Also there is a source code released of 3.1 opencv which is mainly for Linux and Arm development with many improvements in NEON arm platform. 

    Important from Opencv 3.1 change logs

    Taken from ChangeLog
    • The iOS framework (opencv2.framework) can now be configured to include both opencv and opencv_contrib functionality.
    • more efficient camera support on Android 5+
    • faster round() on ARM (it’s also applicable to iOS); big thanks to Manuele Tamburano and Stefano Fabri for this!
    • OpenCV 3.1 supports fresh OSes from Microsoft and Apple, as well as the newest development tools (VS2015 and Xcode 7, respectively).
    • IPPICV (a specially-for-opencv free-of-charge subset of IPP (https://software.intel.com/en-us/intel-ipp) that has been kindly provided by Intel Corporation) is now based on IPP 9.0.1, which should make OpenCV even faster on modern Intel chips.
    • There are multiple new features in the OpenCL layer, resulted from our collaboration with Intel Corporation
    • Improved/extended interoperability with DirectX 9, 10, 11

    Selected contributed functionality of Opencv 3.1

    • 3x faster SimpleFlow – optflow 
    • Improved performance of haartraining 
    • Unscented Kalman Filter 
    • Efficient Graph-based image segmentation algorithm

    Selected Improvements in Opencv 3.1 contrib modules

    • Improved Deformable Part-based Models – opencv_contrib/dpm
    • Real-time Multi-object Tracking using Kernelized Correlation Filter – opencv_contrib/tracking
    • Implementation of universal interface for deep neural network frameworks – opencv_contrib/dnn
    • Improved ICF detector, waldboost implementation – opencv_contrib/xobjdetect
    • Multi-target TLD tracking – opencv_contrib/tracking