Experiment No.: 02 Date

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

S.S.G.B.C.O.E.& T.BHUSAWAL.

Experiment No. : 02

Date:

Aim: Study of statistical properties- mean, standard deviation, profile, variance and Histogram plotting. Objective: To find out Mean, variance and deviation of a BMP image. Tools: MATLAB 6.0 Theory: Statistical properties: We investigate the statistical properties of progressive image sequences in order to determine what is the most efficient format from a coding point of view .Statistical properties provide useful information about an image at a glance for example mean tells us the average value of all the pixels hence we know that the image is a dark one or light one. They helps us search information in numerical form.Varience gives an idea of the distribution of the various intensities about the mean value. Histogram 1. Histogram of a digital image with gray levels in the range (0 to L-1) is a discrete function of h(rk) = nk. (k is the kth gray level and n gives the no. of pixels in the kth level) 2. It gives the distribution of gray levels within an image. If the maximum number of gray levels within an image is (L-1) then, L-1 hi(rk) = 1 i=0 3. The increase in the gray levels leads to the enhancement of the image. 4. A common practice to normalize the histogram is by dividing each of its values by the total no. of pixels. The normalized histogram is given by P(rk)= nk /n where n= N x M for N x M size image.

DEPT. OF E & C ENGG

S.S.G.B.C.O.E.& T.BHUSAWAL.

Applications: It can be used to segment object pixels from the background pixels. They are also the basis of numerous spatial domain frequency techniques and they are used in image enhancement to enhance brightness and contrast of an image. It is also useful in image compression and segmentation. Histogram equalization: This is a term used to describe the transformation of an image into an image with a flatter histogram, thus bringing out the contrast in the image while maintaining the details. It also equalizes intensity and saturation components of an image while the hue remains constant. Brightness: It is the perceived darkness or brightness and is defined as the average of all the pixels within an image. The brightness indicates the mean value of the image. Contrast: 1. It gives the range of gray level variation I an image. Zero gray level indicates dark intensity. 2. It is the average variation in gray level within image. C varies between 0 to1. 3. C=1 means high contrast image, i.e. maximum and minimum gray levels are present in the image. 4. C=0 indicates only one gray level is present in the image. 5. Contrast indicates Standard Deviation. Mean: It is the measure of average gray level or brightness in an image. Let r denote a discrete random variable representing discrete gray level in the range [0, L 1] and P(ri) denote the normalized histogram component corresponding to the ith value of r. P(ri) can be viewed as an estimate of the probability of occurrence of gray level ri Mean is given by
L 1 i =0

M = ri P(ri )

DEPT. OF E & C ENGG

S.S.G.B.C.O.E.& T.BHUSAWAL.

Standard Deviation: Standard Deviation is measure of average contrast of an image. So if deviation decreases contrast of image decreases. It measures average peak to peak gray level deviation of noise. The Standard deviation is simply defined as square root of variance, where variance is the 2nd moment of r about its mean and is defined as
L 1 i =0

2 (r ) = ( ri M ) P(ri ) = 2 (r )
2

Therefore, Standard Deviation is given by 2 (r ) Application of Mean and Deviation: 1. Image Enhancement. 2. For adjustment of intensity of an image. 3. For local image enhancement, where local mean and variance are used as basis for making changes that depend on image characteristics in predefined region. Result:

Conclusion:

Remark:

Signature with Date Subject In charge

DEPT. OF E & C ENGG

S.S.G.B.C.O.E.& T.BHUSAWAL.

Oral Based Questions.

Q:1 What do you mean by Histogram ?

Q:2 What do you mean by mean?

Q:3 What do you mean by standard deviation?

Q:4 Histogram plotting signifies what ?

Q:5 Peaks in an Histogram correspond to what ?

DEPT. OF E & C ENGG

S.S.G.B.C.O.E.& T.BHUSAWAL.

MATLAB CODE clc; close all; clear all; i=imread('lena.bmp'); s=size(i); m=s(1); n=s(2); img=double(i); total=m*n; new=i; figure,imshow(i),title('Original image'); sum=0; i=double(i); for j=1:m for k=1:n sum=sum+i(j,k); end end mean=sum/total; disp('Mean is '); disp(mean); dev=0; for j=1:m for k=1:n dev=dev+(i(j,k)-mean)^2; end end dev=sqrt(dev/total); disp('Deviation is '); disp(dev); var=dev^2; disp('Variance is '); disp(var);

DEPT. OF E & C ENGG

S.S.G.B.C.O.E.& T.BHUSAWAL.

OUTPUT

Mean is 124.0505 Deviation is 47.8537 Variance is 2.2900e+003

DEPT. OF E & C ENGG

You might also like