Download presentation
Presentation is loading. Please wait.
Published byBaldric Short Modified over 9 years ago
1
Image enhancement in the spatial domain
2
Human vision for dummies Anatomy and physiology Wavelength Wavelength sensitivity
3
Human vision for dummies (2) Visual perception of the image Contrast (local change in brightness) eye has logarithmic perception of brightness Acuity (details) best resolution: 500 lux, 40 cm => 0.16 mm => 0.16 mm Object border Borders are important and also context-dependent Color The human eye is more sensitive to color than brightness
4
Optical illusions http://www.optillusions.com/
5
Image enhancement We want to create an image which is ”better” in some sense. ► Transformation is pointwise ► Helps visual interpretation (brightening, sharpening…) => SUBJECTIVE ► Pre-processing for a subsequent image analysis algorithm => PERF = PERF of IA TASK ► Make the image more ”specific” => APPLICATION DEPENDENT f(x,y)g(x,y) Original imageNew image T
6
Image (pre-) Processing Image processing can be performed in the ► Spatial domain ► Frequency domain that is after Fourier transform (next two lectures) We have three types of transforms in the spatial domain : ► Pixel brightness transforms, point processing (depend only on the pixel value itself) ► Spatial filters, local transforms or local processing (depend on a small neighborhood around the pixel) ► Geometric transforms
7
Pixel brightness transforms ► Each pixel in the output image depends directly on the corresponding pixel in the input image One-to-one transform: pointwise ► Common transforms inverse contrast stretching logarithmic exponential ► With more than one input image: sums, mean images statistical operations (variance, t-test…) ► Pixel brightness transforms are easy to generalize to 3D
8
Grey scale histogram ► A grey scale histogram shows how many pixels there are of each grey level (intensity level).
10
original image inverse transform logarithmic transform (neutral transform)
11
How is the histogram changed? ► Explains the terms - compression - expansion you find sometimes in the textbooks.
12
Example : the inverse transform
13
brightness (addition/subtraction) contrast = histogram stretching original image
14
Paint Shop Pro example ► What do the function do? ► How to use them to get the best results? And why it is best. ► Implementation: Look Up Table (LUT) Note: MATLAB V6.0 with IP Toolbox 3.0, also has these tools
15
Histogram equalization ► Contrast / Brightness adjustments sometimes need to be automatized ► What can be “optimal” contrast for an image? => FLAT histogram ► It can also be useful to do histogram normalization i.e.: to get a given shape for the histogram (see GW 3.3.2)
16
r k n k p r (r k ) s k output 0 /7=0 249790.380.383 1 /7=0.14 216360.330.715 2 /7=0.29 108650.170.886 3 /7=0.43 31220.050.936 4 /7=0.57 14110.020.957 5 /7=0.71 6560.010.967 6 /7=0.86 25830.041.007 7 /7=1 2840.001.007 Histogram Equalization, example quantization interval [0 7], image size 256x256
17
original image histogram equalization transformation by probability density function - see black board notes
19
Adaptative / localized histogram equalization
20
Relations between pixels A picture element (pixel) has 4 or 8 neighbors in 2D depending on neighbor definition: ► 4-neihgborhood - each neighbor must share an edge with the pixel ► 8- neighborhood - each neighbor must share an edge or a corner with the pixel 4- neighborhood 8- neighborhood
21
Spatial filtering In spatial filtering, the pixel in the output image is given a value calculated from a local neighborhood in the input image. The local neighborhood is described by a mask, or spatial filter (typical sizes 3x3, 5x5, 7x7… pixels) Filtering is performed by letting the mask move over the image. The center pixel in the output image is given a value that depends on the input image and the weights of the mask. Several types of spatial filters: ► Linear filters ► Fractile filters ► Adaptative filters (steerable) 1 1 1 1 1 1 1 1 1
22
Convolution
23
Filtering: implementation ► Generic code for P(x,y) in image for F(u,v) in filter Q(x,y) += F(u,v) P(x-u,y-v) end ► Managing the border Outside pixel value set to zero Mirroring of the border pixel values Changing filter size along the border (BEST, but slower) (-1,-1)(0,-1)(1,-1) (-1,0)(0,0)(1,0) (-1,1)(0,1)(1,1)
24
Spatial filtering original image mean filter = ”smoothing” Laplace filterLaplace + original image = ”sharpening”
25
Spatial filters Linear filters: Smoothing filters mean filters Gauss filters Edge enhancing filter Sobel operator Prewitt operator Laplace operator Fractile filters** Median, Min, Max **have no correspondence in frequency domain For details, see next lecture…
26
Mean filtering original image mean 3x3mean 5x5mean 11x11
27
Edge enhancing filters ► The Sobel operator: detection of horizontal edges -2000 121
28
► The Laplace operator: detection of edges independent of direction Edge enhancing filters004 00
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.