Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image Enhancement in the Spatial Domain.

Similar presentations


Presentation on theme: "Image Enhancement in the Spatial Domain."— Presentation transcript:

1 Image Enhancement in the Spatial Domain

2 Image Enhancement in the
Spatial Domain The spatial domain: The image plane For a digital image is a Cartesian coordinate system of discrete rows and columns. At the intersection of each row and column is a pixel. Each pixel has a value, which we will call intensity. The frequency domain : A (2-dimensional) discrete Fourier transform of the spatial domain We will discuss it in chapter 4. Enhancement : To “improve” the usefulness of an image by using some transformation on the image. Often the improvement is to help make the image “better” looking, such as increasing the intensity or contrast.

3 Background A mathematical representation of spatial domain enhancement: where f(x, y): the input image g(x, y): the processed image T: an operator on f, defined over some neighborhood of (x, y)

4 Gray-level Transformation

5 Some Basic Gray Level Transformations

6 Image Negatives Let the range of gray level be [0, L-1], then

7 Log Transformations where c : constant

8 Power-Law Transformation
where c, : positive constants

9 Power-Law Transformation
Example 2: Gamma Correction

10 Piecewise-Linear Transformation Functions Case 1: Contrast Stretching

11 Piecewise-Linear Transformation Functions Case 2:Gray-level Slicing
An image Result of using the transformation in (a)

12 Piecewise-Linear Transformation Functions Case 3:Bit-plane Slicing
It can highlight the contribution made to total image appearance by specific bits. Each pixel in an image represented by 8 bits. Image is composed of eight 1-bit planes, ranging from bit-plane 0 for the least significant bit to bit plane 7 for the most significant bit.

13 Piecewise-Linear Transformation Functions
Bit-plane Slicing: A Fractal Image

14 Piecewise-Linear Transformation Functions
Bit-plane Slicing: A Fractal Image 7 6 5 4 3 2 1

15 Enhancement Using Arithmetic/Logic Operations
Two images of the same size can be combined using operations of addition, subtraction, multiplication, division, logical AND, OR, XOR and NOT. Such operations are done on pairs of their corresponding pixels. Often only one of the images is a real picture while the other is a machine generated mask. The mask often is a binary image consisting only of pixel values 0 and 1. Example: Figure 3.27

16 Enhancement Using Arithmetic/Logic Operations
AND OR

17 Image Subtraction Example 1

18 Image Subtraction Example 2 When subtracting two images, negative pixel values can result. So, if you want to display the result it may be necessary to readjust the dynamic range by scaling.

19 A noisy image g(x,y) can be defined by
Image Averaging When taking pictures in reduced lighting (i.e., low illumination), image noise becomes apparent. A noisy image g(x,y) can be defined by where f (x, y): an original image : the addition of noise One simple way to reduce this granular noise is to take several identical pictures and average them, thus smoothing out the randomness.

20 Noise Reduction by Image Averaging Example: Adding Gaussian Noise
Figure 3.30 (a): An image of Galaxy Pair NGC3314. Figure 3.30 (b): Image corrupted by additive Gaussian noise with zero mean and a standard deviation of 64 gray levels. Figure 3.30 (c)-(f): Results of averaging K=8,16,64, and 128 noisy images.

21 Noise Reduction by Image Averaging Example: Adding Gaussian Noise
Figure 3.31 (a): From top to bottom: Difference images between Fig (a) and the four images in Figs (c) through (f), respectively. Figure 3.31 (b): Corresponding histogram.

22 Basics of Spatial Filtering
In spatial filtering (vs. frequency domain filtering), the output image is computed directly by simple calculations on the pixels of the input image. Spatial filtering can be either linear or non-linear. For each output pixel, some neighborhood of input pixels is used in the computation. In general, linear filtering of an image f of size MXN with a filter mask of size mxn is given by where a=(m-1)/2 and b=(n-1)/2 This concept called convolution. Filter masks are sometimes called convolution masks or convolution kernels.

23 Basics of Spatial Filtering

24 Basics of Spatial Filtering
Nonlinear spatial filtering usually uses a neighborhood too, but some other mathematical operations are use. These can include conditional operations (if …, then…), statistical (sorting pixel values in the neighborhood), etc. Because the neighborhood includes pixels on all sides of the center pixel, some special procedure must be used along the top, bottom, left and right sides of the image so that the processing does not try to use pixels that do not exist.

25 Smoothing Spatial Filters
Smoothing linear filters Averaging filters (Lowpass filters in Chapter 4)) Box filter Weighted average filter Box filter Weighted average

26 Smoothing Spatial Filters
The general implementation for filtering an MXN image with a weighted averaging filter of size mxn is given by where a=(m-1)/2 and b=(n-1)/2

27 Smoothing Spatial Filters Image smoothing with masks of various sizes

28 Smoothing Spatial Filters
Another Example

29 Order-Statistic Filters
Median filter: to reduce impulse noise (salt-and-pepper noise)

30 Sharpening Spatial Filters
Sharpening filters are based on computing spatial derivatives of an image. The first-order derivative of a one-dimensional function f(x) is The second-order derivative of a one-dimensional function f(x) is

31 Use of Second Derivatives for Enhancement
The Laplacian Development of the Laplacian method The two dimensional Laplacian operator for continuous functions: The Laplacian is a linear operator.

32 Use of Second Derivatives for Enhancement
The Laplacian

33 Use of Second Derivatives for Enhancement
The Laplacian To sharpen an image, the Laplacian of the image is subtracted from the original image. Example: Figure 3.40

34

35 Use of Second Derivatives for Enhancement
The Laplacian: Simplifications The g(x,y) mask Not only

36 Use of First Derivatives for Enhancement
The Gradient Development of the Gradient method The gradient of function f at coordinates (x,y) is defined as the two-dimensional column vector: The magnitude of this vector is given by

37 Use of First Derivatives for Enhancement
The Gradient Roberts cross-gradient operators Sobel operators

38 Use of First Derivatives for Enhancement
The Gradient: Using Sobel Operators

39 Combining Spatial Enhancement Methods

40 Combining Spatial Enhancement Methods

41


Download ppt "Image Enhancement in the Spatial Domain."

Similar presentations


Ads by Google