29

roja (ppt)

Embed Size (px)

Citation preview

Page 1: roja (ppt)
Page 2: roja (ppt)

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. It’s 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.

Page 3: roja (ppt)

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.

Page 4: roja (ppt)

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.

Page 5: roja (ppt)

In digital camerasi. effect of sensor size.ii. sensor fill factor.iii. sensor heating.

Types of noises• Amplifier noise • Quantization noise• Salt and pepper noise• Short noise

Page 6: roja (ppt)

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.

Page 7: roja (ppt)

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.

Page 8: roja (ppt)
Page 9: roja (ppt)

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.

Page 10: roja (ppt)

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.

Page 11: roja (ppt)
Page 12: roja (ppt)

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)

Page 13: roja (ppt)

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 = 4545 / 9 = 5

Page 14: roja (ppt)
Page 15: roja (ppt)

• 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

Page 16: roja (ppt)

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

Page 17: roja (ppt)

Median filter * * * * 4 * * * *

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

Page 18: roja (ppt)
Page 19: roja (ppt)

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.

Page 20: roja (ppt)

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 image data (compatible with Windows & OS2)

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

Page 21: roja (ppt)

BMP FILE FORMAT

Indexed Colour Data

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

Page 22: roja (ppt)

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 file2. Apply Median or Rotating Filter

Page 23: roja (ppt)

BMP Image

Extract the image data

Apply Median or Averaging Filter

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

Block diagram for Median and Rotating Filters

Page 24: roja (ppt)

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.

Page 25: roja (ppt)

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,[]);

Page 26: roja (ppt)

Original lena imagenoisy lena image

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

Reconstructed Original image

Page 27: roja (ppt)

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.

Page 28: roja (ppt)
Page 29: roja (ppt)

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.