Image Formation

68
3D Computer Vision and Video Computing Image Formation Topic 1 of Part I Image Formation CSc I6716 Spring 2011 Zhigang Zhu, City College of New York [email protected]

description

Image Formation. CSc I6716 Spring 2011. Topic 1 of Part I Image Formation. Zhigang Zhu, City College of New York [email protected]. Install Matlab. You want to contact both Di Yao and Nick: [email protected] [email protected] You will need to let them know - PowerPoint PPT Presentation

Transcript of Image Formation

Page 1: Image Formation

3D Computer Vision

and Video Computing Image FormationImage Formation

Topic 1 of Part IImage Formation

CSc I6716Spring 2011

Zhigang Zhu, City College of New York [email protected]

Page 2: Image Formation

3D Computer Vision

and Video Computing Install MatlabInstall Matlab

You want to contact both Di Yao and Nick:

[email protected]

[email protected]

You will need to let them know

the Operating System, and Login ID(NAME) for your computer

your computers primary network MAC address.

your current Bursar’s Receipt as proof of your current enrollment,and your Student ID card

Matlab will be tied that machine only.

Page 3: Image Formation

3D Computer Vision

and Video Computing AcknowledgementsAcknowledgements

The slides in this lecture were kindly provided by

Professor Allen Hanson

University of Massachusetts at Amherst

Page 4: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 5: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 6: Image Formation

3D Computer Vision

and Video Computing Abstract ImageAbstract Image

n An image can be represented by an image function whose general form is f(x,y).

n f(x,y) is a vector-valued function whose arguments represent a pixel location.

n The value of f(x,y) can have different interpretations in different kinds of images.

Examples

Intensity Image - f(x,y) = intensity of the scene

Range Image - f(x,y) = depth of the scene from imaging system

Color Image - f(x,y) = {fr(x,y), fg(x,y), fb(x,y)}

Video - f(x,y,t) = temporal image sequence

Page 7: Image Formation

3D Computer Vision

and Video Computing Basic RadiometryBasic Radiometry

n Radiometry is the part of image formation concerned with the relation among the amounts of light energy emitted from light sources, reflected from surfaces, and registered by sensors.

Surface

Optics

CCD Array

P

Light Source

L(P,d)

in

p

e

Page 8: Image Formation

3D Computer Vision

and Video Computing Light and MatterLight and Matter

n The interaction between light and matter can take many forms:l Reflectionl Refractionl Diffractionl Absorptionl Scattering

Page 9: Image Formation

3D Computer Vision

and Video Computing Lecture AssumptionsLecture Assumptions

n Typical imaging scenario:l visible lightl ideal lensesl standard sensor (e.g. TV camera)l opaque objects

n Goal

To create 'digital' images which can be processed to recover some of the characteristics of the 3D world which was imaged.

Page 10: Image Formation

3D Computer Vision

and Video Computing Image FormationImage Formation

Light (Energy) Source

Surface

Pinhole Lens

Imaging Plane

World Optics Sensor Signal

B&W Film

Color Film

TV Camera

Silver Density

Silver densityin three colorlayers

Electrical

Page 11: Image Formation

3D Computer Vision

and Video Computing StepsSteps

World Optics Sensor

Signal Digitizer

Digital Representation

World realityOptics focus {light} from world on sensorSensor converts {light} to {electrical energy}Signal representation of incident light as continuous electrical energyDigitizer converts continuous signal to discrete signalDigital Rep. final representation of reality in computer memory

Page 12: Image Formation

3D Computer Vision

and Video Computing Factors in Image FormationFactors in Image Formation

n Geometryl concerned with the relationship between points in the

three-dimensional world and their imagesn Radiometry

l concerned with the relationship between the amount of light radiating from a surface and the amount incident at its image

n Photometryl concerned with ways of measuring the intensity of light

n Digitizationl concerned with ways of converting continuous signals

(in both space and time) to digital approximations

Page 13: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 14: Image Formation

3D Computer Vision

and Video Computing GeometryGeometry

n Geometry describes the projection of:

two-dimensional (2D) image plane.

three-dimensional (3D) world

n Typical Assumptionsl Light travels in a straight line

