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

Image Processing 1

The document describes performing various image processing techniques on an input image, including negative transformation, power law transformation, logarithmic transformation, filtering operations, thresholding, intensity level slicing, histogram stretching, and histogram equalization. The key steps are to transform the pixel values using different mathematical functions, apply filters to modify pixel values, extract pixel values within certain ranges, modify pixel value distributions, and equalize the histogram for contrast enhancement.

Uploaded by

ykomma
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)
30 views

Image Processing 1

The document describes performing various image processing techniques on an input image, including negative transformation, power law transformation, logarithmic transformation, filtering operations, thresholding, intensity level slicing, histogram stretching, and histogram equalization. The key steps are to transform the pixel values using different mathematical functions, apply filters to modify pixel values, extract pixel values within certain ranges, modify pixel value distributions, and equalize the histogram for contrast enhancement.

Uploaded by

ykomma
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/ 13

Image Processing

Given the following Image perform the transformations:

• Negative Transformation
• Power Law
• Logarithmic
2. Perform various filters:
• Average
• Gaussian
• Low Pass Filter
• Mean
• Max
• Min
30 28 26
9 11 12
8 6 10

Negative Transformation [ S = (L-1) - r]


L = 32

r S = (L-1) – r

6 S = 31 – 6 = 25
1 3 5
8 S = 31 – 8 = 23

9 S = 31 – 9 = 22
22 20 19
10 S = 31 – 10 = 21

11 S = 31 – 11 = 20
23 25 21
12 S = 31 – 12 = 19

26 S = 31 – 26 = 5

28 S = 31 – 28 = 3

30 S = 31 – 30 = 1
Power law, C = 0.8, ɣ = 0.5 [ S = C.r ɣ]

r S = C.r ɣ

6 S = 0.8(60.5) = 1.95 ≅ 2

8 S = 0.8(80.5) = 2.26 ≅ 2 4 4 3
9 S = 0.8(90.5) = 2.40 ≅ 2

10 S = 0.8(100.5) = 2.52 ≅ 3
2 3 3
11 S = 0.8(110.5) = 2.65 ≅ 3

12 S = 0.8(120.5) = 2.77 ≅ 3
2 2 3
26 S = 0.8(260.5) = 3.26 ≅ 3

28 S = 0.8(280.5) = 4.23 ≅ 4

30 S = 0.8(300.5) = 4.38 ≅ 4

Logarithmic = 0.76 [ S = C log(r-1)]


Given C = 0.8

r S = C log(r-1)

6 S = 0.8 log(6 – 1) = 0.55 ≅ 1


8 S = 0.8 log(8 – 1) = 0.67 ≅ 1
1 1 1
9 S = 0.8 log(9 – 1) = 0.72 ≅ 1

10 S = 0.8 log(10 – 1) = 0.76 ≅ 1


1 1 1
11 S = 0.8 log(11 – 1) = 0.8 ≅ 1

12 S = 0.8 log(12 – 1) = 0.83 ≅ 1

26 S = 0.8 log(26 – 1) = 1.11 ≅ 1 1 1 1

28 S = 0.8 log(28 – 1) = 1.14 ≅ 1

30 S = 0.8 log(30 – 1) = 1.16 ≅ 1


Order Static Filters:
Max [6,8,9,10,11,12,26,28,30]

30 30 30

30 30 30

30 30 30

Min [6,8,9,10,11,12,26,28,30]

6 6 6

6 6 6

6 6 6

Median [6,8,9,10,11,12,26,28,30]
11 11 11

11 11 11

11 11 11

Average Filter, 3*3

1 1 1

1 1 1 X [1/9]

1 1 1

(30+28+26+9+11+12+8+6+10)/9 = 15.55 ≅ 16

Gaussian Filter,3*3

1 2 1

2 4 2
X [1/16]

1 2 1
(30+56+26+18+44+24+8+12+10)/16 = 14.25 ≅ 14

Low Average Filter,3*3

1 1 1 0 1 0

1 2 1 X [1/10] & [1/6] X 1 2 1

1 1 1 0 1 0

(30+28+26+9+22+12+8+6+10)/10 = 15.1 ≅ 15 & (0+28+0+9+22+8+0+6+0)/6 = 12.8 ≅ 13


Thresholding

r >= 4
L = 32

S = L-1 ; r >= 4
0 ; Otherwise

r S

6 31

8 31 31 31 31
9 31

10 31
31 31 31
11 31
12 31
31 31 31
26 31

28 31

30 31
Intensity level slicing with and without background, 3>=r>=5

Without Background
S = L-1 ; 3>=r>=5
0 ; Otherwise

L = 32

r S

6 0

8 0

9 0 0 0 0

10 0

11 0 0 0 0
12 0

26 0
0 0 0
28 0

30 0
Intensity Level Slicing with Background

S = L-1 ; 3>=r>=5
r ; Otherwise

30 28 26
L = 32
r S
9 11 12
6 6

8 8

9 9 8 6 10

10 10

11 11

12 12
26 26

28 28

30 30
Histogram Stretching g(x,y) = [(f(x,y) - fmin)/(fmax – fmin)] * 2bpp

2bpp = 32
fmin = 6, fmax = 30

g(1,1) = [30 – 6) / (30 – 6)]*32 ≅ 31


g(1,2) = [(28 – 6) / (30 – 6)]*32 ≅ 31 31 31 31
g(1,3) = [(26 – 6) / (30 – 6)]*32 ≅ 31
g(2,1) = [(9 – 6) / (30 – 6)]*32 ≅ 31
31 31 31
g(2,2) = [(11 – 6) / (30 – 6)]*32 ≅ 31
g(2,3) = [(12 – 6) / (30 – 6)]*32 ≅ 31
g(3,1) = [(8 – 6) / (30 – 6)]*32 ≅ 31 31 31 31
g(3,2) = [(6 – 6) / (30 – 6)]*32 ≅ 31
g(3,3) = [(10 – 6) / (30 – 6)]*32 ≅ 31
-Perform following on the given Image:
Contrast Streching
Contrast Stretching

34 64 22 42

16 4 3 6

24 2 19 18

42 30 24 21

r1 =12 and r2 =30 , s1= 20 and s2=26

αr ; 0 <= r < 12
S = β(r – r1) + s1 ; 12 <= r < 30
ɣ(r – r2) + s2 ; 30 <= r <= 127

α = [(20 – 0)/(12 – 0)] = 1.66


β = [(26 – 20)/(30 – 12)] = 0.33
ɣ = [(127 – 26)/(127 – 30)] = 1.04
-Given the below frequency distribution perform Histogram Equivalization

r S
34 30
64 61
22 23
42 38 30 61 23 38
16 21
4 7 21 7 5 10
3 5
6 10 30 3 35 28
24 30
2 3 38 26 30 29
19 35
18 28
42 38
30 26
24 30
21 29

Histogram Equalisation:

(L-1) Freq
0 500
1 600
2 450
3 300
4 200
5 560
6 290
7 300

(L-1) Freq PMF CDF CDF(L-1) Round off


0 500 0.15 0.15 1.05 1
1 600 0.18 0.33 2.31 2
2 450 0.14 0.47 3.29 3
3 300 0.09 0.56 3.92 4
4 200 0.06 0.63 4.41 4
5 560 0.17 0.81 5.67 6
6 290 0.09 0.91 6.23 6
7 300 0.09 1.00 7 7
3200

(L-1) NSK

0 0

1 500

2 600
3 450

4 300 + 200= 500

5 0

6 290 + 560 = 850

7 300

You might also like