Anda di halaman 1dari 53

Image Enhancement in the Spatial Domain

Dr. Vipin Tyagi

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)

Dr. Vipin Tyagi

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)

Dr. Vipin Tyagi

Contrast Stretching
The values of r below m are compressed by the transformation function into a narrow range of s, towards black.

Dr. Vipin Tyagi

Dr. Vipin Tyagi

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

Dr. Vipin Tyagi

Power-Law Transformations

Dr. Vipin Tyagi

Gamma Correction

Dr. Vipin Tyagi

Gamma Correction

Dr. Vipin Tyagi

10

Gamma Correction

Dr. Vipin Tyagi

11

Piecewise-Linear Transformation Function Contrast Stretching

Dr. Vipin Tyagi

12

Gray-level Slicing :
highlighting a specific range of gray levels

Dr. Vipin Tyagi

13

Bit-plane slicing:
Instead of highlighting gray-level ranges, highlighting the contribution made to total image appearance by specific bits

Dr. Vipin Tyagi

14

Dr. Vipin Tyagi

15

Dr. Vipin Tyagi

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

Normalized histogram: p(rk)=nk/n

Histogram Processing

Dr. Vipin Tyagi

19

Equalisation Transformation Function

Dr. Vipin Tyagi

20

Dr. Vipin Tyagi

21

Dr. Vipin Tyagi

22

Dr. Vipin Tyagi

23

Dr. Vipin Tyagi

24

Histogram Matching/Specification

Dr. Vipin Tyagi

25

Local Enhancement

Dr. Vipin Tyagi

26

Dr. Vipin Tyagi

27

Dr. Vipin Tyagi

28

Dr. Vipin Tyagi

29

Enhancement using Arithmetic/Logic Operations

Dr. Vipin Tyagi

30

Image Subtraction

Dr. Vipin Tyagi

31

Enhancement by Image Subtraction

(Mask Mode Radiography)

Dr. Vipin Tyagi

32

Image Averaging

Dr. Vipin Tyagi

33

Dr. Vipin Tyagi

34

Spatial Filtering

Dr. Vipin Tyagi

35

Dr. Vipin Tyagi

36

Smoothing Spatial Filters


Used for blurring and noise reduction

Smoothing Linear (Averaging) filters ( Low Pass filters):

Dr. Vipin Tyagi

37

Dr. Vipin Tyagi

38

Dr. Vipin Tyagi

39

Order-Statistics Filters

Dr. Vipin Tyagi

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

Dr. Vipin Tyagi 41

Sharpening spatial Filters

Dr. Vipin Tyagi

42

Use of II derivatives for Enhancement The Laplacian

Dr. Vipin Tyagi

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

Dr. Vipin Tyagi

45

Dr. Vipin Tyagi

46

Unsharp Masking and HighBoost filtering

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

Dr. Vipin Tyagi

48

Dr. Vipin Tyagi

49

First Derivative : the Gradient

Dr. Vipin Tyagi

50

Dr. Vipin Tyagi

51

Combining Spatial Enhancement methods

Dr. Vipin Tyagi

52

Dr. Vipin Tyagi

53

Anda mungkin juga menyukai