Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department...

13
Image Enhancement Image Enhancement Digital Image Processing Instructor: Dr. Cheng- Chien Liu Department of Earth Sciences National Cheng Kung University Last updated: 16 September 2003 Chapter 4 Chapter 4

Transcript of Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department...

Page 1: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Image EnhancementImage Enhancement

Digital Image ProcessingInstructor: Dr. Cheng-Chien Liu

Department of Earth Sciences

National Cheng Kung University

Last updated: 16 September 2003

Chapter 4Chapter 4

Page 2: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

IntroductionIntroduction

Image enhancementImage enhancement• Subjectively look better

More detailsRemove unwanted flickeringEnhance contrast

• Two approachesStatistics of the gray values of the image

Manipulate the histogram Principal component analysis Rank order filtering

Spatial frequency content of the image

Page 3: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

HistogramHistogram

HistogramHistogram• Number(gray level)

• Normalized probability density function

• Good or bad imageGood image more spread of histogramBad image narrow histogram

• Modification of histogramps(s)ds = pr(r)dr

Page 4: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Histogram (cont.)Histogram (cont.)

Histogram equalizationHistogram equalization• s = [ 0

rpr(x)dx] / cc = ps(s)

• Much more spread, but not flat (Figure 4.2 a – d)

Histogram equalization with random Histogram equalization with random additionaddition• Randomly re-distribute the pixels with neighboring

gray values generate an absolutely flat histogram

• Figure 4.2 e – f

Page 5: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Histogram (cont.)Histogram (cont.)

Histogram manipulation with function Histogram manipulation with function ppss((ss))• ps(s)ds = pr(r)dr• Three-step process

EqualizationSpecify the histogram and obtain the transformation w = T2(s)Apply the inversion to the equalized histogram

• Figure 4.3• Example 4.1

Locally manipulating histogramLocally manipulating histogram• Scan the image with a window inside• Modify the histogram but alter only the center pixel• Figure 4.4 – 4.6

Flat black patch receive too little light to record anythingAmplify non-existing information look damaged

Page 6: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Histogram (cont.)Histogram (cont.)

Alternative manipulationAlternative manipulation• g(x,y) = m(x,y) + A[f(x,y)- m(x,y)]

m(x,y): the mean of the distribution of pixels inside a window(x,y): the deviation of the distribution of pixels inside a window

• TransformAreas with lower variance to be amplified most A = kM / (x,y)

k: constant M: the average grey value of the image

• Example 4.4 (d)Window size 5 5 with k = 3

• Example 4.5 (d), 4.6 (d)Window size 5 5 with k = 3 + post-processing of histogram equalization

Page 7: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Principal component analysisPrincipal component analysis

Multi-spectral image (Fig 4.7)Multi-spectral image (Fig 4.7)• The pixels plotted in the multi-spectral space form a cluster

PCA (L-E transform)PCA (L-E transform)• A linear transformation of the coordinate system

Three new axes coincide with the directions of the three largest spreads of the point distribution

The data are uncorrelated in the new set of axes

ProcessesProcesses• Find the mean xi0

• C(i,j) = (1/N2) kl[xi(k,l) - xi0][xj(k,l) - xj0]k = 1, 2, …, N; l = 1, 2, …, N

• Find eigenvalues of C(i,j), form eigenvector matrix A• Linear transform: y = Ax

Page 8: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Principal component analysis (cont.)Principal component analysis (cont.)

AdvantagesAdvantages• Convey the maximum information in a certain

number of bits• The 1st principal component has the maximum

contrast and informationFigure 4.8

DisadvantagesDisadvantages• Gray values have no physical meaning

connot be used for classificatione.g. water, trouser in Figure 4.8 (d) – (f)

Example 4.2 – 4.5Example 4.2 – 4.5

Page 9: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Rank order filteringRank order filtering

Types of noiseTypes of noise• Additive noise

Impulse noise, Gaussian noise, salt and pepper noisee.g. additive zero-mean Gaussian noise a zero-mean

Gaussian probability function is added to the true value

• Multiplicative noisee.g. variable illumination

Page 10: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Rank order filtering (cont.)Rank order filtering (cont.)

Median filterMedian filter• Principle

Choose a small window take median value force points with distinct intensities to be more like their neighbors eliminate intensity spikes which appear isolated

• Remove the impulse noise almost completelye.g. Figure 4.9 (c)

• Not good for additive Gaussian noisee.g. Figure 4.9 (d)

Page 11: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Rank order filtering (cont.)Rank order filtering (cont.)

Smoothing the imageSmoothing the image• Principle

Choose a small window take median value force points with distinct intensities to be more like their neighbors eliminate intensity spikes which appear isolated

• Remove additive Gaussian noisee.g. Figure 4.9 (f)

• Not good for the impulse noisee.g. Figure 4.9 (e)

Page 12: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Rank order filtering (cont.)Rank order filtering (cont.)

Lowpass filterLowpass filter• Principle

Signal and noise are uncorrelatedFlat spectrum of noise (Fig 4.11)Use a lowpass filter kill off all higher frequency noises

• Fig 4.12The ideal lowpass filter in 2D in the frequency domain r0

• DrawbackAlso kill off the useful information of the image buried in these high frequencies

clean but blurred image Sharpening enhance small fluctuations in the intensity of the image, noise included High pass filter (Fig 4.13)

• ProcedureFournier transformMultiply with a filter functionInverse Fournier transform

Page 13: Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.

Rank order filtering (cont.)Rank order filtering (cont.)

Homomorphic filterHomomorphic filter• f(x, y) = i(x, y)r(x, y)

i(x, y): illumination function Uniform low-frequency components

r(x, y): reflectance function Sharp transitions in the intensity of an image high-frequency components

• PrincipleSeparate i and r take logarithmln f(x, y) = ln i(x, y) + ln r(x, y)Enhance the high frequencies and suppress the low frequencyFig 4.15Fig 4.16