image processing and computer vision with matlab and …€¦ · image processing and computer...

42
1 © 2014 The MathWorks, Inc. Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

Upload: others

Post on 05-Apr-2020

66 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

1© 2014 The MathWorks, Inc.

Image Processing and Computer Vision

with MATLAB and SIMULINK

By Joss Knight

Senior Developer, GPU and Parallel Algorithms

Page 2: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

2

Computer

Intelligence

Robotic Vision

Non-linear SP

Multi-variable SP

Cognitive

Vision

Statistics

Geometry

Optimization

Biological Vision

Optics

Smart

Cameras

Computer

Vision

Machine

Vision

Image

Processing

Physics

Imaging

Neurobiology

Mathematics

Machine

Learning

Control

RoboticsArtificial

IntelligenceSignal Processing

Physics

Imaging

Neurobiology

Mathematics

Machine

Learning

Control

RoboticsArtificial

IntelligenceSignal Processing

Computer Vision

System Toolbox™

Neural Network Toolbox™

Simulink™

Signal Processing

Toolbox™

SimScape™

Image Processing

Toolbox™SimBiology™

Embedded

Coder™

Optimization

Toolbox™

MATLAB™

Statistics Toolbox™

SimMechanics™

Control System

Toolbox™DSP System

Toolbox™

Image Acquisition

Toolbox™

The Computer Vision Ecosystem

Page 3: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

3

Applications: Image and Video Processing

Medical imaging

Surveillance

Robotics

Automotive safety

Consumer electronics

Geospatial computing

Machine vision

and more…

Page 4: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

4

Agenda

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

Page 5: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

5

http://www.mathworks.co.uk/products/image-video-processing

Page 6: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

6

Agenda

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition Demo: Live video in MATLAB

Demo: Image Acquisition App

Demo: Live video in SIMULINK

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

Page 7: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

7

Image Acquisition

Acquire images and video directly into MATLAB and Simulink

Configure device properties

Page 8: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

8

Agenda

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition Demo: Live video in MATLAB

Demo: Image Acquisition App

Demo: Live video in SIMULINK

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze Demo: Tissue segmentation

Demo: Image analysis Apps

Demo: Digital display reader

• 3D Vision

• Image Registration • Embedded Applications

Page 9: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

9

Standard Segmentation Workflow

Page 10: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

10

Standard Segmentation Workflow

Explore image

Page 11: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

11

Standard Segmentation Workflow

Explore image

Enhance image

Page 12: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

12

Standard Segmentation Workflow

Explore image

Enhance image

Segment image

Page 13: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

13

Standard Segmentation Workflow

Explore image

Enhance image

Segment image

Analyze image

Page 14: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

14

Demos: Explore-Enhance-Segment-Analyze

Page 15: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

15

Image Processing Apps

NEW!NEW!

Image Viewer

Color Thresholder

Region Analyzer

Page 16: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

16

Optical Character Recognition

Support for English, Japanese + others

Simple interface:

>> results = ocr(I)

Page 17: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

17

Segmentation – other techniques

Watershed and Active Contours (NEW)

Page 18: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

18

Agenda

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze Demo: Tissue segmentation

Demo: Image analysis Apps

Demo: Digital display reader

• 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

Demo: Video Mosaicking (Simulink) • Embedded Applications

Page 19: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

19

Image Registration

2D and 3D

Align multi-model images

Page 20: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

20

Image Registration

NEW: Non-rigid image

registration and warping

Page 21: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

21

Demo: Video Mosaicking

Page 22: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

22

Agenda

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

Demo: Video Mosaicking (Simulink) • Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction

• Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

Geometry Estimation

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

Page 23: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

23

Feature Detection, Extraction and Matching

Corner Template SURF MSEREdge

Page 24: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

24

Point Tracker

Simple interface:

points = detectXFeatures(I);

tracker = vision.PointTracker;

initialize(tracker, points.Location, frame);

while ~finished

frame = step(videoFileReader);

