You are on page 1of 29

What is an image

The term image refers to a 2 - Dimensional light intensity function f(x, y), where x, y denotes special coordinates and value of at any point (x, y) is proportional to the brightness of the image (or gray level) at that point.

A digital image can be considered as a matrix. Its row and column indices indicates intensity at that point in the image and the corresponding matrix value identifies the gray level at that point. The elements of digital array are called image elements or picture elements or pixel or pels.

Processing of images which are digital in nature by a digital computer.

Why do we need image processing?


1.Improvement of pictorial information for human perception. 2.Image processing for autonomous machine applications. 3.Efficient storage and transmission.

Image noise is random variation of brightness or color information in images. It is basically aspect of electronic noise. it is produced by the sensor and the circuitry of scanner(or) digital camera.

In i.

ii. iii.

Types of noises

digital cameras effect of sensor size. sensor fill factor. sensor heating.

Amplifier noise Quantization noise Salt and pepper noise Short noise

It is also called as gauss ion noise. It is independent at each pixel and independent on 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.

Quantization noise
the noise caused by quantizing the pixels of a sensed image to a no.of discrete levels.

An image containing salt & pepper noise will have dark pixels in the bright region and bright pixels in the dark region.
this type of noise can be caused by analog to digital converter error, bit errors in transmission. By using median filtering technique we can remove this type of noise.

What

is image enhancement?

processing an image to enhance certain features of the image. the result is more suitable than the original image.
Types

of image enhancement

spatial domain filter


work on image plane itself direct manipulation of pixels in an image.

Frequency domain filter


Modify the Fourier transform coeffient of an image. Take inverse Fourier transform.

Spatial filtering is performed by convolving the image with mask(or) kernel. Spatial filter includes sharpening, smoothing, edge detection, noise removal etc.
the spatial filtering of an image using a spatial mask 3x3, and then this mask is used in blurring filter and Laplacian.

Convolution of spatial domain is equivalent to the multiplication of frequency domain. f(x,y)*h(u,v)F(X,Y) H(U,V) f(x,y) h(u,v)F(X,Y)*H(U,V)

The mean filter is a simple sliding-window spatial filter that replaces the center value in the window with the average (mean) of all the pixel values in the window. The window, or kernel, is usually square but can be any shape. An example of mean filtering of a single 3x3 window of values is shown below.

unfiltered values 5 3 6 2 1 9 8 4 7
5 + 3 + 6 + 2 + 1 + 9 + 8 + 4 + 7 = 45 45 / 9 = 5

Problem with Averaging Filter


Blur edges and details in an image Not effective for impulse noise (Salt-and-pepper)

Median filter:
Taking the median value instead of the average or weighted average of pixels in the window

Median: sort all the pixels in an increasing order,


take the middle one The window shape does not need to be a square Special shapes can preserve line structures

The median filter is also a sliding-window spatial filter, but it replaces the center value in the window with the median of all the pixel values in the window. An example of median filtering of a single 3x3 window of values is shown below.

Unfiltered value
6 2 0 3 97 4 19 3 10

In order 0,2,3,3,4,6,10,19,97

Median filter
* * * * 4 * * * *

Center value (previously 97) is replaced by the median of all nine values (4).

Imaged data is usually stored in a permanent magnetic medium such as computer disk files, magnetic tapes, Compact Discs etc. In order that the image data may be used by the image processing community in a standard way without any ambiguity, the image data is usually stored in some standard format.

There are several standards in existence. We will discuss the following industry standard formats for image files: Bitmap files storing raw image data (compatible with Windows & OS2) JPEG files storing compressed (compatible with Windows & OS2) image data

TIFF files storing compressed or uncompressed data (compatible with Windows, Unix and various other operating systems)

BMP FILE FORMAT

Indexed Colour Data

14 + 40 + 4 * infoheader.ncolors = header.offset

Data Processing can be achieved with number of ways . The original image is taken through series of steps to process the image

Processing steps:
1. Extract the image data from the BMP file 2. Apply Median or Rotating Filter

Block diagram for Median and Rotating Filters


BMP Image

Extract image data

the

Apply Median or Averaging Filter


Write the Processed data in the output file in the BMP format

Extracting the image data from the BMP file involves the following steps.
1. Check validity of the BMP file. 2. Extract the geometry of the image width, height and pixel depth. 3. Extracting the raw data from the file and storing it to memory so that subsequent process can be done on memory contents.

The next step involves preparing the data in such away that Median or Rotating filter can be applied.

A=imread(lena.bmp);

Imshow(A); Im=im2 double(A); B=imnoise(im,salt&pepper,0.05); Figure,imshow(b,[]); C=filter2(fspecial(average,3),B)/255; Figure,imshow(c,[]); D=medfilt2(b,[3 3]); Figure,imshow(C,[]); Figure,imshow(D,[]);

Original lena image

noisy lena image

First stage of removing the salt & pepper noise in noisy image Reconstructed Original image

The main disadvantage of median filter is an entire image is loss when image sharpens. For removal of salt & pepper noise,generally averaging filters of 3*3,5*5,7*7(or) median filters are suitable. but they tend to blur the edges when the averaging operation takes place near the edge boundaries.

By using this median filters we can remove the salt and paper noise in the image and also any type of noises can be removed by using different types of filtering techniques in the image.

You might also like