Top Banner
24-09-2013 ©Kalyan Acharjya 1 Introduction to Digital Image Processing Digital Image Processing in MATLAB Two Live Applications of Digital Image Processing 75 Min 120 Min 30 Min © KALYAN ACHARJYA
72

Introduction to digital image processing

Jun 10, 2015

Download

Engineering

Kalyan Acharjya

Introduction to Digital Image Processing-Basics-Part 1 of the Workshop
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 1

Introduction to Digital Image Processing

Digital Image Processing in MATLAB

Two Live Applications of Digital Image Processing

75 Min

120 Min

30 Min

© K

ALYA

N A

CH

AR

JYA

Page 2: Introduction to digital image processing

A Lecture on

Introduction to

DIGITAL IMAGE PROCESSING

24-09-2013 ©Kalyan Acharjya

2

Presented By Kalyan Acharjya

Assistant Professor, Dept. of ECE Jaipur National University

Page 3: Introduction to digital image processing

25-09-2013 ©Kalyan Acharjya 3

Sorry, shamelessly I opened the lock without prior permission taken

from the original owner. Some images used in this presentation contents

are copied from internet without permission. Only Original Owner has full rights reserved for copied images. This PPT is only for fair academic use.

Kalyan Acharjya

Page 4: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 4

Objective of Two Hour Presentation

“To introduce the basic concept of Digital Image Processing”

Page 5: Introduction to digital image processing

Contents

24-09-2013 ©Kalyan Acharjya

5

What is image and Image

Processing?

Image Understanding.

Why Digital image Processing ?

Digitization of Image.

Histogram and Thresholding of

Image.

Noise and its Extraction from

Image.

Edge Detection.

Image Enhancement.

Image Compression.

Data Hiding in Image.

Color Image Processing.

Applications

Page 6: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 6

What is image ?

And Image Understanding.

Page 7: Introduction to digital image processing

What is image?

24-09-2013 ©Kalyan Acharjya

7

An image is a 2-D light intensity function f( x, y).

An image is considered as Matrix.

A digital image f( x, y) is described both in

spatial co-ordinates and Brightness.

• The points in the image and element value of matrix

identifies gray level value at that point.

This element is called pels or Pixels.

• So f( x, y)=R( x, y) *I(x, y)

Where R Reflectivity of Surface (Pixel Point)

I Intensity of incident Light

y

x

Page 8: Introduction to digital image processing

Matrix or Digital Representation of Image

24-09-2013 ©Kalyan Acharjya

8

• An Image has infinite intensity value.

• Also infinite picture point -How its stored.

• Digitization of image.

Spatial discretization by Sampling.

Intensity discretization by Quantization.

I=

Page 9: Introduction to digital image processing

Matrix as an Image

24-09-2013 ©Kalyan Acharjya

9

An Matrix is an image for DIP

Page 10: Introduction to digital image processing

Types of Digital Images

24-09-2013 ©Kalyan Acharjya

10

Binary Image: Each Pixel is just

Black and white, i.e. 0 or 1

<462x493 logical>

Gray Scale Image: Each Pixel is

shade of Gray, its 0(black) to

white(255),i.e. each pixel~8 bits

<462x493 unit8>

Color Image or RGB Image, Each

pixel corresponds to 3 values.

<462x493x3 unit8>

Page 11: Introduction to digital image processing

Image Data Type

24-09-2013 ©Kalyan Acharjya

11

int8-8 bit integer, Range -128 to 127

unit8-8 bit unsigned integer, Range 0 to 225

int16-16 bit integer, Range -32768 to 32767

uint16-16 bit unsigned integer, Range 0 to 65535

double-Double precision real number, Machine Specific

Page 12: Introduction to digital image processing

Levels of Image Understanding

24-09-2013 ©Kalyan Acharjya

12

Low Level-Involve primitive operations.

e.g. Image Preprocessing, noise reduction,

Enhancement etc.

Image input - Image Out

• Mid Level-

Image segmentation, identify particular objects.

Image input - Attributes extracted from those images

