CVi – 1 Introduction to Computer [email protected] 20 Basic Camera Geometry The model...

72
CVi – 1 Introduction to Computer Vision Alina Trifan ([email protected]) IEETA / Universidade de Aveiro

Transcript of CVi – 1 Introduction to Computer [email protected] 20 Basic Camera Geometry The model...

Page 1: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

CVi – 1Introduction to Computer Vision

Alina Trifan([email protected])

IEETA / Universidade de Aveiro

Page 2: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 2

Outline

• Computer Vision?

• History of Cameras

• Pinhole Model

• The Human Visual System

Acknowledgements: Most of this course is based on the excellent courses offered by Prof. Shree Nayar at Columbia University, USA and by Prof. Srinivasa Narasimhan at CMU, USA and these slides have been mostly prepared by Prof. João Paulo Cunha . This was also based on Prof. Miguel Coimbra’s slides. Please acknowledge the original source when reusing these slides for academic purposes.

Page 3: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 3

Topic: Computer Vision?

• Computer Vision ?

• History of Cameras

• Pinhole Model

• The Human Visual System

Page 6: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 6

A Picture is Worth a Million Words

Page 7: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 7

Human Vision

• Can do amazing things like: – Recognize people and objects– Navigate through obstacles– Understand mood in the scene– Imagine stories

• But:– Suffers from illusions– Ignores many details– Ambiguous description of the world– Doesn’t care about accuracy of world

Page 8: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 8

A Picture is Worth a ...?

Necker’s Cube Reversal

Page 9: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 9

A Picture is Worth a ...?

Checker Shadow Illusion[E. H. Adelson]

Squares A&B are at the same level of grey

Page 11: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 11

Topic: History of Cameras

• Computer Vision ?

• History of Cameras

• Pinhole Model

• The Human Visual System

Page 12: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 12

A Brief History Cameras

1544

Camera Obscura, Gemma Frisius, 1544

Page 13: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 13

A Brief History of Cameras

15441568

Lens Based Camera Obscura, 1568

Page 14: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 14

A Brief History of Cameras

1544

1837

1568

Still Life, Louis Jaques Mande Daguerre, 1837

Page 15: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 15

A Brief History of Cameras

1544

1837

1568

1930

Page 16: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 16

A Brief History of Cameras

1544

1837

1568

1970

Silicon Image Detector, 19701930

Page 17: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 17

A Brief History of Cameras

1544

1837

1568

19701995Digital Cameras

1930

Page 18: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 18

Topic: Pinhole Model

• Computer Vision ?

• Camera History

• Pinhole Model

• The Human Visual System

Page 19: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 19

Pinhole Camera Model

Pinhole or central perspective, Bruneleschi, XV century

Page 20: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 20

Basic Camera Geometry

The model consists of a plane (image plane) and a 3D point O (center of projection).

The distance f between the image plane and O is the focal length.

The line through O and perpendicular to the image plane is the optical axis.

The intersection of the optical axis with the image plane is called principal point.

Page 22: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 22

Basic Camera Geometry

• Far objects appear smaller

• Lines project to lines

• These geometric properties are “common sense”

• Other properties can be inferred if we formalize the model using….

…. Mathematics, of course…

Page 24: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 24

Perspective Projection

HA=HC=0.5 HB

Page 27: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 27

Perspective Projection

f gets smaller → wide-angle camera f gets larger → more telescopic Lines in 3D project to lines in 2D. Distances and angles are not preserved. Parallel lines project onto lines that on

extension intersect at a single point in the image plan (vanishing point).

The vanishing points of all the lines that lie on the same plane form the vanishing line.

Page 28: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 28

Problems with Pinholes• Pinhole size (aperture) must be “very small” to obtain a clear image.

• However, as pinhole size is made smaller, less light is received by image plane.

• If pinhole is comparable to wavelength of incoming light, DIFFRACTION blurs the image!

• Sharpest image is obtained when:

