introduction to computer vision cs / ece 181b thursday, april 13, 2004 image formation

37
Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004 Image Formation

Post on 22-Dec-2015

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Introduction to Computer Vision

CS / ECE 181B

Thursday, April 13, 2004

Image Formation

Page 2: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Course web site

• http://www.ece.ucsb.edu/~manj/cs181b

• http://www.ece.ucsb.edu/~manj/ece181b

• Not a substitute for attending the class– Note that not all lecture are in PPT. I will be using the board for

most “math” related stuff.

Page 3: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Prereqs and background knowledge

• E.g., I assume you know:– Basic linear algebra

– Basic probability

– Basic calculus

– Programming languages (C, C++) or MATLAB You had two sessions on MATLAB

Page 4: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Your job

• You are expected to:– Attend the lectures and discussion sessions

You're responsible for everything that transpires in class and discussion session (not just what’s on the slides)

– Ask questions in class – participate!

– Do the homework assignments on time and with integrity “Honest effort” will get you credit

– Give us feedback during the quarter

Page 5: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

First part of course: Image Formation

• Geometry of image formation(Camera models and calibration)– Where?

• Radiometry of image formation– How bright?

Page 6: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Digital images

• We’re interested in digital images, which may come from– An image originally recorded on film

Digitized from negative or from print– Analog video camera

Digitized by frame grabber– Digital still camera or video camera– Sonar, radar, ladar (laser radar)– Various kinds of spectral or multispectral sensors

Infrared, X-ray, Landsat…

• Normally, we’ll assume a digital camera (or digitized analog camera) to be our source, and most generally a video camera (spatial and temporal sampling)

Page 7: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

What is a Camera?

• A camera has many components– Optics: lens, filters, prisms,

mirrors, aperture

– Imager: array of sensing elements (1D or 2D)

– Scanning electronics

– Signal processing

– ADC: sampling, quantizing, encoding, compression

May be done by external frame grabber (“digitizer”)

• And many descriptive features– Imager type: CCD or CMOS

– Imager number

– SNR

– Lens mount

– Color or B/W

– Analog or digital (output)

– Frame rate

– Manual/automatic controls

– Shutter speeds

– Size, weight

– Cost

Page 8: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Camera output: A raster image

• Raster scan – A series of horizontal scan lines, top to bottom – Progressive scan – Line 1, then line 2, then line 3, …

– Interlaced scan – Odd lines then even lines

Raster patternProgressive scan

Interlaced scan

Page 9: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Pixels

• Each line of the image comprises many picture elements, or pixels– Typically 8-12 bits (grayscale) or 24 bits (color)

• A 640x480 image:– 480 rows and 640 columns

– 480 lines each with 640 pixels

– 640x480 = 307,200 pixels

• At 8 bits per pixel, 30 images per second– 640x480x8x30 = 73.7 Mbps or 9.2 MBs

• At 24 bits per pixel (color)– 640x480x24x30 = 221 Mbps or 27.6 MBs

Page 10: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Aspect ratio

• Image aspect ratio – width to height ratio of the raster– 4:3 for TV, 16:9 for HDTV, 1.85:1 to 2.35:1 for movies

– We also care about pixel aspect ratio (not the same thing) Square or non-square pixels

Page 11: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Sensor, Imager, Pixel

• An imager (sensor array) typically comprises n x m sensors– 320x240 to 7000x9000 or more (high end astronomy)– Sensor sizes range from 15x15m down to 3x3 m or smaller

• Each sensor contains a photodetector and devices for readout

• Technically: – Imager – a rectangular array of sensors upon which the scene is

focused (photosensor array)– Sensor (photosensor) – a single photosensitive element that generates

and stores an electric charge when illuminated. Usually includes the circuitry that stores and transfers it charge to a shift register

– Pixel (picture element) – atomic component of the image (technically not the sensor, but…)

• However, these are often intermingled

Page 12: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Color sensors

• CCD and CMOS chips do not have any inherent ability to discriminate color (i.e., photon wavelength/energy)– They sense “number of photons”, not wavelengths

– Essentially grayscale sensors – need filters to discriminate colors!

• Approaches to sensing color– 3-chip color: Split the incident light into its primary colors

(usually red, green and blue) by filters and prisms Three separate imagers

– Single-chip color: Use filters on the imager, then reconstruct color in the camera electronics

Filters absorb light (2/3 or more), so sensitivity is low

Page 13: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

3-chip color

Incidentlight

Lens

Neutral densityfilter

Infraredfilter

Low-passfilter