n Optical Axis: the axis perpendicular to the image plane and passing through the pinhole (also called the central projection ray)

n Each point in the image corresponds to a particular direction defined by a ray from that point through the pinhole.

n Various kinds of projections:l - perspective - obliquel - orthographic - isometricl - spherical

Page 15: Image Formation

3D Computer Vision

and Video Computing Basic OpticsBasic Optics

n Two models are commonly used:l Pin-hole cameral Optical system composed of lenses

n Pin-hole is the basis for most graphics and visionl Derived from physical construction of early camerasl Mathematics is very straightforward

n Thin lens model is first of the lens modelsl Mathematical model for a physical lensl Lens gathers light over area and focuses on image plane.

Page 16: Image Formation

3D Computer Vision

and Video Computing Pinhole Camera ModelPinhole Camera Model

n World projected to 2D Imagel Image invertedl Size reducedl Image is diml No direct depth information

n f called the focal length of the lensn Known as perspective projection

Pinhole lens

Optical Axis

f

Image Plane

Page 17: Image Formation

3D Computer Vision

and Video Computing Pinhole camera imagePinhole camera image

Photo by Robert Kosara, [email protected]

http://www.kosara.net/gallery/pinholeamsterdam/pic01.html

Amsterdam

Page 18: Image Formation

3D Computer Vision

and Video Computing Equivalent GeometryEquivalent Geometry

n Consider case with object on the optical axis:

fz

n More convenient with upright image:

- fz

Projection plane z = 0

n Equivalent mathematically

Page 19: Image Formation

3D Computer Vision

and Video Computing

f

IMAGEPLANE

OPTICAXIS

LENS

i o

1 1 1f i o

= + ‘THIN LENS LAW’

Thin Lens ModelThin Lens Model

n Rays entering parallel on one side converge at focal point.n Rays diverging from the focal point become parallel.

Page 20: Image Formation

3D Computer Vision

and Video Computing Coordinate SystemCoordinate System

n Simplified Case:l Origin of world and image coordinate systems coincidel Y-axis aligned with y-axisl X-axis aligned with x-axisl Z-axis along the central projection ray

WorldCoordinateSystem

Image Coordinate System

Z

X

Y

Y

ZX

(0,0,0)

y

x

P(X,Y,Z)p(x,y)

(0,0)

Page 21: Image Formation

3D Computer Vision

and Video Computing Perspective ProjectionPerspective Projection

n Compute the image coordinates of p in terms of the world coordinates of P.

n Look at projections in x-z and y-z planes

x

y

Z

P(X,Y,Z)p(x, y)

Z = 0

Z=-f

Page 22: Image Formation

3D Computer Vision

and Video Computing X-Z ProjectionX-Z Projection

n By similar triangles:

Z- f

X

x

=x

f

X

Z+f

=xfX

Z+f

Page 23: Image Formation

3D Computer Vision

and Video Computing Y-Z ProjectionY-Z Projection

n By similar triangles: =y

f

Y

Z+f

=yfY

Z+f

- f

Z

Y

y

Page 24: Image Formation

3D Computer Vision

and Video Computing Perspective EquationsPerspective Equations

n Given point P(X,Y,Z) in the 3D worldn The two equations:

n transform world coordinates (X,Y,Z)

into image coordinates (x,y)n Question:

l What is the equation if we select the origin of both coordinate systems at the nodal point?

=yfY

Z+f=x

fX

Z+f

Page 25: Image Formation

3D Computer Vision

and Video Computing Reverse ProjectionReverse Projection

n Given a center of projection and image coordinates of a point, it is not possible to recover the 3D depth of the point from a single image.

In general, at least two images of the same point taken from two different locations are required to recover depth.

All points on this linehave image coordi-nates (x,y).

p(x,y)

P(X,Y,Z) can be any-where along this line

Page 26: Image Formation

3D Computer Vision

and Video Computing Stereo GeometryStereo Geometry

n Depth obtained by triangulation

n Correspondence problem: pl and pr must correspond

to the left and right projections of P, respectively.

Object point

CentralProjection

Rays

Vergence Angle

pl

pr

P(X,Y,Z)

