Skip to main content


Showing posts from February, 2016

Opencv 3.1 Tutorial Optical flow (calcOpticalFlowFarneback)

Farneback Optical flow Opencv simple C++ tutorial and code to achieve optical flow and farneback optical flow of moving an object in opencv video. Lets check the video example and the achieved result on my blog. Working and well describe code is included. 

Optical Flow Farneback parameters remarksYou need 2 images at least to calculate optical flow, the previous image (prevgray) and current image (img).  !! The previous image must be initialized first !!  Both images have to be gray scale. 
Result is computer in flowUmat which has same size as inputs but format is CV_32FC2

0.4- image pyramid or simple image scale
1 is number of pyramid layers. 1 mean that flow is calculated only from previous image.  12 is win size.. Flow is computed over the window larger value is more robust to the noise.  2 mean number of iteration of algorithm 8 is polynomial degree expansion recommended value are 5 - 7 1.2 standard deviation used to smooth used derivatives recommended values from 1.1 - 1,5

Microsoft Project oxford computer vision

Research AI and Computer vision There is some demo. Actually it works. I am younger and good thing is that gender is right. Project oxford This is great project from Microsoft research.. The computer vision SDK and API of a state-of-the-art image algorithms. Gender classification optical letter Recognition and many more.

Check all the demos of this great project
Face DetectionFace VerificationEmotion RecognitionFace TrackingMotion DetectionStabilizationSpeech to TextText to SpeechSpeaker IdentificationSpeaker VerificationSpell CheckWord Breaking More information about microsoft computer vision research you can find here research microsoft There are project for images understanding like  microsoft Coco i mentioned in some pervious  articles  (More about Coco). Another projects like Human behavior and video understanding, also 3D modelling and machine learning optimization and many more articles, source code and ideas. The lots of informations are related to Kinect and RGBD. 

Opencv tutorial, VideoCapture playback, frame skip

Opencv VideoCapture playback, fast frame replay Opencv C++ tutorial how to playback video frames and video loaded into memory, Fast video replay by slider. Simple described and working tutorial working in Visual studio 2015 with simple installation by Nugets Here or also with classical one.. 

This is not something special, but useful. Few days earlier, I post in memory video access by vector<Mat>. Great, fast approach but the short video fills RAM memory and crash the program even if you have 8 GB available. Maybe It is to danger and i decided to cancel this article. 
In this example, i want to access GOPRO HD faster and skipped frames video and in memory is pure fantasy over minute video length. 
Opencv VideoCapture property CV_CAP_PROP_POS_FRAMES
I don't add extra comments. The code is pretty simple. I only highlights the important parts by RED font color. 
This is only important part. By the slider_position value set the CV_CAP_PROP_POS_FRAMES value. cap.set(CV_CAP_PROP_P…

Computer vision in mobile apps.

Computer vision mobile apps
The biggest piece of computer vision apps are related to fun. I am not talking about image processing but about computer vision. Look at these apps.

Fun Morph apps  Fun applications are mainly focus on augmented reality and Face Substitution or replacement. This 10 minutes of fun applications are great instead of youtube. You can create your child looks with your gf with 2 photos and one click.

This is great valuable tool in movie and TV insdustry. Smart film effects in future mobile phones will be scary tool. Imagine 2000 video of Leonardo Dicaprio at the same time on difference place on the earth. This apps are for fun and definitelly for short period

Sport computer vision apps The profesional footbal player uses smart tracking belts. Or some kind of computer vision tracking apps. All this apps in Hockey, Ragby and American fotbal focus on strategy. This is professional usage of computer vision and system like this for his price cannot find in Appstore.


Install opencv with ffmpeg Debian Jessie linux

FFMPEG Debian Jessie and Opencv instalation Share this for more tutorials and computer vision post from me.. Thanks best Vladimir +

// Just update and upgrade your system
sudo apt-get updatesudo apt-get -y upgrade //Install basic staff in any case you dont have this packagessudo apt-get -y install build-essentialsudo apt-get -y install cmakesudo apt-get -y install pkg-config Install opencv dependenciessudo apt-get -y install libgtk2.0-dev python-dev python-numpy libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libunicap2 libunicap2-dev libdc1394-22-dev libdc1394-22 libdc1394-utils libv4l-0 libv4l-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libdc1394-utils libjpeg-dev libpng-dev libtiff-devlibjasper-dev libtiff5 libtiff5-dev libopenexr-dev libjasper-dev Install FFMPEGsudo apt-get -y install git make nasm pkg-config libx264-dev libxext-dev libxfixes-dev zlib1g-devsudo wget -O ffmpeg-2.8.tar.bz2 "https://www.ff…

Opencv tutorial, Read all images withim a folder (Windows) and Labeled Data

Load all pictures inside the Folder into Opencv Mat
This is example how to load all images inside the folder on the Windows system.
I use this to collect vector<Mat> to train classificator for image recognition.

Collect positive and negative pictures Basically, I load all positive samples from one Folder and negative samples from another Folder into one vector<Mat>. Code show only reading from one folder.

Label positive and negative data in Opencv Also It is easy to count files (images) in one folder and another folder and label the images in your vector in sense that the first part contains only positive samples and when Iterator is greater than Num of positive samples rest we can labeled as negative. 
Mat of labels 1 for positive and - 1 for negative you can create like that
This is vector  with POSITIVE | NEGATIVE image samples inside The number of positive images and negative images is count in code at the end of this article.  vector<Mat> samples;

// Create emp…