Lecture 02 DIP Fall 2019
Lecture 02 DIP Fall 2019
Engr Dr Muhammad
Image Processing Jamil Khan
Objectives
❑Understand some important functions and limitations of human vision.
❑Be familiar with the electromagnetic energy spectrum, including basic
properties of light.
❑Know how digital images are generated and represented.
❑Understand the basics of image sampling and quantization.
❑Be familiar with spatial and intensity resolution and their effects on
image appearance.
❑Understand basic geometric relationships between image pixels.
❑Be familiar with the principal mathematical tools used in digital image
processing.
❑Be able to apply a variety of introductory digital image processing
techniques
Human Visual System
The eye is nearly a sphere (with a diameter
of about 20 mm) enclosed by three
membranes:
◼ Cornea and Sclera outer cover
◼ Choroid
◼ Retina
The cornea is a tough, transparent tissue
that covers the anterior surface of the eye.
Continuous with the cornea, the sclera is an
opaque membrane that encloses the
remainder of the optic globe.
Human Visual System
The amount of light entering the eye is
controlled by the pupil, which dilates and
contracts accordingly. The cornea and lens,
whose shape is adjusted by the ciliary
body, focus the light on the retina, where
receptors convert it into nerve signals that
pass to the brain.
Human Visual System
◼ Elements of visual perception
◼ Cones
◼ 6 – 7 million in each eye
◼ Photopic or bright-light vision
◼ Highly sensitive to color
◼ Rods
◼ 75 – 150 million
◼ Not involved in color vision
◼ Sensitive to low level of illumination (scotopic or dim-light vision)
log (cd/m2)
Human Visual System
◼Image formation in the eye
◼ Distance between centre of lens and retina (focal length)
vary between 14-17 mm.
Source: Wikipedia
Human Visual System
◼Brightness adaptation
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.
Saturation and Noise
Storage Vs Bits
Number of megabytes
required to store
images for various
values of N and k.
Spatial and Intensity Resolution
Spatial Operations
Representative
Iso-preference
curves for the
three types of
images in
Fig.
Neighbors of a Pixel
Neighbors of a Pixel
We consider three types of adjacency:
Neighbors of a Pixel
Distance Measure
Distance Measure
Spatial and Intensity Resolution
Spatial Resolution Example
FIGURE 2.23
Effects of reducing spatial
resolution. The images
shown are at:
(a) 930 dpi,
(b) 300 dpi,
(c) 150 dpi, and
(d) 72 dpi.
Variation of Number of Intensity Levels
• Reducing the number of bits from k=7 to
k=1 while keeping the image size constant
• Insufficient number of intensity levels in
smooth areas of digital image leads to
false contouring.
Effects of Varying the Number of Intensity Levels
Effects of Varying the Number of Intensity Levels
Image Interpolation Techniques
Zooming using Various Interpolation Techniques
FIGURE 2.27 (a) Image reduced to 72 dpi and zoomed back to its original 930 dpi using nearest
neighbor interpolation. This figure is the same as Fig. 2.23(d). (b) Image reduced to 72 dpi
and zoomed using bilinear interpolation. (c) Same as (b) but using bicubic interpolation.
Arithmetic Operations
Averaging of Images
Averaging K different
noisy images can
decrease noise. Used in
astronomy.
FIGURE 2.29 (a) Image of Galaxy Pair NGC 3314 corrupted by additive Gaussian noise. (b)-(f) Result of
averaging 5, 10, 20, 50, and 1,00 noisy images, respectively. All images are of size 566 598 pixels, and all
were scaled so that their intensities would span the full [0, 255] intensity scale. (Original image courtesy of
NASA.)
Image Subtraction Application
Enhancement of difference between images using image
subtraction
FIGURE (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. (Original image courtesy of NASA.)
Image Subtraction Application
A vivid indication of image change as a function of resolution can be obtained
by displaying the differences between the original image and its various lower-
resolution counterparts. Figure 2.31(a) shows the difference between the 930 dpi
and 72 dpi images.
(a) Difference between the 930 dpi and 72 dpi images in Fig. 2.23. (b) Difference between
the 930 dpi and 150 dpi images. (c) Difference between the 930 dpi and 300 dpi images.
Image Subtraction Application
As a final illustration, we discuss
briefly an area of medical imaging
called mask mode radiography, a
commercially successful and highly
beneficial use of image subtraction.
Consider image differences of the
form
g(x, y) = f (x, y) − h(x, y)
Digital subtraction angiography.
(a) Mask image.
(b) A live image.
(c) Difference between (a) and (b).
(d) Enhanced difference image.
Shading correction by image multiplication
(and division)
An important application of image multiplication (and division) is
shading correction.
Shading correction by image multiplication
(and division)
An important application of image multiplication (and division) is
shading correction.
Masking (RIO) using image multiplication
The union of two gray-scale sets is an array formed from the maximum
intensity between pairs of spatially corresponding elements
Logical Operations
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.
Spatial Operations
Single-pixel operations
– For example,
transformation to obtain the
negative of an 8-bit image
Spatial Operations
Neighborhood operations
For example, compute the average
value of the pixels in a rectangular
neighborhood of size m n
centered on (x, y)
Affine Transformation
Affine Transformation
Interpolation
Size of Rotated Image
The size of the spatial rectangle
needed to contain a rotated image is
larger than the rectangle of the
original image, as Figs. 2.41(a) and (b)
illustrate. We have two options for
dealing with this: (1) we can crop the
rotated image so that its size is equal
to the size of the original image, as in
Fig. 2.41(c), or we can keep the larger
image containing the full rotated
original, an Fig. 2.41(d).
a b
c d
Image Registration
• Used for aligning two or more images of the same scene
• Input and output images available but the specific transformation
that produced output is unknown
• Estimate the transformation function and use it to register the two
images.
➢ Input image- image that we wish to transform
➢ Reference image- image against which we want to register the
input
• Principal approach- use tie points ( also called control points) ,which
are corresponding points whose locations are known precisely in
the input and reference images
Image Registration
a b
c d