opencv introduction -...

14
OpenCV Introduction Hang Xiao

Upload: donhi

Post on 26-Mar-2018

271 views

Category:

Documents


0 download

TRANSCRIPT

OpenCV Introduction

Hang Xiao

History • 1999 Jan : lanched by Intel, real time machine vision library for UI, optimized code for intel

• 2000 Jun : OpenCV alpha 3。

• 2000 Dec : OpenCV beta 1 for linux

• 2006 : the first 1.0 version supports Mac OS

• 2008 mid : obtain corporate support from Willow Garage

• 2009 Sep : OpenCV 1.2(beta2.0

• 2009 Oct : Version 2.0 released。

• 2010 Dec : OpenCV 2.2。

• 2011 Aug : OpenCV 2.3。

• 2012 Apr : OpenCV 2.4.

Overview

• Goals – Develop a universal toolbox for research and development in

the field of Computer Vision

• Algorithms – More than 350 algorithms, 500 API

• Programming language – C/C++, C#, Ch , Python, Ruby, Matlab, and Java (using JavaCV)

• OS support – Windows, Android, Maemo, FreeBSD, OpenBSD, iOS, Linux and

Mac OS.

• Licence – BSDlisence, free for commercial and non-commmercial

Overview - Applications

• 2D and 3D feature toolkits • Egomotion estimation • Facial recognition system • Gesture recognition • Human–computer interaction (HCI) • Mobile robotics • Motion understanding • Object identification • Segmentation and Recognition • Stereopsis Stereo vision: depth perception from 2 cameras • Structure from motion (SFM)Motion tracking

Overview - A statistical machine learning library

• Boosting (meta-algorithm)

• Decision tree learning

• Gradient boosting trees

• Expectation-maximization algorithm

• k-nearest neighbor algorithm

• Naive Bayes classifier

• Artificial neural networks

• Random forest

• Support vector machine (SVM)

Outline

• Image Analysis

• Structural Analysis

• Object Recognition

• Motion Analysis and Object Tracking

• 3D Reconstruction

Image Analysis

• Thresholds

• Statistics

• Pyramids

• Morphology

• Distance transform

• Flood fill

• Feature detection

• Contours retrieving

Image Thresholding Examples

Source picture Fixed threshold Adaptive threshold

Canny Edge Detector

Hough Transform Detects lines in a binary image

•Probabilistic Hough

Transform •Standard Hough

Transform

Another Sample of the Hough Transform Using

Source picture Result

Motion Templates Example

Motion templates allow to retrieve the dynamic characteristics of the moving object

OpenCV modules

Cv - Main OpenCV functions. Cvaux - Auxiliary (experimental) OpenCV functions. Cxcore - Data structures and linear algebra support. Highgui - GUI functions.

Image data structure in OpenCV

#include "cv.h" //main OpenCV functions #include "highgui.h" //OpenCV GUI functions ̄include <stdio.h> int main() { /* declare a new IplImage pointer, the basic image data structure in OpenCV */ IplImage* newImg; /* load an image named "apple.bmp", 1 means this is a color image */ newImg = cvLoadImage("apple.bmp",1); //create a new window cvNamedWindow("Window", 1); //display the image in the window cvShowImage("Window", newImg); //wait for key to close the window cvWaitKey(0); cvDestroyWindow( "Window" ); //destroy the window cvReleaseImage( &newImg ); //release the memory for the image return 0; }