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

Lecture 2

Uploaded by

Robera
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)
22 views

Lecture 2

Uploaded by

Robera
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/ 92

ü“A picture speaks more than thousands

of words.”
ü Visual Information is more powerful than
textual information.
Image

An image is a two dimensional function f(x,y), where


(x,y) are spatial co-ordinates and amplitude of a f at
any point (x,y) is called intensity or gray level of the
image at that point.
What is a Digital Image?
• A digital image is a representation of a two-
dimensional image as a finite set of digital
values, called picture elements or pixels.
• Pixel values typically represent gray levels,
colours, opacity etc.
• Remember digitization implies that a digital
image is an approximation of a real scene.

1 pixel
Pixles types
üBinary
üGraylevel
üColour
Binary pixles
üSome images are stored in a binary format. this
i s th e s i m p l e s t fo r m o f re p re s e n t i n g a n
image.
üOften used in optical character recognition.
üIn this representation the foreground is represented
by a 1 and the background by a 0.
ü Bitdepth in this case is 1.
Gay level pixles
Graylevel pixles arusually represented as integer numbers,ranging from
0(black) to the highest possible value for the bit depth of the images.bit depth
for many grayscale images is 8(8bits=1byte of storage for each pixle).this
gives a range of 256 gray levels ranging from 0 to 255.
Colour pixles
In this case depth bit depth refers to the number of bits required to store all
of the available colours. For example 24 bit colour allows for 16.7million
different colours. When this is the case, the number of bits is divided by three
to provide the number of bits for each separate channel(24bits=8R bits+8G
bits+8B bits).
• Common image formats include:
– 1 sample per point (B&W or Grayscale)
– 3 samples per point (Red, Green, and Blue)
– 4 samples per point (Red, Green, Blue, and
“Alpha”means Opacity)

• For most of this course we will focus on


grey-scale images
Common image file formats

•GIF (Graphic Interchange Format)


•PNG (Portable Network Graphics)
•JPEG (Joint Photographic Experts Group)
•TIFF (Tagged Image File Format)
•PGM (Portable Gray Map)
•FITS (Flexible Image Transport System)
Image Types
• The continuum from image processing to computer vision can be broken
up into low-, mid- and high-level processes
Low-level : input, output are images Primitive operations such as image
preprocessing to reduce noise, contrast enhancement, and image sharpening
Mid-level : inputs may be images, outputs are attributes extracted from those
images
Segmentation, Description of objects, Classification of individual objects
High-level : Image analysis

Low Level Process Mid Level Process High Level Process


Input: Image Input: Image Input: Attributes
Output: Image Output: Attributes Output:
Understanding

Examples: Noise Examples: Object


removal, image recognition, Examples: Scene
sharpening segmentation understanding,
autonomous
navigation
Key Stages in Digital Image Processing
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Image Acquisition
n It is the first process
n The input image will be in digital form
n It involves acquisition of source from real
word images and storing them in
computer for further pre-processing such
as scaling.
Key Stages in Digital Image Processing: Image Aquisition

Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Image Enhancement
n Process of manipulating an image so that
the result is more suitable than the
original for a specific application
n Enhancement techniques are problem
oriented
n Means a method which is suitable for
enhancing x ray Images may not be the
best approach for enhancing satellite
images
Key Stages in Digital Image Processing:
Image Enhancement
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Image Restoration
n Which deals with improving the
appearance of an image.
n Restoration techniques are based on
mathematical or probabilistic models of
image degradation.
n Where as enhancement is based on
human subjective preferences
Key Stages in Digital Image Processing:
Image Restoration
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Morphological Processing
n Deals with tools for extracting image
components that are useful in the
representation and description of shape
such as boundaries skeleton etc.
n Input are images and output are attributes
extracted from those images
Key Stages in Digital Image Processing:
Morphological Processing
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Segmentation
n Partition of an image into its constituent
parts or objects
n It is one of the most difficult stages in DIP
n More accurate the segmentation the more
likely the recognition to succeed
Key Stages in Digital Image Processing:
Segmentation
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Object Recognition
n A pattern class is a family of patterns that
share some common properties
n Pattern classes are denoted by
w1,w2….Ww Where W is the no of class
patterns
n Grouping into separate classes
n That assigns a label to an object based on
its descriptors
Key Stages in Digital Image Processing:
Object Recognition
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Representation & Description
n It is the output of the segmentation stage
which usually is raw pixel data consisting
either the boundary of a region
n Description also called feature selection
deals with extracting attributes that result
in some quantitative information of
interest or are basic differentiating once
class of object from another
Key Stages in Digital Image Processing:
Representation & Description
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Image Compression
n The technique deals with reducing the
storage required to save an image or the
bandwidth required to transmit it.
Key Stages in Digital Image Processing:
Image Compression
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Colour Image Processing

