Image Enhancement Process an image to make the

  • Slides: 29
Download presentation
Image Enhancement Process an image to make the result more suitable than the original

Image Enhancement Process an image to make the result more suitable than the original image for a specific application – Image enhancement is subjective (problem/application oriented) Image enhancement methods Spatial domain: Direct manipulation of pixel in an image (on the image plane) Frequency domain: Processing the image based on modifying the Fourier transform of an image Many techniques are based on various combinations of methods from these two categories 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 1

Image Enhancement § Goals: – To improve the subjective quality of an image for

Image Enhancement § Goals: – To improve the subjective quality of an image for human viewing; (an image needs improvement) – To modify the image in such a way as to make it more suitable for further analysis and automatic extraction of its contents. (low-level features must be detected) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 2

Image Enhancement Process 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC

Image Enhancement Process 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 3

Image Enhancement Types of image enhancement operations Point/pixel operations Output value at specific coordinates

Image Enhancement Types of image enhancement operations Point/pixel operations Output value at specific coordinates (x, y) is dependent only on the input value at (x, y) Local operations The output value at (x, y) is dependent on the input values in the neighborhood of (x, y) Global operations The output value at (x, y) is dependent on all the values in the input image 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 4

Basic concepts Spatial domain enhancement methods can be generalized as g(x, y)=T[f(x, y)] f(x,

Basic concepts Spatial domain enhancement methods can be generalized as g(x, y)=T[f(x, y)] f(x, y) : input image g(x, y): processed (output) image T[*] : an operator on f (or a set of input images), defined over neighborhood of (x, y) Neighborhood about (x, y): a square or rectangular subimage area centered at (x, y) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 5

Basic Concepts 3 x 3 neighborhood about (x, y) 11/5/2020 COMSATS Institute of Information

Basic Concepts 3 x 3 neighborhood about (x, y) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 6

Basic concepts Pixel/point operation: Neighborhood of size 1 x 1: g depends only on

Basic concepts Pixel/point operation: Neighborhood of size 1 x 1: g depends only on f at (x, y) T: a gray-level/intensity transformation/mapping function Let r = f(x, y) s = g(x, y) r and s represent gray levels of f and g at (x, y) Then s = T(r) Local operations: g depends on the predefined number of neighbors of f at (x, y) Implemented by using mask processing or filtering Masks (filters, windows, kernels, templates) : a small (e. g. 3× 3) 2 -D array, in which the values of the coefficients determine the nature of the process 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 7

Linear Point/Pixel Transformations § Example 8. 1 c = 1 b = -56 c

Linear Point/Pixel Transformations § Example 8. 1 c = 1 b = -56 c = 2 b = 32 11/5/2020 c = 0. 3 b = 0 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 8

Linear Point/Pixel Transformations § Contrast manipulation 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital

Linear Point/Pixel Transformations § Contrast manipulation 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 9

Linear Point/Pixel Transformations § Auto Contrast 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital

Linear Point/Pixel Transformations § Auto Contrast 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 10

Linear Point/Pixel Transformations § Auto Contrast Example I = imread('salzburg_before. png'); f = double(I);

Linear Point/Pixel Transformations § Auto Contrast Example I = imread('salzburg_before. png'); f = double(I); fmin = min(f)) fmax = max(f)) g = uint 8(255*(f-fmin)/(fmax-fmin)); imshow(g) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 11

Common pixel operations § Image negatives § Log transformations § Power-law transformations 11/5/2020 COMSATS

Common pixel operations § Image negatives § Log transformations § Power-law transformations 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 12

Image negatives § Reverses the gray level order § For L gray levels the

Image negatives § Reverses the gray level order § For L gray levels the transformation function is s =T(r) = (L-1)-r Input image (X-ray image) 11/5/2020 Output image (negative) COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 13

Image scaling s =T(r) = a. r 11/5/2020 (a is a constant) COMSATS Institute

Image scaling s =T(r) = a. r 11/5/2020 (a is a constant) COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 14

Log transformations Function of 11/5/2020 s = c Log(1+r) COMSATS Institute of Information Technology,

Log transformations Function of 11/5/2020 s = c Log(1+r) COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 15

Log transformations Properties of log transformations – For lower amplitudes of input image the

Log transformations Properties of log transformations – For lower amplitudes of input image the range of gray levels is expanded – For higher amplitudes of input image the range of gray levels is compressed Application: – Dynamic range of a processed image far exceeds the capability of the display device • (e. g. display of the Fourier spectrum of an image) – Also called “dynamic-range compression / expansion” 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 16

Log transformations Fourier spectrum with values of range 0 to 1. 5 x 106

Log transformations Fourier spectrum with values of range 0 to 1. 5 x 106 scaled linearly 11/5/2020 The result applying log transformation, c=1 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 17

Log transformations 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331

Log transformations 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 18

Power-law Transformation Basic form: s = crg , where c & g are positive

Power-law Transformation Basic form: s = crg , where c & g are positive Plots of equation s = crg, For various values of g (c = 1) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 19

Power-law Transformation For γ < 1: Expands values of dark pixels, compress values of

Power-law Transformation For γ < 1: Expands values of dark pixels, compress values of brighter pixels For γ > 1: Compresses values of dark pixels, expand values of brighter pixels If γ=1 & c=1: Identity transformation (s = r) A variety of devices (image capture, printing, display) respond according to a power law and need to be corrected; Gamma (γ) correction The process used to correct the power-law response phenomena 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 20

Power-law Transformation § Example of gamma correction § To linearize the CRT response a

Power-law Transformation § Example of gamma correction § To linearize the CRT response a pre-distortion circuit is needed s = cr 1/g 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 21

Gamma correction Linear wedge gray scale image Response of CRT to Linear wedge Gamma

Gamma correction Linear wedge gray scale image Response of CRT to Linear wedge Gamma corrected wedge Output of monitor 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 22

Power-law Transformation: Example MRI image of fractured human spine 11/5/2020 Result of applying power-law

Power-law Transformation: Example MRI image of fractured human spine 11/5/2020 Result of applying power-law transformation c = 1, g = 0. 6 c = 1, g = 0. 4 c = 1, g = 0. 3 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 23

Power-law Transformation: Example Original satellite image Result of applying power-law transformation c = 1,

Power-law Transformation: Example Original satellite image Result of applying power-law transformation c = 1, g = 3. 0 Result of applying power -law transformation c = 1, g = 4. 0 11/5/2020 Result of applying power-law transformation c = 1, g = 5. 0 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 24

Piecewise-linear transformation Contrast stretching Goal: Increase the dynamic range of the gray levels for

Piecewise-linear transformation Contrast stretching Goal: Increase the dynamic range of the gray levels for low contrast images Low-contrast images can result from – poor illumination – lack of dynamic range in the imaging sensor – wrong setting of a lens aperture during image acquisition 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 25

Piecewise-linear transformation 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331

Piecewise-linear transformation 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 26

Piecewise-linear transformation § Specifying point transformations interactively – glsdemo 11/5/2020 COMSATS Institute of Information

Piecewise-linear transformation § Specifying point transformations interactively – glsdemo 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 27

Piecewise-linear transformation (Intensity Level Slicing) § Specifying point transformations interactively – glsdemo example 11/5/2020

Piecewise-linear transformation (Intensity Level Slicing) § Specifying point transformations interactively – glsdemo example 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 28

Piecewise-linear transformation (Intensity Level Slicing) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image

Piecewise-linear transformation (Intensity Level Slicing) 11/5/2020 COMSATS Institute of Information Technology, Lahore Digital Image Processing CSC 331 29