[points, validity] = step(tracker, frame);

end

Page 25: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

25

Geometry Estimation

RANSAC – Random Sampling and Consensus

Gets geometry from a minimal sample set and checks it against all matches

Page 26: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

26

Agenda

• Introduction • Feature Detect, Extract & Match

Geometry Estimation

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition

• Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

Demo: Multi-object Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

Page 27: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

27

Object Detection and Tracking

Page 28: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

28

Face Detection, People Detection and Foreground Detection

Page 29: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

29

Training Image Labeler App

Page 30: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

30

Demo: Tracking multiple objects with a Kalman Filter

Page 31: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

31

Demo: Tracking multiple objects with a Kalman Filter

Kalman Filter interface:

– Configure:

– Predict:

– Update:

predictedCentroid = predict(kalmanFilter);

kalmanFilter = configureKalmanFilter( ...

'ConstantVelocity', centroid, ...

[200, 50], [100, 25], 100);

c2 = correct(kalmanFilter, centroid);

Page 32: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

32

Agenda

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

Demo: Multi-object Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision Demo: Camera Calibrator App

Demo: 3D Reconstruction

Demo: Depth Mapping

• Image Registration

• Embedded Applications

Page 33: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

33

3D Vision

-4-3-2-10123

-8

-6

-4

-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

x (meters)z (meters)

y (

mete

rs)

Pyramid with dynamic programming and sub-pixel accuracy

0

5

10

15

Page 34: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

34

NEW Apps: Camera Calibrator and Stereo Camera Calibrator

Simplified workflow estimating

camera intrinsic and extrinsic

parameters

Removes the effects of lens

distortion from an image

Automatically detects

checkerboard patterns

Page 35: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

35

Demo: 3D Reconstruction of Point Cloud

Detect calibration grid to define

world coordinates

Detect and match features on

object

Project into scene using triangulate

Page 36: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

36

Demo: Disparity Maps and Distance detection

Page 37: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

37

Agenda

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision Demo: Camera Calibrator App

Demo: 3D Reconstruction

Demo: Depth Mapping

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration

• Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications Demo: Ball Tracker

Demo: Quad-copter Model

Page 38: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

38

Embedded Applications

56 Image Processing functions

support code generation

Most Computer Vision functionality

supports code generation

Many features generate platform-

independent code

bwdist

bwlookup

bwmorph

bwpack

bwselect

bwtraceboundary

bwunpack

conndef

edge

fitgeotrans

fspecial

getrangefromclass

histeq

im2double

im2int16

im2single

im2uint16

im2uint8

imadjust

imbothat

imclearborder

imclose

imcomplement

imdilate

imerode

imextendedmax

imextendedmin

imfill

imfilter

imhist

imhmax

imhmin

imlincomb

imopen

imquantize

imreconstruct

imregionalmax

imregionalmin

imtophat

imwarp

iptcheckmap

iptcheckconn

label2rgb

mean2

medfilt2

multithresh

ordfilt2

padarray

rgb2ycbcr

strel

stretchlim

ycbcr2rgb

imref2d

imref3d

affine2d

projective2d

Page 39: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

39

Demos: Ball Tracker and Quad-copter model

Page 40: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

40

Agenda

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

• Introduction • Feature Detect, Extract & Match

• Image Acquisition • Object Detection and Tracking

• Explore-Enhance-Segment-Analyze • 3D Vision

• Image Registration • Embedded Applications

Page 41: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

41

Explore-Enhance-Segment-Analyze

3D Vision

Apps

Feature Detection

Object Detection and Tracking

Image Registration

Image

AcquisitionImage

Viewer

Color

Thresholder

Region

Analyzer

Camera

Calibrator

http://www.mathworks.co.uk/products/image-video-processing

Page 42: Image Processing and Computer Vision with MATLAB and …€¦ · Image Processing and Computer Vision with MATLAB and SIMULINK By Joss Knight Senior Developer, GPU and Parallel Algorithms

43© 2014 The MathWorks, Inc.