Vous êtes sur la page 1sur 9

IMAGE PROCESSING BASICS

Frequencies; Low and High Pass Filters


Frequencies are the amount by which grey values change with
distance.
High frequency components are characterized by large
changes in grey values over small distances; (edges and noise)
Low frequency components are parts characterized by little
change in the gray values. (backgrounds, skin textures)
High pass filter: if it passes over the high frequency
components, and reduces or eliminates low frequency
components.
Low pass filter: if it passes over the low frequency
components, and reduces or eliminates high frequency
components.
Noise
Noise is any degradation in the image signal, caused by
external disturbance.
Salt and pepper noise: It is caused by sharp, sudden
disturbances in the image signal; it is randomly scattered white
or black (or both) pixels. It can be modeled by random values
added to an image
Gaussian noise: is an idealized form of white noise, which is
caused by random fluctuations in the signal.
Speckle noise: It is a major problem in some radar
applications. It can be modeled by random values multiplied by
pixel values.

MATLAB IMAGE FORMATS

Images can be treated as two-dimensional data, and many of the signal


processing
approaches presented in the previous chapters are equally applicable
to images:
some can be directly applied to image data while others require some
modification to account for the two (or more) data dimensions. For
example,
both PCA and ICA have been applied to image data treating the twodimensional
image as a single extended waveform. Other signal processing methods
including Fourier transformation, convolution, and digital filtering are
applied to
images using two-dimensional extensions. Two-dimensional images are
usually
represented by two-dimensional data arrays, and MATLAB follows this
tradition;*
however, MATLAB offers a variety of data formats in addition to the
standard format used by most MATLAB operations. Three-dimensional
images

can be constructed using multiple two-dimensional representations, but


these
multiple arrays are sometimes treated as a single volume image.

Images as Matrices
The coordinate system in Fig. 2.1(a) and the preceding discussion lead
to the following representation for a digitized image:

A digital image can be represented as a MATLAB matrix:

Image Types

The toolbox supports four types of images:

Gray-scale images
Binary images
Indexed images
RGB images

Most monochrome image processing operations are carried out using


binary or gray-scale images

IMAGE NOISE
Image noise is the random variation of brightness or color information in
images produced by the sensor and circuitry of a scanner or digital camera.
Image noise can also originate in film grain and in the unavoidable shot noise
of an ideal photon detector .Image noise is generally regarded as an
undesirable by-product of image capture. Although these unwanted
fluctuations became known as "noise" by analogy with unwanted sound they
are inaudible and such as dithering. The types of Noise are following: Amplifier noise (Gaussian noise)
Salt-and-pepper noise
Shot noise(Poisson noise)
Speckle noise
Amplifier noise (Gaussian noise)
The standard model of amplifier noise is additive, Gaussian, independent at
each pixel and independent of the signal intensity.In color cameras where
more amplification is used in the blue color channel than in the green or red
channel, there can be more noise in the blue channel .Amplifier noise is a

major part of the "read noise" of an image sensor, that is, of the constant
noise level in dark areas of the image .
Salt-and-pepper noise
An image containing salt-and-pepper noise will have dark pixels in bright
regions and bright pixels in dark regions . This type of noise can be caused by
dead pixels, analog-to-digital converter errors, bit errors in transmission, etc.
This can be eliminated in large part by using dark frame subtraction and by
interpolating around dark/bright pixels.
Poisson noise

Poisson noise or shot noise is a type of electronic noise that occurs when the
finite number of particles that carry energy, such as electrons in an electronic
circuit or photons in an optical device, is small enough to give rise to
detectable statistical fluctuations in a measurement .
Speckle noise
Speckle noise is a granular noise that inherently exists in and degrades the
quality of the active radar and synthetic aperture radar (SAR) images.
Speckle noise in conventional radar results from random fluctuations in the
return signal from an object that is no bigger than a single image-processing
element. It increases the mean grey level of a local area. Speckle noise in
SAR is generally more serious, causing difficulties for image interpretation. It
is caused by coherent processing of backscattered signals from multiple
distributed targets. In SAR oceanography , for example, speckle noise is
caused by signals from elementary scatters, the gravity-capillary ripples, and
manifests as a pedestal image, beneath the image of the sea waves.

NOISE FILTERING
Removing Noise By Linear Filtering
We can use linear filtering to remove certain types of noise. Certain filters,
such as averaging or Gaussian filters, are appropriate for this purpose. For
example, an averaging filter is useful for removing grain noise from a
photograph. Because each pixel gets set to the average of the pixels in its
neighborhood, local variations caused by grain are reduced.
Removing Noise By Median Filtering
Median filtering is similar to using an averaging filter, in that each output
pixel is set to an average of the pixel values in the neighborhood of the
corresponding input pixel. However, with median filtering, the value of an
output pixel is determined by the median of the neighborhood pixels, rather
than the mean. The median is much less sensitive than the mean to extreme
values (called outliers). Median filtering is therefore better able to remove
these outliers without reducing the sharpness of the image. The medfilt2
function implements median filtering.
Removing Noise By Adaptive Filtering
The wiener2 function applies a Wiener filter (a type of linear filter) to an
image adaptively, tailoring itself to the local image variance. Where the
variance is large, wiener2 performs little smoothing. Where the variance is
small, wiener2 performs more smoothing.
This approach often produces better results than linear filtering. The adaptive
filter is more selective than a comparable linear filter, preserving edges and
other high-frequency parts of an image. In addition, there are no design
tasks; the wiener2 function handles all preliminary computations and
implements the filter for an input image. wiener2, however, does require
more computation time than linear filtering.
wiener2 works best when the noise is constant-power ("white") additive
noise, such as Gaussian noise

