You are on page 1of 4

S&S(Lab)

LAB# 09

15-12-2014

IMAGES (Only)
Q# 05) What is the representation in a
MATLAB colormap for the color white? what
about black?
function lab08=question5()
a=imread('minion.jpg');
subplot(2,2,1)
imshow(a);
R=a;
R=a;
R=a;
R(:,:,1)=1;
R(:,:,2)=1;
R(:,:,3)=1;
subplot(2,2,3);
imshow(R);
G(:,:,1)=1;
G(:,:,2)=1;
G(:,:,3)=1;
subplot(2,2,4);
imshow(G)
end

OUTPUT:

Usama Rizwan Ghauri

12-EE-15

Group: C-1

S&S(Lab)

LAB# 09

15-12-2014

Q# 06) Gray command


function lab8=question6()
x=[1:200];
map=gray(256);
image(repmat(x,200,1));
colormap(map);
figure;
axis off;
axis image;
end

OUTPUT:

Usama Rizwan Ghauri

12-EE-15

Group: C-1

S&S(Lab)

LAB# 09

15-12-2014

Q# 07) Change the image so that the


sinusoidal variations are horizontal rather
than vertical.
function lab8=question7()
b=[1:200];
map=gray(256);
image((repmat(b,200,1))');
colormap(map);
figure;
axis off;
axis image;
end

OUTPUT:

Usama Rizwan Ghauri

12-EE-15

Group: C-1

S&S(Lab)

LAB# 09

15-12-2014

Q# 08) An image can have both horizontal


and vertical frequency content at the same
time. Change the image so that intensity at
any point is product of vertical and horizontal
sinusoid.
function lab8=question7()
b=[1:200];
map=gray(256);
image((repmat(b,200,1))'+(repmat(b,200,1)));
colormap(map);
figure;
axis off;
axis image;
end

OUTPUT:

Usama Rizwan Ghauri

12-EE-15

Group: C-1

You might also like