25
Image Enhancement • Principal objective of enhancement is to process an image so that the result is more suitable than the original image for a specific application.

Enhancement in Spatial Domain

Embed Size (px)

Citation preview

Page 1: Enhancement in Spatial Domain

Image Enhancement

• Principal objective of enhancement is to

process an image so that the result is more

suitable than the original image for a

specific application.

Page 2: Enhancement in Spatial Domain

Categories

• Spatial domain: the term spatial domain refers to the image plane itself; approaches in this category are based on direct manipulation of pixels in an image.

• Frequency domain: processing techniques are based on modifying the Fourier transform of an image.

Page 3: Enhancement in Spatial Domain

Background

• Spatial domain processes will be denoted by the expression

g(x, y) = T [ f(x, y) ]

where f(x, y) is the input image,

g(x, y) is the processed image,

and T is an operator on f, defined over some neighbourhood of (x, y).

Page 4: Enhancement in Spatial Domain
Page 5: Enhancement in Spatial Domain

Point Processing

• When the neighborhood is of size l x l, g depends only on the value of f at (x, y), and T becomes a gray-level (also called an intensity or mapping) transformation function of the form

s = T(r)

where, r and s are variables denoting, respectively, the gray level of f(x, y) and g(x, y) at any point (x, y).

Page 6: Enhancement in Spatial Domain

Some Basic Gray Level Transformations

• linear transformations negative identity

• logarithmic transformations log inverse-log

• power-law transformations nth powernth root

Page 7: Enhancement in Spatial Domain

Image Negative

• Equivalent of a photographic negative

• Input gray level: [ 0, L − 1 ]

• Transformation is given by

s = L − 1 − r

• Suited for enhancing white or gray detail embedded in dark regions of an image, especially when the black areas are dominant in size

Page 8: Enhancement in Spatial Domain

Log Transformations

• Maps a narrow range of low intensity values in input to a wider range of output levels. The opposite is true for higher values of input levels.

• Expand the values of dark pixels in an image while compressing the higher-level values. Opposite is true for inverse log transformation.

• Log function compresses the dynamic range of images with large variation in pixel values

• General form given by:

s = c log(1 + r), c is a constant, r ≥ 0

Page 9: Enhancement in Spatial Domain

Example: Log Transformations

Page 10: Enhancement in Spatial Domain

Power-law Transformations • General form given by:

s = crγ, c and γ are positive constants

• Fractional value of γ map a narrow range of dark input values into a wider range of output values; opposite is true for higher values of input levels

• The transformation reduces to identity values when c = γ = 1

• Different devices respond differently to pixel values according to power law

• Gamma-correction

• Typical values of γ for CRTs is between 1.8 and 2.5

• Gamma-correction is important if displaying the image accurately on a computer screen is of concern Images not properly corrected can look bleached out or too dark

Page 11: Enhancement in Spatial Domain

Power-law (Gamma) Transformations

Page 12: Enhancement in Spatial Domain

Example: Gamma Transformations

Page 13: Enhancement in Spatial Domain

Example: Gamma Transformations

Page 14: Enhancement in Spatial Domain

• The principal advantage is that the form of piecewise functions can be arbitrarily complex; in fact, a practical implementation of some important transformations can be formulated only as piecewise functions.

• The principal disadvantage is that their specification requires considerably more user input.

Piecewise-Linear Transformation Functions

Page 15: Enhancement in Spatial Domain

Piecewise-Linear Transformation Functions

• Contrast Stretching - Expands the range of intensity levels in an image so that it spans the full intensity range of the recording medium or display

• Intensity-level Slicing

- Highlighting a specific range of intensities in an image.

• Bit-plane Slicing

- Highlighting the contribution made to total image

appearance by specific bits

Page 16: Enhancement in Spatial Domain
Page 17: Enhancement in Spatial Domain

Contrast stretching

• The locations of points (r1, s1) and (r2, s2) control the shape of the transformation If r1 = s1 and r2 = s2, the transformation is a linear

function that produces no changes in gray levels.

If r1 = r2, s1 = 0 and s2 = L - 1, the transformation becomes a thresholding function that creates a binary image.

Intermediate values of (r1, s1) and (r2, s2) produce various degrees of spread in the gray levels of the output image, thus affecting its contrast.

Page 18: Enhancement in Spatial Domain

Intensity-level slicing

• Highlighting a specific range of gray levels in an image

• Two basic themes: display a high value for all gray levels in the range of

interest and a low value for all other gray levels; produces a binary image.

brightens (or, darkens) the desired range of gray levels but preserves the background and gray-level tonalities in the image.

Page 19: Enhancement in Spatial Domain

Highlight the major blood vessels and study the shape of the flow of the contrast medium (to detect blockages, etc.)

Measuring the actual flow of the contrast medium as a function of time in a series of images

Page 20: Enhancement in Spatial Domain

Bit-plane slicing • Highlighting the contribution made to total image appearance

by specific bits

• The higher-order bits (especially the top four) contain the majority of the visually significant data.

• The other bit planes contribute to more subtle details in the image.

Useful for analyzing the relative importance played by each bit of the image; helps in determining the adequacy of the number of bits used to quantize each pixel.

Useful for image compression.

Page 21: Enhancement in Spatial Domain
Page 22: Enhancement in Spatial Domain

Bit-plane Slicing

Page 23: Enhancement in Spatial Domain

Bit-plane Slicing

Page 24: Enhancement in Spatial Domain

Problem

Suppose r be the graylevel of the input image which has to be transformed to s by linear stretching. Let ni

and mi be the no. of pixels having i-th graylevel in the input and output images, respectively. Suppose for an 8-level image we have the following frequency table for the input graylevels. What will be the frequency table for the output graylevel.

i 0 1 2 3 4 5 6 7

ni 0 0 a b c d e 0

Page 25: Enhancement in Spatial Domain

Problem

Propose a set of gray-level-slicing transformations capable of producing all the individual bit planes of an 8-bit monochrome image. (For example, a transformation function with the property T(r) = 0 for r in the range [0, 127], and T(r) = 255 for r in the range [128, 255] produces an image of the 7th bit plane in an 8-bit image.)