Wednesday, June 11, 2008

Assignment # 9

Question # 1
A=imread('bitter.jpg');
B=floor(A/64)*85;
image(B)














A=imread('toyboy.jpg');
>> B=floor(A/64)*85;
>> image(B)














Question # 3

> A=int16(imread('bitter.jpg'));
>> B=(A(:,:,1)+A(:,:,2)+A(:,:,3))/3;
>> colormap(gray(256));
>> image(B)














Question # 2

a) first option

A=imread('bittersweet.jpg');
>> B=floor((A+64)/128)*128;
>> image(B)

A=imread('toyboy.jpg');
>> B=floor((A+64)/128)*128;
>> image(B)





















b) second option

A=imread('bittersweet.jpg');
B=floor(A/85)*128;
image(B)
















Question # 4


A=int16(imread('bittersweet.jpg'));
B=(A(:,:,1)+A(:,:,2)+A(:,:,3))/3;
C=floor(B/4)*4;
>> colormap(gray(256));
>> image(C)

















A=int16(imread('toyboy.jpg'));
>> B=(A(:,:,1)+A(:,:,2)+A(:,:,3))/3;
C=floor(B/4)*4;
colormap(gray(256));
image(C)


















Question # 5

A=int16(imread('toyboy.jpg'));
>> B=(A(:,:,1)+A(:,:,2)+A(:,:,3))/3;
C=floor(B/16)*16;
colormap(gray(256));
image(C)

















A=int16(imread('.jpg'));
>> B=(A(:,:,1)+A(:,:,2)+A(:,:,3))/3;
C=floor(B/16)*16;
colormap(gray(256));
image(C)




No comments: