You are on page 1of 55

Chapter 2.

Digital Image Fundamentals

1. Image Sensing and Acquisition


2. Image Sampling and Quantization
3. Some Basic Relationships Between Pixels
4. Basic Mathematical Tools Used in Digital Image Processing

2
1. Image Sensing and Acquisition

❖Image Sensing and Acquisition

(a) Single sensing element

(b) Line sensor

(c) Array sensor

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 3


1. Image Sensing and Acquisition

❖Image Acquisition Using a Single Sensing Element

Combining a single sensing element with mechanical motion to generate a 2-D image.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 4
1. Image Sensing and Acquisition

❖Image Acquisition Using Sensor Strips

(a) Image acquisition


using a linear sensor strip

(b) Image acquisition using


a circular sensor strip 5
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
1. Image Sensing and Acquisition

❖Image Acquisition Using Sensor Arrays

An example of digital image acquisition. (a) Illumination


(energy) source. (b) A scene. (c) Imaging system. (d)
Projection of the scene onto the image plane. (e)
Digitized image.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 6


1. Image Sensing and Acquisition

❖A Simple Image Formation Model


➢ We denote images by two-dimensional functions of the form f(x, y)
f(x, y) = i(x, y) r(x, y)
• i(x, y): the amount of source illumination incident on the scene being viewed
• r(x, y): the amount of illumination reflected by the objects in the scene

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 7


Chapter 2. Digital Image Fundamentals

1. Image Sensing and Acquisition


2. Image Sampling and Quantization
3. Some Basic Relationships Between Pixels
4. Basic Mathematical Tools Used in Digital Image Processing

8
2. Image Sampling and Quantization

❖Basic Concepts in Sampling and Quantization


➢ Digitizing the coordinate values is called sampling. Digitizing the amplitude
values is called quantization.

(a) Continuous image. (b) A scan line


showing intensity variations along line
AB in the continuous image. (c)
Sampling and quantization. (d) Digital
scan line. (The black border in (a) is
included for clarity. It is not part of the
image).

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 9


2. Image Sampling and Quantization

❖Basic Concepts in Sampling and Quantization

(a) Continuous image projected (b) Result of image sampling


onto a sensor array and quantization
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 10
2. Image Sampling and Quantization

❖Representing Digital Images

(a) Image plotted as a surface. (b)


Image displayed as a visual intensity
array. (c) Image shown as a 2-D
numerical array. (The numbers 0, .5,
and 1 represent black, gray, and
white, respectively.)

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 11


2. Image Sampling and Quantization

❖Representing Digital Images

Coordinate convention used to


represent digital images.
Because coordinate values are
integers, there is a one-to-one
correspondence between x and
y and the rows (r) and columns
(c) of a matrix.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 12


2. Image Sampling and Quantization

❖Representing Digital Images

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 13


2. Image Sampling and Quantization

❖Representing Digital Images


➢ The number of intensity levels: L

where k is an integer.

➢ The discrete levels are equally spaced and that they are integers in the range
[0, L-1]

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 14


2. Image Sampling and Quantization

❖Representing Digital Images


➢ The number, b, of bits required to store a digital image is

➢ When M = N:

Number of megabytes
required to store
images for various
values of N and k

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 15


2. Image Sampling and Quantization

❖Linear vs. Coordinate Indexing


➢ coordinate indexing or subscript indexing (x, y) vs linear indexing ()

Illustration of column scanning for generating linear indices. Shown are several
2-D coordinates (in parentheses) and their corresponding linear indices.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 16
2. Image Sampling and Quantization

❖Spatial and Intensity Resolution


➢ Spatial resolution is a measure of the
smallest discernible detail in an image.
➢ Dots per unit distance is a measure of
image resolution used in the printing and
publishing industry. In the U.S., this
measure usually is expressed as dots per
inch (dpi).
➢ Intensity resolution is the number of bits
used to quantize intensity.

Effects of reducing spatial resolution. The images shown


are at: (a) 930 dpi, (b) 300 dpi, (c) 150 dpi, and (d) 72 dpi.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 17
2. Image Sampling and Quantization

❖Spatial and Intensity Resolution

(a) 256-level image. (b)-(d) Image displayed in 128, 64, and 32 intensity levels, while keeping the image
size constant. (e)-(h) Image displayed in 16, 8, 4, and 2 intensity levels.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 18
2. Image Sampling and Quantization

❖Spatial and Intensity Resolution

(a) Image with a low level of detail. (b) Image with a medium level of detail. (c) Image with a
relatively large amount of detail.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 19
2. Image Sampling and Quantization

❖Spatial and Intensity Resolution


