No Slide Title

Download Report

Transcript No Slide Title

Digital Image Processing
Chapter 2
Chapter 2: Digital Image Fundamentals

Digital image processing is based on


Mathematical and probabilistic models
Human intuition and analysis


Resolution
Adaptation
2.2 Light and the EM Spectrum

Light is a particular type of EM radiation that
can be seen by human eye.


Green object reflect light with wavelengths primarily
in 500 to 570 nm range.
Chromatic light spans EM spectrum from 0.43
m(violet) to 0.79 m(red).



Radiance: energy in Watt.
Luminance: in lumens(lm), the amount of energy the
observer perceives.
Brightness: subjective description of light perception.
Chapter 2: Digital Image Fundamentals
A single sensor
A sensor strip
In flat bed scanners
A sensor array
In digital cameras
2.4 Image Sampling and Quantization


To acquire digital images from the continuous sensed
data f(x, y):
 Digitization in coordinate values: Sampling
 Digitization in amplitude values: Quantization.
The resulting image has M rows and N columns as
 f (0,0)
 f (1,0)

f ( x, y )  


 f ( M  1,0)
f (0,1)
f (1,1)
f ( M  1,1)
f (0, N  1) 
f (1, N  1) 



f ( M  1, N  1)

The digitization process requires to determine
the M, N, and L.



Dynamic range: the range of values spanned
by the gray scale, [Lmin, Lmax].


M and N: spatial resolution
L: gray-level resolution
L = 2k. L = gray-level
High dynamic range = high contrast image
The number of bits required to store the
image
b = M  N  k or
b = N2  k
•Spatial resolution is the smallest discernible detail
in an image.
• line pair width = 2W (line width + space)
• No. of line pairs per unit distance = 1 / 2W
• Resolution is the smallest number of
discernible line pairs per unit distance.
Gray-level resolution refers to the smallest
discernible change in gray level (subjective).
Example of false contouring
2.4.4 Aliasing and Moire Patterns



Band-limited function: the highest frequency is
finite and the function is of unlimited duration
Undersampling – aliasing.
Aliasing frequencies



Sampling rate: the number of samples taken per unit
distance
Reduce high frequency component prior to
sampling.
Moire Pattern is caused by a break-up of the
periodicity, i.e., images are scanned from a
printed page, which consists of periodic ink
dots.
2.4.4 Aliasing and Moire Pattern


Aliasing occurs when a signal is sampled at a less than twice the highest
frequency present in the signal.
The following figure shows if a signal is sampled at regular time intervals
that are slightly less often than once per period of the original signal.

The blue curve is the original signal, and the red dots indicate the sampled values.
資料來源:http://www.wfu.edu/~matthews/misc/DigPhotog/alias/index.html
Aliasing


The red dots are what are recorded, since they represent the
signal values at the times the signal is sampled.
The pattern of the red dots is a terrible representation of the
signal. The red sampled data looks like a sine wave at about
one-tenth the frequency of the original!

This is aliasing.
資料來源:http://www.wfu.edu/~matthews/misc/DigPhotog/alias/index.html
Moire Pattern
2.4.5 Zooming and Shrinking Digital Images

Zooming:
 Create a new pixel location.
 Assign a gray-level to those new locations

Nearest neighbor interpolation

Pixel replication: a checkboard effect
Bilinear interpolation using four nearest neighbors
 v(x’, y’)=ax’+by’+cx’y’+d
 where a, b, c, and d are determined from the gray-level of the
four neighbors.
Higher-order non-linear interpolation: using more neighbors for
interpolation


2.4.5 Zooming and Shrinking Digital Images

Proof
2.4.5 Zooming and Shrinking Digital Images

Shrinking:
 Direct shrinking causes aliasing
 Expansion then Shrinking: blurring the image before shrinking it
and reduce aliasing.
a checkboard effect
2.5 Basic Relations between Pixels

Neighbors of a pixel
 Horizontal and vertical neighbors.


Four diagonal neighbors: ND(p)






(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
4-neighbors of p: N4(p).
8-neighbors of p: N8(p).


(x+1, y), (x-1, y), (x, y+1), (x, y-1)
N8(p) = N4(p) ∪ ND(p)
Adjacency
Connectivity
Regions
Boundary
Relations between Pixels

Adjacency
p
4-adjacency:
N4(p)
p
8-adjacency: N4(p)
∪N (p)
D
• 4-adjacency: if q is in the set N4(p).
• 8-adjacency: if q is in the set N8(p).
• m-adjacency: if
– if q is in the set N4(p), or
– if q is in the set ND(p) and the set N4(p)∩N4(q) has no
pixels whose values are from V.
m-Adjacency

A mixed adjacency combines 4- and 8-adjacency to avoid
the ambigities.
Multiple 8-adjacency
m-adjacency
Two pixels p and q are m-adjacent if
(i) q is in N4(p) or,
(ii)q is in ND(p) and N4(p)∩ N4(q) has no pixel.
Connectivity

Path:



(x0, y0), (x1, y1), …, (xn, yn) where (xi, yi) and (xi+1, yi+1) are
adjacent.
Closed path: (xn, yn) = (x0, y0)
Connectivity:


Two pixels are said connected if they have the same value and there is a
path between them.
If a S is a set of pixels,


For any pixel p in S, the set of pixels that are connected to it is called a
connected component of S.
If S has only one connected component, S is called a connected set.
Regions


R is a region if R is a connected set.
The pixel in the boundary (contour) has at least one 4adjacent neighbor whose value is 0.

Distance measures


Euclidean distance
City-block distance or D4 distance.
D4(p, q)= |x - s | + |y - t |

D8 distance or chessboard distance.
2
2 1 2
2 1 0 1 2
2 1 2
2
D8(p, q)= max (|x - s |, | y - t |)
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2