What Is Digital Image? Intensity Gray Level

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 19

IMAGE ENHANCEMENT TECHNIQUES

What is Digital image?


 An image may be defined as a two dimensional function f(x,y) ,
x & y = spatial coordinates .
The amplitude of f at any pair coordinates (x,y) is called the
intensity or Gray level of the image at that point .
When x,y & the amplitude value of f are all finite, discrete
quantities ,we call the image a DIGITAL IMAGE.

 Digital Image is composed of a finite no of elements. They are


referred to as picture elements, image elements ,peels or pixels.
Pixel is the term most widely we use.

 Two techniques for image enhancement:


1) Spatial Domain, which refers to the image plane itself & direct
manipulation of pixels in image.
2) Frequency Domain ,which are based on modifying the Fourier
transform of an image .
1) Spatial Domain Tequenics:
 It is the aggregate of pixels composing an image.These methods
are procedures that operate directly on these pixels.

 It is denoted by the formula g(x,y)=T[f(x,y)],


where f(x,y) is the input image , g(x,y) is the
processed image & T is an operator on f , defined over some
neighborhood of (x,y).

 Enhancement at any point in an image depends only on the gray


level at that point, known as point processing.
Some basic gray level Transformation:
 Image negatives:
 The negative of an image with gray levels in the range [0,L-1] is
obtained by using negative transformation s=L-1-r.

 Log Transformation:
 The expression for this is s=clog(1+r)
where c is a constant,
 It is used٧ to expand the values of dark pixels in the image while
compressing the higher level values.
 Power law transformation:
 It has the basic form s=cr٧(gamma),
where c & ٧ are positive constants.
 Power law curves with fractional values of ٧ map a narrow range of
dark input values into a wider range of output levels , with the
opposite being true for higher values of input levels.

 The process used to correct this power law response phenomena is


called gamma correction.
 Contrast Streching:
 Simple piecewise linear function is Contrast stretching
transformation. Low contrast images can result from poor
illumination,
 The idea behind contrast stretching is to increase the dynamic range
of the gray levels in the image being processed.

 Gray level slicing:


 One approach of its is to display a high value for all gray levels in
the range of interest & a low value for all other gray levels.
 Histogram processing:
 The histogram of of a digital image with gray levels in the range
[0,L-1] is a discrete function h(rk)=nk, rk is the kth gray level & nk is
the no of pixels in the image having gray levels rk.
 In the dark image that the components of the histogram are
concentrated on the low side of the gray scale. Similarly, the
components of the histogram of the bright image are biased towards
the high side of the gray scale.
 Histogram Equalization:
 Let variable r represent gray level of the image to be enhanced. with
r=0 represent black & r=1 represent white.

 For the formula s=T(r) ,0<=r<=1 that produces a level s for pixel
value r in the original image but T(r) satisfies some conditions:

1)T(r) is single valued & monotonically increasing in the interval


[0,1].
2)0<=T(r)<=1 for 0<=r<=1

The method used to generate a processed image that has a


specified histogram is called HISTOGRAM MATCHING or HISTOGRAM
SPECIFICATION.
 Local Enhancment:
 The histogram methods are global in the sense that pixels are
modified by a transformation function based on the gray level
content of the entire image.
 The procedure is to define a square or rectangular neighborhood &
move the center of the area from pixel to pixel. At each location the
histogram in the points in the neighborhood is computed & either a
histogram specification transformation function is obtained.
 Enhancement using Arithmetic/Logic operation:
 A/L operations involving images are performed on a pixel by pixel
basis between two or more images. Logic operations similarly
operate on a pixel by pixel basis.

 Performing the NOT operation on a black,8-bit pixel produces a


white pixel. Intermediate values are processed the same way.
changing all 1’s to 0’s.The AND and OR operations are used for
masking. In the AND & OR image masks, light represents a binary 1
& dark represents a binary 0.Masking sometimes referred to as
region of interest processing. In terms of enhancement, masking is
used primarily to isolate an area for processing.
 Image subtraction:

 The difference between two images f(x,y) & h(x,y) expressed as,
