90
CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Embed Size (px)

Citation preview

Page 1: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

CS 423 (CS 423/CS 523)

Computer Vision

Lecture 1INTRODUCTION TO COMPUTER VISION

Page 2: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

About the Course

2

Page 3: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

http://vvgl.ozyegin.edu.tr

Objective

Introduction to the theory, tools, and algorithms of computer vision

Instructor

Assist. Prof. M. Furkan Kıraç

E-mail: [email protected]

Room: 219

Hours

Mondays, 9:40-12:30, Room: 246

Grading

Projects: 4x15%

Midterm Exam: 40%

Syllabus

3

Page 4: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Projects:Late submissions are not accepted. Copying answers from others’ work is not permitted.

Midterm Exam:At least 3 of the 4 Projects must be turned in by the due date in order to qualify for the Final Exam. No Composite Exam (Bütünleme Sınavı), as there is no final exam.  

Grading

4

Page 5: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Computer Vision: Algorithms and Applications, Richard Szeliski, Springer, 2010.

Computer Vision: A Modern Approach, David A. Forsyth and Jean Ponce, Prentice-Hall, 2002.

  Introductory Techniques for 3D Computer

Vision, Emanuele Trucco and Alessandro Verri, Prentice-Hall 1998.

Recommended Books

5

Page 6: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

OpenCV Computer Vision Application Programming Cookbook Second Editon, Robert Laganiere, Packt Publishing, 2014.

Learning OpenCV, Gary Bradski and Adrian Kaehler, O'Reilly, 2008.

Mastering OpenCV with Practical Computer Vision Projects, Daniel Lelis Baggio, et al., Packt Publishing, 2012.

 

OpenCV Resources

6

Page 7: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Applications of Computer Vision

7

Page 8: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Image Stitching

Page 9: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Image Matching

Page 10: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Object Recognition

Page 11: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

3D Reconstruction

Page 12: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Interior Modeling

12

Page 13: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

3D Augmented Reality

13

Page 14: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

3D Camera Tracking

14

Page 15: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

15

Stereo Conversion for 3DTV

Page 16: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Depth Estimation and View Interpolation for 3DTV

16

Page 17: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human Tracking

17

Page 18: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

License Plate Recognition

18

Page 19: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human Pose Estimation

19

Page 20: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Course Outline

20

Page 21: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Linear Filters, Frequency Domain Filtering, Edge and Boundary Detection Feature Detection Fitting, Alignment Histograms Covariance, Principle Component Analysis (PCA) Face Detection and PCA Optical Flow and Motion Tracking and Mean-Shift Randomized Decision Trees, Pose Estimation Bag of Features Context, Two-View Geometry Summary

Topics to be covered...

21

Page 22: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Relation to Other Fields

22

Page 23: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Computer Vision

23

Figure from "Computer Vision: Algorithms and Applications,” Richard Szeliski, Springer, 2010.

Page 24: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Lights and materials Shading Texture mapping Environment effects Animation 3D scene modeling 3D character modeling (OpenGL)

Computer Graphics

24

Page 25: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Computer Graphics

25

Page 26: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Resampling Enhancement Noise filtering Restoration Reconstruction Segmentation Image compression (MATLAB and OpenCV)

Image Processing Topics

26

Page 27: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Image Processing

27

Page 28: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Motion estimation Frame-rate conversion Multi-frame noise filtering Multi-frame restoration Super-resolution Video compression (MATLAB & OpenCV)

Video Processing Topics

28

Page 29: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Video acquisition-display chain

29

Capture Representation Coding

Transmission Decoding Rendering

Page 30: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human vs. Computer

30

Page 31: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Optical illusions

Page 32: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Actual vs. Perceived Intensity (Mach band effect)

32

Page 33: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Brightness Adaptation of the Eye

33

Page 34: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Optical illusions

Page 35: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION
Page 36: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Optical illusions

Page 37: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Why is Computer Vision Difficult?

Page 38: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human perception

Page 39: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human perception

Page 40: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human Visual System

40

Page 41: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human Eye

Page 42: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION
Page 43: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION
Page 44: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Photoreceptors: Rods & Cones

Page 45: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION
Page 46: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Rods vs. Cones

RodsPerceive brightness onlyNight vision

ConesPerceive colorDay visionRed, green, and blue cones

Page 47: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Cone Distribution

64%

32%

2%

Blue is less-focused

