# Projective Geometry Conversion Euclidean -> Homogenous ... Projective Geometry • Axioms of...

date post

10-Oct-2020Category

## Documents

view

5download

0

Embed Size (px)

### Transcript of Projective Geometry Conversion Euclidean -> Homogenous ... Projective Geometry • Axioms of...

1

CS252A, Fall 2017

Computer Vision I

Image Formation and Cameras

Computer Vision I CSE 252A Lecture 4

CS252A, Fall 2017

Computer Vision I

Announcements • HW0 is due on today • HW1 will be assigned tomorrow. • Read Chapters 1 & 2 of Forsyth & Ponce • Everyone is off waitlist • Welcome extension students – send email to

Bolun Zhang [email protected] • (Subset of?) Final exam can be use for CSE

MS Comprehensive Exam [Pending]

CS252A, Fall 2017

Computer Vision I

Projective Geometry • Axioms of Projective Plane

1. Every two distinct points define a line 2. Every two distinct lines define a point (intersect

at a point) 3. There exists three points, A,B,C such that C

does not lie on the line defined by A and B. • Different than Euclidean (affine) geometry • Projective plane is “bigger” than affine

plane – includes “line at infinity”

Projective Plane

Affine Plane = + Line at Infinity

CS252A, Fall 2017

Computer Vision I

Conversion Euclidean -> Homogenous -> Euclidean In 2-D • Euclidean -> Homogenous:

(x, y) -> λ(x,y,1)= (λx, λy, λ)

• Homogenous -> Euclidean: (x, y, w) -> (x/w, y/w)

In 3-D • Euclidean -> Homogenous:

(x, y, z) -> λ(x ,y, z, 1) • Homogenous -> Euclidean:

(x, y, z, w) -> (x/w, y/w, z/w)

X

Y (x,y)

(x,y,1)

1 W

CS252A, Fall 2017

Computer Vision I

The equation of projection: Euclidean & Homogenous Coordinates

Cartesian coordinates:

€

(x,y,z)→( f x z , f y

z )

€

U V W

⎛

⎝

⎜ ⎜ ⎜

⎞

⎠

⎟ ⎟ ⎟

=

1 0 0 0 0 1 0 0 0 0 1 f 0

⎛

⎝

⎜ ⎜ ⎜ ⎜

⎞

⎠

⎟ ⎟ ⎟ ⎟

X Y Z T

⎛

⎝

⎜ ⎜ ⎜ ⎜

⎞

⎠

⎟ ⎟ ⎟ ⎟

Homogenous Coordinates and Camera matrix

CS252A, Fall 2017

Computer Vision I

Affine Camera Model

• Take perspective projection equation, and perform Taylor series expansion about some point (x0,y0,z0).

• Drop terms that are higher order than linear. • Resulting expression is affine camera model

⎥ ⎥ ⎥

⎦

⎤

⎢ ⎢ ⎢

⎣

⎡

0

0

0

z y x

Appropriate in Neighborhood About (x0,y0,z0)

2

CS252A, Fall 2017

Computer Vision I

Simplified Camera Models Perspective Projection

Scaled Orthographic Projection

Affine Camera Model

Orthographic Projection

Approximation: Taylor Series Expansion about (X0, Y0, Z0)

Case of affine where X0= Y0 = 0

Case of scaled orthograhic where f/Z0 = 1

CS252A, Fall 2017

Computer Vision I

Projective Transformation Mapping from Plane to Plane

• 3 x 3 linear transformation of homogenous coordinates

• Points map to points • Lines map to lines

⎥ ⎥ ⎥

⎦

⎤

⎢ ⎢ ⎢

⎣

⎡

⎥ ⎥ ⎥

⎦

⎤

⎢ ⎢ ⎢

⎣

⎡

=

⎥ ⎥ ⎥

⎦

⎤

⎢ ⎢ ⎢

⎣

⎡

3

2

1

333231

232221

211211

3

2

1

x x x

aaa aaa aaa

u u u

X U

CS252A, Fall 2017

Computer Vision I

^

Figure borrowed from Hartley and Zisserman “Multiple View Geometry in computer vision”

Mapping from a Plane to a Plane under Perspective is given by a projective transform H

x’ = Hx H is a 3x3 matrix, x, x’ are 3x1 vectors of homogenous coordinates

î ĵ

Oπ

CS252A, Fall 2017

Computer Vision I

The equation of projection

Cartesian coordinates:

€

(x,y,z)→( f x z , f y

z )

U V W

⎛

⎝

⎜ ⎜ ⎜

⎞

⎠

⎟ ⎟ ⎟ =