g(x,y)=f(x,y)-h(x,y).

 It is obtained by computing the difference between all pairs of


corresponding pixels from f & h. The key usefulness of subtraction
is enhancement of difference between images. The higher order bit
planes of an image carry a significant amount of visually relevant
details .
 Image Averaging:
 Consider g(x,y)= f(x,y)+ n(x,y),
where f(x,y)=original image
g(x,y)=noisy image &
n(x,y)=noise
The objective of the following procedure is to reduce the noise
content by adding a set of noisy images { gi (x,y) } if an image g^(x,y) is
formed by averaging K different noisy images,
g^(x,y)=1/K 1∑kgi(x,y) then E{ g^ (x,y) }= f (x,y). It is possible In some
implementations of image averaging to have negative values when noise
is added to an image.
 Basics of spatial filtering:
 The values in a filter sub image is are referred to as coefficients, rather
than pixels.
 The concept of filtering has its roots in the use of Fourier Transform so
called frequency domain.
 At each point (x,y) the response of the filter at that point is calculated
using a predefined relationship. For linear spatial filtering , the response
is given by a sum of products of the filter coefficients. For 3*3 mask ,the
result R of linear filtering with the filter mask at a point (x , y) in the
image is,
R=w(-1,-1)f(x-1,y-1)+w(-1,0)f(x-1,y)+....+w(0,0)f(x,y)+…
w(1,0)f(x+1,y)+w(1,1)f(x+1,y+1)
 The response R of an m*n mask at any point (x,y), using the
following expression: R = w1z1+w2z2 + w3z3+ w4z4 +…… +
wmnzmn
= 1 ∑mn wizi
where ,w’s are mask coefficients,
z’s are values of image gray levels
corresponding to those coefficients.
& mn is the total no of coefficients.

 Smoothing Spatial filters:


 These filters are used for blurring & for noise reduction. Blurring is
used in preprocessing steps such as removal of some details from an
image prior to object extraction , bridling of small gaps in lines or
curves.

 Smoothing linear filters:


 The output of smoothing linear filter is simply average of the pixels
contained in the neighborhood of the filter mask. These filters are
also called averaging filters.
 The most obvious application of smoothing is noise reduction.
 Sharpening Spatial filters:
 The principal objective of sharpening is to highlight fine detail in an
image or to enhance details that has been blurred.
 Uses of image sharpening :vary & include application ranging from
1)electronic printing
2) medical imaging &
3) to industrial inspection &
4) autonomous guidance in military systems.
 Sharpening filters are based on first & second order derivatives. The
derivatives of a digital function are defined in terms of differences.
 We use for a first derivative
1) must be zero in flat segments
2)must be nonzero at the onset of a gray level step or gray level.
3) must be nonzero along ramps.
 while a second derivative
 1) must be zero in flat areas
 2) must be nonzero at onset & at a gray level step or ramp
 3) must be zero along ramps of constant slope.
Comparing the response between first & second order derivative , we
arrive the following conditions.
1)First order derivatives generally produce thicker images in an image.
2)Second order derivative have a stronger response to fine detail such
as thin lines & isolated points.
3)First order derivatives have a stronger response to gray level step.
4)Second order derivatives produce a double response at step changes
in gray level.

 Isotroic filters are rotation invariant in the sense that rotating the
image & then applying the filter gives the same result as applying the
filter to image first & then rotating the result.

Use of development of the method:


 d^2f/dx^2=f(x+1,y) + f(x-1,y) – 2f(x,y)
 d^2f/dx^2=f(x,y+1) + f(x,y-1) – 2f(x,y)
 ▼^2f= [f(x+1,y) + f(x,y+1) + f(x,y-1)] – 4 f(x,y)
Because the Laplacian is a derivative operator ,its use highlights gray
level discontinuities in an image .
 This will tend to produce images that have grayish edge lines & other
