Computer Vision with MATLAB

29
1 © 2011 The MathWorks, Inc. Computer Vision with MATLAB Master Class Bruce Tannenbaum

Transcript of Computer Vision with MATLAB

Page 1: Computer Vision with MATLAB

1© 2011 The MathWorks, Inc.

Computer Vision with MATLABMaster Class

Bruce Tannenbaum

Page 2: Computer Vision with MATLAB

2

Agenda

Introduction Feature-based registration

– Automatic image registration– Rotation correction with SURF– Stereo image rectification

Video processing with System objects– Tracking cars with optical flow

Classification– Texture classification– Face detection

Summary

Page 3: Computer Vision with MATLAB

3

Examples of Computer Vision with MATLAB

Page 4: Computer Vision with MATLAB

4

Computer Vision

Using images and video to detect, classify, and track objects or events in order to “understand” a real-world scene

Computer Vision Interpretation

DetectIdentifyClassifyRecognizeTrack…

PedestrianBicyclistTruckCarTraffic violationAccident…

ImageProcessing

Remove noiseAdjust contrastMeasure…

Page 5: Computer Vision with MATLAB

5

Typical Computer Vision Challenges

Variable lighting conditions Unknown scene depth or perspective Background clutter Partially hidden objects (occlusion) Differences in scale, location, and orientation

Page 6: Computer Vision with MATLAB

6

Technical Computing with MATLAB

Reporting and Documentation

Outputs for Design

Deployment

ShareExplore and Discover

Data Analysis and Modeling

Algorithm Development

Application Development

Files

Software

Hardware

Access

Code and Applications

Page 7: Computer Vision with MATLAB

7

Key Products for Computer Vision

Computer Vision System Toolbox - NEW Image Processing Toolbox MATLAB Statistics Toolbox

Additionally…– Image Acquisition Toolbox– MATLAB Coder– Parallel Computing Toolbox

Page 8: Computer Vision with MATLAB

8

Computer Vision System Toolbox

Design and simulate computer vision and video processing systems

Feature detection Feature extraction and matching Feature-based registration Motion estimation and tracking Stereo vision Video processing Video file I/O, display, and graphics

Page 9: Computer Vision with MATLAB

9

Demo: Feature-Based Registration

Workflow– Feature detection– Feature extraction– Feature matching– Geometric transformation

estimation with RANSAC

Page 10: Computer Vision with MATLAB

10

Demo: Rotation Correction with SURF

Workflow– Feature detection– Feature extraction– Feature matching

Page 11: Computer Vision with MATLAB

11

Demo: Stereo Image Rectification

Page 12: Computer Vision with MATLAB

12

Recovering Scene Depth with Stereo Cameras

Page 13: Computer Vision with MATLAB

13

Epipolar Geometry

Page 14: Computer Vision with MATLAB

14

Fundamental Matrix

XLT FXR = 0

Page 15: Computer Vision with MATLAB

15

Video Processing

Video file I/O and display Video pre-processing Motion estimation and analysis

Page 16: Computer Vision with MATLAB

16

Motion Estimation and Analysis

Techniques– Block matching– Optical flow– Template matching– Background estimation

using Gaussian mixture models

Applications Object tracking Interpolation Compression

Page 17: Computer Vision with MATLAB

17

Demo: Using Optical Flow to Track Cars

Video file I/O and display Video preprocessing Motion estimation Segmentation and analysis

Page 18: Computer Vision with MATLAB

18

Useful System Objects for Video File I/O, Display, and Graphics

File I/O– VideoFileReader

– VideoFileWriter

Display– VideoPlayer

– DeployableVideoPlayer

Graphics– AlphaBlender

– MarkerInserter

– ShapeInserter

– TextInserter

Page 19: Computer Vision with MATLAB

19

Useful System Objects for Video Preprocessing and Statistics

Preprocessing– ChromaResampler

– Deinterlacer

– DemosaicInterpolator

Statistics (running across video frames)– Histogram

– Maximum

– Mean

– Median

– Minimum

– StandardDeviation

– Variance

Page 20: Computer Vision with MATLAB

20

Different Interfaces, Different Benefits in Computer Vision System Toolbox

Audience Functions System Objects Simulink BlocksAlgorithm developers

• Application-specificalgorithms and tools

• Algorithms that maintain state

• Efficient video streamprocessing

System designers • Fixed-pointmodeling

• C-code generation

• Multidomainmodeling

• Real-time system design

Implementers • Target-specific embedded hardware

• HIL, PIL

Page 21: Computer Vision with MATLAB

21

Typical Parts of a Computer Vision Algorithm

1. Image/video acquisition2. Image/video pre-processing3. Feature detection4. Feature extraction5. Feature matching6. Using features

– Stabilization, mosaicking– Stereo image rectification

7. Feature classification

Image Acquisition Toolbox

Statistics Toolbox

Image Processing Toolbox

Computer VisionSystem Toolbox

Page 22: Computer Vision with MATLAB

22

Challenge: Accurate Classification is Hard

How can a computer tell that these are all chairs?

Page 23: Computer Vision with MATLAB

23

Demo: Texture Classification

Identify features appropriate for classification Extract features for training and test data Train classifier with features Test classifier and analyze results

Using KTH-TIPS databasehttp://www.nada.kth.se/cvap/databases/kth-tips/

“On the significance of real-world conditions for material classification,”E. Hayman, B. Caputo, M. J. Fritz, J-O. Eklund, Proc ECCV 2004“Classifying materials in the real world,” B. Caputo, E. Hayman, M. J. Fritz, J.-O. Eklundh, Image and Vision Computing, 28 (2010), 150- 163.

Page 24: Computer Vision with MATLAB

24

Demo: Face Detection

Page 25: Computer Vision with MATLAB

25

Statistics Toolbox

Perform statistical analysis, modeling, and algorithm development

Clustering– Principle components analysis– K-means– Gaussian mixture models

Classification– Naïve Bayes– K-nearest neighbor search– Boosted decision trees

AdaBoost, GentleBoost, LogitBoost,…

Page 26: Computer Vision with MATLAB

26

Key Products for Computer Vision

Computer Vision System Toolbox - NEW Image Processing Toolbox MATLAB Statistics Toolbox

Additionally…– Image Acquisition Toolbox– MATLAB Coder– Parallel Computing Toolbox

Page 27: Computer Vision with MATLAB

27

Why Use MATLAB for Computer Vision?

Comprehensive environment– Analysis, algorithm development, visualization, etc.

Broad library of algorithms– Computer vision– Image processing– Classification and clustering

Documentation, examples, and technical support Increased productivity over C/C++ programming

Page 28: Computer Vision with MATLAB

28

For More Information

mathworks.com/products/computer-vision Relevant demos:

– Barcode Recognition– Image Rectification– Traffic Warning Sign Recognition– People Tracking– Video Mosaicking

Documentation Contact your sales representative

Page 29: Computer Vision with MATLAB

29

Questions and Answers