CH 3 Image Enhancement in the Spatial domain

  • Slides: 44
Download presentation
CH 3. Image Enhancement in the Spatial domain 3. 1 Background 3. 2 Grey

CH 3. Image Enhancement in the Spatial domain 3. 1 Background 3. 2 Grey level transformations 3. 3 Histogram processing histogram equalization, histogram matching local enhancement 3. 4 Enhancement using A/L operations 3. 5 Basic spatial filtering 3. 6 Smoothing spatial filters 3. 7 sharpening spatial filters 3. 8 Combining spatial enhancement methods 1

3. 1 Background • Why image enhancement ? 1. processing an images so that

3. 1 Background • Why image enhancement ? 1. processing an images so that the result is more suitable than the original image for a SPECIFIC application. 2. Providing `better' input for other automated image processing techniques. • Two approaches - Spatial domain methods: operate directly on pixels - Frequency domain methods: operate on the Fourier transform of an image 2

3. 1 Background • What is spatial domain? - it refers to the aggregated

3. 1 Background • What is spatial domain? - it refers to the aggregated of pixels composing an image. • Spatial domain processes will be denoted by the expression g(x, y)=T[f(x, y)] where f(x, y) is the input image, g(x, y) is the processed image (output image), and T is an operator of f 3

Background 4

Background 4

Background Gray-level transformation functions for contrast Enhancement. 5

Background Gray-level transformation functions for contrast Enhancement. 5

3. 2 Gray-Level Transformations Some basic gray-level transformations: Three basic types of functions (Fig.

3. 2 Gray-Level Transformations Some basic gray-level transformations: Three basic types of functions (Fig. 3. 3) used for image enhancement: • Image negative transformations • Log transformations • Power-law transformations 6

7

7

Gray-Level Transformations § Image negative transform: s = T(r) • obtained by using the

Gray-Level Transformations § Image negative transform: s = T(r) • obtained by using the negative transformation s = L-1 – r e. g. Input=10, output=255 -10 - produces the equivalent of a photographic negative - suited for enhancing white or gray detail embedded in dark regions of an image. 8

3. 2. 1 Image negative 9

3. 2. 1 Image negative 9

3. 2. 2 Log transformations § Log transformations: s = c log(1+r) - Expand

3. 2. 2 Log transformations § Log transformations: s = c log(1+r) - Expand the values of dark pixels while compressing the high-level values - Compress the dynamic range of images with large variations 10

3. 2. 2 Log transformations INPUT IMAGE LOG TRANFORM IMAGE 11

3. 2. 2 Log transformations INPUT IMAGE LOG TRANFORM IMAGE 11

3. 2. 2 Log transformations 12

3. 2. 2 Log transformations 12

3. 2. 3 Power-law transformations 13

3. 2. 3 Power-law transformations 13

3. 2. 3 Power-law transformations 14

3. 2. 3 Power-law transformations 14

3. 2. 3 Power-law transformations 15

3. 2. 3 Power-law transformations 15

3. 2. 3 Power-law transformations 16

3. 2. 3 Power-law transformations 16

3. 2. 3 Power-law transformations 17

3. 2. 3 Power-law transformations 17

3. 2. 4 Piecewise-linear transform functions • Advantage: its form can be arbitrary complex

3. 2. 4 Piecewise-linear transform functions • Advantage: its form can be arbitrary complex over the previous functions • Disadvantage: require considerably more user input § Contrast stretching - One of the simplest piecewise function - Increase the dynamic range of the gray levels in the image - A typical transformation: control the shape of the transformation e. g. if r 1 = r 2, s 1=0 and s 2=L-1 threshold function 18

3. 2. 4 Piecewise-linear transform functions 19

3. 2. 4 Piecewise-linear transform functions 19

Contrast stretching 20

Contrast stretching 20

3. 2. 4 Piecewise-linear transform functions § Gray-level slicing - Highlight a specific range

3. 2. 4 Piecewise-linear transform functions § Gray-level slicing - Highlight a specific range of gray levels - Display a high value for all gray levels in the range of interest and a low value for all other gray levels : produce a binary image (Fig. 3. 11(a)) - Preserving background (Fig. 3. 11(b)) 21

Gray-level slicing 22

Gray-level slicing 22

Bit-plane slicing § Bit-plane slicing - Suppose that each pixel in an image is

Bit-plane slicing § Bit-plane slicing - Suppose that each pixel in an image is represented by 8 bits. - Imagine that the image is composed of eight 1 -bit planes, ranging from bit-plane 0 (the least significant bit) to bit-plane 7 (the most significant bit). 23

Bit-plane slicing Original Image Bit-plane 7 Bit-plane 6 Bit-plane 4 Bit-plane 1 24

Bit-plane slicing Original Image Bit-plane 7 Bit-plane 6 Bit-plane 4 Bit-plane 1 24

25

25

3. 3 Histogram Processing Types of processing: • Histogram Equalization • Histogram Matching(Specification) •

3. 3 Histogram Processing Types of processing: • Histogram Equalization • Histogram Matching(Specification) • Local Enhancement 26

3. 3. 1 Histogram equalization Histogram Equalization: - produce a level s for every

3. 3. 1 Histogram equalization Histogram Equalization: - produce a level s for every pixel value r in the input image. - the transformation function T(r) satisfies the following: (a) T(r) is single-valued and monotonically increasing in the interval 0 ≤ r ≤ 1; and (b) 0 ≤ T(r) ≤ 1 for 0 ≤ r ≤ 1 27

3. 3. 1 Histogram equalization 28

3. 3. 1 Histogram equalization 28

3. 3. 1 Histogram equalization - n = total # of pixel, nk =

3. 3. 1 Histogram equalization - n = total # of pixel, nk = #of pixel having gray-level k - Probability of occurrence of gray-level rk Pr(rk) = nk/n - Cumulative Distribution Function(CDF) - Histogram equalization(HE) results are similar to contrast stretching - the advantage: HE automatically determines a transformation function to produce a new image with a uniform histogram. 29

3. 3. 1 Histogram equalization 32

3. 3. 1 Histogram equalization 32

3. 3. 2 Histogram matching/specification Enhancement based on a uniform histogram is not always

3. 3. 2 Histogram matching/specification Enhancement based on a uniform histogram is not always the best approach It is useful sometimes to specify the shape of the histogram that we wish to have Suitable for interactive image enhancement Difficulty--building a meaningful histogram The procedure for histogram matching (Page 99)

3. 3. 2 Histogram matching/specification - Specify the desired density function and obtain the

3. 3. 2 Histogram matching/specification - Specify the desired density function and obtain the transformation function G(z): pz: specified desirable PDF for output -Find z by using s = v 34

Image Enhancement in the Spatial Domain

Image Enhancement in the Spatial Domain

3. 3. 2 Histogram matching/specification 36

3. 3. 2 Histogram matching/specification 36

3. 3. 2 Histogram matching/specification 37

3. 3. 2 Histogram matching/specification 37

3. 3. 2 Histogram matching/specification 38

3. 3. 2 Histogram matching/specification 38

3. 3. 3 Histogram Local Enhancement § Normally, transformation function based on the content

3. 3. 3 Histogram Local Enhancement § Normally, transformation function based on the content of an entire image. § Some cases it is necessary to enhance details over small areas in an image. § The histogram processing techniques are easily adaptable to local enhancement. 39

3. 3. 3 Histogram Local Enhancement 40

3. 3. 3 Histogram Local Enhancement 40

3. 3. 4 Histogram Statistics for Image Enhanc. Contrast manipulation using local statistics (the

3. 3. 4 Histogram Statistics for Image Enhanc. Contrast manipulation using local statistics (the mean and variance) is useful for images where part of the image is acceptable, but other parts may contain hidden features of interest. 41

42

42

3. 3. 4 Histogram Statistics for Image Enhanced Image Original Image 43

3. 3. 4 Histogram Statistics for Image Enhanced Image Original Image 43

Summary 3. 1 Background ◦ Why enhancement? Specific app. ◦ Spatial/freq. domain 3. 2

Summary 3. 1 Background ◦ Why enhancement? Specific app. ◦ Spatial/freq. domain 3. 2 Grey level transformations ◦ ◦ Image negatives Log transformations Power-law transformations Piecewise-linear transformation function Contrast stretching, gray-level slicing, bit-plane-slicing 3. 3 Histogram processing ◦ histogram equalization, ◦ histogram matching ◦ local enhancement t