➢ Observe that isopreference curves tend
to become more vertical as the detail in
the image increases. Representative
isopreference
➢ This result suggests that for images with curves for the
a large amount of detail only a few three types of
images
intensity levels may be needed.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 20


2. Image Sampling and Quantization

❖Image Interpolation
➢ Interpolation is the process of using known data to estimate values at unknown
locations.
➢ Nearest neighbor interpolation
➢ Bilinear interpolation
➢ Bicubic interpolation

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 21


2. Image Sampling and Quantization

❖Image Interpolation

(a) Image reduced to 72 dpi and zoomed back to its original 930 dpi using nearest neighbor
interpolation. (b) Image reduced to 72 dpi and zoomed using bilinear interpolation. (c) Same as
(b) but using bicubic interpolation.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 22


Chapter 2. Digital Image Fundamentals

1. Image Sensing and Acquisition


2. Image Sampling and Quantization
3. Some Basic Relationships Between Pixels
4. Basic Mathematical Tools Used in Digital Image Processing

23
3. Some Basic Relationships Between Pixels

❖Neighbors of a Pixel
➢ A pixel p at coordinates (x, y)
➢ N4(p): 4-neighbors of p

➢ ND(p): 4 diagonal neighbors of p

➢ N8(p): N4(p) together with ND(p)

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 24


3. Some Basic Relationships Between Pixels

❖Adjacency
➢ Let V be the set of intensity values used to define adjacency.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 25


3. Some Basic Relationships Between Pixels

❖Adjacency
➢ V = {1}

(a) An arrangement of pixels. (b) Pixels that are 8-adjacent (adjacency is shown by dashed lines). (c) m-
adjacency. (d) Two regions (of 1’s) that are 8-adjacent. (e) The circled point is on the boundary of the 1-valued
pixels only if 8-adjacency between the region and background is used. (f) The inner boundary of the 1-valued
region does not form a closed path, but its outer boundary does.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 26


3. Some Basic Relationships Between Pixels

❖Connectivity
➢ A digital path (or curve) from pixel p with coordinates (x0, y0) to pixel q with
coordinates (xn, yn) is a sequence of distinct pixels with coordinates:

n is the length of the path

➢ If (x0, y0) = (xn, yn) the path is a closed path.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 27


3. Some Basic Relationships Between Pixels

❖Connectivity
Let S represent a subset of pixels in an image.
➢ Two pixels p and q are said to be connected in S if there exists a path between
them consisting entirely of pixels in S.
➢ The set of pixels that are connected to p in S is called a connected component of
S.
➢ If it only has one component, and that component is connected, then S is called a
connected set.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 28


3. Some Basic Relationships Between Pixels

❖Regions
Let R represent a subset of pixels in an image.
➢ We call R a region of the image if R is a connected set.
➢ Two regions, Ri and Rj are said to be adjacent if their union forms a connected
set.
➢ Regions that are not adjacent are said to be disjoint.
➢ Foreground: the union of all the K disjoint regions (Ru)
➢ Background: the complement of the set Ru: (Ru)c

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 29


3. Some Basic Relationships Between Pixels

❖Regions

background

foreground

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 30


3. Some Basic Relationships Between Pixels

❖Boundaries
➢ The boundary (also called the border or contour) of a region R is the set of pixels
in R that are adjacent to pixels in the complement of R.

Boundary >< Edge

closed paths intensity discontinuities

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 31


3. Some Basic Relationships Between Pixels

❖Distance Measures
➢ For pixels p, q, and s, with coordinates (x, y), (u, v), and (w, z), respectively, D is a
distance function or metric if:

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 32


3. Some Basic Relationships Between Pixels

❖Distance Measures
➢ The Euclidean distance between p and q is defined as:

The distance D4, (city-block distance) The distance D8, (chessboard distance)

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 33


Chapter 2. Digital Image Fundamentals

1. Image Sensing and Acquisition


2. Image Sampling and Quantization
3. Some Basic Relationships Between Pixels
4. Basic Mathematical Tools Used in Digital Image Processing

34
4. Basic Mathematical Tools Used in Digital Image Processing

❖Elementwise Versus Matrix Operations


➢ An elementwise operation involving one or more images is carried out on a pixel-
by-pixel basis.
➢ The elementwise product of these two images is

➢ The matrix product of the images

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 35


4. Basic Mathematical Tools Used in Digital Image Processing

❖Linear Versus Nonlinear Operations


➢ Consider a general operator, H, that produces an output image, g(x, y), from a
given input image, f(x, y):

➢ H is said to be a linear operator if

➢ An operator that fails to satisfy above equation is said to be nonlinear.


Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 36
4. Basic Mathematical Tools Used in Digital Image Processing

