Vous êtes sur la page 1sur 9

ASSIGNMENT # 1 Advance Digital Image Processing

Image Normalization through MATLAB and Grid Illusion Phenomena

Submitted to: Col. Dr, Muhammad Almas

Submitted by: Muhammad Abubakar Yamin MS69-11-133

Wednesday, October 5, 2011


Department of Computer Engineering College of Electrical and Mechanical Engineering, Rawalpindi Normalization

In image processing, normalization is a process that changes the range of pixel intensity values. Applications include photographs with poor contrast due to glare, for example. Normalization is sometimes called contrast stretching. In more general fields of data processing, such as digital signal processing, it is referred to as dynamic range expansion.

The purpose of dynamic range expansion in the various applications is usually to bring the image, or other type of signal, into a range that is more familiar or normal to the senses, hence the term normalization. Often, the motivation is to achieve consistency in dynamic range for a set of data, signals, or images to avoid mental distraction or fatigue. For example, a newspaper will strive to make all of the images in an issue share a similar range of grayscale.

Image to be used in normalization process:

Matlab Codes:

User defines normalization code:


%-----------------Muhammad Abubakar Yamin----MS69-11-133------------------clc clear close all pic_mat = imread('F:\Univ Work\NUST\1st\DIP\assignmnet 1\pic2.jpg'); %Orignal picture----------------------------------------------------------figure, imshow((pic_mat)); title('initial image'); %scaler multiplication to be done-----------------------------------------mult = 5; pic_mat0 = double(mult) .* double(pic_mat); figure, imshow(pic_mat0); title('before normalisation'); %image normalisation------------------------------------------------------factor = 255/max(max(max(pic_mat0))); pic_mat1 = factor * pic_mat0; %-------------------------------------------------------------------------%Picture after normalisation and------------------------------------------figure, imshow(uint8(pic_mat1)); title('after normalisation'); %---------------------------All Rights Reserved By------------------------%-------------------------------Abubakar Yamin----------------------------%---------------------------------MS69-11-133------------------------------

Results:

After increasing intensity of image:

After Normalization:

Matlab built-in normalization code:

%Muhammad Abubakar Yamin--------MS69-11-133-------------------------------pic_mat2 = imread('F:\Univ Work\NUST\1st\DIP\assignmnet 1\pic2.jpg'); %Orignal picture----------------------------------------------------------figure, imshow((pic_mat2)); title('initial image'); %scaler multiplication to be done-----------------------------------------mult = 5; pic_mat2 = double(mult) .* double(pic_mat2); figure, imshow(pic_mat2); title('before normalisation'); %image normalisation------------------------------------------------------figure, imshow(pic_mat2,[0 1275]); title('after normalisation'); %---------------------------All Rights Reserved By------------------------%-------------------------------Abubakar Yamin----------------------------%---------------------------------MS69-11-133------------------------------

Results:

Before Normalization:

After Normalization:

Conclusion:

By applying user defined code we are normalizing the image within the range of 0-255. Final matrix value of pic_mat1 from user defined code shows the minimum value=0 and maximum value=255. When applying matlab built-in code for normalization we are also getting the same matrix range from 0-255. (However it is showing the value in multiple of the variable which we used in increasing the intensity value).We have confirmed this things by subtracting the both final matrices of images after normalization. We get a result of 0 after subtraction. Hence we can say that normalization method which user used is much more similar in mathematics and processing to that of matlab built-in function. This code is working with 2-D, 8-bit grayscale image:

Grid Illusion:

In the above illustration, black dots appear to form and vanish at the intersections of the gray horizontal and vertical lines. When focusing attention on a single white dot, some gray dots nearby and some black dots a little further away also seem to appear. More black dots seem to appear as the eye is scanned across the image (as opposed to focusing on a single point). Consider two regions of your retina. One region views an intersection of a white horizontal and vertical band and the other region views a white band between two intersections (the region going away from the intersection). Although, the two regions themselves receive the same amount of light, the situation in their neighboring regions is different. At the intersection, there is light coming in from all four sides, but in the white band that lies between the two intersections it is surrounded by two dark sides.

This leads to a physiological mechanism called lateral inhibition, which has the effect of causing a bright surround to an area appear darker and, conversely, a dark surround will make an area appear lighter.

The Physiological Explanation


Your retina is partially composed of many small nerves, which function as receptors of light. These receptors are arranged in rows on the inside of your retina. A number of scientists have shown that it is possible to illuminate and record from a single receptor (A) without illuminating its neighboring receptors. It was discovered that if you illuminate a single receptor (A) you will get a large response; however, when you add illumination to A's neighbors, the response in A decreases. In other words, illumination of receptors "inhibits" of firing of neighboring receptors. This effect is called lateral inhibition because it is transmitted laterally, across the retina, in a structure called the lateral plexus. In the case of the Hermann grid, there is light coming from the four sides of the intersection, but from only two sides of a band going away from the intersection. The region viewing the intersection is more inhibited than the region of the band going away. Thus the intersection appears darker than the other section. You see dark spots at the intersections of the white bands, but not at the points away from the intersections. The effect is greater in your peripheral vision, where lateral inhibition acts over greater distances.

Lateral inhibition also explains the illusion of simultaneous contrast seen above. The two center squares reflect the same amount of light into your eyes but, because of the simultaneous contrast effect, they look different. You can prove this to yourself by covering up the areas surrounding the two center squares.

References:
1- IllusionWorks, L.L.C. http://www.psychologie.tu-dresden.de/i1/kaw/diverses %20Material/www.illusionworks.com/html/hermann_grid.html

2- http://en.wikipedia.org/wiki/Normalization_(image_processing)

Vous aimerez peut-être aussi