KEMBAR78
IIP Lecture - 04 Point Processing | PDF | Digital Signal Processing | Image Editing
0% found this document useful (0 votes)
2 views41 pages

IIP Lecture - 04 Point Processing

Uploaded by

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

IIP Lecture - 04 Point Processing

Uploaded by

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

Image Enhancement

(Point Processing)

Awais Muhammad Lodhi

Contents

 In this lecture we will look at image enhancement point


processing techniques:
 Connectivity & Relationship b/w Pixels
 What is Image Processing
 What is point processing?
 Negative images
 Thresholding
 Logarithmic transformation
 Power law transforms
 Grey level slicing
 Bit plane slicing
What is Image Enhancement

Process an image to make the result more suitable than the


original image for a specific application
–Image enhancement is subjective (problem /application oriented)

Image enhancement methods:


Spatial domain: Direct manipulation of pixel in an image (on
the image plane)
Frequency domain: Processing the image based on modifying the
Fourier transform of an image

Many techniques are based on various combinations of methods from


these two categories

Relationship Between Pixels


Connectivity

 Establishing boundaries of objects and components of


regions in an image.
 Group the same region by assumption that the pixels
being the same color or equal intensity will have the
same region
 Two pixels may be four neighbors, but they are said
to be connected only if they have the same value
(gray level)

Basic Relationship b/w Pixels

6
Basic Relationship b/w Pixels

Basic Relationship b/w Pixels

8
Basic Relationship b/w Pixels

A Note About Grey Levels

So far when we have spoken about image grey level


values we have said they are in the range [0, 255]
 Where 0 is black and 255 is white
There is no reason why we have to use this range
 The range [0,255] stems from display technologes
For many of the image processing operations in this
lecture grey levels are assumed to be given in the range
[0.0, 1.0]
What Is Image Enhancement?

Image enhancement is the process of making images


more useful
The reasons for doing this include:
 Highlighting interesting detail in images
 Removing noise from images
 Making images more visually appealing

Image Enhancement Examples


Image Enhancement Examples (cont…)

Image Enhancement Examples (cont…)


Image Enhancement Examples (cont…)

Spatial & Frequency Domains

There are two broad categories of image enhancement


techniques
 Spatial domain techniques
 Direct manipulation of image pixels
 Frequency domain techniques
 Manipulation of Fourier transform or wavelet transform of an
image
For the moment we will concentrate on techniques that
operate in the spatial domain
Image Engancement

Process an image to make the result more suitable than the


original image for a specific application
–Image enhancement is subjective (problem /application oriented)

Image enhancement methods:


Spatial domain: Direct manipulation of pixel in an image (on
the image plane)
Frequency domain: Processing the image based on modifying the
Fourier transform of an image

Many techniques are based on various combinations of methods from


these two categories

Image Enhancement

18
Some Basic Concepts

Spatial domain enhancement methods can be generalized as


g(x,y)=T[f(x,y)]
f(x,y): input image
g(x,y): processed (output) image
T[*]: an operator on f (or a set of input images),
defined over neighborhood of (x,y)

Neighborhood about (x,y): a square or rectangular


sub-image area centered at (x,y)

19

Some Basic Concepts

20
Some Basic Concepts

g(x,y) = T [f(x,y)]
Pixel/point operation:
Neighborhood of size 1x1: g depends only on f at (x,y)
T: a gray-level/intensity transformation/mapping function
Let r = f(x,y) s = g(x,y)
r and s represent gray levels of f and g at (x,y)
Then s = T(r)
Local operations:
g depends on the predefined number of neighbors of f at (x,y)
Implemented by using mask processing or filtering
Masks (filters, windows, kernels, templates) :
a small (e.g. 3×3) 2-D array, in which the values of the
coefficients determine the nature of the process

Point Processing

 The simplest spatial domain operations occur when the


neighbourhood is simply the pixel itself
 In this case T is referred to as a grey level transformation
function or a point processing operation
 Point processing operations take the form
 s=T(r)
 where s refers to the processed image pixel value and r
refers to the original image pixel value
Common Pixel Operations

 Image Negatives
 Log Transformations
 Power-Law Transformations

23

Point Processing Example:


Negative Images

 Negative images are useful for enhancing white or grey detail


embedded in dark regions of an image
 Note how much clearer the tissue is in the negative image of the
mammogram below

Original Negative
Image Image
Negative Images

Point Processing Example:


Negative Images (cont…)

Original Image Enhanced Image x


x

y Image f (x, y) y Image f (x, y)

s = intensitymax - r
 For L gray levels the transformation function is
s =T(r) = (L - 1) - r
Point Processing Example:
Thresholding

 Thresholding transformations are particularly useful for


segmentation in which we want to isolate an object of
interest from a background

255 r > threshold


s=
0 r <= threshold

Point Processing Example:


Thresholding
Point Processing Example:
Thresholding (cont…)

Original Image Enhanced Image x


x

y Image f (x, y) y Image f (x, y)

255 r > threshold


s=
0 r <= threshold

Intensity Transformations
Basic Grey Level Transformations

 There are many different


kinds of grey level
transformations
 Three of the most
common are shown
here
 Linear
 Negative/Identity
 Logarithmic
 Log/Inverse log
 Power law
 nth power/nth root

