Spatial domain methods operate directly on pixels. Spatial domain processes are expressed as :
g(x,y) = T [ f(x,y)], where f(x,y) is input image and g(x,y) is processed image, T is an operator on f, defined over some neighborhood of (x,y)
The simplest form of T is when the neighborhood of size 1x1 (single pixel). In this case, g depends only on the value of f at (x,y) and T becomes a gray-level (intensity or mapping) transformation function of the form s = T(r) where r and s are variable denoting the gray level of f(x,y) and g(x,y) at any point (x,y)
Contrast Stretching
The values of r below m are compressed by the transformation function into a narrow range of s, towards black.
Image Negatives:
Negative of an image with gray levels [0, L-1] is obtained using transformation : s = L-1-r
Suited for enhancing white or gray detail embedded in dark regions of an image, especially when the black areas are dominant in size.
Dr. Vipin Tyagi 6
Log Transformations:
s = c log (1+r), c = contt, r >= 0. Transformation maps a narrow range of low gray-level values in the input image into a wider range of output levels
Power-Law Transformations
Gamma Correction
Gamma Correction
10
Gamma Correction
11
12
Gray-level Slicing :
highlighting a specific range of gray levels
13
Bit-plane slicing:
Instead of highlighting gray-level ranges, highlighting the contribution made to total image appearance by specific bits
14
15
16
Image Histograms
The histogram of an image shows us the distribution of gray levels in the image Massively useful in image processing, especially in segmentation
Frequencies
Gray Levels
Dr. Vipin Tyagi 17
Histogram Processing
The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(rk)=nk, where:
rk is the kth gray level nk is the # pixels in the image with that gray level n is the total number of pixels in the image k = 0, 1, 2, , L-1 sum of all components = 1
Dr. Vipin Tyagi 18
Histogram Processing
19
20
21
22
23
24
Histogram Matching/Specification
25
Local Enhancement
26
27
28
29
30
Image Subtraction
31
32
Image Averaging
33
34
Spatial Filtering
35
36
37
38
39
Order-Statistics Filters
40
To perform median filtering sort the values of the pixel and its neighbors, determine their median and assign this value to that pixel. - 3X3 neighborhood median is 5th largest value, for 5X5 median is 13th largest value - Median filter force points with distinct gray levels to be more like their neighbors - Isolated clusters which are light or dark with respect to neighbors and whose area is less than one half the filter area are eliminated
42
43
Because the Laplacian is a derivative operator, its use highlights gray-level discontinuities in an image and deemphasizes regions with slowly varying gray levels. This will tend to produce images that have grayish edge lines and other discontinuities, all superimposed on a dark, featureless background. Background features can be recovered while still preserving the sharpening effect of the Laplacian operation simply by adding the original and Laplacian images
Dr. Vipin Tyagi 44
45
46
One of the principal applications of boost filtering is when the input image is darker than desired. By varying the boost coefficient, it generally is possible to obtain an overall increase in average gray level of the image, thus helping to brighten the final result
Dr. Vipin Tyagi 47
48
49
50
51
52
53