e.g. edges, contour, identify etc.

• High Level-Involving making sense of an ensemble of recognize objects, image

analysis and far end the functions normally associated with human vision.

Image • Processing

Image • Analysis

Image •Measurements

Page 13: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 13

Lets look back !

When the Digital Image Processing Started ?

Page 14: Introduction to digital image processing

History of Image Processing

24-09-2013 ©Kalyan Acharjya

14

Its not young field, In 1920 submarine cables were used to transmit digitalized

newspaper pictures between London and New-Work-Use Telegraphic Printing.

In 1921 –Improved in printing, use photographic

printing to enhance the quality and resolution.

Actually DIP/ Computer Processing Technique

was used to improve the pictures of moon

transmitted by RANGER 7 at JET PROPULSION LAB.

it’s the real beginning…

Page 15: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 15

Why Digital Image Processing ?

Page 16: Introduction to digital image processing

Why Digital Image Processing

24-09-2013 ©Kalyan Acharjya

16

How we stored the image: Reduce the size for storage .

How analog image world is relate to digital processing world.

Compression-Remove redundancies.

Transmission with minimum bandwidth.

Lossy Compression=redundancy +some information, but still acceptable.

Original Image Size-116 KB

Compressed Image Size-12.9 KB, 11 %

Compressed Image Size-1.95 KB, 1.6 %

Page 17: Introduction to digital image processing

Why Digital Image Processing

24-09-2013 ©Kalyan Acharjya

17

Image Enhancement :To improve the

interpretability or perception of

information in image.

Spatial Domain Method.

Frequency Domain Method.

• Moving Object Tracking

• Human-Computer Interaction

• Computer Vision etc.

Lena Central Compressed

Spatial Domain Frequency Domain

Page 18: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 18

How Digitization of Image ?

Page 19: Introduction to digital image processing

Lets, little detail : Digitization of Image

24-09-2013 ©Kalyan Acharjya

19

a b

a b

a b a b

Fig-A-Continuous Image Fig-B-Gray level Variation from a to b

Fig-C-Sampling and Quantization Fig-D-Digital line from a to b

Page 20: Introduction to digital image processing

Bit Planes of Grey Scale image

24-09-2013 ©Kalyan Acharjya

20

Grey scale images can be transformed into a sequence of binary images by breaking them into bit planes.

Page 21: Introduction to digital image processing

Spatial and Gray Level Resolution

24-09-2013 ©Kalyan Acharjya

21

• Gray level L=2k

• L is discrete level allowed to

each pixel.

• M and N are spatial

• Halve and Double

• The number of bits required to

store digital image b=MxNxk

• When M=N, b= kN2

Page 22: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 22

Basics operations with image.

Page 23: Introduction to digital image processing

Arithmetic and Logical Operations in images

24-09-2013 ©Kalyan Acharjya

23

Say Image as y=f(x)

This include add or subtract or multiply or divide each pixel value by constant factor, which may be pixel value of another image.