1 0 0 0 0 1 0 0 0 0 1 f 0

⎛

⎝

⎜ ⎜ ⎜ ⎜

⎞

⎠

⎟ ⎟ ⎟ ⎟

X Y Z T

⎛

⎝

⎜ ⎜ ⎜ ⎜

⎞

⎠

⎟ ⎟ ⎟ ⎟

Homogenous Coordinates and Camera matrix

CS252A, Fall 2017

Computer Vision I

^

Oπ

x = xî + yĵ +Oπ

3D point coordinates on plane π

As a matrix equation

X = î ĵ Oπ ⎡ ⎣⎢

⎤ ⎦⎥

x y 1

⎡

⎣

⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥

In homogenous coordinates

x ' y ' w '

⎡

⎣

⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥ =

1 0 0 0 0 1 0 0 0 0 1 f 0

⎡

⎣

⎢ ⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥ ⎥

î 0

ĵ 0

Oπ 1

⎡

⎣

⎢ ⎢

⎤

⎦

⎥ ⎥

x y 1

⎡

⎣

⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥ = H

x y 1

⎡

⎣

⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥

And taking perspective projection onto π’

î ĵX = î0

ĵ 0

Oπ 1

⎡

⎣

⎢ ⎢

⎤

⎦

⎥ ⎥

x y 1

⎡

⎣

⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥

x’ = Hx

4x3

CS252A, Fall 2017

Computer Vision I

Application of Homography: OCRs, scan,…

Homography: Can be estimated from four points.

P1

P3

P4

P2

(0,0) (0,1)

(1,1) (1,0)

3

CS252A, Fall 2017

Computer Vision I Figure borrowed from Hartley and Zisserman “Multiple View Geometry in computer vision”

Planar Homography

x =H1X X’ =H2X

x’ = H2X = H2(H1-1 x) = (H2H1-1)x

Application: Two photos of a white board CS252A, Fall 2017

Computer Vision I Figure borrowed from Hartley and Zisserman “Multiple View Geometry in computer vision”

Planar Homography: Pure Rotation

x’ = H2X = H2(H1-1 x) = (H2H1-1)x

Application: Panoramas

CS252A, Fall 2017

Computer Vision I

Application: Panoramas and image stitching

All images are warped to central image CS252A, Fall 2017

Computer Vision I

Lenses

CS252A, Fall 2010 Computer Vision I

Beyond the pinhole Camera Getting more light – Bigger Aperture

CS252A, Fall 2010 Computer Vision I

Pinhole Camera Images with Variable Aperture

1mm

.35 mm

.07 mm

.6 mm

2 mm

.15 mm

4

CS252A, Fall 2010 Computer Vision I

Limits for pinhole cameras

CS252A, Fall 2010 Computer Vision I

The reason for lenses

CS252A, Fall 2010 Computer Vision I

Thin Lens

O

• Rotationally symmetric about optical axis. • Spherical interfaces.

Optical axis

CS252A, Fall 2010 Computer Vision I

Thin Lens: Center

O

• All rays that enter lens along line pointing at O emerge in same direction.

F

CS252A, Fall 2010 Computer Vision I

Thin Lens: Focus

O

Parallel lines pass through the Focal Point, F

F

CS252A, Fall 2010 Computer Vision I

Thin Lens: Image of Point

O

All rays passing through lens and starting at P converge upon P’

F

P

P’

5

CS252A, Fall 2010 Computer Vision I

Thin Lens: Image of Point

O F

P

P’ z’

f

z

1 z ' − 1 z = 1 f

Where z, z’, and f are the z-coordinates of P, P, and F. i.e., z is negative.

j k

i

CS252A, Fall 2010 Computer Vision I

Thin Lens: Image Plane

O F

P

P’

Image Plane

Q’

Q

A price: Whereas the image of P is in focus, the image of Q isn’t.

CS252A, Fall 2010 Computer Vision I

Thin Lens: Aperture

O

P

P’

Image Plane • Smaller Aperture -> Less Blur • Pinhole -> No Blur

CS252A, Fall 2010 Computer Vision I

Field of View

O Field of View

Im age Plane

f

– Telephoto lens: small field of view (large f) – Wide angle lens: large field of view(small f) – Zoom lens: variable f using compound lens

CS252A, Fall 2010 Computer Vision I

Deviations from the lens model Deviations from this ideal are aberrations Two types

2. chromatic

1. geometrical ❑ spherical aberration ❑ astigmatism ❑ distortion ❑ coma

Aberrations are reduced by combining lenses

Compound lenses CS252A, Fall 2010 Computer V