OpenCV Introduction Hang Xiao Oct 26, 2012. History  1999 Jan : lanched by Intel, real time machine vision library for UI, optimized code for intel 

Slides:



Advertisements
Similar presentations
Distinctive Image Features from Scale-Invariant Keypoints
Advertisements

Applications of one-class classification
Linear Classifiers (perceptrons)
An Overview of Machine Learning
CDS 301 Fall, 2009 Image Visualization Chap. 9 November 5, 2009 Jie Zhang Copyright ©
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
Coin Counter Andres Uribe. what Find out the amount of money in a coin picture.
Facial feature localization Presented by: Harvest Jang Spring 2002.
Uncertainty Representation. Gaussian Distribution variance Standard deviation.
OpenCV Training course
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Content Based Image Retrieval
Computer Vision Group Edge Detection Giacomo Boracchi 5/12/2007
Digital Image Processing: Revision
3-D Depth Reconstruction from a Single Still Image 何開暘
Code Development for Processing Video Streams
OpenCV Stacy O’Malley CS-590 Summer, What is OpenCV? Open source library of functions relating to computer vision. Cross-platform (Linux, OS X,
Information that lets you recognise a region.
Face Processing System Presented by: Harvest Jang Group meeting Fall 2002.
Heather Dunlop : Advanced Perception January 25, 2006
INDEX ∞ Image Processing ∞ OpenCV ∞ Download & Setup ∞ Make Project ∞ Show Result ∞ Q & A Setup OpenCV & Tutorial.
Machine Learning1 Machine Learning: Summary Greg Grudic CSCI-4830.
A Method for Hand Gesture Recognition Jaya Shukla Department of Computer Science Shiv Nadar University Gautam Budh Nagar, India Ashutosh Dwivedi.
Intelligent Vision Systems ENT 496 Object Shape Identification and Representation Hema C.R. Lecture 7.
© by Yu Hen Hu 1 ECE533 Digital Image Processing Image Segmentation.
Image Segmentation & Template Matching Multimedia Signal Processing lecture on Petri Hirvonen.
UCF REU: Weeks 1 & 2. Gradient Code Gradient Direction of the Gradient: Calculating theta.
Data Extraction using Image Similarity CIS 601 Image Processing Ajay Kumar Yadav.
A Face processing system Based on Committee Machine: The Approach and Experimental Results Presented by: Harvest Jang 29 Jan 2003.
A survey of different shape analysis techniques 1 A Survey of Different Shape Analysis Techniques -- Huang Nan.
Fourier Descriptors For Shape Recognition Applied to Tree Leaf Identification By Tyler Karrels.
Mathematical Morphology Mathematical morphology (matematická morfologie) –A special image analysis discipline based on morphological transformations of.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Sean M. Ficht.  Problem Definition  Previous Work  Methods & Theory  Results.
PRESENTATION REU IN COMPUTER VISION 2014 AMARI LEWIS CRCV UNIVERSITY OF CENTRAL FLORIDA.
Mathematical Morphology
Lecture 10: Lines from Edges, Interest Points, Binary Operations CAP 5415: Computer Vision Fall 2006.
A New Method for Crater Detection Heather Dunlop November 2, 2006.
CDS 301 Fall, 2008 Image Visualization Chap. 9 November 11, 2008 Jie Zhang Copyright ©
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Edge Segmentation in Computer Images CSE350/ Sep 03.
TOPIC 12 IMAGE SEGMENTATION & MORPHOLOGY. Image segmentation is approached from three different perspectives :. Region detection: each pixel is assigned.
Announcements Final is Thursday, March 18, 10:30-12:20 –MGH 287 Sample final out today.
Frank Bergschneider February 21, 2014 Presented to National Instruments.
1 Review and Summary We have covered a LOT of material, spending more time and more detail on 2D image segmentation and analysis, but hopefully giving.
License Plate Recognition of A Vehicle using MATLAB
Motion tracking TEAM D, Project 11: Laura Gui - Timisoara Calin Garboni - Timisoara Peter Horvath - Szeged Peter Kovacs - Debrecen.
Optical Character Recognition
IMAGE PROCESSING Tadas Rimavičius.
Mathematical Morphology
Morphological Transformations and Histogram Equalization
CSC391/691 Intro to OpenCV Dr. Rongzhong Li Fall 2016
Chapter 10 Image Segmentation
Announcements Final is Thursday, March 20, 10:30-12:20pm
Recognition using Nearest Neighbor (or kNN)
Classification of Hand-Written Digits Using Scattering Convolutional Network Dongmian Zou Advisor: Professor Radu Balan.
Multiscale Feature Identification in the Solar Atmosphere
Jeremy Bolton, PhD Assistant Teaching Professor
Digital Image Processing
What I learned in the first 2 weeks
Image processing and computer vision
Filtering Things to take away from this lecture An image as a function
Announcements Final is Thursday, March 16, 10:30-12:20
Midterm Exam Closed book, notes, computer Similar to test 1 in format:
Code Development for Processing Video Streams
Midterm Exam Closed book, notes, computer Similar to test 1 in format:
Filtering An image as a function Digital vs. continuous images
Presented by Xu Miao April 20, 2005
Review and Importance CS 111.
Presentation transcript:

OpenCV Introduction Hang Xiao Oct 26, 2012

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

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  Fixed threshold;  Adaptive threshold;

Image Thresholding Examples Source picture Fixed threshold Adaptive threshold

Statistics  min, max, mean value, standard deviation over the image  Norms C, L1, L2  Multidimensional histograms  Spatial moments up to order 3 (central, normalized, Hu)

Multidimensional Histograms  Histogram operations calculation, normalization, comparison, back project  Histograms types: Dense histograms Signatures (balanced tree)  EMD algorithm The EMD computes the distance between two distributions, which are represented by signatures. The signatures are sets of weighted features that capture the distributions. The features can be of any type and in any number of dimensions, and are defined by the user. The EMD is defined as the minimum amount of work needed to change one signature into the other

EMD – a method for the histograms comparison

Image Pyramids  Gaussian and Laplacian pyramids  Image segmentation by pyramids

Image Pyramids  Gaussian and Laplacian

Pyramid-based color segmentation On still pictures And on movies

Morphological Operations  Two basic morphology operations using structuring element: erosion dilation  More complex morphology operations: opening : erosion + dilation closing : dilation + erosion morphological gradient : the difference between the dilation and the erosion of an image top hat : the difference between an input image and its opening black hat : the difference between the closing and its input image

Morphological Operations Examples  Morphology - applying Min-Max. Filters and its combinations Opening IoB= (I  B)  B Dilatation I  B Erosion I  B Image I Closing IB= (I  B)  BTopHat(I)= I - (I  B)BlackHat(I)= (I  B) - I Grad(I)= (I  B)-(I  B)

Distance Transform  Calculate the distance for all non-feature points to the closest feature point  Two-pass algorithm, 3x3 and 5x5 masks, various metrics predefined

Flood Filling  Simple  Gradient

Feature Detection  Fixed filters (Sobel operator, Laplacian);  Optimal filter kernels with floating point coefficients (first, second derivatives, Laplacian)  Special feature detection (corners)  Canny operator  Hough transform (find lines and line segments)  Gradient runs

Canny Edge Detector

Hough Transform Detects lines in a binary image Probabilistic Hough TransformProbabilistic Hough Transform Standard Hough TransformStandard Hough Transform

Another Sample of the Hough Transform Using Source picture Result

Contour Retrieving  The contour representation: Chain code (Freeman code) Polygonal representation Initial Point Chain code for the curve: Contour representation

Hierarchical representation of contours Image Boundary (W1)(W2)(W3) (B2)(B3)(B4) (W5)(W6)

Contours Examples Source Picture (300x600 = pts total) Retrieved Contours (<1800 pts total) After Approximation (<180 pts total) And it is rather fast: ~70 FPS for 640x480 on complex scenes

Outline  Image Analysis  Structural Analysis  Object Recognition  Motion Analysis and Object Tracking  3D Reconstruction

Structural Analysis  Contours processing  Approximation  Hierarchical representation  Shape characteristics  Matching  Geometry  Contour properties  Fitting with primitives  PGH: pair-wise geometrical histogram for the contour.

Contour Processing  Approximation: RLE algorithm (chain code) Teh-Chin approximation (polygonal) Douglas-Peucker approximation (polygonal);  Contour moments (central and normalized up to order 3)  Hierarchical representation of contours  Matching of contours

Hierarchical Representation of Contours  A contour is represented with a binary tree  Given the binary tree, the contour can be retrieved with arbitrary precision  The binary tree is quasi invariant to translations, rotations and scaling

Contours matching  Matching based on hierarchical representation of contours

Geometry  Properties of contours: (perimeter, area, convex hull, convexity defects, rectangle of minimum area)  Fitting: (2D line, 3D line, circle, ellipse)  Pair-wise geometrical histogram

Pair-wise geometrical histogram (PGH)

Outline  Image Analysis  Structural Analysis  Object Recognition  Motion Analysis and Object Tracking  3D Reconstruction

Object Recognition  Eigen objects  Hidden Markov Models

Eigen Objects

Eigen objects (continued)

Hidden Markov Model Definitions - The set of states - The set of measurements - The state at time t - The transition probability matrix - The conditional probability matrix - The starting states distribution

Embedded HMM for Face Recognition Model- - Face ROI partition

Face recognition using Hidden Markov Models One person – one HMM Stage 1 – Train every HMM Stage 2 – Recognition P i - probability Choose max(P i ) … 1 n i

Outline  Image Analysis  Structural Analysis  Object Recognition  Motion Analysis and Object Tracking  3D Reconstruction

Motion Analysis and Object Tracking  Background subtraction  Motion templates  Optical flow  Active contours  Estimators

Background Subtraction  Background model (normal distribution)  Background statistics functions: Average Standard deviation Running average

Motion Templates  Object silhouette  Motion history images  Motion history gradients  Motion segmentation algorithm silhouetteMHI MHG

Motion Segmentation Algorithm  Two-pass algorithm labeling all motion segments

Motion Templates Example  Motion templates allow to retrieve the dynamic characteristics of the moving object

Optical Flow  Block matching technique  Horn & Schunck technique  Lucas & Kanade technique  Pyramidal LK algorithm  6DOF (6 degree of freedom) algorithm Optical flow equations:

Pyramidal Implementation of the optical flow algorithm J imageI image Image Pyramid Representation Iterative Lucas – Kanade Scheme Generic Image (L-1)-th Level L-th Level Location of point u on image u L =u/2 L Spatial gradient matrix Standard Lucas – Kanade scheme for optical flow computation at level L d L Guess for next pyramid level L – 1 Finally, Image pyramid building Optical flow computation

6DOF Algorithm Parametrical optical flow equations:

Active Contours  Snake energy:  Internal energy:  External energy:  Two external energy types:

Estimators  Kalman filter  ConDensation filter

Kalman object tracker

Outline  Image Analysis  Structural Analysis  Object Recognition  Motion Analysis and Object Tracking  3D Reconstruction

3D reconstruction  Camera Calibration  View Morphing  POSIT

Camera Calibration  Define intrinsic and extrinsic camera parameters.  Define Distortion parameters

Camera Calibration Now, camera calibration can be done by holding checkerboard in front of the camera for a few seconds. And after that you ’ ll get: 3D view of etalon Un-distorted image

View Morphing

POSIT Algorithm  Perspective projection: Weak-perspective projection:

OpenCV Websites  OpenCV official webpage.  OpenCV documentation and FAQs.

OpenCV Examples  adaptiveskindetector : detect skin area  fback_c : dense Franeback optical flow  contours : calculate contours on different levels  delaunay : delaunay triangle  find_obj : SURF Detector and Descriptor using either FLANN or brute force matching on planar objects  morphology : open/close, erode/dilate  motempl : motion templates  mser_sample : Maximal Extremal Region interest point detector  polar_transforms : illustrates Linear-Polar and Log-Polar image transforms  pyramid_segmentation : color pyramid segmentation

Thanks !!!