Page 48: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Visual Threshold drop during Dark Adaptation

Page 49: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Spatial Resolution of the Human Eye Photopic (bright-light) vision:

Approximately 7 million cones Concentrated around fovea

Scotopic (dim-light) vision Approximately 75-150 million rods Distributed over retina

(HDTV: 1920x1080 = 2 million pixels)

49

Page 50: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Frequency Responses of Cones

Same amount of energy produces different sensations of brightness at different wavelengths

Green wavelength contributes most to the perceived brightness.

50

Page 51: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Trichromatic Color Mixing

Any color can be obtained by mixing three primary colors Red, Green, Blue (RGB) with the right proportion

valuessTristimulu :,3,2,1

kk

kk TCTC

Page 52: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION
Page 53: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Image Formation

53

Page 54: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human Eye vs. Camera

Camera components Eye components

Lens Lens, cornea

Shutter Iris, pupil

Film Retina

Cable to transfer images Optic nerve to send the incident light information to the brain

Page 55: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human Vision

Page 56: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Image formation

Page 57: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Pin-Hole Camera Model

Page 58: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Point Spread Effect

Page 59: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Out-of-Focus Blur

Page 60: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Shrinking the Aperture

Page 61: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Converging Lens

Page 62: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Correction with a Converging Lens

Page 63: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION
Page 64: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Perfectly In-Focus for a Certain Distance Only

“circle of confusion”

Page 65: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Depth-of-Field

Page 66: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Depth-of-Field

Page 67: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

“Sharp Image” within Depth-of-Field due to Finite Sensor Size

NZFZ

Page 68: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Focal Length (F) and Depth (Z)

Z

YFy

F

y

Z

Y

Z

XFx

Page 69: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Aperture Size Affects Depth-Of-Field

f / 5.6

f / 32

Page 70: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Aperture

2dA

Page 71: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Camera f-number

d

Ff

2

f

FA

Page 72: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Exposure Time

Page 73: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Motion Blur Effect due to Finite Exposure Time

Page 74: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Decrease in aperture implies…

Increase in depth-of-field Decrease in motion blur Decrease in exposure

Page 75: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

2D Image Representation

75

Page 76: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

76

Image Capture

(Courtesy Gonzalez & Woods)

Page 77: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Digital Image Capture

Page 78: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Digital Image Capture

Light sensitive diodes convert photons to electrons

Page 79: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Color Image Capture: Single vs. Three CCD Arrays

RGB splitter(three separate imaging sensors, higher resolution)

Bayer filter(cheaper but introduces spatial resolution loss)

Page 80: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Digital Camera Issues

Noise caused by low light

Color color fringing (chromatic aberration) artifacts from Bayer patterns

Blooming charge overflowing into neighboring pixels

In-camera processing over-sharpening can produce halos

Compression creates blocking artefacts

Page 81: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Digitization: Sampling and Quantization

Page 82: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Sampling Rate Problem

Page 83: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Over Quantization

83

Page 84: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

84

Images as Matrices of Integers

126 127 126

125 126 127

123 126 125

128 127 124

123 120 144

121 128 155

126 123 127

120 122 124

119 121 123

122 142 162

130 157 161

145 162 164

158

163

160

164

166

165

m

n

(0,0)

0 ≤ s(m,n) ≤ 255 } quantization

0 ≤ m ≤ M-1

0 ≤ n ≤ N-1

MxN 8-bit gray-scale (intensity, luminance) image

sampling

0 → black, 255 → white

Page 85: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Images as Functions

We can think of an image as a function, f, from R2 to R: f( x, y ) gives the intensity at position ( x, y ) Realistically, we expect the image only to be defined

over a rectangle, with a finite range:• f: [a,b]x[c,d] [0,1]

A color image is just three functions pasted together. We can write this as a “vector-valued” function:

( , )

( , ) ( , )

( , )

r x y

f x y g x y

b x y

Page 86: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

RGB Color Bands (Channels)

Red

Green Blue

Page 87: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

YUV Bands

Also called Y Cb Cr Y : Luma

Cb : Chrominance_blueCr : Chrominance_red

Y

U (Cb)

V(Cr)

Color

Page 88: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

YUV-RGB Conversion

Page 89: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Summary

89

Page 90: CS 423 (CS 423/CS 523) Computer Vision Lecture 1 INTRODUCTION TO COMPUTER VISION

Human visual system

Pin-hole camera model

Image representation

Summary

90