0% found this document useful (0 votes)
79 views

Digital Image Processing

Digital image processing involves several fundamental steps: 1) Image acquisition involves capturing an image using a sensor and digitizing it. 2) Common processing steps like enhancement, restoration, and compression are used to improve image quality or reduce file size. 3) Higher-level tasks include segmentation to partition an image, representation to describe image components, and classification for recognition of objects. The steps generally involve low-level image processing, attribute extraction through techniques like segmentation, and higher-level computer vision tasks.

Uploaded by

Aayush Chachan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Digital Image Processing

Digital image processing involves several fundamental steps: 1) Image acquisition involves capturing an image using a sensor and digitizing it. 2) Common processing steps like enhancement, restoration, and compression are used to improve image quality or reduce file size. 3) Higher-level tasks include segmentation to partition an image, representation to describe image components, and classification for recognition of objects. The steps generally involve low-level image processing, attribute extraction through techniques like segmentation, and higher-level computer vision tasks.

Uploaded by

Aayush Chachan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 85

Digital Image Processing

Introduction
Contents
•This lecture will cover:
–Image Processing Fields
–Computerized Processes Types
–Digital Image Definition
–Fundamental steps in Digital Image
Image Processing Fields
• Computer Graphics: The creation of images

• Image Processing: Enhancement or other


manipulation of the image

• Computer Vision: Analysis of the image


content
Computerized Processes Types
• Low-Level Processes:
– Input and output are images
– Tasks: Primitive operations, such as, image processing to
reduce noise, contrast enhancement and image
sharpening
Computerized Processes Types
• Mid-Level Processes:
– Inputs, generally, are images. Outputs are attributes
extracted from those images (edges, contours, identity
of individual objects)
– Tasks:
• Segmentation (partitioning an image into regions or
objects)
• Description of those objects to reduce them to a form
suitable for computer processing
• Classifications (recognition) of objects
Computerized Processes Types
• High-Level Processes:
– Image analysis and computer vision
Digital Image Definition
• An image can be defined as a two-dimensional
function f(x,y)
• x,y: Spatial coordinate
• f: the amplitude of any pair of coordinate x,y,
which is called the intensity or gray level of
the image at that point.
• x,y and f, are all finite and discrete quantities.

The maximum deviation from the average or equilibrium value of any repeatedly
changing quantity, such as the position of a vibrating object, pressure, velocity,
voltage, current and many others.
Digital Image Types : Intensity Image

Intensity image or monochrome image


each pixel corresponds to light intensity
normally represented in gray scale (gray
level).

Gray scale values


10 10 16 28
 9 6 26 37
 
15 25 13 22
 
32 15 87 39
Digital Image Types : COLOR (RGB) Image

Color image or RGB image:


each pixel contains a vector
representing red, green and
blue components.

RGB components
10 10 16 28
 9 656 7026
56  43
37 
 32 99 54 96 56
70 67 78
15  25 13 22  
  21 60 42 67
47 96
54 90
 
32 15 87 39  
54 85
65 85
65 4339 92
 
32 65 87 99
Image Types : Binary Image

Binary image or black and white image


Each pixel contains one bit :
1 represent white
0 represents black

Binary data
0 0 0 0
0 0 0 0
 
1 1 1 1
 
1 1 1 1
Image Types : Index Image

Index image
Each pixel contains index number
pointing to a color in a color table

Color Table

Index Red Green Blue


component component component
No.
1 0.1 0.5 0.3
2 1.0 0.0 0.0
1 4 9
6 4 7  3 0.0 1.0 0.0
  4 0.5 0.5 0.5
6 5 2
5 0.2 0.8 0.9
Index value … … … …
Image File Formats (1/2)
BMP – Bitmap format from Microsoft uses Raster-based
1~24-bit colors (RGB) without compression or allows a
run-length compression for 1~8-bit color depths

GIF – Graphics Interchange Format from CompuServe Inc. is


Raster-based which uses 1~8-bit colors with resolutions
up to 64,000*64,000 LZW (Lempel-Ziv-Welch, 1984)
lossless compression with the compression ratio up to 2:1

Raw – Raw image format uses a 8-bit unsigned character to