discontinuitty , featureless background.. Thus the basic way in which
way we use Laplacian for image enhancement is as follows:
g(x,y)= f(x,y) - ▼^2f(x,y) if the center coefficient is negative.
= f(x,y) +▼^2f(x,y) if the center coefficient is positive.
2) Image enhancement in the frequency domain:
 The one dimensional Fourier , F(u) of a single variable , continous
function , f(x) , is defined by the equation

 F(u) = ∫ f(x) e^(-j2∏ux)dx ,


where j^2=(-1) .
 f(x) by means of the inverse Fourier transform
f(x)= ∫ F(u) e^(j2∏ux)du. These two equations comprise the
Fourier transform pair. These equations are easy
 F(u,v)=∫∫f(x,y) e^-j2∏(ux+vy)dxdy , Similarly for the inverse
transform,

 f(x,y)=∫ ∫ F(u,v)e^j2∏(ux+vy)dudv F(u)=| F(u) | e^(-jΦ(u))


where , |F(u)|=[ R^2(u) + I^2(u) ] ^1/2 is called the
magnitude or spectrum of the Fourier transform &
,Φ(u)=tan^-1[ I[u] / R[u] ] & Power
spectrum
P(u)= | F(u) |^2 = R^2(u)+ I^2(u) . The spectral density also is used
to refer to the power spctrum.
 Basics of filtering in frquency domain:
1) Multiply the input image by (-1)^x+y to center the transform.
2) Compute F(u,v) , the DFT of an image from (1).
3) Multiply F(u,v) by a filter function H(u,v).
4) Compute the inverse DFT of the result in (3).
5) Obtain the real part of result in (4).
6) Multiply the result in (5) by (-1)^x+y .

H(u,v) is called a filter because it suppresses certain frequencies


in the transform while leaving others unchanged.
G(u,v)=H(u,v)F(u,v) .The multiplication of H & F involves two
dimensional function & it s defined on an element – by – element.

 Some basic filters & their properties :

 Suppose that we wish to force the average value of an image to


zero. The average of an image is given by F(0,0).. If we set this
term to zero in the frequency domain & take the inverse transform
, then average value of the resulting image will be zero.. We can
do this operation by multiplying all values of F(u,v) by the filter
function: H(u,v)=0 if (u,v)=(M/2,N/2) , 1 otherwise.
 This filters are called notch filter because it is constant function with
a hole at the origin.
 Low frequencies in an image are responsible for the general gray
level appearance of an image over smooth areas, while high
frequencies are responsible for edges & noise.

 Smoothing frequency domain filters:


 Edges & other sharp transitions in the gray levels of an image
contribute significantly to the high frequency content of its Fourier
transform. Hence smoothing is achieved in the frequency domain by
attenuating high frequency components in the transform of a given
image.
 There are basically 3) types of filters:
1) ideal ,
2)Butterworth &
3) Gaussian .These three filters cover the range from very sharp to
very smooth filter functions.
 The Butterworth filter has a parameter called the filter order.
 For high value of this parameter ,the Butterworth filter approaches
the form of the ideal filter. For lower order values the Butterworth
filter has a smooth waveform similar to Gaussian filter.
 Ideal low pass filers:
 It has the transfer function H(u,v) = 1 if D(u,v)<= Do
= 0 if D(u,v)>Do,
where Do is the specified nonnegative quantity &
D(u,v) is the distance from point (u,v) to the origin of
the frequency rectangle.

 The distance from any point (u,v) to the center of the Fourier
transform is given by

D(u,v)=[ (u-M/2)^2 + (v- N/2)^2 ] ^1/2.


 For an ideal low pass filter , the point of transition between H(u,v)=1
& H(u,v)=0 is called the cutoff frequency.

 The FT of original image f(x,y) & blurred image g(x,y) are related in
the frequency domain G(u,v) = H(u,v) F(u,v).
H(u,v)is the filter function &
G & F are FT of the two images.
 In spatial domain g(x,y)= h(x,y)* f(x,y)
where h(x,y) is the inverse Fourier transform of
filter function.
 Butterworth lowpass filters:

 The transfer function of a Butterworth low pass filter of order n ,


