Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intensity Transformations and Spatial Filtering

Similar presentations


Presentation on theme: "Intensity Transformations and Spatial Filtering"— Presentation transcript:

1 Intensity Transformations and Spatial Filtering

2 Basics of Intensity Transformation and Spatial Filtering
Spatial Domain Process Neighborhood is rectangle, centered on (x,y), and much smaller in size than image. Neighborhood size is 1x1, 3x3, 5x5, etc.

3 Intensity Transformation
T[f(x,y)] is Intensity Transformation, if the neighborhood size is 1x1. Intensity Transformation can be written as follows s = T[r], where s = g(x,y), and r = f(x,y)

4 Image Negatives s = L-1 – r where intensity level is in the range

5 Log Transformations s = c Log(1+r)
Log Transformation is used to expand the value of the dark pixels while compressing the higher-level value. It is used to compress the intensity of an image which has very large dynamic range.

6 Log Transformations of Fourier Spectrum
Original Image Fourier Spectrum Log Transform of Fourier Spectrum We cannot see the Fourier spectrum, because its dynamic range is very large.

7 Power-Law (Gamma) Transformations
If <1, expand dark pixels, compress bright pixels. If >1, compress dark pixels, expand bright pixels.

8 Examples of Gamma Transformations

9 Contrast Stretching If r<r1 then s = r*s1/r1
If r1<= r<=r2 then s = (r-r1)*(s2-s1)/(r2-r1)+s1 If r>r2 then s = (r-r2)*(255-s2)/(255-r2)+s2 If r1=r2 and s1=0,s2=255, the transform is called “Threshold Function”.

10 Examples of Contrast Stretching

11 Contrast Stretching in Medical Image
Window Width/Level(Center) s1=0,s2=255 width (w)=r2-r1, level (c)=(r1+r2)/2

12 Histogram & PDF h(r) = nr
where nr is the number of pixels whose intensity is r. The Probability Density Function (PDF)

13 Cumulative Distribution Function (CDF)
PDF CDF Transfer Function s r

14 Example of Histogram and Cumulative Distribution Function (CDF)

15 Low Contrast Image The image is highly concentrated on low intensity values. The low contrast image is the image which is highly concentrated on a narrow histogram. High Concentrate Low Concentrate

16 Histogram Equalization
The Histogram Equalization is a method which makes the histogram of the image as smooth as possible

17 The PDF of the Transformed Variable
s = Transformed Variable. = The PDF of r = The PDF of s

18 Transformation Function of Histogram Equalization
The PDF of s

19 Histogram Equalization Example
Intensity # pixels 20 1 5 2 25 3 10 4 15 6 7 Total 100 CDF of Pr 20/100 = 0.2 (20+5)/100 = 0.25 ( )/100 = 0.5 ( )/100 = 0.6 ( )/100 = 0.75 ( )/100 = 0.8 ( )/100 = 0.9 ( )/100 = 1.0 1.0

20 Histogram Equalization Example (cont.)
Intensity (r) No. of Pixels (nj) Acc Sum of Pr Output value Quantized Output (s) 20 0.2 0.2x7 = 1.4 1 5 0.25 0.25*7 = 1.75 2 25 0.5 0.5*7 = 3.5 3 10 0.6 0.6*7 = 4.2 4 15 0.75 0.75*7 = 5.25 0.8 0.8*7 = 5.6 6 0.9 0.9*7 = 6.3 7 1.0 1.0x7 = 7 Total 100

21 Histogram Matching How to transform the variable r whose PDF is to the variable t whose PDF is T( ) G-1( ) r s t


Download ppt "Intensity Transformations and Spatial Filtering"

Similar presentations


Ads by Google