Page 27: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 28: Image Formation

3D Computer Vision

and Video Computing RadiometryRadiometry

n Image: two-dimensional array of 'brightness' values.n Geometry: where in an image a point will project.n Radiometry: what the brightness of the point will be.

l Brightness: informal notion used to describe both scene and image brightness.

l Image brightness: related to energy flux incident on the image plane: => IRRADIANCE

l Scene brightness: brightness related to energy flux emitted (radiated) from a surface: => RADIANCE

Page 29: Image Formation

3D Computer Vision

and Video Computing Radiometry & GeometryRadiometry & Geometry

n Goal: Relate the radiance of a surface to the irradiance in the image plane of a simple optical system.

dAi

dAs Lens Diameter d

e

i

F

Page 30: Image Formation

3D Computer Vision

and Video Computing Radiometry Final ResultRadiometry Final Result

n Image irradiance is proportional to:

l Scene radiance Lsl Focal length of lens fl Diameter of lens d

n f/d is often called the f-number of the lens

l Off-axis angle a

E =i sL cos a d-f

2 p4

4

Page 31: Image Formation

3D Computer Vision

and Video Computing Cos a Light FalloffCos a Light Falloff44

x

y

p/2-p/2

-p/2

Lens Center Top view shaded by height

Page 32: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 33: Image Formation

3D Computer Vision

and Video Computing PhotometryPhotometry

n Photometry:Concerned with mechanisms for converting light energy

into electrical energy.

World Optics Sensor

Signal Digitizer

Digital Representation

Page 34: Image Formation

3D Computer Vision

and Video Computing B&W Video SystemB&W Video System

.

OpticsImage Plane

A/D Converterand Sampler

E(x,y) : Electricalvideo signal

Image L(x,y)

VideoCamera

I(i,j) Digital Image

22 34 22 0 18 ¥¥¥

¥¥¥¥¥¥

Grayscale Image Data

Computer Memory

Page 35: Image Formation

3D Computer Vision

and Video Computing Color Video SystemColor Video System

.

Blue ChannelA/D ConverterGreen Channel

A/D Converter

OpticsImage Plane

Digital Image

E(x,y) : Electricalvideo signal

Image L(x,y)

Computer Memory

22 3422 0 18 ¥¥¥

¥¥¥¥¥¥

Red ChannelA/D Converter

VideoCamera

B(i,j)G(i,j)

R(i,j)

Page 36: Image Formation

3D Computer Vision

and Video Computing Color RepresentationColor Representation

n Color Cube and Color Wheel

n For color spaces, please readl Color Cube http://www.morecrayons.com/palettes/webSmart/l Color Wheel http://r0k.us/graphics/SIHwheel.htmll http://www-viz.tamu.edu/faculty/parke/ends489f00/notes/sec1_4.html

R

B

GS

I

H

Page 37: Image Formation

3D Computer Vision

and Video Computing Digital Color CamerasDigital Color Cameras

n Three CCD-chips camerasl R, G, B separately, AND digital signals instead

analog video

n One CCD Camerasl Bayer color filter array

l http://www.siliconimaging.com/RGB%20Bayer.htm

Page 38: Image Formation

3D Computer Vision

and Video Computing Human Eyes & Color PerceptionHuman Eyes & Color Perception

n Visit a cool site with Interactive Java tutorial:l Human Vision and Color Perception

n Another site about human color perception:l Color Vision

Page 39: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 40: Image Formation

3D Computer Vision

and Video Computing DigitizationDigitization

n Digitization: conversion of the continuous (in space and value) electrical signal into a digital signal (digital image)

n Three decisions must be made:l Spatial resolution (how many samples to take)l Signal resolution (dynamic range of values- quantization)l Tessellation pattern (how to 'cover' the image with

sample points)

World Optics Sensor

Signal Digitizer

Digital Representation

Page 41: Image Formation

3D Computer Vision

and Video Computing Digitization: Spatial ResolutionDigitization: Spatial Resolution

n Let's digitize this imagel Assume a square sampling patternl Vary density of sampling grid

Page 42: Image Formation

3D Computer Vision

and Video Computing Spatial ResolutionSpatial Resolution

