Aim: - Objective:-: Experiment 7
Aim: - Objective:-: Experiment 7
Aim: - Objective:-: Experiment 7
Aim: - Implementation of contrast stretching, Dynamic range compression and Bit Plane Slicing.
Objective:-
To conduct contrast stretching.
To bring images out of visible spectrum range to normal range through Dynamic range
compressor.
To implement Steganography through encoding images with bit plane Slicing.
Problem Definition:-
Input grayscale image.
Apply Contrast Stretching through linear scaling function.
Apply Dynamic range compression through log(1+|d|)
Apply Bit Plane Slicing using Binary bits cutting from MSB to LSB.
Generate output.
Theory:-
Contrast Sequencing
Contrast stretching (often called normalization) is a simple image enhancement technique that attempts to
improve the contrast in an image by `stretching' the range of intensity values it contains to span a desired
range of values, e.g. the the full range of pixel values that the image type concerned allows. It differs from
the more sophisticated histogram equalization in that it can only apply a linear scaling function to the
image pixel values. As a result the `enhancement' is less harsh. (Most implementations accept a graylevel
image as input and produce another graylevel image as output.)
How It Works
Before the stretching can be performed it is necessary to specify the upper and lower pixel value limits
over which the image is to be normalized. Often these limits will just be the minimum and maximum
pixel values that the image type concerned allows. For example for 8-bit graylevel images the lower and
upper limits might be 0 and 255. Call the lower and the upper limits a and b respectively.
The simplest sort of normalization then scans the image to find the lowest and highest pixel values
currently present in the image. Call these c and d. Then each pixel P is scaled using the following
function:
Values below 0 are set to 0 and values about 255 are set to 255.
The problem with this is that a single outlying pixel with either a very high or very low value can severely
affect the value of c or d and this could lead to very unrepresentative scaling. Therefore a more robust
approach is to first take a histogram of the image, and then select c and d at, say, the 5th and 95th
percentile in the histogram (that is, 5% of the pixel in the histogram will have values lower than c, and 5%
of the pixels will have values higher than d). This prevents outliers affecting the scaling so much.
Another common technique for dealing with outliers is to use the intensity histogram to find the most
popular intensity level in an image (i.e. the histogram peak) and then define a cutoff fraction which is the
minimum fraction of this peak magnitude below which data will be ignored. The intensity histogram is
then scanned upward from 0 until the first intensity value with contents above the cutoff fraction. This
defines c. Similarly, the intensity histogram is then scanned downward from 255 until the first intensity
value with contents above the cutoff fraction. This defines d.
Some implementations also work with color images. In this case all the channels will be stretched using
the same offset and scaling in order to preserve the correct color ratios.
In terms of 8-bits bytes, plane 0 contains all lowest order bits in the bytes comprising the pixels in the
image and plane 7 contains all high order bits.
The bit plane slicing is a fundamental technique of image processing in which the image is sliced into
different planes (each layer contains sequences of only binary digits 0 or 1). It is ranges from plane1
which contains the least significant bit (LSB) to the last plane N which contains the most significant bit
(MSB), where the number of layers depends on the bit depth of the image. The bit depth means how
many bits need to represent the pixel’s intensity. For example if the image is grayscale then the bit depth
is 8bit and it will be separated into 8 layers, or into 24 layers if the image is colored i.e. bit depth is 24bit.
MSB Plane
Centre bit plane
LSB Plane
Conclusion:-
Bit plane slicing is the conversion of image into multilevel binary image.
The Dynamic Range Compression tool is used to compress the dynamic range of an image,
reducing highlights and lifting shadows.
Contrast stretching enhances the contrast of the image by’stretching ’ the intensity range.