n Use of color images has been gaining


importance because of significant increase
in the use of digital images over the
internet
Key Stages in Digital Image Processing:
Colour Image Processing
Morphologic
Image
al
Restoration
Processing

Image
Segmentatio
Enhancemen
n
t

Image Object
Acquisition Recognition

Representati
Problem Domain on &
Description
Colour
Image
Image
Compression
Processing
Cont’d..

Introduction
Basic intensity transformation
Histogram processing

2.36
Introduction

§ Image enhancement is the first technique in the image


processing.
§ In this technique the original image is processed so that the
resultant image is more suitable than the original for specific
application.
§ Image enhancement is the subjective analysis i.e. the desired
result varies from person to person.
§ Image enhancement does not add any extra information to the
original image. It improves the subjective quality of the image by
working with existing data.

2.37
Cont’d..

§ Image enhancement can be done in two domains


1. Spatial Domain
2. Frequency Domain
§ The spatial domain methods

- In this technique we are working with the pixel values in

images.

- Let f(x,y) is input image, and g(x,y) is output image.

- Here f and g represent the grey level in the input image

and output image respectively.

2.38
Cont’d..

• The processed image can be expressed as:-

• Here T is the transformation function defined over some


neighbourhood of (x, y) and applied to the original image to
obtain a modified image.

2.39
Cont’d..

• The spatial domain methods can be done in two different


ways:
1. Point processing
2. Histogram based techniques
1. Point processing
- The simplest spatial domain operations occur when the
neighbourhood is a single pixel itself (1X1).
- In this case T is referred to as a grey level transformation
function or a point processing operation

2.40
Cont’d..

• Point processing operations take the form

• where s refers to the processed image pixel value and

r refers to the original image pixel value

2.41
Cont’d..

Contrast stretching Thresholding

2.42
Cont,d..

§ There are three basic types of transformation function used


for enhance the images:-
1. Linear (Negative and identity transformation)
2. Logarithmic (Log and inverse log transformation)
3. Power-low (nth power and nth roots transformation)
§ Image negative
- Image negative means inverting the gray levels.
- The black in the original image is transformed in to white and
vice versa.

2.43
Cont,d..

n The negative of an image with intensity levels in the range [0,


L-1] For 8 – bit image is obtained by using the negative
transformation, which is given by the expression

n where, L is Number of gray levels,

r is the value of pixel before processing,

S is the value of pixel after processing.

2.44
Cont’d..

2.45
Cont’d..
• 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

2.46
Cont,d..
§ Example: Consider 3X3 8 bit image, the negative of the given
image can be obtained using the equation

Solution

2.47
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

2.48
Cont’d..

2.49
Power Law Transformations
• Power law transformations have the following form

s=c*rγ
• 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 ,usually set c to 1.


• The power law transformation is used to improve the dynamic
range of an image. we observe that
1. If γ < 1 , the output image looks bright.
2. If γ >1 , the output image looks darker.

2.50
Cont’d..

2.51
Cont’d..
Example 1.

n The images to the


right show a
magnetic resonance
(MR) image of a
fractured human
spine

n Different curves
highlight different
detail

2.52
Cont’d..

Example 2.

n An aerial photo
of a runway is
shown