store a pixel value of 0~255 for a Raster-scanned gray
image without compression. An R by C raw image occupies
R*C bytes or 8RC bits of storage space
Some Image File Formats (2/2)
• TIFF – Tagged Image File Format from Aldus and Microsoft was designed for
importing image into desktop publishing programs and quickly became accepted
by a variety of software developers as a standard. Its built-in flexibility is both a
blessing and a curse, because it can be customized in a variety of ways to fit a
programmer’s needs. However, the flexibility of the format resulted in many
versions of TIFF, some of which are so different that they are incompatible with
each other

• JPEG – Joint Photographic Experts Group format is the most popular lossy method
of compression, and the current standard whose file name ends with “.jpg” which
allows Raster-based 8-bit grayscale or 24-bit color images with the compression
ratio more than 16:1 and preserves the fidelity of the reconstructed image

• EPS – Encapsulated PostScript language format from Adulus Systems uses Metafile
of 1~24-bit colors with compression

• JPEG 2000
Fundamental Steps in Digital Image Processing:
Outputs of these processes generally are images

Wavelets &

Outputs of these processes generally are image attributes


Colour Image Image Morphological
Multiresolution
Processing Compression Processing
processing

Image
Restoration
Segmentation

Image Knowledge Base


Enhancement Representation
& Description

Image
Acquisition Object
Recognition

Problem Domain
Fundamental Steps in DIP:
(Description)
Step 1: Image Acquisition
The image is captured by a sensor (eg.
Camera), and digitized if the output of the
camera or sensor is not already in digital form,
using analogue-to-digital convertor
Fundamental Steps in DIP:
(Description)
Step 2: Image Enhancement
The process of manipulating an image so that the
result is more suitable than the original for
specific applications.

The idea behind enhancement techniques is to


bring out details that are hidden, or simple to
highlight certain features of interest in an image.
Fundamental Steps in DIP:
(Description)
Step 3: Image Restoration
- Improving the appearance of an image

- Tend to be mathematical or probabilistic


models. Enhancement, on the other hand, is
based on human subjective preferences regarding
what constitutes a “good” enhancement result.
Fundamental Steps in DIP:
(Description)
Step 4: Colour Image Processing
Use the colour of the image to extract features
of interest in an image
Fundamental Steps in DIP:
(Description)
Step 5: Wavelets
Are the foundation of representing images in
various degrees of resolution. It is used for
image data compression.
Fundamental Steps in DIP:
(Description)
Step 6: Compression
Techniques for reducing the storage required
to save an image or the bandwidth required to
transmit it.
Fundamental Steps in DIP:
(Description)
Step 7: Morphological Processing
Tools for extracting image components that
are useful in the representation and
description of shape.

In this step, there would be a transition from


processes that output images, to processes
that output image attributes.
Fundamental Steps in DIP:
(Description)
Step 8: Image Segmentation
Segmentation procedures partition an image into its constituent parts or
objects.

Important Tip: The more accurate the segmentation, the more likely
recognition is to succeed.
Fundamental Steps in DIP:
(Description)
Step 9: Representation and Description
- Representation: Make a decision whether the data should
be represented as a boundary or as a complete region. It is
almost always follows the output of a segmentation stage.
- Boundary Representation: Focus on external shape
characteristics, such as corners and inflections
- Region Representation: Focus on internal properties,
such as texture or skeleton shape
Fundamental Steps in DIP:
(Description)
Step 9: Representation and Description
- Choosing a representation is only part of the solution for
transforming raw data into a form suitable for subsequent
computer processing (mainly recognition)

- Description: also called, feature selection,


deals with extracting attributes that result in
some information of interest.
Fundamental Steps in DIP:
(Description)
Step 9: Recognition and Interpretation
Recognition: the process that assigns label to
an object based on the information provided
by its description.
Fundamental Steps in DIP:
(Description)
Step 10: Knowledge Base
Knowledge about a problem domain is coded
into an image processing system in the form of
a knowledge database.
Components of an Image Processing
System
Network

Image displays Computer Mass storage

Specialized image Image processing


Hardcopy
processing hardware software