Coarse Sampling: 20 points per row by 14 rows

Finer Sampling: 100 points per row by 68 rows

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Sam

pli

ng

in

terv

al

Sample picture at each red point

Page 43: Image Formation

3D Computer Vision

and Video Computing Effect of Sampling Interval - 1Effect of Sampling Interval - 1

n Look in vicinity of the picket fence:

Sampling Interval:

100 100 100

100 100 100

100 100 100

100 100 100

100 100 100

100 100 100

100 100 100

100 100 100

40 40 40 40 40 40

40 40 40 40 40 40

40 40 40 40 40 40

40 40 40 40 40 40

White Image! Dark Gray Image!

NO EVIDENCEOF THE FENCE!

Page 44: Image Formation

3D Computer Vision

and Video Computing Effect of Sampling Interval - 2Effect of Sampling Interval - 2

n Look in vicinity of picket fence:

Sampling Interval:

40 100 10040 40

40 100 10040 40

40 100 10040 40

40 100 10040 40

Now we've got a fence!

What's the difference between this attempt and the last one?

Page 45: Image Formation

3D Computer Vision

and Video Computing The Missing Fence FoundThe Missing Fence Found

n Consider the repetitive structure of the fence:

d

s'

s

Sampling Intervals

Case 1: s' = dThe sampling interval is equal to the size of the repetitive structure

NO FENCE

Case 2: s = d/2 The sampling interval is one-half the size of the repetitive structure

FENCE

Page 46: Image Formation

3D Computer Vision

and Video Computing The Sampling TheoremThe Sampling Theorem

n IF: the size of the smallest structure to be preserved is dn THEN: the sampling interval must be smaller than d/2

n Can be shown to be true mathematicallyn Repetitive structure has a certain frequency

l To preserve structure must sample at twice the frequencyl Holds for images, audio CDs, digital television….

n Leads naturally to Fourier Analysis (optional)

Page 47: Image Formation

3D Computer Vision

and Video Computing SamplingSampling

n Rough Idea: Ideal Case

Dirac Delta Function 2D "Comb"

"Continuous Image"

"Digitized Image"

d (x,y) = 0 for x = 0, y= 0

d(x,y) dx dy = 1

f(x,y)d(x-a,y-b) dx dy = f(a,b)

d (x-ns,y-ns) for n = 1….32 (e.g.)

23

s

Page 48: Image Formation

3D Computer Vision

and Video Computing SamplingSampling

n Rough Idea: Actual Casel Can't realize an ideal point function in real equipmentl "Delta function" equivalent has an areal Value returned is the average over this area

23

s

Page 49: Image Formation

3D Computer Vision

and Video Computing Mixed Pixel ProblemMixed Pixel Problem

Page 50: Image Formation

3D Computer Vision

and Video Computing Signal QuantizationSignal Quantization

n Goal: determine a mapping from a continuous signal (e.g. analog video signal) to one of K discrete (digital) levels.

I(x,y) = .1583 volts

= ???? Digitalvalue

Page 51: Image Formation

3D Computer Vision

and Video Computing QuantizationQuantization

n I(x,y) = continuous signal: 0 ≤ I ≤ Mn Want to quantize to K values 0,1,....K-1n K usually chosen to be a power of 2:

n Mapping from input signal to output signal is to be determined.n Several types of mappings: uniform, logarithmic, etc.

K #Levels #Bits2 2 14 4 28 8 316 16 432 32 564 64 6128 128 7256 256 8

Page 52: Image Formation

3D Computer Vision

and Video Computing Choice of KChoice of K

Original

Linear Ramp

K=2 K=4

K=16 K=32

Page 53: Image Formation

3D Computer Vision

and Video Computing Choice of KChoice of K

K=2 (each color)

K=4 (each color)

Page 54: Image Formation

3D Computer Vision

and Video Computing Choice of Function: UniformChoice of Function: Uniform

n Uniform quantization divides the signal range [0-M] into K equal-sized intervals.

n The integers 0,...K-1 are assigned to these intervals.n All signal values within an interval are represented by

the associated integer value.n Defines a mapping:

Qu

an

tiza

tion

Le

vel

3

M

2