n This time power law


transforms are used to

darken the image

n Different curves
highlight different detail

2.53
Thresholding Function

§ The gray scale image is transformed in to binary (black and


white) image.
§ Choosing a gray level T in the original image and then
transforming every pixel black or white according to whether
its gray value is greater than or less than .
§ Thresholding is used to segment the given image.

§ The thresholding function is given by

2.54
Cont’d..

Example : Consider a 3 x 3 8 bit image as shown below, the binary


image of the given image can be obtained by using the below
equation, for threshold value T = 100,

2.55
Cont’d..

2.56
Cont,d..

2.57
Intensity Level(Gray Level ) Slicing

§ It is used to highlight a specific range of gray levels in the image.

– Similar to thresholding

– Other levels can be


suppressed or maintained

– Useful for highlighting features


in an image.
§ This transformation produces a binary image. This process can be
implemented in two ways.

2.58
Cont’d..

2.59
Cont’d..

1. Intensity Level slicing without background:


- This approach is to display in one value (say, white) all the
values in the range of interest and in another (say, black) all other
intensities. The figure 2.1(a) shows the intensity level slicing
without background. Mathematically, the transformation is given
as,

2.60
Cont’d..

2. Intensity Level slicing with background:


- This approach is based on the transformation as shown in the
figure 2.1(b), brightens (or darkens) the desired range of
intensities but leaves all other intensity levels in the image
unchanged. Mathematically, this transformation is given as

2.61
Cont’d..

Example: Perform grey level slicing with background and without

background on the following 8 bit image. Let A = 150 and

B = 200.

2.62
Cont’d..
Solution
Intensity Level slicing with background can be
represented mathematically as

Intensity Level slicing with background can be


represented mathematically as

Using the above equation we can get the output image as


shown below
2.63
Cont’d..

2.64
Cont’d..

2.65
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

2.66
Cont’d..

2.67
Cont’d..
Example: Consider a 4 bit input image shown below

Solution

- By converting decimal to binary value, we can obtain

2.68
Cont’d..
0 0 0 0 0 0 1 1 0 0 1 1

0 0 1 1 1 0 0 1 1 0 0 0

1 0 0 0 1 0 0 1 0 0 1 0

Bit0 plane Bit1 plane Bit2 plane Bit3 plane

Original image Bit 0 plane Bit 1 plane

2.69
Cont’d..

2.70
Quiz

1. For the following 3-bit image find the negative. Also find the
bit planes for this image and reconstruct the image using two
most significant bits.

3 2 0

4 3 1

5 4 3

2.71
Contrast Stretching
§ When you capture an image by using camera Low contrast
image can happen this is due to different resean
1. poor illumination,
2. lack of dynamic range in the imaging sensor, or
3. even the wrong setting of a lens aperture during image
acquisition.
§ Contrast stretching is a process that expands the range of
intensity levels in the image so that it spans the full intensity
range of the display device.
§ The figure 2.2 shows a typical transformation used for
contrast stretching
2.72
Cont’d..

2.73
Cont’d..

2.74
Cont’d…

2.75
Cont’d..

2.76
Histogram Processing

n The histogram of an image shows us the distribution of grey


levels in the image

n Massively useful in image processing, especially in segmentation


Frequencies

Grey Levels

2.77
Cont’d..

2.78
Cont’d..

2.79
Cont’d..

2.80
Cont’d..

2.81
Cont’d..

2.82
Cont’d..

2.83
Cont’d..

2.84
Cont’d..

2.85
Cont’d..

2.86
Cont’d…

2.87
Cont’d..
Example1. Perform Linear stretching contrast enhancement for the
given histogram

2.88
Cont’d..

2.89
Cont’d..

2.90
Cont’d..

1.91
Cont’d..

§ Histogram Equalization Contrast Enhancement Method


- Histogram equalization is a technique by which the dynamic
range of the histogram of an image is increased.
- It flattens and stretches the dynamic range of the image's
histogram and resulting in overall contrast improvement.

2.92

You might also like