Professional Documents
Culture Documents
MATHEMATICAL REPRESENTATION
General expression g(x, y) = T{f(x, y) }
Origin
Target
Neighbourhood
(x, y)
Image f (x, y)
Image g(x, y)
Generally denoted by
r values before transformation s Values after transformation T the performed
transformation s = T(r)
HISTOGRAM PROCESSING
Histogram in digital images is defined as a discreet function
Where
h(rk) = nk
rk is the gray level of k and nk is the number of pixels of that value
Histogram normalization Performed by dividing each value by the total number of pixels in the image.
p(rk) = nk / n
p(rk) gives an estimate of the probability of occurrence of gray level rk . The sum of all components of a normalized histogram is equal to 1.
Dark image
Bright image
Histogram Equalization
p(rk) = nk / n
histogram equalization
Each pixel with level rk is mapped into a corresponding pixel with level sk in the output image.
histogram linearization
HISTOGRAM MATCHING
The method used to generate a processed image that has a specified histogram shape. In contrast to the aim of histogram where we perform automatic uniform histogram.
HISTOGRAM MATCHING
1. Obtain the histogram of the given image. 2. Precompute a mapped level sk for each level rk.
HISTOGRAM MATCHING
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Original
HISTOGRAM SUMMARY
Useful for assessment of acquisition quality. Critical for image presentation Used as basis for subsequent analysis steps such as thresholding etc.
NEIGHBORHOOD OPERATIONS
Neighborhood is defined as any area bigger than the single pixel.
Origin
(x, y)
Image f (x, y)
NEIGHBOURHOOD OPERATIONS
For each pixel in the origin image, the outcome is written on the same location at the target image.
Origin x Target
Neighbourhood
(x, y)
Image f (x, y)
Original
http://www.biologyimagelibrary.com/
135 142 142 142 142 142 142 142 140 129 113 98 80 80 80 80 71 64 52 31
135 142 142 142 142 142 142 142 140 135 129 124 107 81 80 80 80 71 64 55
115 135 142 142 142 142 142 140 140 135 129 126 124 110 102 96 86 77 75 74
82 115 135 142 142 142 140 140 135 135 129 127 127 127 127 126 119 115 111 108
29 66 103 132 140 140 140 135 135 129 128 141 144 145 145 145 144 144 144 145
R=3
1 1 1 1 9 33 52 52 52 52 32 14 2 2 2 2 1 0 0 0
0 0 0 0 0 9 30 52 52 52 32 14 2 2 2 2 0 0 0 0
0 0 0 0 0 0 7 30 52 52 52 32 14 2 2 2 0 0 0 0
0 0 0 0 0 0 0 7 30 52 53 55 32 14 2 2 0 0 0 0
0 0 0 0 0 0 0 1 7 35 55 62 61 45 28 7 7 0 0 0
48 82 115 135 142 140 140 134 134 129 124 107 81 80 80 80 71 64 55 42
6 29 65 103 132 140 134 134 129 125 126 124 110 102 96 86 77 75 74 69
6 5 12 43 82 124 134 129 125 126 126 126 127 127 126 119 115 111 108 100
R=1.5
3 3 9 33 82 63 52 52 52 52 52 32 14 2 2 2 2 2 0 0
2 1 1 9 33 80 63 52 52 52 53 55 32 14 2 2 2 1 0 0
0 1 0 0 9 30 67 63 52 53 55 62 55 32 14 2 2 0 0 0
0 0 0 0 0 7 30 67 70 55 62 62 62 61 45 28 7 7 0 0
0 0 0 0 0 0 7 30 67 83 66 62 62 62 63 53 35 25 7 0
123 154 180 186 186 186 186 186 164 116 83 74 59 27 13 13 12 13 6 4
123 154 181 186 185 186 186 186 170 134 102 92 79 50 27 13 13 13 6 4
122 151 181 186 186 186 186 186 171 136 120 102 92 79 49 30 22 14 8 5
119 137 159 181 186 186 186 174 170 150 133 109 92 82 55 52 50 39 29 16
R=2
62 62 62 80 89 55 42 26 14 9 7 2 0 0 0 0 0 0 0 0
62 62 62 80 89 55 42 26 14 9 7 2 0 0 0 0 0 0 0 0
56 56 80 91 115 89 55 42 24 11 7 2 0 0 0 0 0 0 0 0
19 19 33 55 79 98 80 69 47 24 7 7 2 0 0 0 0 0 0 0
5 5 5 14 32 51 82 80 69 50 27 7 4 1 0 0 0 0 0 0
a d g
Simple 3*3 Neighbourhood e 3*3 Filter
b e h
c f i
k n q
l o r
m p
Filter (w)
Image f (x, y)
eprocessed = n*e + j*a + k*b + l*c + m*d + o*f + p*g + q*h + r*i
Performed for each pixel in the original image to generate the filtered image
1/ 1/ 1/
1/ 1/ 1/
1/ 1/ 1/
1/
9 9 9
1/ 1/ 1/
9 9 9
1/ 1/ 1/
9 9 9
95
90
85
1/ 1/
Filter
Image f (x, y)
e = 1/9*106 + 1/9*104 + 1/9*100 + 1/9*108 + 1/9*99 + 1/9*98 + 1/ *95 + 1/ *90 + 1/ *85 = 98.3333 9 9 9
Mean R=1
Mean R=4
WEIGHTED AVERAGE
Created by defining different weight for different pixels around the center pixel. Pixels closer to the center pixel are contribute more to the average Size of objects in the image should taken into account.
1/ 2/ 16 2/ 4/ 16 1/ 2/ 16
16
16
16
1/
g ( x, y )
s at b
w(s, t ) f ( x s, y t )
s at b
16
2/
16
1/
16
w(s, t )
Mean Filter
Median Filter
SPATIAL DIFFERENTIATION
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Differentiation measures the rate of change of a function. For a simplified explanation we will use a 1 dimensional example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
SPATIAL DIFFERENTIATION
1ST DERIVATIVE
The formula for the 1st derivative of a function is as follows:
f f ( x 1) f ( x) x
Calculates difference between subsequent values and measures the rate of change of the function
f(x)
5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7 0 -1 -1 -1 -1 0 0 6 -6 0 0 0 1 2 -2 -1 0 0 0 7 0 0 0
8 6 4
f (x)
0
-2 -4 -6 -8
2ND DERIVATIVE
The formula for the 2nd derivative of a function is as follows:
f f ( x 1) f ( x 1) 2 f ( x) 2 x
2
Takes into account the values both before and after the current value
f(x)
4 2 0 8 6
f(x)
4 2 0 -2 -4 -6 -8 10
f(x)
5 0 -5 -10 -15
THE LAPLACIAN
The Laplacian is defined as follows:
f f f 2 2 x y
2 2 2
f f ( x 1, y ) f ( x 1, y ) 2 f ( x, y ) 2 x
2
f f ( x, y 1) f ( x, y 1) 2 f ( x, y ) 2 y
2
f [ f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1)] 4 f ( x, y )
2
1
0
-4
1
1
0
Applying the Laplacian to an image we get a new image that highlights edges and other discontinuities
Original Image
=
Sharpened Image
In the final sharpened image edges and fine detail are much more obvious
g ( x, y) f ( x, y) f
2
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Original channel
Laplace filter
Subtraction result
http://www.biologyimagelibrary.com/Image - 21481_0_Miller_28_BIL27090
SHARPENING SUMMARY
A derivative operator is proportional to the degree of discontinuity of the image at the point at which the operator is applied.
Thus, image differentiation enhances edges and other discontinuities (such as noise) and deemphasizes areas with slowly varying gray-level values
Original Laplace
Applying a single spatial operation is usually not enough A combination of a range of techniques in will usually result in a better final result.
(b) Sharpened version of bone scan (c) achieved by subtracting (a) and Sobel filter of bone scan (a) (b)
(d)
The product of (c) and (e) which will be used as a mask (e)
Result of applying a power-law trans. Sharpened image to (g) which is sum of (a) (g) and (f) (f)
(h)