To R imager

To G imager

To B imager

Prisms

How much light energy reaches each sensor?

Page 14: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Single-chip color

)),((),(

)),((),(

)),((),(

dyydxxIfyxB

dyydxxIfyxG

dyydxxIfyxR

B

G

R

±±=±±=±±=

Incidentlight To imager

• Uses a mosaic color filter– Each photosensor is covered by a single filter

– Must reconstruct (R, G, B) values via interpolation

Page 15: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Eye is not a (digital) camera! (or, is it?)

http://www.discoveryfund.com/anatomyoftheeye.html

Page 16: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Image Formation

• Projection Geometry

• Radiometry (Image Brightness) - to be discussed later in SFS.

Page 17: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Pinhole Camera

(source: A Guided tour of computer vision/Vic Nalwa)

Page 18: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Perspective Projection

(source: A Guided tour of computer vision/Vic Nalwa)

Page 19: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Perspective Projection

Page 20: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Some Observations/questions

• Note that under perspective projection, straight-lines in 3-D project as straight lines in the 2-D image plane. Can you prove this analytically?– What is the shape of the image of a sphere?

– What is the shape of the image of a circular disk? Assume that the disk lies in a plane that is tilted with respect to the image plane.

• What would be the image of a set of parallel lines– Do they remain parallel in the image plane?

Page 21: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Note: Equation for a line in 3-D (and in 2-D)

Line in 3-D:

Line in 2-D

By using the projective geometry equations, it is easy to show that a line in 3-D projects as a line in 2-D.

Page 22: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Vanishing Point

• Vanishing point of a straight line under perspective projection is that point in the image beyond which the projection of the straight line can not extend.– I.e., if the straight line were infinitely long in space, the line would

appear to vanish at its vanishing point in the image.

– The vanishing point of a line depends ONLY on its orientation is space, and not on its position.

– Thus, parallel lines in space appear to meet at their vanishing point in image.

Page 23: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Vanishing Point

(sou

rce:

A G

u id e

d to

ur o

f co

mpu

ter

visi

on/V

ic N

a lw

a)

Page 24: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

The Vanishing Point

(source: A Guided tour of computer vision/Vic Nalwa)

Page 25: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Vanishing point (last slide!)

• For any given spatial orientation, the vanishing point is located at that point on the projection surface where a straight line passing through the center of projection with the given orientation would intersect the projection surface.

Page 26: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Planar vs Spherical Perspective Projection

(source: A Guided tour of computer vision/Vic Nalwa)

Page 27: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Spherical Perspective Projection

• Under parallel perspective projection, straight line map onto straight line.

• Question: What do straight lines map onto under spherical perspective projection?

Page 28: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Orthographic Projection

• Projection onto a plane by a set of parallel rays orthogonal to this plane.

X x

Y yi

i

=

=0

0

(source: A Guided tour of computer vision/Vic Nalwa)

Page 29: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Approximation of Perspective Projection

A. object dimensions are small compared to the distance of the object from the center of projection.B. Compared to this distance, the object is close to the straight line that passes through COP and is orthogonal to the IP.

Page 30: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Approximation by Parallel Projection

(source: A Guided tour of computer vision/Vic Nalwa)

Page 31: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Parallel Projection

• Parallel Projection is a generalization of orthographic projection in which the object is projected onto the image plane by a set of parallel rays that are not necessarily orthogonal to this plane.

• Perspective projection can be approximated by parallel projection up to a uniform scale factor whenever the object’s dimensions are small compared to the average distance of the object from the center of projection.

Page 32: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Note: Imaging with a lens

Page 33: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Misfocus Blur

Page 34: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Brightness

• Irradiance, as a measure of image brightness– Irradiance is the power per unit area (Watts per square

meter) of radiant energy falling on a surface.

EP

A=dd

Irradiance

Page 35: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Brightness

• Scene Brightness -- Radiance

– Radiance is the power emitted per unit area into a cone of directions having unit solid angle (Watts per square meter per steridian.)

LP

A=dd dw

2

Page 36: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Image Formation: Summary

– Projection Geometry What determines the position of a 3D point

in the image?– Image Brightness

What determines the brightness of the image of some surface?

This we will discuss later when we talk about shape from shading.

Page 37: Introduction to Computer Vision CS / ECE 181B Thursday, April 13, 2004  Image Formation

Summary

Projection Geometry - determines the position of a 3D point in the image.– Perspective projection– approximations using

orthographic projection parallel projection

– terminology center of projection vanishing point optic axis focal point, focal length