Image Scaling

s =T(r) = a.r (a is a constant)


Image Scaling

Logarithmic Transformations

 The general form of the log transformation is


 s = c * log(1 + r)
 The log transformation maps a narrow range of low input
grey level values into a wider range of output values
 The inverse log transformation performs the opposite
transformation
 Log functions are particularly useful when the input grey
level values may have an extremely large range of values
Logarithmic Transformations (cont…)

Logarithmic Transformations

Properties of log transformations


–For lower amplitudes of input image the range of gray levels is
expanded
–For higher amplitudes of input image the range of gray levels is
compressed
Application:
 This transformation is suitable for the case when the dynamic
range of a processed image far exceeds the capability of the
display device (e.g. display of the Fourier spectrum of an
image)
 Also called “dynamic-range compression / expansion”

36 08/01/2018
Logarithmic Transformations (cont…)

Original Image Enhanced Image x


x

y Image f (x, y) y Image f (x, y)

s = log(1 + r)
We usually set c to 1
Grey levels must be in the range [0.0, 1.0]

Power Law Transformations

 Power law transformations have the following form


 s=c*rγ
 c & γ must be positive
 Map a narrow range
of dark input values
into a wider range of
output values or vice
versa
 Varying γ gives a whole
family of curves
Power Law Transformations (cont…)

Original Image Enhanced Image x


x

y Image f (x, y) y Image f (x, y)

s=rγ
 We usually set c to 1
 Grey levels must be in the range [0.0, 1.0]

Power Law Transformations (cont…)

For γ < 1: Expands values of dark pixels,


compress values of brighter pixels
For γ > 1: Compresses values of dark pixels,
expand values of brighter pixels
If γ=1 & c=1: Identity transformation (s = r)

A variety of devices (image capture, printing, display) respond


according to power law and need to be corrected

Gamma (γ) correction


The process used to correct the power-law response phenomena
Power Law Example

Power Law Example (cont…)

γ = 0.6
1
0.9
0.8
Transformed Intensities

0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Old Intensities
Power Law Example (cont…)

γ = 0.4
1
0.9
Transformed Intensities

0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities

Power Law Example (cont…)

γ = 0.3
1
0.9
Transformed Intensities

0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
Power Law Example (cont…)

 The images to the


right show a
magnetic resonance
(MR) image of a
fractured human
spine
 Different curves
highlight different
detail

Power Law Example

γ = 1.0
Power Law Example (cont…)

γ = 3.0

Power Law Example (cont…)

γ = 4.0
Power Law Example (cont…)

γ = 5.0
1
0.9
Transformed Intensities

0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities

Power Law Transformations (cont…)

 An aerial photo
of a runway is
shown
 This time
power law
transforms are
used to darken
the image
 Different curves
highlight
different detail
Power Law Transformations (cont…)

51

Gamma Correction
Problem: CRT display devices do not respond linearly to different intensities
More Contrast Issues

More Contrast Issues


Piecewise Linear Transformation

Contrast Stretching
Goal:
 Increase the dynamic range of the gray levels for low
contrast images

Low-contrast images can result from


–poor illumination
–lack of dynamic range in the imaging sensor
–wrong setting of a lens aperture during image acquisition

Contrast Stretching
Contrast Stretching

57

Gray Level Slicing

 Highlights a specific range of grey levels


 Similar to thresholding
 Other levels can be
suppressed or maintained
 Useful for highlighting features
in an image
Bit Plane Slicing

 Often by isolating particular bits of the pixel values in an


image we can highlight interesting aspects of that image
 Higher-order bits usually contain most of the significant
visual information
 Lower-order bits contain
subtle details

Bit Plane Slicing (cont…)

[10000000] [01000000]

[00100000] [00001000]

[00000100] [00000001]
Bit Plane Slicing (cont…)

Bit Plane Slicing (cont…)


Bit Plane Slicing (cont…)

Bit Plane Slicing (cont…)


Bit Plane Slicing (cont…)

Bit Plane Slicing (cont…)


Bit Plane Slicing (cont…)

Bit Plane Slicing (cont…)


Bit Plane Slicing (cont…)

Bit Plane Slicing (cont…)


Bit Plane Slicing (cont…)

Reconstructed image using


only bit planes 8 and 7

Reconstructed image using


only bit planes 8, 7 and 6

Reconstructed image using


only bit planes 7, 6 and 5

A Different Problem
Lets Double the Size

Interpolation

Nearest Neighbor
What Happens When Tripling

Is There a Better Method

Interpolation: Bi-Linear
Is There be a Better Method

What Happens in 2D
Which is Better

Which is Better

Lets Scale

Before Interpolation
Original

Nearest Neighbor Bi-Linear


No Interpolation Interpolated

 Fast as No Processing Required  Slow due to Processing


 Depends on only 2 Pixel  Depends on 4 or more pixels
 Results are Blocky  Smoother Gradients
 Cannot Create New Values  Can Find New Values
 Not Recommended for Smooth  Not Recommended for
Data Categorical Data
 New Value always inside the  Value may or May not be
boundary range outside the boundary range

Summary

 We have looked at different kinds of point processing


image enhancement
 Assignment & Quiz
 Bring Your Laptops on Monday?
 Next time we will start to look at Global Operations

You might also like