Wednesday, June 11, 2008
Q#3(ii) Picture
Q#3(b)
Average Colour of second image
Octave Commands
octave-3.0.0.exe:47> a=imread("pic2.jpg");
octave-3.0.0.exe:48> b=double(a)/255;
octave-3.0.0.exe:49> size(b)
ans =
541 500 3
octave-3.0.0.exe:50> c=sum(sum(b))/(541*500)
c =
ans(:,:,1) = 0.56223
ans(:,:,2) = 0.62916
ans(:,:,3) = 0.65633
octave-3.0.0.exe:51> d=ones(256);
octave-3.0.0.exe:52> d(:,:,1)=0.56223*ones(256);
octave-3.0.0.exe:53> d(:,:,2)=0.62916*ones(256);
octave-3.0.0.exe:54> d(:,:,3)=0.65633*ones(256);
octave-3.0.0.exe:55> imshow(d);
Assignment#6 Q3
Monday, June 9, 2008
Q#3a continued..
Assignment #6 Q3
Assignment #6 Q2
Question#3c
Big T 7pi/4
Octave Command
bigT=255*ones(256);
bigT(30:79,64:191)=zeros(50,128);
bigT(50:199,111:146)=zeros(150, 36);
for x = 1:256
for y = 1:256
newy=rem(2*x+y,256)+1;
bigTskew(x,y)=bigT(x,newy);
end;
end;
for x=1:256;
for y=1:256;
bigTskewrotate(x,y)=bigTskew(mod(round(x*cos(7*pi/4)-y*sin(7*pi/4)),256)+1, mod(round(x*sin(7*pi/4)+y*cos(7*pi/4)),256)+1);
end;
end;
imshow(bigTskewrotate);
Question #3 b
BigT for S=1
Octave commandoctave-3.0.0.exe:5>
octave-3.0.0.exe:5> bigT=255*ones(256);
octave-3.0.0.exe:6> bigT(30:79,64:191)=zeros(50,128);
octave-3.0.0.exe:7> bigT(50:199,111:146)=zeros(150,36);
octave-3.0.0.exe:8>
octave-3.0.0.exe:8> # as given from assignment question...
octave-3.0.0.exe:8>
octave-3.0.0.exe:8> for x=1:256
> for y=1:256
> xnew=x;
> ynew=mod((2*x+y),256)+1;
> newbigT(xnew,ynew)=bigT(x,y);
> endfor
> endfor
octave-3.0.0.exe:9>
octave-3.0.0.exe:9> imshow(newbigT)
octave-3.0.0.exe:10>
Subscribe to:
Posts (Atom)