Fun Computer Vision opencv tutorials and ..


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
  • Research results in vibration control, Time delay systems and control theory


    How force to follow through the Ph.D. thesis. This is my background.  Miles away from the images, video and machine learning. At the end, All is the same. Math, math is the connection and again Algebra, little bit optimization and math again.

    I was focus mainly to vibration control, modern control theory like H_inf optimization, MIMO systems and system with time delay. All started connected to project with Boeing ACFA 2020. Flexible crazy new construction that needs to upgrade the control law according to this new concept.
    Another crazy project was related to time delay, signal shapers, vibration control and resonators.
    Love it.

    Is this related to computer vision ?

    No, i felt with love with computer vision for many reason. You can see the result. You can achieve and build something by your own skills. You dont need to construct the machine to drive and test something and the computer vision is really cool combination of programming skills, algorithm optimizations, smart solutions, machine learning, math and much more..
    Maybe, I visit to many areas to be close to perfect state in if only one of them. This unique knowledge connections give me so much more that just stay on one topics for the whole life.

    Impacted journals

    [1] Vyhlidal, Tomas, Kucera, Vladimir, Hromcik, Martin, :Signal shaper with a distributed delay: Spectral analysis and design , In: AUTOMATICA , 2013 , pp.: 3484-3489 , ISSN.: 0005-1098 ,WOS:000326553300038 , Web of Science® Times Cited: 2
    [2] Vyhlidal, Tomas, Olgac, Nejat, Kucera, Vladimir, :Delayed resonator with acceleration feedback - Complete stability analysis by spectral methods and vibration absorber design , In: JOURNAL OF SOUND AND VIBRATION , 2014 , pp.: 6781-6795 , ISSN.: 0022-460X
    [3] Vyhlidal T., Hromcik M., Kucera V. Anderle M., On feedback architectures with zero vibration signal, Submited to IEEE TAC, accepted
    [4] Kucera V., Pilbaurer D. ,Vyhlidal T., Olgac N, “Extended Delayed Resonators Implementation aspects and experimental verification” IFAC Mechatronics
    [5] Kucera V., Vyhlidal T. “Stability analysis of double delayed resonator” Final revision

    Conference papers

    [6] Sipahi R.,Kucera V,Vyhlidal T.,Stability Analysis and Control Design of a Vibration Control System with Uncertain and Tunable Delays, Accepted 2015 IFAC Workshop on Time Delay Systems
    [7] Vyhlidal, Tomas; Hromcik, Martin; Kucera, Vladimir Inverse signal shapers in effective feedback architecture Conference: European Control Conference (ECC) Location: ETH Zurich, Zurich, SWITZERLAND Date: JUL 17-19, 2013
    [8] Double oscillatory mode compensation by inverse signal shaper with distributed delays By: Vyhlidal, Tomas; Hromcik, Martin; Kucera, Vladimir; et al. Book Group Author(s): IEEE Conference: 13th European Control Conference (ECC) Location: Univ Strasbourg, Strasbourg, FRANCE Date:JUN 24-27, 2014

    [9] Vyhlidal, Tomas, Kucera, Vladimir, Hromcik, Martin, :Spectral features of ZVD shapers       with lumped and distributed delays , In: 2013 9TH ASIAN CONTROL CONFERENCE      (ASCC) , 2013 , pp.: , ISBN.: 978-1-4673-5767-8 ,WOS:000333734900326
    [10] Haniš, T. - Kučera, V. - Hromčík, M.: Low Order H∞Optimal Control for ACFA Blended Wing Body. In: 4th European Conference for Aerospace Sciences. Paříž: Eucass, 2011, art. no. 604,
    [11] Kučera, V. - Hromčík, M. - Vyhlídal, T.: Delay-Based Shapers for Controlling Vibration in Future Aircraft. In: Proceedings of the 13th Mechatronics Conference. Linz: Universität Linz, 2012, p. 267-272. ISBN 978-3-99033-042-5
     [12] Kucera, Vladimir; Hromcik, Martin; Vyhlidal, Tomas, Experimental comparison of signal shapers with lumped and distributed delays International Conference on Process Control (PC)Location: SLOVAKIA Date: JUN 18-21, 2013
    [13] Hanis T.,Kucera V.,Hromcik M.” Low Order H_inf Optimal Control for ACFA Blended Wing Body”,4th European Conference for Aerospace Sciences, Saint Petersburg 2011
    [14]Kucera V., Hromcik M. “Delay-based input command shapers: frequency properties and finite-dimensional alternatives”,Proceedings of the 18th IFAC World Congress, Milan 2011
    [15]Kucera V., Hromcik M. “Delay-based input shapers in feedback interconnections”,Proceedings of the 18th IFAC World Congress, Milan 2011
    [16]Kucera V., Hromcik M. “Delay-based signal shapers and ACFA 2020 BWB aircraft FCS”, 4th European Conference for Aerospace Sciences, Saint Petersburg 2011
    [17]Kucera V., Hromcik M., “Feed-Forward Delay-based Input Shaper Confrontation With Active Feedback Control”,The 6th IEEE International Conference on Intelligent Data Acquisition and Advanced Computing Systems: Technology and Applications, Prague 2011
    [18]Kucera V., Hromcik M.,”Signal Shapers for BWB Aircraft Control”,Proceedings of the 18th International Conference on Process Control, Tatranská Lomnica, 2011
    [19], Vyhlidal T., Kucera V., Hromcik M.”Input Shapers with Uniformly Distributed delays”, Accepted to 10-th IFAC workshop on Time Delay Systems, Boston, 2012

    Binary Convolutional neural network by XNOR.AI

    Great idea to save memory and computation by different type number representation. Convolutional neural network are expensive for its memory needs, specific HW and computational power. This simple trick is able to bring this networks to less power devices.. 

    XNOR convolutional neural network

    Unique solution ?

    I am thinking about this. Let me know in comments how unique is this solution. In automotive industry on embedded HW solutions close to this one already exist.. In convolution layers is this unique, I guess. 
    In GPU there is different types of registers to be able calculate FLOAT16 faster than FLOAT32 bit representation. This basically brings something like represent Real 32 bits number as Binary number. This bring the 32x memory saving information. Say in other way, They are introduce approximation of    Y=WX     
     This could be input vector x multiply by w weight metrics for each 
    layer. W and X are real number. Float32 or Float 16. The approximation looks like
     alpha is scalar numbers, beta is matrix and W and X are just binary.Lower precision but maybe enough power for some applications. Instead of approximate already learned network BWN. They bring this into the learning of the network. Compute convolution layers during the forward pass is also much more effective, that less power CPU devices could handle the problem in real time. 

      Binary representation Binary field in C

    I am going more deeper into this technology.. Let me introduce some operation with binary arrays in C.. This is exciting area. Not so special. Maybe you are programming only in higher languages like Java, python and how to set only one particular bit in C should be interesting for you. It is for me.. There is no direct support for this.. 

    int A[2];  when your int is size of 32 bit, You have two integers array.. You can store 64 bits. If you represented image in only black and white is quite limited to represent good features. If you represented this for each color and convolution filters. The representation is not so boring..
    One convolution layer should be stored in memory size / 32.

    int A[2];
    Set first bit of A
    setBit(A, 1);

    Set fifth bit of A
    setBit(A, 5);

    This should work only for 32 bit int. In this world we have 16, 31 and maybe more int representations...

    void setBit(int *Field,int n) {
    Field[n / 32] |= 1 << (n % 32);

    void clearBit(int *Field, int n) {
    Field[n / 32] &= ~(1 << (n % 32));

    n/32 is index in array, n%32 is bit position in Filed[i]
    This 1 is like only move this 00001 to the right place by <<  bit shift. The magic is
    based on the conditions in this expression shift 1 Hexa, 00001 B to the right position.
    000000000 set 0001 to n = 3 ->000001000

    This is just example how to work with binary arrays in C. I have a plan to implement this in pure C and introduce more from this implementation.. 
    By this principle is possible to write print of the array and almost all you need. 


    Look at the founded company using this technology

    Check also github

    There is some integration into the TORCH, I think also Yolo, darknet but this need some extension for already existing layers.

    Intel invest in computer vision

    Intel more and more focus on computer vision technology, software and mainly related  hardware.  In past, Intel just bought itseez company which is mainly known for Opencv and other related computer vision activity. Now, intel acquire Mobileye, which is another step to go forward against competitors like Nvidia in future intelligent autonomous cars.
    Intel itseez

    History of Mobileye

    Since 1999 the Mobileye focus on vision-safety technology related to driving assistance like Advanced Driver Assistance System. ADAS. The approach is different and important for this acquisition.  When google try to build cheaper LIDAR sensor for autonomous vehicles, company like Mobileye believe that Mono vision camera is everything you need to understand the scene. Cheaper than Lidar and cheaper than stereo. Mono vision as a primary source of the information that can handle, traffic-sign, pedestrians, vehicles is key factor of success of this company.  This is little bit strange for me personally.  Stereo camera make sense like human eyes and some animals need to handle their mono vision eye placement by strange movement of the head. Simply, I think that two cameras, eyes are better than the only one. It is not a mystery, that number of eyes in nature is most probably 2. 

    This is citation from Mobileye web site

    "All depth-perception cues for farther distances – such as perspective, shading, texture, and motion cues, that the human visual system uses in order to understand the visual world – are interpreted by a single eye"

    Honestly, I do not know. Also 360-degree surround-view mono-vision sensing is not the same as stereo approach. It is more or less something like Samsung 360 cameras than stereo that can handle depth by triangulation. 

    Computer vision Hardware and Software

    Mobileye focus also on specific HW for computer vision called EyeQ chip more complex than for example  CEVA-XM4 processor. This processor category is System on Chip (SOC), specialized for car sensing.. There is 8xCPU, 18xComputer Vision Processors, Security module, Wide band Sensor interface, IO controller and iSRAM wih Boot ROM memory.. All is certified for automotive whit passive cooling.. 
    Check all the other specification on website..

    Good luck to Mobileye under intel. Great that deeplearning is not a place only for strong cuda machines.. Deep learning is for distributive learning between many agents. The training parts.. Classification could be handled by low power specific processors like EyeQ or CEVA. Where smarter architectures, vectors, specific float registers or XNOR convolutional neural nets with only binary representation could beat down brutal cuda power.

    BTW XNOR is great, technology.. Check article later this month.

    Opencv in Visual studio 2017

    This tutorial show you how to use and install OPENCV 3 + in Visual Studio 2017. It is more hack than proper install. Use Nuget packages in package console is simple installation of opencv without setting of environmental variables and additional troubles with installation. All Visual Studio Versions needs its own build of Opencv library also the Nuget packages. VS 2012 needs version of libs V110. If you match following pictures together you have my point.. VC12 libs is version for Visual studio 2013. VC14 is lib version for Visual Studio 2015. Finally Visual Studio 2017 needs platform tool set and lib version V141. In opencv prebuild libs we need to wait to VC141. Hopefully. I never get the point of this naming convention.. Visual studio year and V140 141 110 120 but.. Current release is more confusing than the others.

    opencv VS141

    Opencv library has prebuild versions in that location after install.

    opencv visual studio 2017

    If you want to VC141 libs you need to build by CMAKE and Visual studio 2017 like in my older tutorial.. Same approach but switch visual studio version..
    Build opencv for new version of Visual Studio in cmake

    Opencv visual studio 2017 and older toolset

    Best approach is set the tool set in Visual studio project to V140 and use prebuild version of opencv libs for VS 2015 or use Nuget packages in simple 2 minutes installation also for version 2015 and enjoy coding in Visual studio 2017 until somebody solve and build the libs in VS 2017. 

    Follow and enjoy coding. Build own opencv is necessary in case using the embedded and specific HW. In case of coding on windows its better to wait for prebuild libs than install cmake on windows machine.. 

    Opencv Visual studio 2017 Step by step image tutorial

    opencv VS141

    opencv visual studio 2017opencv C ++ VS141

    Opencv nuget package console Visual studio 2017

    Previous step are really simple. Just openc empty project in C++ and add one source file source.cpp.. There is no magic and nothing to block you to start coding.. Just follow the pictures and let me know if any problems occurred. 
    Add some program, for example this for capture video from web camera.. If you try to build and link.. You will failed with no resolve dependency.. Now is the time to add. Opencv library.. Nuget is the simplest option..
    #include "opencv2\highgui.hpp"
    #include "opencv2\imgproc.hpp"
    #include "opencv2\objdetect\objdetect.hpp"
    #include "opencv2\videoio\videoio.hpp"
    #include "opencv2\imgcodecs\imgcodecs.hpp"
    #include <vector>
    #include <stdio.h>
    #include <Windows.h>
    #include <iostream>
    Now open the Nuget packages console TOOLS-NUGET Package Manager and Package Manager console.. Do not afraid of console..

    opencv visual studio 2017

     In console just write PM>  Install-Package opencvdefault 
    ONLY part start with Install..  and wait until your includes in visual studio is resolved and we see that the packages are successfully installed. We are not finished!!

    opencv visual studio 2017

    Now, if you try to build and link you will have trouble with linking.. Right click to Project name Opencv and go to general settings and change platform support to v140 to 2015.. If you do not  have this V140 you need to install something like compatibility pack.. platform toolchain for VS140..

    opencv visual studio 2017

    Compile, link and run.. Web cam is here.. It is a hack, no proper installation for VS141 but there is no reason for it.. There is no difference. Better hack than build by CMAKE on windows machine if you are not skilled enough.

    Enjoy coding in Visual studio 2017.

    opencv visual studio 2017

    Opencv 3.2, and Deep Regression Networks

    deep reression network

    Opencv 3.2 is out. I am just checking the change log. What is inside from the my point of view ?
    The tuns of improvement are mainly in opencv_contrib modules Github fork is here.

    There is several thinks that should be mentioned. For example GOTURN tracker. Is also part of the opencv_contrib fork under the tracking modules.. Goturn is convolutional neural network based tracking algorithm.

    More information should be also found on Learning to Track at 100 FPS with Deep Regression Networks.

    Deep Regression Networks (goturn basic information)

    In opposite to online learning (for example first version of TLD that using warp path of negative example and geometric transformation over positive sample) the proposed DRN (Deep regression networks) using somehow pretrained feed-forward network without online learning. The authors pre-train algorithms on many different video samples called generic object tracking. Let say there is a video sample with car. Lets build the positive sample in sense that the neural network tracker hit the target in next frame.. Negative samples in opposite way. Collect the many video samples with different kind of object  and let just penalize the network when he make a mistake in tracking and in opposite when is overthink with tracking OK..

    Idea simple as hell. Make sense. I have to try. Network should penalize samples that are not connected in space. Let say samples apart from consecutive video frames. Samples with weird behaviour and and strange similarities in object appearance.. 
    Let the neural network learn what is tracking, how to track, what is optical flow, the relations between frames and object itself.. This is not bad idea. I have to try.. 
    Yes, there are already lots of detectors based on neural network and others great idea. I really want to know more about this method and maybe try to implement.. 
    Make sense..

    Build from Convolutional neural network 

    The architecture of the network is 2 pretrained convolutional neural network. One is processing and judge the feature of previous frame and the second one evaluate and judge the current frame.. Outputs of the both convolutional neural network are connected to one input vector to fully-connected layer. That evaluate relation between the object in previous and current video frames.. There is nothing new from the technical perspective just and idea used in tracking.  

    Conclusion is that, I want to try select positive and negative samples from connected frames to learn neural network ho to track. 

    Make sense ??