You are on page 1of 23

Eng.

Mohammed Elasmer LOGO


Feb,2012
Add your company slogan

MatLab :Matrix Laboratory


LOGO
2
Add your company slogan

LOGO
3
Add your company slogan

LOGO
Add your company slogan
Images Formats
JPEG , TIFF, BMP, PNG and GIF

LOGO
Add your company slogan

double data type:


0 and 1 to each pixel. The value 0 corresponds to black and the value
1 corresponds to white.

The uint8
which assigns an integer between 0 and 255 to represent the
brightness of a pixel. The value 0 corresponds to black and 255 to white.

LOGO
Add your company slogan

LOGO
Add your company slogan

>> I=imread('1.jpg'); RGB

>> I3=im2double(I);

>> I2=rgb2gray(I);  Gray

>> I4=im2double(I2);
LOGO
Add your company slogan

Interpolation

LOGO
Add your company slogan

clear all
y1=imread('1.jpg');
figure(1)
imshow(y1)

figure(2)
y=rgb2gray(y1);
imshow(y)

for i=20:180;
for j=170:280;
I(i-19,j-169)=y(i,j);
end
end
figure(3)
subimage(I)
LOGO
20

40

60

80

100

120

140

160
20 40 60 80 100
Add your company slogan

LOGO
Add your company slogan

% Reducing the Size of I using nearest neighbor


interpolation
I128=imresize(I,0.5); imshow(I128),pause
I64=imresize(I,0.25);close,imshow(I64),pause
I32=imresize(I,0.125);close,imshow(I32),pause
I16=imresize(I,0.0625);close,imshow(I16),pause

LOGO
Add your company slogan

LOGO
I16_N=imresize(I16,16); Add your company slogan

I32_N=imresize(I32,8);
I64_N=imresize(I64,4);
I128_N=imresize(I128,2);

subplot(151),subimage(I),axis off,title('I')
subplot(152),subimage(I128_N ),axis off,title('I128')
subplot(153),subimage(I64_N ),axis off,title('I64')
subplot(154),subimage(I32_N ),axis off,title('I32')
subplot(155),subimage(I16_N ),axis off,title('I16')

LOGO
Add your company slogan
In neighbor interpolation the new pixels which result from zoom out the image will
take the value of its neighbor.
So the image with small size will appear as a group of rectangles of gray color, which
result from assigns of each pixels to its nearest.

LOGO
Re Add the resultant face Portion neighbor to the original Image
Add your company slogan

K=size(I32_N)
for i=20:(K(1)+19);
for j=170:(K(2)+169);
y(i,j)= I32_N(i-19,j-169);
end
end
figure(3)
imshow(y)
%%Apply for I16_N,I64_N,I32_N,I128_N

LOGO
Add your company slogan

LOGO
Add your company slogan

I128=imresize(I,0.5,'bilinear');

LOGO
Add your company slogan

LOGO
Add your company slogan

LOGO
Add your company slogan

LOGO
LOGO
www.iugaza2010.blogspot.com
Eng.Mohammed Elasmar