WIENER FILTER

The goal of the Wiener filter is to filter out noise that has corrupted a signal. It
is based on a statistical approach. Typical filters are designed for a desired
frequency response. The
Wiener filter approaches filtering from a different angle. One is assumed to
have knowledge of the spectral properties of the original signal and the noise,
and one seeks the LTI filter whose output would come as close to the original
signal as possible . Wiener filters are characterized by the following:
a. Assumption: signal and (additive) noise are stationary linear random
processes with known spectral characteristics.
b. Requirement: the filter must be physically realizable, i.e. causal (this
requirement can be
dropped, resulting in a non-causal solution)
c. Performance criteria: minimum mean-square error
Gaussian Filters
Gaussian filters are a class of low-pass filters, all based on the
Gaussian probability distribution function:

where is the standard deviation: a large value of produces


to a flatter curve, and a small value leads to a pointier
curve.
Blurrin

SPECTRAL ANALYSIS: THE FOURIER TRANSFORM

The Fourier transform and the efficient algorithm for computing it, the fast
Fourier transform, extend in a straightforward manner to two (or more)
dimensions. The two-dimensional version of the Fourier transform can be applied
to
images providing a spectral analysis of the image content. Of course, the
resulting spectrum will be in two dimensions, and usually it is more difficult to
interpret than a one-dimensional spectrum. Nonetheless, it can be a very useful
analysis tool, both for describing the contents of an image and as an aid in the
construction of imaging filters as described in the next section. When applied
to images, the spatial directions are equivalent to the time variable in the
onedimensional Fourier transform, and this analogous spatial frequency is given
in
terms of cycles/unit length (i.e., cycles/cm or cycles/inch) or normalized to cycles

per sample. Many of the concerns raised with sampled time data apply to
sampled spatial data.
The two-dimensional Fourier transform in continuous form is a direct
extension of the equation

The variables 1 and 2 are still frequency variables, although they define
spatial frequencies and their units are in radians per sample.
The inverse two-dimensional Fourier transform is defined as:

The discrete form of Eqs. (1) and (2) is again similar to their time domain
analogs. For an image size of M by N, the discrete Fourier transform becomes:

The values F(p,q) are the Fourier Transform coefficients of f(m,n). The
discrete form of the inverse Fourier Transform becomes:

MATLAB IMPLEMENTION
SALT & PAPER NOISE

Matlab Codef=imread('C:\Users\shankar\Desktop\tst.gif');
imshow(f),title('original image');
g=imnoise(f,'salt & pepper',0.05);
figure,imshow(g),title('noisy image')
h = fspecial('unsharp');
j=imfilter(g,h);
figure,imshow(j),title(' linear filtered image')
k = filter2(fspecial('average',3),g)/255;
figure,imshow(k),title('FIR filtered image')
l = medfilt2(g,[3 3]);
figure,imshow(l),title(' median filtered image')
m= wiener2(g,[5 5]);
figure, imshow(m),title('adaptive filtered image')

GAUSSIAN NOISE
Matlab Code-

f=imread('C:\Users\shankar\Desktop\tst.gif');
imshow(f),title('original image');
g=imnoise(f,'gaussian',0,0.05);
figure,imshow(g),title('noisy image')
h = fspecial('unsharp');
j=imfilter(g,h);
figure,imshow(j),title(' linear filtered image')
k = filter2(fspecial('average',3),g)/255;
figure,imshow(k),title('FIR filtered image')
l = medfilt2(g,[3 3]);
figure,imshow(l),title(' median filtered image')
m= wiener2(g,[5 5]);
figure, imshow(m),title('adaptive filtered image')

SPECKLE NOISE
Matlab Code-

x=imread('C:\Users\murli\Desktop\tst.gif');
f=rgb2gray(x)
imshow(f),title('original image');
g=imnoise(f,'speckle',0.05);
figure,imshow(g),title('noisy image');
h = fspecial('unsharp');
j=imfilter(g,h);
figure,imshow(j),title(' linear filtered image');
k = filter2(fspecial('average',3),g)/255;
figure,imshow(k),title('FIR filtered image');
l = medfilt2(g,[3 3]);
figure,imshow(l),title(' median filtered image');
m= wiener2(g,[5 5]);
figure,imshow(m);

Vous aimerez peut-être aussi