Y=f(x)+/-/*c

Complement: For gray scale image is its photographic negative.

Logical Operations: AND,OR,NOT in binary image.

Page 24: Introduction to digital image processing

Resize an Image

24-09-2013 ©Kalyan Acharjya

24

Interpolation

Extrapolation

Page 25: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 25

Histogram of Image.

Page 26: Introduction to digital image processing

Histograms of Images

24-09-2013 ©Kalyan Acharjya

26

Histograms of Gray level image represents the numbers of times each gray level occurs in the image.

Dark image-the gray levels would be clustered at the lower end

In a Uniformly bright image, the gray levels would be clustered at the upper end.

In a well contrasted image, the gray levels would be well spread out over much of the range.

Page 27: Introduction to digital image processing

Importance of Histograms Graph

24-09-2013 ©Kalyan Acharjya

27

In Poorly Contrast image, enhance by spreading out of its histograms.

There are two ways-

Histograms stretching (contrast Stretching).

Histogram Equalization.

Histograms stretching:

• Poorly contrasted image in the range [a, b]

• Stretch the gray levels in the center of the range out by applying a

piecewise linear function.

• This function has the effect of stretching the gray levels [a, b] to

[c, d], where a<c and d>b

Page 28: Introduction to digital image processing

Histograms stretching (Cont.)

24-09-2013 ©Kalyan Acharjya

28

The linear function imadjust(I, [a, b],[c, d])

if Pixel value is less than c are all converted to c and pixel values greater

than d are all converted to d.

a b 1

c

d

1

Gamma<1 Gamma>1

Y= (𝑥−𝑎

𝑏−𝑎)^Gamma (d-c)+c

Page 29: Introduction to digital image processing

Gamma Scaling

24-09-2013 ©Kalyan Acharjya

29

Its important for graphics and games, its relates to pixel intensities of the image.

One horn RHINO at Kaziranga National Park, Assam

Page 30: Introduction to digital image processing

Histograms Equalization

24-09-2013 ©Kalyan Acharjya

30

Histogram equalization is a technique for adjusting image intensities to

enhance contrast

• Histogram equalisation algorithm: Let be the

intensities of the image, and let be its normalised histogram

function. The intensity transformation function for histogram equalisation is

That is, we add the values of the normalised histogram function from 1

to k to find where the intensity will be mapped. Notice that the range

of the equalised image is the interval [0,1].

mkrk ,...,2,1,

)( krp

k

j

kk rprT

1

)()(

kr

Page 31: Introduction to digital image processing

Histogram Equalization

24-09-2013 ©Kalyan Acharjya

31

Original Image and It’s Histogram

Histogram Equalized Image and It’s Histogram

Page 32: Introduction to digital image processing

Thresholding of an image

24-09-2013 ©Kalyan Acharjya

32

Single Threshold:

A gray scale image is turned into a binary image by first choosing a

gray level T in the original image.

Pixel Value>T tends to white (1)

Pixel Value<=T tends to black (0)

• Double Threshold:

A pixel becomes white if T1<pixel value<T2.

A pixel becomes black if gray level is others.

Page 33: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 33

Noise Extraction from Image.

Page 34: Introduction to digital image processing

Noise and Its Extraction

24-09-2013 ©Kalyan Acharjya

34

Noise is any degradation in the image signal caused by external disturbance.

Salt and pepper noise: It is caused by sharp and sudden disturbances in the image.

Gaussian noise: It is caused by random fluctuations in the signal. It can be idealized form of white noise.

Speckle noise: it is modeled by random values multiplied by pixel values. In radar applications.

Shot noise: The dominant noise in the lighter parts of an image from an image sensor.

Page 35: Introduction to digital image processing

Removal of noise by Filtering

24-09-2013 ©Kalyan Acharjya

35

Linear filter

Median Filter

Specific case of order statistic filtering.

Remove salt & pepper noise.

Adaptive Filter

Weiner filter use to remove Gaussian

noise.

Page 36: Introduction to digital image processing

Extract Noise from an image

24-09-2013 ©Kalyan Acharjya

36

Image with Gaussian Noise Image after Noise removal

‘wiener2’ Filter

Page 37: Introduction to digital image processing

Spectral Filtering

24-09-2013 ©Kalyan Acharjya

37

Spectral filtering is most commonly used to either select or eliminate

information from an image based on the wavelength of the information.

Spectral selectivity is a technique for creating images which uses

intentionally limited ranges of radiation in the ultraviolet, visible or

infrared portions of the spectrum

Page 38: Introduction to digital image processing

Example High Pass Filtering

24-09-2013 ©Kalyan Acharjya

38

Origina

l Image

High P

ass

filte

ring

resu

lt

High f

requ

enc

y

emphasis

resu

lt

Aft

er

histo

gram

equ

alisa

tion

Page 39: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 39

Edge Detection of Image ?

Page 40: Introduction to digital image processing

What is Image Edge

24-09-2013 ©Kalyan Acharjya

40

Edges are those places in an image that

correspond to object boundaries.

Edges are pixels where image brightness

changes abruptly.

It is a vector variable (magnitude of the

gradient, direction of an edge) .

Page 41: Introduction to digital image processing

Steps of Edge Detection

24-09-2013 ©Kalyan Acharjya

41

Filtering – Filter image to improve performance of the Edge Detector with

respect to noise

Enhancement – Emphasize pixels having significant change in local intensity

Detection – Identify edges - Thresholding

Localization – Locate the edge accurately, estimate edge orientation

Types of Edges

Step Edge

Ramp Edge

Line Edge

Roof Edge

Page 42: Introduction to digital image processing

Edge Detection

24-09-2013 ©Kalyan Acharjya

42

Hey its our TAJMAHAL…!

What you have done…?

Page 43: Introduction to digital image processing

Edge Detection

24-09-2013 ©Kalyan Acharjya

43

Motivation: Detect changes in the pixel value as large gradient.

I(m , n)={1 𝑔 𝑚, 𝑛 > 𝑇ℎ 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Image x(m , n) Edge Map I(m, n)

Prewitt Operator.

Sobel Operator.

Canny Edge Detector.

Kirsch Compass Masks.

Roberts Operator

Gradient Operator

Thresholding

Page 44: Introduction to digital image processing

Basics Relationship Between Pixels

24-09-2013 ©Kalyan Acharjya

44

Neighbors of pixel

Adjacency, Connectivity

4 Adjacency.

8 Adjacency.

m Adjacency.

Image Operations

Point

Local

Global

Region and Boundaries.

Distance between Pixel

Image operation on pixel basis.

Page 45: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 45

Image Enhancement.

Page 46: Introduction to digital image processing

Image Enhancement Technique

24-09-2013 ©Kalyan Acharjya

46

Basic Gray level transformation

Histogram Modification

Average and Median Filtering

Frequency domain operations.

Homomorphic Filtering.

Edge Enhancement.

Image Enhancement

Technique

Better Image Spatial or Frequency Domain

Page 47: Introduction to digital image processing

Spatial Domain

24-09-2013 ©Kalyan Acharjya

47

Point of interest is f( x, y)

Contrast stretching

All these point operation, hence its point processing.

f(x, y)

y

x

r

s

r > Input gray level s > Output Gray level

s=T(r)

s=T(r)

s

r

Threshold

Page 48: Introduction to digital image processing

Image Enhancement in Frequency Domain

24-09-2013 ©Kalyan Acharjya

48

• To filter an image in the frequency domain:

Compute F( u, v) the DFT of the image

Multiply F( u , v) by a filter function H( u, v)

Compute the inverse DFT of the result

Page 49: Introduction to digital image processing

DFT of Image

24-09-2013 ©Kalyan Acharjya

49

• The DFT of a two dimensional image can be visualised by showing the

spectrum of the images component frequencies.

DFT

y

x

v

u

Page 50: Introduction to digital image processing

Basic Frequency Domain Filters

24-09-2013 ©Kalyan Acharjya

50

Low Pass Filter

High Pass Filter

Page 51: Introduction to digital image processing

Ex. of Image Enhancement in FD

24-09-2013 ©Kalyan Acharjya

51

• Different low pass Gaussian filters used to remove blemishes in a photograph.

Page 52: Introduction to digital image processing

Frequency Domain Laplacian Example

24-09-2013 ©Kalyan Acharjya

52

Original Image Laplacian Filtered Image

Laplacian Image Scaled

Enhanced image

Page 53: Introduction to digital image processing

Conclusion of Filtering

24-09-2013 ©Kalyan Acharjya

53

Fourier transform in Image Processing in the frequency domain

Image smoothing

Image sharpening

Fast Fourier Transform

Image restoration using the spatial and frequency based techniques.

Page 54: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 54

Information Hiding

By Image Processing.

© K

ALYA

N A

CH

AR

JYA

Page 55: Introduction to digital image processing

Information Hiding by Image Processing

24-09-2013 ©Kalyan Acharjya

55

Steganography

It is the process of hiding of a secret message within an ordinary image.

• Watermarking

It is the process of hiding of a secret message within an ordinary image, but

carrier image must be unchanged.

Encoder Decoder

Page 56: Introduction to digital image processing

JPEG

24-09-2013 ©Kalyan Acharjya 56

Image Compression.

Size-270 KB Size-22 KB

“Without Compression a CD store only 200 Pictures or 8 Seconds Movie”

Page 57: Introduction to digital image processing

Image Compression-Lossy or Lossless

24-09-2013 ©Kalyan Acharjya

57

Image compression is the process of reducing the amount of data required

to represent an image.

But its resolution or features should be unchanged for human perception.

Relative Data Redundancy Rd of the first data set is Rd=1-1/CR

where CR-Compression Ratio=n1/n2 ,n1 and n2 denote the nos. of information

carrying units in two data sets that represent the same information.

• In Digital Image Compression , the basics data redundancies are

Coding Redundancy

Inter pixel Redundancy

Psycho-visual Redundancy

Page 58: Introduction to digital image processing

Image Compression General Models

24-09-2013 ©Kalyan Acharjya

58

Some image Compression Standard

JPEG-Based on DCT

JPEG 2000-Based on DWT

GIF-Graphics Interchange Format etc.

Source Encoder

Channel Encoder

Channel Decoder

Source Decoder

Channel/ Store

F(x, y)

F’(x, y)

Page 59: Introduction to digital image processing

Data ≠ Information

24-09-2013 ©Kalyan Acharjya

59

Data and information are not synonymous terms!

Data is the means by which information is conveyed.

Data compression aims to reduce the amount of data required to represent

a given quantity of information while preserving as much information as

possible.

Image compression is an irreversible process.

Some Transform used for Image Compression

DCT-Discrete Cosine Transform

DWT-Discrete wavelet Transform etc

Page 60: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 60

Color Image Processing

Page 61: Introduction to digital image processing

Color Image Processing

24-09-2013 ©Kalyan Acharjya

61

• RGB : Color Monitor, Color Camera, Color Scanner

• CMY : Color Printer, Color Copier

• YIQ : Color TV-Y(Luminance), I(In phase), Q(Quadrature)

HSI, HSV

Page 62: Introduction to digital image processing

Color Issue of an Image

24-09-2013 ©Kalyan Acharjya

62

Red, Green and Blue Color cube

Consider Each element=8 bit

R,G,B ~0 to 255

Grey scale f(x , y , L)

256 Grey shades

Color Scale f(x , y, r , g , b)-24 bit

255x255x255=16777216 colors

Page 63: Introduction to digital image processing

What a color image contains

24-09-2013 ©Kalyan Acharjya

63

Page 64: Introduction to digital image processing

RGB Components of an Image

24-09-2013 ©Kalyan Acharjya

64

Page 65: Introduction to digital image processing

CMY and CMYK Color Model

24-09-2013 ©Kalyan Acharjya

65

Cyan(C), Magenta(M) and Yellow(Y) are the secondary colors of light.

• Or CMY are Primary colors of pigments.

RGB to CMY

Black=Cyan + Magenta + Yellow

Printing Industry used to four color Printing.

Cyan, Magenta, Yellow plus Black.

B

G

R

Y

M

C

1

1

1

Page 66: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 66

Where you start ?

Digital Image Processing !

Page 67: Introduction to digital image processing

Popular Image Processing Software Tools

24-09-2013 ©Kalyan Acharjya

67

CVIP tools

(Computer Vision and Image Processing tools)

Intel Open Computer Vision Library

Microsoft Vision SDL Library

MATLAB

KHOROS

Page 68: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 68

Applications of

Digital Image Processing?

© K

ALYA

N A

CH

AR

JYA

Page 69: Introduction to digital image processing

Applications of Digital Image Processing

24-09-2013 ©Kalyan Acharjya

69

Identification.

Robot vision.

Steganography.

Image Enhancement.

Image Analysis in Medical.

Morphological Image Analysis.

Space Image Analysis.

IC Industry……….etc.

Page 70: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 70

Page 71: Introduction to digital image processing

24-09-2013 ©Kalyan Acharjya 71