Typical general-
Image sensors purpose DIP
Problem Domain system
Components of an Image Processing
System
1. Image Sensors
Two elements are required to acquire digital
images. The first is the physical device that is
sensitive to the energy radiated by the object
we wish to image (Sensor). The second,
called a digitizer, is a device for converting
the output of the physical sensing device into
digital form.
Components of an Image Processing
System
2. Specialized Image Processing Hardware
Usually consists of the digitizer, mentioned before, plus
hardware that performs other primitive operations, such as an
arithmetic logic unit (ALU), which performs arithmetic and
logical operations in parallel on entire images.

This type of hardware sometimes is called a front-end


subsystem, and its most distinguishing characteristic is speed.
In other words, this unit performs functions that require fast
data throughputs that the typical main computer cannot
handle.
Components of an Image Processing
System
3. Computer
The computer in an image processing system is a general-
purpose computer and can range from a PC to a
supercomputer. In dedicated applications, sometimes specially
designed computers are used to achieve a required level of
performance.
Components of an Image Processing
System
4. Image Processing Software
Software for image processing consists of specialized modules
that perform specific tasks. A well-designed package also
includes the capability for the user to write code that, as a
minimum, utilizes the specialized modules.
Components of an Image Processing
System
5. Mass Storage Capability
Mass storage capability is a must in a image processing
applications. And image of sized 1024 * 1024 pixels requires
one megabyte of storage space if the image is not compressed.

Digital storage for image processing applications falls into three


principal categories:
1. Short-term storage for use during processing.
2. on line storage for relatively fast recall
3. Archival storage, characterized by infrequent access
Components of an Image Processing
System
5. Mass Storage Capability
One method of providing short-term storage is computer memory.
Another is by specialized boards, called frame buffers, that store one or
more images and can be accessed rapidly.

The on-line storage method, allows virtually instantaneous image zoom,


as well as scroll (vertical shifts) and pan (horizontal shifts). On-line
storage generally takes the form of magnetic disks and optical-media
storage. The key factor characterizing on-line storage is frequent access
to the stored data.

Finally, archival storage is characterized by massive storage requirements


but infrequent need for access.
Components of an Image Processing
System
6. Image Displays
The displays in use today are mainly color
(preferably flat screen) TV monitors.
Monitors are driven by the outputs of the
image and graphics display cards that are an
integral part of a computer system.
Components of an Image Processing
System
7. Hardcopy devices
Used for recording images, include laser
printers, film cameras, heat-sensitive devices,
inkjet units and digital units, such as optical
and CD-Rom disks.
Components of an Image Processing
System
8. Networking
Is almost a default function in any computer system,
in use today. Because of the large amount of data
inherent in image processing applications the key
consideration in image transmission is bandwidth.

In dedicated networks, this typically is not a


problem, but communications with remote sites via
the internet are not always as efficient.
Visual Perception: Human Eye

(Picture from Microsoft Encarta 2000)


Cross Section of the Human Eye

The lens and the ciliary muscle focus the reflected lights from
objects into the retina to form an image of the objects.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
1. The lens contains 60-70% water, 6% of fat.
2. The iris diaphragm controls amount of light that enters the eye.
3. Light receptors in the retina
- About 6-7 millions cones for bright light vision called photopic
- Density of cones is about 150,000 elements/mm2.
- Cones involve in color vision.
- Cones are concentrated in fovea about 1.5x1.5 mm2.
- About 75-150 millions rods for dim light vision called scotopic
- Rods are sensitive to low level of light and are not involved
color vision.
4. Blind spot is the region of emergence of the optic nerve from the
eye. Absence of receptors there hence the name.
5. Fovea : Circular indentation in center of retina, about 1.5mm
diameter, dense with cones.
•Photoreceptors around fovea responsible for spatial vision (still
images).
•Photoreceptors around the periphery responsible for detecting
motion.
Image Formation in the Human Eye

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.

(Picture from Microsoft Encarta 2000)


Brightness Adaptation of Human Eye : Mach Band Effect

Intensity

Position
Mach Band Effect

Intensities of surrounding points effect


perceived brightness at each point.

In this image, edges between bars appear


brighter on the right side and darker on the
left side.

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Mach Band Effect (Cont)

A
B
Intensity

Position

In area A, brightness perceived is darker while in area B is


brighter. This phenomenon is called Mach Band Effect.
Brightness Adaptation of Human Eye : Simultaneous Contrast