pinhole diameter

Example: If f’ = 50mm,

= 600nm (red),

d = 0.36mm

d = 2 √ f' λ

λ

Page 29: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 29

Topic: The Human Visual System

• Computer Vision ?

• Camera History

• Pinhole Model

• The Human Visual System

Page 30: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 30

Our Eyes

-Iris is the diaphragm that changes the aperture (pupil)

-Retina is the sensor where the fovea has the highest resolution

Cornea

ScleraIris Pupil

Page 31: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 31

Focusing

Changes the focal length of the lens

shorter focal length

Page 32: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 32

Myopia and Hyperopia

(myopia)(myopia)

Page 33: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 33

Astigmatism

The cornea is distorted causing images to be un-focused on the retina.

Page 34: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 34

Blind Spot in the Eye

Close your right eye and look directly at the “+”

Page 35: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 35

Colour•Our retina has:

– Cones – Measure the frequency of light (colour)

• 6 to 7 millions• High-definition• Need high luminosity

– Rods – Measure the intensity of light (luminance)

• 75 to 150 millions• Low-definition• Function with low

luminosity

Gonzalez & Woods

We only see colour in the center of our retina!

Page 36: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

[email protected] 36

Resources

• J.C. Russ – Chapters 1 and 2

• Gonzalez & Woods – Chapter 1

• L. Shapiro, and G. Stockman – Chapter 1

• “Color Vision: One of Nature's Wonders” in http://www.diycalculator.com/sp-cvision.shtml

Page 37: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

1

CVi – 1Introduction to Computer Vision

Alina Trifan([email protected])

IEETA / Universidade de Aveiro

Page 38: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

2

[email protected] 2

Outline

• Computer Vision?

• History of Cameras

• Pinhole Model

• The Human Visual System

Acknowledgements: Most of this course is based on the excellent courses offered by Prof. Shree Nayar at Columbia University, USA and by Prof. Srinivasa Narasimhan at CMU, USA and these slides have been mostly prepared by Prof. João Paulo Cunha . This was also based on Prof. Miguel Coimbra’s slides. Please acknowledge the original source when reusing these slides for academic purposes.

Page 39: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

3

[email protected] 3

Topic: Computer Vision?

• Computer Vision ?

• History of Cameras

• Pinhole Model

• The Human Visual System

Page 40: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

4

[email protected] 4

A Picture is Worth 1000 Words

Page 41: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

5

[email protected] 5

A Picture is Worth 100.000 Words

Page 42: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

6

[email protected] 6

A Picture is Worth a Million Words

Page 43: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

7

[email protected] 7

Human Vision

• Can do amazing things like: – Recognize people and objects– Navigate through obstacles– Understand mood in the scene– Imagine stories

• But:– Suffers from illusions– Ignores many details– Ambiguous description of the world– Doesn’t care about accuracy of world

Page 44: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

8

[email protected] 8

A Picture is Worth a ...?

Necker’s Cube Reversal

Page 45: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

9

[email protected] 9

A Picture is Worth a ...?

Checker Shadow Illusion[E. H. Adelson]

Squares A&B are at the same level of grey

Page 46: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

10

[email protected] 10

A Picture is Worth a ... ?

Page 47: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

11

[email protected] 11

Topic: History of Cameras

• Computer Vision ?

• History of Cameras

• Pinhole Model

• The Human Visual System

Page 48: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

12

[email protected] 12

A Brief History Cameras

1544

Camera Obscura, Gemma Frisius, 1544

Page 49: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

13

[email protected] 13

A Brief History of Cameras

15441568

Lens Based Camera Obscura, 1568

Page 50: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

14

[email protected] 14

A Brief History of Cameras

1544

1837

1568

Still Life, Louis Jaques Mande Daguerre, 1837

Page 51: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

15

[email protected] 15

A Brief History of Cameras

1544

1837

1568

1930

Page 52: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

16

