Вы находитесь на странице: 1из 76

Contents

This lecture will cover:


The human visual system Light and the electromagnetic spectrum Image representation Image sensing and acquisition Sampling, quantisation and resolution

Human Visual System


The best vision model we have! Knowledge of how images form in the eye can help us with processing digital images We will take just a whirlwind tour of the human visual system

Structure Of The Human Eye


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

The lens focuses light from objects onto the retina The retina is covered with light receptors called cones (6-7 million) and rods (75-150 million) Cones are concentrated around the fovea and are very sensitive to colour Rods are more spread out and are sensitive to low levels of illumination

Optics Review:

The EYE

Optics Review:
Farsightedness lens too flat, the image produced by the lens is too far past the retina Correction use a convex lens to converge the image on the retina

The EYE and Lenses

Optics Review:
The EYE Eyelash Retina Lens iris Ciliary muscles Optic Nerve

The EYE

The Camera Lens cap Film / chip Lens Diaphragm Focus ring USB cable

Image Formation In The Eye


Muscles within the eye can be used to change the shape of the lens allowing us focus on objects that are near or far away An image is focused onto the retina causing rods and cones to become excited which ultimately send signals to the brain

Brightness Adaptation & Discrimination


The human visual system can perceive approximately 1010 different light intensity levels However, at any one time we can only discriminate between a much smaller number brightness adaptation Similarly, the perceived intensity of a region is related to the light intensities of the regions surrounding it

Brightness Adaptation & Discrimination (cont)


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

An example of Mach bands

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Brightness Adaptation & Discrimination (cont)

Light And The Electromagnetic Spectrum


Light is just a particular part of the electromagnetic spectrum that can be sensed by the human eye The electromagnetic spectrum is split up according to the wavelengths of different forms of energy

Electromagnetic Radiation is a spectrum of wave energies and includes VISIBLE light


Waves have WAVELENGTH (), FREQUENCY(), and AMPLITUDE (A)

From shortest to greatest frequency


(least energy --------------------------------------------------------- most energy)

Radio Micro Infrared VIS UV X-Rays Gamma Rays Longest ----------------------------------------------- shortest

RadioWaves
TV, radio, cell phones

Microwaves
Microwave ovens cooking food Telecommunications

Infrared
Remote controls Thermal imaging

UV
Tanning (also causes sun burns and skin damage) Heating lamps fast food, spas

X-Rays
Doctors and dentists use to see bones/teeth

Gamma Rays
Doctors use to target and kill cancer cells

Reflected Light
The colours that we perceive are determined by the nature of the light reflected from an object For example, if white light is shone onto a green object most wavelengths are Colours Absorbed absorbed, while green light is reflected from the object

Sampling, Quantisation And Resolution


In the following slides we will consider what is involved in capturing a digital image of a real-world scene
Image sensing and representation Sampling and quantisation Resolution

Image Representation
Before we discuss image acquisition recall that a digital image is composed of M rows and N columns of pixels col each storing a value Pixel values are most often grey levels in the range 0-255(black-white) We will see later on that images can easily be represented as f (row, col) matrices
row
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Sensing arrangement

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Single imaging sensor

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Linear sensor strip

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image acquisition process

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Definitions
Images generated from a physical process,

0 < f (x, y) < f (x, y) = i(x, y)r(x, y) 0 < i(x, y) < 0 < r(x, y) <1
2002 R. C. Gonzalez & R. E. Woods

Characterized by two components: illumination and reflectance (transmittance)

Some Typical Ranges of Reflectance

Reflectance
0.01 for black velvet
0.65 for stainless steel

0.80 for flat-white wall paint


0.90 for silver-plated metal 0.93 for snow
Lecture # 2 12

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Definitions

Radiance is the total amount of energy that flows from a light source Luminance is a measure of the amount of energy an observer perceives from a light source Brightness is a subjective descriptor of light perception

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation

projection through lens


image of object

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation

projection onto discrete sensor array.

digital camera

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation

sensors register average color.

sampled image

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation

continuous colors, discrete locations.

discrete realvalued image


by Richard Alan Peters II

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Image formation: Quantization

continuous colors mapped to a finite, discrete set of colors.

continuous color input


by Richard Alan Peters II
2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Sampling and quantization

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixels

A digital image, I, is a mapping from a 2D grid of uniformly spaced discrete points, {p = (r,c)}, into a set of positive integer values, {I( p)}.

At each column location in each row of I there is a value. The pair ( p, I( p) ) is called a pixel (for picture element).

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixels

p = (r,c) is the pixel location indexed by row, r, and column, c. I( p) = I(r,c) is the value of the pixel at location p. If I( p) is a single number then I is monochrome. If I( p) is a vector (ordered list of numbers) then I has multiple bands (e.g., a color image).

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixels

Pixel Location: p = (r , c) Pixel Value: I(p) = I(r , c)


by Richard Alan Peters II
2002 R. C. Gonzalez & R. E. Woods

Pixel : [ p, I(p)]

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixels Pixel : [ p, I(p)]

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Spatial and gray level resolution

Resolution refer to the smallest discernible change M x Nspatial resolution Lgray level resolution

2002 R. C. Gonzalez & R. E. Woods

Spatial and intensity resolution


Spatial resolution -smallest discernible detail in an image and also on how sampling was carried out.

Line pairs per unit distance or dots (pixels)per unit distance (dpi)

Eg., 100 line pairs per mm Newspapers75 dpi, magazines133dpi, this book page - 2400 dpi Spatial resolution with respect to spatial units

Intensity Level Resolution


Intensity level resolution refers to the number of intensity levels used to represent the image
The more intensity levels used, the finer the level of detail discernable in an image Intensity level resolution is usually given in terms of the number of bits used to store each intensity level
Number of Bits 1 2 Number of Intensity Levels 2 4 Examples 0, 1 00, 01, 10, 11

4
8 16

16
256 65,536

0000, 0101, 1111


00110011, 01010101 1010101010101010

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Spatial Resolution (cont)

Images at 1250, 300, 150 and 72 dpi

Lower intensity resolution results in false contouring and checker boards. Example Fig. 2.21 Images of size 256x256 pixels with 64 intensity levels and printed on a size format of 5 x 5 cm have lowest acceptable spatial and intensity resolution.

Image at 128, 64 and 32 intensity levels

Resolution: How Much Is Enough?


The big question with resolution is always how much is enough?
This all depends on what is in the image and what you would like to do with it Key questions include
Does the image look aesthetically pleasing? Can you see what you need to see within the image?

Intensity Level Resolution (cont)


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Low Detail

Medium Detail

High Detail

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Intensity Level Resolution (cont)

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Intensity Level Resolution (cont)

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Intensity Level Resolution (cont)

Effects of varying N and k simultaneously


Subjective study using images in Fig. 2.22 with varying N and k Subjects were asked to rank them according to subjective quality Isopreference curvespoints on the curve correspond to equal subjective quality Curves tend to be vertical as detail in image increases Images with a large amount of detail require only few intensity levels

Isopreference curves
Isopreference curves (ranking of subjective quality by naked eyes)points lying on an isopreference curve correspond to images of equal subjective quality (increasing subjective quality from left to right).

Image Interpolation
Introduction
What is image interpolation? Why do we need it?

Interpolation Techniques

Nearest Neighbor Interpolation Bilinear Interpolation Bicubic interpolation Digital zooming (resolution enhancement) Image inpainting (error concealment) Geometric transformations (where your imagination can fly)

Interpolation Applications

EE465: Introduction to Digital Image Processing

52

Introduction
What is image interpolation?
An image f(x,y) tells us the intensity values at the integral lattice locations, i.e., when x and y are both integers Image interpolation refers to the guess of intensity values at missing locations, i.e., x and y can be arbitrary Note that it is just a guess (Note that all sensors have finite sampling distance)

EE465: Introduction to Digital Image Processing

53

Engineering Motivations
Why do we need image interpolation?
We want BIG images
When we see a video clip on a PC, we like to see it in the full screen mode

We want GOOD images


If some block of an image gets damaged during the transmission, we want to repair it

We want COOL images


Manipulate images digitally can render fancy artistic effects as we often see in movies

EE465: Introduction to Digital Image Processing

54

Linear Interpolation Formula


Heuristic: the closer to a pixel, the higher weight is assigned Principle: line fitting to polynomial fitting (analytical formula) f(n)

f(n+a)

f(n+1)

1-a

f(n+a)=(1-a)f(n)+af(n+1), 0<a<1

Note: when a=0.5, we simply have the average of two

EE465: Introduction to Digital Image Processing

55

Example

Enlarge image of size 500x500 pixels to 750x750 Pixels Nearest neighbor interpolationmake an overlay of 750x750 pixels and assign values to points from closest pixel in the original image Causes artifactsdistortion of straight edges

Nearest neighbor interpolation is the simplest method and basically makes the pixels bigger. The color of a pixel in the new image is the color of the nearest pixel of the original image. If you enlarge 200%, one pixel will be enlarged to a 2 x 2 area of 4 pixels with the same color as the original pixel. Most image viewing and editing software use this type of interpolation to enlarge a digital image for the purpose of closer examination because it does not change the color information. For the same reason, it is not suitable to enlarge photographic images because it increases the visibility of jaggies.

Bilinear Interpolation

Bilinear Interpolation determines the value of a new pixel based on a weighted average of the 4 pixels in the nearest 2 x 2 neighborhood of the pixel in the original image. The averaging has an anti-aliasing effect and therefore produces relatively smooth edges with hardly any jaggies.