& with cutoff frequency at a distance Do at the origin, is defined as
H(u,v)= 1/ 1+ [D(u,v)/Do]^2n
where D(u,v)= ([u-M/2]^2 + [v-N/2]^2)^1/2.
 Unlike the ILPF , The BLPF transfer function does not have a sharp
discontinuity that establishes a clear cutoff between passed & filtered
frequencies .
 A Butterworth filter of order 1 has no ringing , but can become a
significant factor in filters of higher order. The BLPF of order 1 has
neither ringing nor negative values.
 The filter of order 2 does show mid ringing & small negative values,
but they certainly are less pronounced than in the ILPF.
In general , BLPFs of order 2 are a good compromise between low
pass filter & acceptable ringing characteristics.
 Gaussian lowpass filters:
 The form of these filters is
H(u,v)=e^(-D²(u,v)/2σ² ,
where D(u,v) is the distance from the origin of the Fourier
transform ,
σ is a measure of the spread of the Gaussian curve . By
letting σ = Do, H(u,v) = e^(-D²(u,v)/2Do²) ,where Do is the cutoff
frequency. When D(u,v)=Do the filter is down to 0.607 of its
maximum value.

 Additional examples of low pass filtering :

1) From the field of machine perception , with application to character


recognition ,
2) From the printing & publishing industry & the third is related to
processing satellite & aerial images.
3) Low pass filtering is a staple in the printing & publishing industry,
where it is used for numerous preprocessing functions, including
unsnap masking . Cosmetic processing is another use of low pass
filter.
 Sharpening frequency domain filters:
 Image can be blurred by attenuating the high frequency
components of its FT because edges & other abrupt changes in gray
levels are associated with high frequency components ,

 Image sharpening can be achieved in the frequency domain by a high


pass filtering process , which attenuates the low frequency
components without disturbing high frequency information .

 The transfer function of the high pass filter is Hhp(u,v)=1 – Hlp(u,v) .


Where Hlp(u,v) is the T.F. of the corresponding low pass filter.

 Ideal highpass filters:


 A 2-D ideal high pass filter is defined as H(u,v)= 1 if D(u,v)<=Do
= 0 if D(u,v)> Do
, where Do is the cutoff distance measured from
the origin of frequency rectangle .
 Butterworth High pass filters:

 The T.F of the Butterworth high pass filter of order n & with cutoff
frequencies of order n & locus at a distance Do from the origin is
given by
H(u,v)= 1 / 1+ [Do/D(u,v)]^2n .
 As in the case of low pass filters , we can expect Butterworth high
pass filters to behave smoother than IHPS .

 The performance of a BHPF of order 2 & with Do set to the same


values. The transition into higher values of a cutoff frequencies is
much smoother with the BHPF.
 Gaussian high pass filters:
 The transfer function of the Gaussian high pass filter with cutoff
frequency locus at a distance Do from the origin is given by
H(u,v)= 1 – e^(-D²(u,v)/2Do²).
 In this way the results obtained are smoother than previous two
examples. Even filtering of the smaller objects & thin bars is cleaner with
the Gaussian filter.
 Homographic filtering:
 It is used to develop a frequency domain for improving the appearance
of an image by simultaneous gray level range compression & contrast
enhancement. f(x,y) can be expressed as the product of illumination &
reflection components.
f(x,y)= i(x,y) r(x,y)
The F.T. of the product of two functions is not separable,
F[ f(x,y) ] =/ F( i(x,y) ). F( r(x,y) ).
Suppose , z(x,y)= ln f(x,y) = ln i(x,y) + ln r(x,y).
Then F{ z(x,y) }=F{ ln f(x,y) }
=F { ln i(x,y) } + F{ ln r(x,y) } or z(u,v)= Fi(u,v) + Fr (u,v) . Where
Fi(u,v) & Fr (u,v) are fourier transform of the result. In the
spatial domain , s( u,v)= H(u,v) Z(u,v)
= H(u,v)Fi(u,v) + H(u,v)Fr(u,v) . S(u,v) is the fourier
transform of the result. S(x,y)= F^(-1) [ S(u,v) ]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy