HW5 Prof Sln

HW5 Prof Sln - o Then use the formula on page 34 of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
5.1 Follow the steps carefully: o Unzip thefile “matlab_files.zip” and save all files in your working directory with images. o Use your camera to take a color picture and save it in JPEG format. o Then open the picture in Matlab use the “readjpg” function: > IMG=readjpg(‘jpeg_file_name.jpg’); > size(IMG) o When the image is stored in the 3-D matrix “IMG” with size of (x, y, 3) where x, y are the sizes of your picture (obtained from the “size” function), type > r=zeros(x,y); g=zeros(x,y); b=zeros(x,y); % initialization > r=IMG(:,:,1); g=IMG(:,:,2); b=IMG(:,:,3);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: o Then use the formula on page 34 of “CpE462-6.ppt” to create a new matrix Y which is the luminance component from “r”, “g” and “b” matrices. Print out your Matlab procedures (using “diary” function). > Y=r*0.299+g*0.587+b*0.114; OR > for i=1:x, % x should be the number of rows > for j=1:y, % y should be the number of columns > Y(i,j)=r(i,j)*0.299+g(i,j)*0.587+b(i,j)*0.114; > end, > end, o Use “dispimg” function to display Y, and print out this gray level image. > dispimg(Y); OR > imshow(Y/256,256);...
View Full Document

This homework help was uploaded on 04/05/2008 for the course EE/CPE 462 taught by Professor Prof.hongman during the Spring '07 term at Stevens.

Page1 / 2

HW5 Prof Sln - o Then use the formula on page 34 of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online