Bilinear Interpolation

Bicubic interpolation

Bicubic interpolation is more sophisticated and produces smoother edges than bilinear interpolation. Notice for instance the smoother eyelashes in the example below. Here, a new pixel is a bicubic function using 16 pixels in the nearest 4 x 4 neighborhood of the pixel in the original image. This is the method most commonly used by image editing software, printer drivers and many digital cameras for resampling images.

Basic Relationships Between Pixels Neighborhood Adjacency Connectivity Paths Regions and boundaries

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixel neighborhood

4-neighbors (N4) Diagonal neighbors 8-neighbors

(x-1 ,y) (x,y-1) (x, y) (x+1,y) (x,y+1)

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixel neighborhood

4-neighbors Diagonal neighbors (ND) 8-neighbors

(x-1, y-1)
(x, y) (x+1, y1)

(x-1, y+1)
(x+1, y+1)

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixel neighborhood

4-neighbors Diagonal neighbors 8-neighbors (N8)

(x-1, y-1)
(x,y-1) (x+1, y-1)

(x-1 ,y)
(x, y) (x+1,y)

(x-1, y+1)
(x,y+1) (x+1, y+1)

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Connectivity of pixels

Two pixels are connected if they are neighbors and their gray levels satisfy a specified criterion of similarity

0
1 0

1
1 1

1
0 0

2002 R. C. Gonzalez & R. E. Woods

Basic Relationships Between Pixels


Adjacency

Let V be the set of intensity values


4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set N 4 (p). 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set N 8 (p).

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Pixel adjacency
Two pixels p and q with values from a set V are 4-adjacent if q is in the set N4(p)

4-adjacency 8-adjacency m-adjacency

Two pixels p and q with values from a set V are said to be mixed (m) adjacent if (1) if q is in the set N4(p) or (2) q is in the set ND(p) and the set N4(p) N4(q) has no pixels whose values are from V

2002 R. C. Gonzalez & R. E. Woods

Basic Relationships Between Pixels Path A (digital) path (or curve) from pixel p with coordinates (x 0 , y 0 ) to pixel q with coordinates (x n , y n ) is a sequence of distinct pixels with coordinates (x 0 , y 0 ), (x 1 , y 1 ), , (x n , yn ) Where (x i , y i ) and (x i-1 , y i-1 ) are adjacent for 1 i n. Here n is the length of the path. If (x 0 , y 0 ) = (x n , y n ), the path is closed path. We can define 4-, 8-, and m-paths based on the type of adjacency used.

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Path or curve

Find the length of shortest 4, 8, m-path between p and q if V={0,1} Repeat for V={1,2}

3 2 1 1(p)

1 2 2 0

2 0 1 1

1(q) 2 1 2

2002 R. C. Gonzalez & R. E. Woods

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Connected component / set

Two pixels p and q in S (S is a subset of pixels in an image) are connected if there exist a path between them consisting entirely of pixels from S For any pixel p in S, the set pixels that are connected to it in S is called a connected component If S has one connected component then set S is called connected set

2002 R. C. Gonzalez & R. E. Woods

Examples: Adjacency and Path


V = {1, 2}

0 1 1 0 2 0 0 0 1

0 1 1 0 2 0 0 0 1

0 1 1 0 2 0 0 0 1

Lecture # 2

42

Examples: Adjacency and Path


V = {1, 2}

0 1 1 0 2 0 0 0 1

0 1 1 0 2 0 0 0 1
8-adjacent

0 1 1 0 2 0 0 0 1

Lecture # 2

43

Examples: Adjacency and Path


V = {1, 2}

0 1 1 0 2 0 0 0 1

0 1 1 0 2 0 0 0 1
8-adjacent

0 1 1 0 2 0 0 0 1
m-adjacent

Lecture # 2

44

Examples: Adjacency and Path


V = {1, 2}

0 1 1 0 2 0 0 0 1
1,1 1,2 2,1 2,2 3,1 3,2

1,3

2,3

3,3

0 1 1 020 001
8-adjacent

0 1 1 020 001
m-adjacent
The m-path from (1,3) to (3,3):
(1,3), (1,2), (2,2), (3,3)

The 8-path from (1,3) to (3,3):


(i) (1,3), (1,2), (2,2), (3,3) (ii) (1,3), (2,2), (3,3)

Lecture # 2

45

Digital Image Processing, 2nd ed.

www.imageprocessingbook.com

Color sensing / color perception

The eye has 3 types of photoreceptors: sensitive to red, green, or blue light.

The brain transforms RGB into separate brightness and color channels (e.g., LHS).
brain photo receptors

by Richard Alan Peters II


2002 R. C. Gonzalez & R. E. Woods

Elements of Visual Perception


Optical illusion

76

Вам также может понравиться