31
Geometric Transformations

Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Geometric Transformations

Page 2: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Let’s design a camera

• Idea 1: put a piece of film in front of an object • Do we get a reasonable image?

Slide by Steve Seitz

Pinhole camera

• Add a barrier to block off most of the rays – This reduces blurring – The opening is known as the aperture

Slide by Steve Seitz

Page 3: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Camera Obscura

First Idea:Mo-Ti , China (470 BC to 390 BC)

First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Page 4: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

http://www.acmi.net.au/AIC/CAMERA_OBSCURA.html (Russell Naughton)

Camera Obscura

"When images of illuminated objects ... penetrate through a small hole into a very dark room ... you will see [on the opposite wall] these objects in their proper form and color, reduced in size ... in a reversed position, owing to the intersection of the rays".

Da Vinci

Page 5: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Pinhole cameras

• Abstract camera model - box with a small hole in it

• Pinhole cameras work in practice

(Forsyth & Ponce)

Page 6: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Distant objects are smaller

(Forsyth & Ponce)

Page 7: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Parallel lines meetCommon to draw image plane in front of the focal point. Moving the image plane merely scales the image.

(Forsyth & Ponce)

Page 8: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Vanishing points

• Each set of parallel lines meets at a different point – The vanishing point for this direction

• Sets of parallel lines on the same plane lead to collinear vanishing points. – The line is called the horizon for that plane

Page 9: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Properties of Projection

•Points project to points •Lines project to lines •Planes project to the whole image or a half image •Angles are not preserved •Degenerate cases • Line through focal point projects to a point.

• Plane through focal point projects to line

• Plane perpendicular to image plane projects to part of the image (with horizon).

Page 10: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Take out paper and pencil

Page 11: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

http://www.sanford-artedventures.com/create/tech_1pt_perspective.html

Page 12: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

The equation of projection

(Forsyth & Ponce)

Page 13: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

The equation of projection• Cartesian coordinates: – We have, by similar

triangles, that

– Ignore the third coordinate,

and get

Page 14: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 15: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 16: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 17: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 18: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 19: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 20: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Intrinsic matrix, K

[xy1] =

f 0 px

0 f py

0 0 1[

XYZ]

f 0 px

0 f py

0 0 1=

1 0 px

0 1 py

0 0 1

f 0 00 f 00 0 1

Page 21: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 22: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 23: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Three different coordinate systems

X

x

Ocamera

OimageOworld

Page 24: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 25: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Camera extrinsic (or external) parameters• Transform a point from the world coordinate

to the camera’s coordinate system • Translation and rotation

Xc = R(Xw − Cw)

Xc = RXw − RCw

Xc

Yc

Zc

1

= [R −RCw

0 1 ]Xw

Yw

Zw

1

[R −RCw

0 1 ] = [R 00 1] [I −Cw

0 1 ]

Page 26: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Camera extrinsic (or external) parameters

Xc

Yc

Zc

1

= [R −RCw

0 1 ]Xw

Yw

Zw

1

[R −RCw

0 1 ] = [R 00 1] [I −Cw

0 1 ]

[R 00 1] =

r11 r12 r13 0r21 r22 r23 0r31 r32 r33 00 0 0 1

[I −Cw

0 1 ] =

1 0 0 −cx

0 1 0 −Cy

0 0 1 −Cz

0 0 0 1

Page 27: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Camera extrinsic (or external) parameters

Xc

Yc

Zc

1

=

r11 r12 r13 0r21 r22 r23 0r31 r32 r33 00 0 0 1

1 0 0 −Cx

0 1 0 −Cy

0 0 1 −Cz

0 0 0 1

Xw

Yw

Zw

1

Xc

Yc

Zc

1

= R(I3×3 | − Cw)

Xw

Yw

Zw

1

[xy1] = K

Xc

Yc

Zc

1

K =f s px

0 mf py

0 0 1

Page 28: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

SummaryXw

Ywzw

Xc

Yczc

[xy]

world coordinates

camera coordinates

pixel coordinates

Page 29: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)
Page 30: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)

Homogeneous coordinates of a 3-D point

Homogeneous coordinates of its 2-D image

Image of a Point

Projection of a 3-D point to an image plane

P

Page 31: Geometric Transformations - University Of Maryland · Camera Obscura First Idea:Mo-Ti , China (470 BC to 390 BC) First built: Ibn Al-Haytham or Alhazen, Iraq/Egypt (965 to 1039AD)