[email protected] 16

A Brief History of Cameras

1544

1837

1568

1970

Silicon Image Detector, 19701930

Page 53: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

17

[email protected] 17

A Brief History of Cameras

1544

1837

1568

19701995Digital Cameras

1930

Page 54: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

18

[email protected] 18

Topic: Pinhole Model

• Computer Vision ?

• Camera History

• Pinhole Model

• The Human Visual System

Page 55: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

19

[email protected] 19

Pinhole Camera Model

Pinhole or central perspective, Bruneleschi, XV century

Page 56: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

20

[email protected] 20

Basic Camera Geometry

The model consists of a plane (image plane) and a 3D point O (center of projection).

The distance f between the image plane and O is the focal length.

The line through O and perpendicular to the image plane is the optical axis.

The intersection of the optical axis with the image plane is called principal point.

Page 57: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

21

[email protected] 21

Basic Camera Geometry

Page 58: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

22

[email protected] 22

Basic Camera Geometry

• Far objects appear smaller

• Lines project to lines

• These geometric properties are “common sense”

• Other properties can be inferred if we formalize the model using….

…. Mathematics, of course…

Page 59: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

23

[email protected] 23

Perspective Projection

Page 60: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

24

[email protected] 24

Perspective Projection

HA=HC=0.5 HB

Page 61: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

25

[email protected] 25

Perspective Projection

Page 62: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

26

[email protected] 26

Perspective Projection

Page 63: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

27

[email protected] 27

Perspective Projection

f gets smaller → wide-angle camera f gets larger → more telescopic Lines in 3D project to lines in 2D. Distances and angles are not preserved. Parallel lines project onto lines that on

extension intersect at a single point in the image plan (vanishing point).

The vanishing points of all the lines that lie on the same plane form the vanishing line.

Page 64: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

28

[email protected] 28

Problems with Pinholes• Pinhole size (aperture) must be “very small” to obtain a clear image.

• However, as pinhole size is made smaller, less light is received by image plane.

• If pinhole is comparable to wavelength of incoming light, DIFFRACTION blurs the image!

• Sharpest image is obtained when:

pinhole diameter

Example: If f’ = 50mm,

= 600nm (red),

d = 0.36mm

d = 2 √ f' λ

λ

Page 65: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

29

[email protected] 29

Topic: The Human Visual System

• Computer Vision ?

• Camera History

• Pinhole Model

• The Human Visual System

Page 66: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

30

[email protected] 30

Our Eyes

-Iris is the diaphragm that changes the aperture (pupil)

-Retina is the sensor where the fovea has the highest resolution

Cornea

ScleraIris Pupil

Page 67: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

31

[email protected] 31

Focusing

Changes the focal length of the lens

shorter focal length

Page 68: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

32

[email protected] 32

Myopia and Hyperopia

(myopia)(myopia)

Page 69: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

33

[email protected] 33

Astigmatism

The cornea is distorted causing images to be un-focused on the retina.

Page 70: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

34

[email protected] 34

Blind Spot in the Eye

Close your right eye and look directly at the “+”

Page 71: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

35

[email protected] 35

Colour•Our retina has:

– Cones – Measure the frequency of light (colour)

• 6 to 7 millions• High-definition• Need high luminosity

– Rods – Measure the intensity of light (luminance)

• 75 to 150 millions• Low-definition• Function with low

luminosity

Gonzalez & Woods

We only see colour in the center of our retina!

Page 72: CVi – 1 Introduction to Computer Visionalina.trifan@ua.pt 20 Basic Camera Geometry The model consists of a plane (image plane) and a 3D point O (center of projection). The distance

36

[email protected] 36

Resources

• J.C. Russ – Chapters 1 and 2

• Gonzalez & Woods – Chapter 1

• L. Shapiro, and G. Stockman – Chapter 1

• “Color Vision: One of Nature's Wonders” in http://www.diycalculator.com/sp-cvision.shtml