❖Arithmetic Operations
➢ Arithmetic operations between two images f(x, y) and g(x, y)

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 37


4. Basic Mathematical Tools Used in Digital Image Processing

❖Arithmetic Operations Using image addition (averaging) for noise reduction

(a) Sample noisy


image of the
Sombrero Galaxy.
(b)-(f) Result of
averaging 10, 50,
100, 500, and 1,000
noisy images,
respectively. All
images are of size
pixels, and all were
scaled so that their
intensities would
span the full [0, 255]
intensity scale.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 38


4. Basic Mathematical Tools Used in Digital Image Processing

❖Arithmetic Operations Comparing images using subtraction.

(a) Infrared image of the Washington, D.C. area. (b) Image resulting from setting to zero the least significant
bit of every pixel in (a). (c) Difference of the two images, scaled to the range [0, 255] for clarity.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 39


4. Basic Mathematical Tools Used in Digital Image Processing

❖Basic Set Operations

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 40


4. Basic Mathematical Tools Used in Digital Image Processing

❖Basic Set Operations

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 41


4. Basic Mathematical Tools Used in Digital Image Processing

❖Basic Set Operations

Set operations involving


grayscale images. (a) Original
image. (b) Image negative
obtained using grayscale set
complementation. (c) The
union of image (a) and a
constant image.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 42


4. Basic Mathematical Tools Used in Digital Image Processing

❖Logical Operations

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 43


4. Basic Mathematical Tools Used in Digital Image Processing

❖Logical Operations

Illustration of logical
operations involving
foreground (white) pixels.
Black represents binary
0’s and white binary 1’s.
The dashed lines are
shown for reference only.
They are not part of the
result.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 44


4. Basic Mathematical Tools Used in Digital Image Processing

❖Single-Pixel Operations

(a) An 8-bit image. (b) Intensity transformation function used to obtain the digital equivalent of a “photographic”
negative of an 8-bit image. The arrows show transformation of an arbitrary input intensity value into its
corresponding output value (c) Negative of (a), obtained using the transformation function in (b).

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 45


4. Basic Mathematical Tools Used in Digital Image Processing

❖Neighborhood Operations

Local averaging using neighborhood processing. The


procedure is illustrated in (a) and (b) for a rectangular
neighborhood. (c) An aortic angiogram. (d) The result of
using Eq. (2) with m = m = 41. The images are of size
790 x 686 pixels.

(2)

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 46


4. Basic Mathematical Tools Used in Digital Image Processing

❖Geometric Transformations

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 47


4. Basic Mathematical Tools Used in Digital Image Processing

❖Geometric Transformations

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 48


4. Basic Mathematical Tools Used in Digital Image Processing

❖Geometric Transformations

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 49


4. Basic Mathematical Tools Used in Digital Image Processing

❖Geometric Transformations

(a) A 541 x 421 image of the letter T. (b)


Image rotated -210 using nearest-neighbor
interpolation for intensity assignments. (c)
Image rotated -210 using bilinear
interpolation. (d) Image rotated -210 using
bicubic interpolation. (e)-(h) Zoomed
sections (each square is one pixel, and the
numbers shown are intensity values).

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 50


4. Basic Mathematical Tools Used in Digital Image Processing

❖Geometric Transformations

(a) A digital image. (b) Rotated image (note the


counterclockwise direction for a positive angle of
rotation). (c) Rotated image cropped to fit the same
area as the original image. (d) Image enlarged to
accommodate the entire rotated image.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 51


4. Basic Mathematical Tools Used in Digital Image Processing

❖Image Registration

Image registration. (a) Reference image. (b) Input


(geometrically distorted image). Corresponding tie
points are shown as small white squares near the
corners. (c) Registered (output) image (note the errors
in the border). (d) Difference between (a) and (c),
showing more registration errors.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 52


4. Basic Mathematical Tools Used in Digital Image Processing

❖Vector and Matrix Operations

Forming a vector from corresponding pixel values in three RGB component images.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 53
4. Basic Mathematical Tools Used in Digital Image Processing

❖Image Transforms
➢ 2-D linear transforms

➢ Inverse transform

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 54


4. Basic Mathematical Tools Used in Digital Image Processing

❖Image Transforms

General approach for working in the linear transform domain.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 55


4. Basic Mathematical Tools Used in Digital Image Processing

❖Image Transforms

(a) Image corrupted by sinusoidal


interference. (b) Magnitude of the Fourier
transform showing the bursts of energy
caused by the interference (the bursts
were enlarged for display purposes). (c)
Mask used to eliminate the energy bursts.
(d) Result of computing the inverse of the
modified Fourier transform.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 56

You might also like