Simultaneous contrast. All small squares have exactly the same intensity
but they appear progressively darker as background becomes lighter.
Simultaneous Contrast

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Optical illusion

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Visible Spectrum

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Image Sensors

Single sensor

Line sensor

Array sensor

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Image Sensors : Single Sensor

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Image Sensors : Line Sensor

Computerized Axial Tomography


(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Image Sensors : Array Sensor

Charge-Coupled Device (CCD)

w Used for convert a continuous


image into a digital image

w Contains an array of light sensors

w Converts photon into electric charges


accumulated in each sensor unit

CCD KAF-3200E from Kodak.


(2184 x 1472 pixels,
Pixel size 6.8 microns2)
Digital Image Acquisition Process

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
A Simple Image Formation Model

Mathematical representation of monochromatic


images.
– Two dimensional function f(x,y), where f is the gray level
of a pixel at location x and y.
0< f(x,y) <
– The values of the function f at different locations are
proportional to the energy radiated from the imaged
object.
f(x,y)=i(x,y)*r(x,y)
0< i(x,y) <
0 < r(x,y) < 1
i(x,y) : Sun on clear day 90,000 lm/m2

: Sun on cloudy day 10,000 lm/m2


: Full moon 0.1 lm/m2
: Commercial office 1,000 lm/m2

r(x,y) :Black Velvet 0.01


:Stainless Steel 0.65
:Flat-white Wall Paint 0.80
:Silver-plated Metal 0.90
:Snow 0.93
Image Sampling and Quantization

• The output of most sensors is continuous in amplitude


and spatial coordinates.
• Converting an analog image to a digital image require
sampling and quantization
• Sampling: is digitizing the coordinate values
• Quantization: is digitizing the amplitude values
• Nyquist Rate:
• Spatial resolution must be less or equal half of the
minimum period of the image or sampling frequency
must be greater or equal to twice of the maximum
frequency
Generating a Digital Image

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Image Sampling and Quantization

Spatial resolution / image resolution: pixel size or number of pixels

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Representing Digital Images
Representing Digital Images

The pixel intensity levels (gray scale levels) are in the


interval of [0, L-1].

0  ai,j  L-1 Where L = 2k


The dynamic range of an image is the range of values spanned by
the gray scale.

The number, b, of bits required to store a digitized image of size


M by N is
b=MNk
4.2. Representing Digital Images
Effect of Spatial Resolution

256x256 pixels 128x128 pixels

64x64 pixels 32x32 pixels


Effect of Spatial Resolution

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Effect of Spatial Resolution

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Can we increase spatial resolution by interpolation ?

Down sampling is an irreversible process.


(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Effect of Quantization Levels

256 levels 128 levels

64 levels 32 levels
Effect of Quantization Levels (cont.)

16 levels 8 levels

In this image,
it is easy to see
false contour.

4 levels 2 levels
IMAGE INTERPOLATION
• Interpolation- constructing new data points
with in the range of discrete set of known data
points.
• Image interpolation- is a tool which is used to
zoom, shrink and geometric corrections of an
image ( re-sampling of images).
• Image interpolation refers to the “guess” of
intensity values at missing locations
• 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
Zooming and shrinking
• Zooming requires the creation of new pixel
locations, and the assignment of gray levels.
125 170 129
172 170 175
125 128 128

v( x' , y ' )  ax'by 'cx' y ' d (2,2)

(2,4)
125 = a(2) + b(2) +c(4) +d (4,2) (3,3)
170 = a(2) + b(4) +c(8) +d
172 = a(4) + b(2) +c(8) +d (4,4)
170 = a(4) + b(4) +c(16) +d
• Image shrinking is done in a similar manner as
just described for zooming.
• For example, to shrink an image by half, we
delete every other row and column.
Bicubic interpolation
• Bicubic interpolation is more sophisticated
and produces smoother edges than bilinear
interpolation.
• 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 re-sampling images
Basic Relationship of Pixels

(0,0) x

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

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


y

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

Conventional indexing method


Neighbors of a Pixel

Neighborhood relation is used to tell adjacent pixels. It is


useful for analyzing regions.

(x,y-1) 4-neighbors of p:

(x-1,y)
(x-1,y) p (x+1,y)
(x+1,y)
N4(p) = (x,y-1)
(x,y+1)
(x,y+1)

4-neighborhood relation considers only vertical and


horizontal neighbors.

Note: q N4(p) implies p N4(q)


Neighbors of a Pixel (cont.)

(x-1,y-1) (x,y-1) (x+1,y-1) 8-neighbors of p:

(x-1,y-1)
(x-1,y) p (x+1,y)
(x,y-1)
(x+1,y-1)
(x-1,y)
(x-1,y+1) (x,y+1) (x+1,y+1) (x+1,y)
N8(p) = (x-1,y+1)
(x,y+1)
(x+1,y+1)

8-neighborhood relation considers all neighbor pixels.


Neighbors of a Pixel (cont.)

(x-1,y-1) (x+1,y-1) Diagonal neighbors of p:

(x-1,y-1)
p
(x+1,y-1)
ND(p) = (x-1,y1)
(x+1,y+1)
(x-1,y+1) (x+1,y+1)

Diagonal -neighborhood relation considers only diagonal


neighbor pixels.
Connectivity

Connectivity is adapted from neighborhood relation.


Two pixels are connected if they are in the same class (i.e. the
same color or the same range of intensity) and they are
neighbors of one another.

For p and q from the same class


w 4-connectivity: p and q are 4-connected if q N4(p)
w 8-connectivity: p and q are 8-connected if q N8(p)
w mixed-connectivity (m-connectivity):
p and q are m-connected if q N4(p) or
q ND(p) and N4(p) N4(q) = 
Adjacency

-A pixel p is adjacent to pixel q then they are said to be connected.

-Two image subsets S1 and S2 are adjacent if some pixel in S1 is


adjacent to some pixel in S2

S1
S2

We can define type of adjacency: 4-adjacency, 8-adjacency


or m-adjacency depending on type of connectivity.
Path

A path from pixel p at (x,y) to pixel q at (s,t) is a sequence


of distinct pixels:
(x0,y0), (x1,y1), (x2,y2),…, (xn,yn)
such that
(x0,y0) = (x,y) and (xn,yn) = (s,t)
and
(xi,yi) is adjacent to (xi-1,yi-1), i = 1,…,n

q
p
Path (cont.)

8-path m-path

p p p

q q q

m-path from p to q
8-path from p to q
solves this ambiguity
results in some ambiguity
Distance Measure (Euclidean)
For pixels p, q, and z, with coordinates (x,y), (s,t), and
(v,w), respectively, D is a distance function or metric if

(a) D(p,q)  0 ,
(b) D(p,q) = D(q,p), (symmetry)
(c) D(p,z)  D(p,q) + D(q,z) (triangular inequality)

Euclidean distance between p and q is


De(p,q) = [ (x - s)2 + (y - t)2 ]1/2
Distance Measure (City block, Chessboard)
2
The D4 distance (city-block) between p and q is 2 1 2
D4(p,q) = |x – s | + |y – t | 2 1 0 1 2
2 1 2
2
Diamond shape

The D8 distance (chessboard) between p and q is


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
Distance Measure of Path
If distance depend on the path between two pixels such
as m-adjacency then the Dm distance between two pixels
is defined as the shortest m-path between the pixels.

0 0 1 q 0 0 1 0 1 1

0 1 0 1 1 0 1 1 0

p 1 0 0 1 0 0 1 0 0

Dm( p , q ) = 2 Dm( p , q ) = 3 Dm( p , q ) = 4


Path Length
Find the shortest 4-, 8-, m-path
(q)
between p and q for
3 1 2 1
V= {0, 1} and V={1, 2}
2 2 0 2

1 2 1 1

1 0 1 2
(p)
Linear and Nonlinear Operation

Linear operation

H is said to be a linear operator if, for any two images f and g


and any two scalars a and b,

H(af + bg) = a H( f ) + b H( g )
Revision
• Image Processing Fields
• Computerized Processes Types
• Digital Image Definition
• Fundamental steps in Digital Image and components of IP system
• Visual Perception: Human Eye
• Image Sensors
• Digital Image Acquisition Process
• A Simple Image Formation Model
• Image Sampling and Quantization
• Representing Digital Images
• Image Interpolation
• Basic Relationship of Pixels
• Distance Measure
• Linear and Nonlinear Operation

You might also like