1

0

K-1

0Signal Value

¥¥¥

Page 55: Image Formation

3D Computer Vision

and Video Computing Logarithmic QuantizationLogarithmic Quantization

n Signal is log I(x,y).n Effect is:

Qu

an

tiza

tion

Le

vel

3

M

2

1

0

K-1

0

Signal Value

¥¥¥

n Detail enhanced in the low signal values at expense of detail in high signal values.

Page 56: Image Formation

3D Computer Vision

and Video Computing Logarithmic QuantizationLogarithmic Quantization

Original

Logarithmic Quantization

Quantization Curve

Page 57: Image Formation

3D Computer Vision

and Video Computing Tesselation PatternsTesselation Patterns

32

Hexagonal Triangular

Rectangular Typical

Page 58: Image Formation

3D Computer Vision

and Video Computing Lecture OutlineLecture Outline

n Image Formation Basic Stepsn Geometry

l Pinhole camera model & Thin lens modell Perspective projection & Fundamental equation

n Radiometryn Photometry

l Color, human vision, & digital imagingn Digitalization

l Sampling, quantization & tessellationsn More on Digital Images

l Neighbors, connectedness & distances

Page 59: Image Formation

3D Computer Vision

and Video Computing Digital GeometryDigital Geometry

n Neighborhoodn Connectednessn Distance Metrics

Picture Element or Pixel

Pixel value I(I,j) =0,1 Binary Image0 - K-1 Gray Scale ImageVector: Multispectral Image

32

I(i,j) (0,0)

i

j

Page 60: Image Formation

3D Computer Vision

and Video Computing Connected ComponentsConnected Components

n Binary image with multiple 'objects'n Separate 'objects' must be labeled individually

6 Connected Components

Page 61: Image Formation

3D Computer Vision

and Video Computing Finding Connected ComponentsFinding Connected Components

n Two points in an image are 'connected' if a path can be found for which the value of the image function is the same all along the path.

P1

P2

P3

P4

P1 connected to P2

P3 connected to P4

P1 not connected to P3 or P4

P2 not connected to P3 or P4

P3 not connected to P1 or P2

P4 not connected to P1 or P2

Page 62: Image Formation

3D Computer Vision

and Video Computing AlgorithmAlgorithm

n Pick any pixel in the image and assign it a labeln Assign same label to any neighbor pixel with the

same value of the image functionn Continue labeling neighbors until no neighbors can be

assigned this labeln Choose another label and another pixel not already

labeled and continuen If no more unlabeled image points, stop.

Who's my neighbor?

Page 63: Image Formation

3D Computer Vision

and Video Computing ExampleExample

Lab. Im. - 4th Component Final Labeling

Image 'Label' Image

Lab. Im. - 1st Component Lab. Im. - 2nd Component Lab. Im. - 3rd Component

Page 64: Image Formation

3D Computer Vision

and Video Computing NeighborNeighbor

n Consider the definition of the term 'neighbor'n Two common definitions:

n Consider what happens with a closed curve.n One would expect a closed curve to partition the

plane into two connected regions.

Four Neighbor Eight Neighbor

Page 65: Image Formation

3D Computer Vision

and Video ComputingAlternate Neighborhood DefinitionsAlternate Neighborhood Definitions

Neither neighborhood definition satisfactory!

4-neighborconnectedness

8-neighborconnectedness

Page 66: Image Formation

3D Computer Vision

and Video Computing Possible SolutionsPossible Solutions

n Use 4-neighborhood for object and 8-neighborhood for backgroundl requires a-priori knowledge about which pixels are

object and which are backgroundn Use a six-connected neighborhood:

Page 67: Image Formation

3D Computer Vision

and Video Computing Digital DistancesDigital Distances

n Alternate distance metrics for digital images

i

m

n

j

i

m

n

j

i

m

n

j

Euclidean Distance City Block Distance Chessboard Distance

= (i-n) 2 + (j-m) 2 = |i-n| + |j-m| = max[ |i-n|, |j-m| ]

Page 68: Image Formation

3D Computer Vision

and Video Computing NextNext

Next:Feature Extraction

n Homework #1 online, Due Feb 22 before class