Digital Image Processing Concepts Explained
Digital Image Processing Concepts Explained
Institute of Technology
ELECTRONICS AND COMMUNICATION ENGINEERING
Scheme: 2022
Module -2
Image Enhancement
Q1. Explain the concepts of Sampling and Quantization with respect to Image Processing.
distance being among the most common measures. A widely used definition of image resolution is the largest
number of discernible line pairs per unit distance (e.g., 100 lines pairs per mm). Dots per unit distance
is a measure of image resolution used commonly in the printing and publishing industry. Reducing the
spatial resolution of an images reduces the quality of an image, producing a checkerboard effect.
Intensity resolution similarly refers to the smallest discernible change in intensity level. Unlike spatial
resolution, which must be based on a per unit of distance basis to be meaningful, it is common practice
to refer to the number of bits used to quantize intensity as the intensity resolution. For example, it is
common to say that an image whose intensity is quantized into 256 levels has 8 bits of intensity
resolution. Because true discernible changes in intensity are influenced not only by noise and saturation
values but also by the capabilities of human perception, saying than an image has 8 bits of intensity
resolution is nothing more than a statement regarding the ability of an 8-bit system to quantize intensity
in fixed increments of units of intensity amplitude.
Reducing the intensity resolution causes false contouring. It is caused by the use of an insufficient
number of intensity levels in smooth areas of a digital image.
Q3. Describe Brightness Adaptation and Discrimination
As the digital images are displayed as a discrete set of intensities, the eye’s ability to discriminate
between different intensity levels is an important consideration in presenting image processing results.
The range of light intensity levels to which the human visual system can adapt is enormous—on the
order of 1010 from the scotopic threshold to the glare limit. Experimental evidence indicates that
subjective brightness (intensity as perceived by the human visual system) is a logarithmic function of
the light intensity incident on the eye.
Figures 2a and 2b shows the brightness sensation curve and variation of weber ratio as a function of
intensity. The long solid curve represents the range of intensities to which the visual system can adapt.
In photopic vision alone, the range is about the transition from scotopic to photopic vision is gradual
over the approximate range from 0.001. to 0.1 millilambert (to in the log scale), as the double branches
of the adaptation curve in this range show.
The essential point in interpreting the impressive dynamic range is that the visual system cannot operate
over such a range simultaneously. Rather, it accomplishes this large variation by changing its overall
sensitivity, a phenomenon known as brightness adaptation. The total range of distinct intensity levels
the eye can discriminate simultaneously is rather small when compared with the total adaptation range.
For any given set of conditions, the current sensitivity level of the visual system is called the brightness
adaptation level, which may correspond, for example, to brightness. The short intersecting curve
represents the range of subjective brightness that the eye can perceive when adapted to this level. This
range is rather restricted, having a level at and below which all stimuli are perceived as indistinguishable
blacks. The upper portion of the curve is not actually restricted but, if extended too far, loses its meaning
because much higher intensities would simply raise the adaptation level higher than B a.
Fig 2a: Range of Subjective Brightness Fig 2b: Weber Ratio as a function of Intensity
where the four coefficients are determined from the four equations in four unknowns that can be written
using the four nearest neighbors of point. Bilinear interpolation gives much better results than nearest
neighbor interpolation, with a modest increase in computational burden. The next level of complexity is
bicubic interpolation, which involves the sixteen nearest neighbors of a point. The intensity value
assigned to point is obtained using the equation
where the sixteen coefficients are determined from the sixteen equations in sixteen unknowns that can
be written using the sixteen nearest neighbors of point.
Q6. Explain some basic relationships between pixels with respect to neighbors of a pixel.
A pixel p at coordinates (x, y) has four horizontal and vertical neighbors whose coordinates are given
by
This set of pixels, called the 4-neighbors of p is denoted by N4(p). Each pixel is at a unit distance from
(x, y) and some of the neighbor locations of p lie outside the digital image if (x, y) is on the border of
the image.
The four diagonal neighbors of p have coordinates
Figure 4: Binary image, ambiguity in 8-adjacency, m-adjacency, Connected regions, closed path
for the pixed, closed path of 0.
Q8. Explain the different Distance Measures along with formulae.
For pixels p, q and z, with coordinates (x, y), (s, t) and (v, w) respectively, D is a distance function or
metric if
For this distance measure, the pixels having a distance less than or equal to some value r from (x, y) are
the points contained in a disk of radius r centered at (x, y).
The City block distance (D4 distance) between p and q is defined as
In this case, the pixels having a distance from (x, y) less than or equal to some value r form a diamond
centered at (x, y). For example, the pixels with distance from (x, y) (the center point) form the following
contours of constant distance:
In this case, the pixels with D8 distance from (x, y) less than or equal to some value r form a square
centered at 0. For example, the pixels with D8 distance ≤ 2 from (x, y) (the center point) form the
following contours of constant distance as shown below.
Q9. For the following figure, find the length of the shortest 4-path, 8-path and m-path.
Solution: When V = {0, 1}, 4-path does not exist between p and q because it is impossible to get from p
to q by traveling along points that are both 4-adjacent and also have values from V . Figure (a) shows
this condition, it is not possible to get to q.
The shortest 8-path is shown in Fig. (b). its length is 4.
The length of the shortest m- path (shown dashed) is 5. Both of these shortest paths are unique in this
case.
(b) One possibility for the shortest 4-path when V = {1, 2} is shown in Fig. (c), its length is 6. It is easily
verified that another 4-path of the same length exists between p and q.
One possibility for the shortest 8-path (it is not unique) is shown in Fig. (d) and its length is 4.
The length of a shortest m-path (shown dashed) is 6. This path is not unique.
Q10. Considering m-adjacency, find the Dm distance between p and p4 in the following example.
Solution:
Dm distance between two points is defined as the shortest m-path between the points. In this case, the
distance between two pixels will depend on the values of the pixels along the path, as well as the values
of their neighbors.
Suppose that we consider adjacency of pixels valued 1 (i.e, V = {1}). If p1 and p3 are 0, the length of
the shortest m-path (the distance) between p and p4 is 2. If p1 is 1,then p2 and p will no longer be m-
adjacent and the length of the shortest m-path becomes 3 (the path goes through the points pp1p2p4 ).
Similar comments apply if p3 is 1 (and p1 is 0);in this case, the length of the shortest m-path also is 3.
Finally, if both p1 and p3 are 1, the length of the shortest m-path between p and p4 is 4. In this case, the
path goes through the sequence of points pp1p2p3p4
Q11. Explain Linear and Non Linear Operations with examples
Consider a general operator, H, that produces an output image, g(x, y), for a given input image, f(x, y):
Where ai, aj, fi (x, y) and fj (x, y) are arbitrary constants and images (of the same size), respectively. The
above equation indicates that the output of a linear operation due to the sum of two inputs is the same as
performing the operation on the inputs individually and then summing the results. In addition, the output
of a linear operation to a constant time an input is the same as the output of the operation due to the
original input multiplied by that constant. The first property is called the property of additivity and the
second is called the property of homogeneity.
As a simple example, suppose that H is the sum operator, that is, the function of this operator is simply
to sum its inputs.
Example: Sum operator is linear and max operator is non-linear. The example below shows that a max
operator is a non-linear operator. Consider the following two images
and suppose that we let a1 = 1 and a2 = -1. To test for linearity, we again start with the left side of the
equation described above
Spatial Domain
Q12. Explain the Concepts of Intensity Transformation functions in the Spatial Domain.
Image enhancement approaches fall into two broad categories: spatial domain methods and
frequency domain methods. The term spatial domain refers to the image plane itself, and
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. Enhancing an image provides better contrast and a more detailed image as compare to
non enhanced image. Image enhancement has very good applications. It is used to enhance medical
images, images captured in remote sensing, images from satellite e.t.c. As indicated previously, the
term spatial domain refers to the aggregate of pixels composing an image. Spatial domain
methods are procedures that operate directly on these pixels. 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 neighborhood of (x, y). The principal approach in defining a neighborhood
about a point (x, y) is to use a square or rectangular subimage area centered at (x, y), as Fig. 5
shows. The center of the subimage is moved from pixel to pixel starting, say, at the top left
corner. The operator T is applied at each location (x, y) to yield the output, g, at that location.
The process utilizes only the pixels in the area of the image spanned by the neighborhood.
s=T(r)
where r is the pixels of the input image and s is the pixels of the output image. T is a
transformation function that maps each value of r to each value of s.
For example, if T(r) has the form shown in Fig. 6(a), the effect of this transformation would be
to produce an image of higher contrast than the original by darkening the levels below m and
brightening the levels above m in the original image. In this technique, known as contrast
stretching, the values of r below m are compressed by the transformation function into a narrow
range of s, toward black. The opposite effect takes place for values of r above m.
In the limiting case shown in Fig. 6(b), T(r) produces a two-level (binary) image. A
mapping of this form is called a thresholding function.
One of the principal approaches in this formulation is based on the use of so-called
masks (also referred to as filters, kernels, templates, or windows). Basically, a mask is a small
(say, 3*3) 2-D array, such as the one shown in Fig. 6, in which the values of the mask
coefficients determine the nature of the process, such as image sharpening. Enhancement
techniques based on this type of approach often are referred to as mask processing or filtering.
LINEAR TRANSFORMATION:
Linear transformation includes simple identity and negative transformation. Identity transition
is shown by a straight line. In this transition, each value of the input image is directly mapped
to each other value of output image. That results in the same input image and output image.
And hence is called identity transformation. It has been shown below:
Fig 8 . Some basic gray-level transformation functions used for image enhancement.
s = (L – 1) – r
since the input image of Einstein is an 8 bpp image, so the number of levels in this image are
256. Putting 256 in the equation, we get this
s = 255 – r
So each value is subtracted by 255 and the result image has been shown above. So what
happens is that, the lighter pixels become dark and the darker picture becomes light. And it
results in image negative.
It has been shown in the graph below.
• The shape of the curve shows that this transformation maps the narrow range of low
gray level values in the input image into a wider range of output image.
• The opposite is true for high level values of input image.
Fig. 10 Plot of the equation S = crγ for various values of γ (c =1 in all cases).
This type of transformation is used for enhancing images for different type of display devices.
The gamma of different display devices is different. For example, Gamma of CRT lies in
between of 1.8 to 2.5, that means the image displayed on CRT is dark. Varying gamma (γ)
γ
obtains family of possible transformation curves S = C* r
Here C and γ are positive constants. Plot of S versus r for various values of γ is
γ > 1 compresses dark values
Expands bright values
γ < 1 (similar to Log
transformation) Expands
dark values Compresses
bright values
When C = γ = 1 , it reduces to identity transformation .
CORRECTING GAMMA:
s=crγ
s=cr (1/2.5)
The same image but with different gamma values has been shown here.
Q14. Explain Piecewise-Linear Transformation Functions.
• Contrast Stretching
If r1=r2, s1=0and 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. In general, r 1≤ r2 and s1 ≤ s2 is assumed
so that the function is single valued and monotonically increasing.
Fig. 11: Contrast stretching. (a) Form of transformation function. (b) A low-contrast
stretching. (c) Result of contrast stretching. (d) Result of thresholding.
Figure 11(b) shows an 8-bit image with low contrast. Fig. 11(c) shows the result of contrast
stretching, obtained by setting (r 1, s1 )=(rmin, 0) and (r2, s2)=(rmax,L-1) where rmin and rmax denote
the minimum and maximum gray levels in the image, respectively. Thus, the transformation
function stretched the levels linearly from their original range to the full range [0, L-1]. Finally,
Fig. 11(d) shows the result of using the thresholding function defined previously,
with r1=r2=m, the mean gray level in the image. The original image on which these results are
based is a scanning electron microscope image of pollen, magnified approximately 700 times.
Intensity-level slicing:
Highlighting a specific range of gray levels in an image often is desired. Applications
include enhancing features such as masses of water in satellite imagery and enhancing flaws in
X-ray images.
There are several ways of doing level slicing, but most of them are variations of two
basic themes. One approach is to display a high value for all gray levels in the range of interest
Dr. Keerti Kulkarni, ECE, BNMIT Page 17 of 36
Digital Image Processing (22ECE151)
This transformation, shown in Fig. 12(a), produces a binary image. The second
approach, based on the transformation shown in Fig.12 (b), brightens the desired range of gray
levels but preserves the background and gray-level tonalities in the image. Figure 12(c) shows
a gray-scale image, and Fig. 12(d) shows the result of using the transformation in Fig. 12(a).
Variations of the two transformations shown in Fig. are easy to formulate.
Fig. 12(a)This transformation highlights range [A,B] of gray levels and reduces all
others to a constant level (b) This transformation highlights range [A,B] but preserves
all other levels.
(c) An image . (d) Result of using the transformation in (a).
Bit-Plane Slicing.
Instead of highlighting gray-level ranges, highlighting the contribution made to total
image appearance by specific bits might be desired. Suppose that each pixel in an image is
represented by 8 bits. Imagine that the 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. In terms of 8-
bit bytes, plane 0 contains all the lowest order bits in the bytes comprising the pixels in the
image and plane 7 contains all the high-order bits.
Figure 13 shows the various bit planes for any image shown. Note that 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. Separating a digital image into its bit
planes is useful for analyzing the relative importance played by each bit of the image, a process
that aids in determining the adequacy of the number of bits used to quantize each pixel.
In terms of bit-plane extraction for an 8-bit image, it is not difficult to show that the
(binary) image for bit-plane 7 can be obtained by processing the input image with a
thresholding gray-level transformation function that (1) maps all levels in the image between 0
and 127 to one level (for example, 0); and (2) maps all levels between 129 and 255 to another
(for example, 255).
Q15. Explain Histogram Processing.
The histogram of a digital image with gray levels in the range [0, L-1] is a discrete function
of the form
H(rk)=nk
where rk is the kth gray level and nk is the number of pixels in the image having the
level rk.. A normalized histogram is given by the equation
p(rk)=nk/n for k=0,1,2,…..,L-1
P(rk) gives the estimate of the probability of occurrence of gray level rk.
The sum of all components of a normalized histogram is equal to 1.
The histogram plots are simple plots of H(r k)=nk versus rk.
In the dark image the components of the histogram are concentrated on the low (dark) side of
the gray scale. In case of bright image the histogram components are baised towards the high
side of the gray scale. The histogram of a low contrast image will be narrow and will be
centered towards the middle of the gray scale.
The components of the histogram in the high contrast image cover a broad range of the gray
scale. The net effect of this will be an image that shows a great deal of gray levels details and
has high dynamic range.
2. Compute all values of the transformation function G, using the Equation below, for q =
0,1,2….L-1, where pz(zi) are the values of the specified histogram. Round the values of G to
integers in the range [0-L-1] . Store the values of G in a table.
3. For every value of use the stored values of G from step 2 to find the corresponding value of zq, so
that G(zq) is closest to and store these mappings from s to z. When more than one value of sk satisfies
the given sk(i.e.,the mapping is not unique),choose the smallest value by convention.
4. Form the histogram-specified image by first histogram-equalizing the input image and then
mapping every equalized pixel value sk, of this image to the corresponding value zq in the histogram-
specified image using the mappings found in step [Link] in the continuous case, the intermediate step
of equalizing the input image is conceptual.
Statistics obtained directly from an image histogram can be used for image enhancement. Let
r denote a discrete random variable representing intensity values in the range and let denote the
normalized histogram component corresponding to value As indicated previously, we may
view as an estimate of the probability that intensity occurs in the image from which the
histogram was obtained. The nth moment of r about its mean is defined as
where m is the mean (average intensity) value of r (i.e., the average intensity of the pixels in
the image):
Whereas the mean is a measure of average intensity, the variance (or standard deviation) is a
measure of contrast in an image. Observe that all moments are computed easily using the
preceding expressions once the histogram has been obtained from a given image.
When working with only the mean and variance, it is common practice to estimate them directly
from the sample values, without computing the histogram. Appropriately, these estimates are
called the sample mean and sample variance. They are given by the following familiar
expressions from basic statistics:
for x = 0,1,2,,….M-1 and y = 0,1, 2….N-1. In other words, as we know, the mean intensity of
an image can be obtained simply by summing the values of all its pixels and dividing the sum
by the total number of pixels in the image.
Q19. Consider the following 2-bit image of size 5 * 5. Calculate the mean.
Solution:
Use the Formula :
The pixels are represented by 2 bits; therefore, and the intensity levels are in the range [0,3].The total
number of pixels is 25,so the histogram has the components.
Letting denote the preceding array and using Equation below, we obtain
A spatial filter consists of (1) a neighborhood (typically a small rectangle), and (2) a predefined
operation that is performed on the image pixels encompassed by the neighborhood. Filtering
creates a new pixel with coordinates equal to the coordinates of the center of the neighborhood,
and whose value is the result of the filtering operation. A processed (filtered) image is generated
as the center of the filter visits each pixel in the input image. If the operation performed on the
image pixels is linear, then the filter is called a linear spatial filter.
Figure 9.1 illustrates the mechanics of linear spatial filtering using a neighborhood. At any
point (x,y) in the image, the response, ,of the filter is the sum of products of the filter
coefficients and the image pixels encompassed by the filter:
we have that the correlation of a filter of size with an image , denoted as is given by the equation
listed at the end of the last section, which we repeat here for convenience:
When interest lies in the characteristic response, R, of a mask either for correlation or
convolution, it is convenient sometimes to write the sum of products as
where the s are the coefficients of an filter and the zs are the corresponding image intensities
encompassed by the filter.
Generating an linear spatial filter requires that we specify mn mask coefficients. In turn, these
coefficients are selected based on what the filter is supposed to do, keeping in mind that all we
can do with linear filtering is to implement a sum of products
In some applications, we have a continuous function of two variables, and the objective is to
obtain a spatial filter mask based on that function. For example,a Gaussian function of two
variables has the basic form
Generating a nonlinear filter requires that we specify the size of a neighborhood and the
operation(s) to be performed on the image pixels contained in the neighborhood.
The output (response) of a smoothing, linear spatial filter is simply the average of the pixels
contained in the neighborhood of the filter mask. These filters sometimes are called averaging
filters. They also are referred to a lowpass filters.
The idea behind smoothing filters is straightforward. By replacing the value of every pixel in
an image by the average of the intensity levels in the neighborhood defined by the filter mask,
this process results in an image with reduced “sharp” transitions in intensities. Because random
noise typically consists of sharp transitions in intensity levels, the most obvious application of
smoothing is noise reduction. However, edges (which almost always are desirable features of
an image) also are characterized by sharp intensity transitions, so averaging filters have the
undesirable side effect that they blur edges. Another application of this type of process includes
the smoothing of false contours that result from using an insufficient number of intensity levels
The constant multiplier in front of each mask is equal to 1 divided by the sum of the values of
its coefficients, as is required to compute an average. The idea here is that it is computationally
more efficient to have coefficients valued [Link] the end of the filtering process the entire image
is divided by [Link] mask would have a normalizing constant equal to mn.A spatial averaging
filter in which all coefficients are equal sometimes is called a box filter. The second mask in
Fig.18 is a little more interesting. This mask yields a so called weighted average, terminology
used to indicate that pixels are multiplied by different coefficients, thus giving more importance
(weight) to some pixels at the expense of others. the pixel at the center of the mask is multiplied
by a higher value than any other, thus giving this pixel more importance in the calculation of
the average. The other pixels are inversely weighted as a function of their distance from the
center of the mask. The diagonal terms are further away from the center than the orthogonal
neighbors (by a factor of ) and, thus, are weighed less than the immediate neighbors of the
center pixel. The basic strategy behind weighing the center point the highest and then reducing
the value of the coefficients as a function of increasing distance from the origin is simply an
attempt to reduce blurring in the smoothing process. , the general implementation for filtering
an image with a weighted averaging filter of size (m and n odd) is given by the expression
The derivatives of a digital function are defined in terms of differences. There are various ways
to define these differences. However, we require that any definition we use for a first derivative
(1) must be zero in areas of constant intensity; (2) must be nonzero at the onset of an intensity
step or ramp; and (3) must be nonzero along ramps. Similarly, any definition of a second
derivative (1) must be zero in constant areas; (2) must be nonzero at the onset and end of an
intensity step or ramp; and (3) must be zero along ramps of constant slope. Because we are
dealing with digital quantities whose values are finite, the maximum possible intensity change
also is finite, and the shortest distance over which that change can occur is between adjacent
pixels. A basic definition of the first-order derivative of a one-dimensional function is the
difference
Figure 19: Illustration of the first and second derivatives of a 1-D digital function
representing a section of a horizontal intensity profile from an image. In (a) and (c) data
points are joined by dashed lines as a visualization aid.
Let us consider the properties of the first and second derivatives as we traverse the profile from
left to right. First, we encounter an area of constant intensity and, as Figs.19(b)and (c) show,
both derivatives are zero there, so condition (1) is satisfied for both. Next, we encounter an
intensity ramp followed by a step, and we note that the first-order derivative is nonzero at the
onset of the ramp and the step; similarly, the second derivative is nonzero at the onset and end
of both the ramp and the step; therefore, property (2) is satisfied for both derivatives. Finally,
we see that property (3) is satisfied also for both derivatives because the first derivative is
nonzero and the second is zero along the ramp. Note that the sign of the second derivative
changes at the onset and end of a step or ramp. In fact, we see in Fig.19(c) that in a step
transition a line joining these two values crosses the horizontal axis midway between the two
extremes.
Q25. Explain the use of the Second Derivative for Image Sharpening—The Laplacian
We are interested in isotropic filters, whose response is independent of the direction of the
discontinuities in the image to which the filter is applied. In other words, isotropic filters are
rotation invariant, in the sense that rotating the image and then applying the filter gives the
same result as applying the filter to the image first and then rotating the result. The Laplacian
is defined as
Therefore, it follows from the preceding three equations that the discrete Laplacian of two
variables is
Figure 20 : (a) Filter mask used to implement Eq.(3.6-6). (b) Mask used to implement an
extension of this equation that includes the diagonal terms. (c) and (d) Two other
implementations of the Laplacian found frequently in practice.
Thus,the basic way in which we use the Laplacian for image sharpening is
A process that has been used for many years by the printing and publishing industry to sharpen
images consists of subtracting an unsharp (smoothed) version of an image from the original
image. This process, called unsharp masking, consists of the following steps:
2. 2. Subtract the blurred image from the original (the resulting difference is called the mask.)
Letting denote the blurred image, unsharp masking is expressed in equation form as
follows. First we obtain the mask:
Then we add a weighted portion of the mask back to the original image:
where we included a weight, for generality. When we have unsharp masking, as defined
above. When the process is referred to as highboost filtering. Choosing de-emphasizes the
contribution of the unsharp mask.
Figure 21 explains how unsharp masking works. The intensity profile in Fig.21(a)can be
interpreted as a horizontal scan line through a vertical edge that transitions from a dark to
a light region in an image. Figure 21 (b) shows the result of smoothing, superimposed on
the original signal (shown dashed) for reference. Figure 21 (c) is the unsharp mask,
obtained by subtracting the blurred signal from the original. By comparing this result with
the section of Fig. 21(c)corresponding to the ramp in Fig.21(a), we note that the unsharp
mask in Fig. 21(c) is very similar to what we would obtain using a second order derivative.
Figure 21(d) is the final sharpened result, obtained by adding the mask to the original signal.
The points at which a change of slope in the intensity occurs in the signal are now
emphasized (sharpened). Observe that negative values were added to the original. Thus, it
is possible for the final result to have negative intensities if the original image has any zero
values or if the value of k is chosen large enough to emphasize the peaks of the mask to a
level larger than the minimum value in the original. Negative values would cause a dark
halo around edges, which, if k is large enough, can produce objectionable results.
Figure 21: 1-D illustration of the mechanics of unsharp masking. (a) Original
signal.(b) Blurred signal with original shown dashed for reference.(c) Unsharp
mask.(d) Sharpened signal, obtained by adding (c) to (a).
Q27. Explain the Use of First-Order Derivatives for (Nonlinear) Image Sharpening—
The Gradient.
First derivatives in image processing are implemented using the magnitude of the gradient.
For a function ,the gradient of fat coordinates (x,y) is defined as the two-dimensional
column vector
This vector has the important geometrical property that it points in the direction of the
greatest rate of change of f at location (x, y). The magnitude (length) of vector denoted as
M(x, y),where
is the value at (x, y) of the rate of change in the direction of the gradient [Link] that
M(x,y) is an image of the same size as the original,created when x and y are allowed to
vary over all pixel locations in [Link] is common practice to refer to this image as the gradient
image (or simply as the gradient when the meaning is clear).
Because the components of the gradient vector are derivatives,they are linear operators.
However, the magnitude of this vector is not because of the squaring and square root
[Link] the other hand,the partial derivatives in Eq.(3.6-10) are not rotation invariant
(isotropic),but the magnitude of the gradient vector [Link] some implementations,it is more
suitable computationally to approximate the squares and square root operations by absolute
values:
This expression still preserves the relative changes in intensity, but the isotropic property
is lost in general.
Figure 22: A region of an image (the zs are intensity values). (b)–(c) Roberts cross
gradient operators. (d)–(e) Sobel [Link] the mask coefficients sum to zero,as
Dr. Keerti Kulkarni, ECE, BNMIT Page 34 of 36
Digital Image Processing (22ECE151)
The histogram processing methods discussed in the previous two sections are global, in the
sense that pixels are modified by a transformation function based on the intensity distribution
of an entire image. Although this global approach is suitable for overall enhancement, there are
cases in which it is necessary to enhance details over small areas in an image. The number of
pixels in these areas may have negligible influence on the computation of a global
transformation whose shape does not necessarily guarantee the desired local enhancement. The
solution is to devise transformation functions based on the intensity distribution in a
neighborhood of every pixel in the image. The histogram processing techniques previously
described are easily adapted to local enhancement. The procedure is to define a neighborhood
and move its center from pixel to pixel. At each location, the histogram of the points in the
neighborhood is computed and either a histogram equalization or histogram specification
transformation function is obtained. This function is then used to map the intensity of the pixel
centered in the neighborhood. The center of the neighborhood region is then moved to an
adjacent pixel location and the procedure is repeated. Because only one row or column of the
neighborhood changes during a pixel-to-pixel translation of the neighborhood, updating the
histogram obtained in the previous location with the new data introduced at each motion step
is possible. This approach has obvious advantages over repeatedly computing the histogram of
all pixels in the neighborhood region each time the region is moved one pixel location. Another
approach used sometimes to reduce computation is to utilize nonoverlapping regions, but this
method usually produces an undesirable “blocky” effect.
Order-statistic filters are nonlinear spatial filters whose response is based on ordering (ranking)
the pixels contained in the image area encompassed by the filter, and then replacing the value
of the center pixel with the value determined by the ranking result. The best-known filter in
this category is the median filter, which, as its name implies, replaces the value of a pixel by
the median of the intensity values in the neighborhood of that pixel (the original value of the
pixel is included in the computation of the median). Median filters are quite popular because,
for certain types of random noise, they provide excellent noise-reduction capabilities, with
considerably less blurring than linear smoothing filters of similar size. Median filters are
particularly effective in the presence of impulse noise, also called salt -and-pepper noise
because of its appearance as white and black dots superimposed on an image. Although the
median filter is by far the most useful order-statistic filter in image processing, it is by no means
the only one. The median represents the 50th percentile of a ranked set of numbers, but recall
from basic statistics that ranking lends itself to many other possibilities. For example, using the
100th percentile results in the so-called max filter, which is useful for finding the brightest
points in an image. The response of a max filter is given by
The 0th percentile filter is the min filter, used for the
opposite purpose.