30.08.2014 Views

Retinal Prosthesis Dissertation - Student Home Pages

Retinal Prosthesis Dissertation - Student Home Pages

Retinal Prosthesis Dissertation - Student Home Pages

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

%Two for loops the first (outer loop) assigning the row number for every<br />

%column of the image<br />

%The second (inner) loop assigns column numbers for every row of the outer<br />

%loop. Note that the row numbers are stored on plane 5 and cols on plane 4.<br />

for r = rx: rowhigh<br />

for c = cy: colhigh<br />

%Assigning column numbers<br />

f(r, c, 4) = c;<br />

end<br />

%Name of this file is "subim.m", which accepts input(s)<br />

function [s] = subi (f, m, n, rx, cy);<br />

%SUBIM Extracts a subimage, s, from a given image, f.<br />

%The subimage is of size m-by-n and the coordinates of<br />

%its top, left corner are (rx, cy).<br />

%maxsize = imread ('D:\testimages\maxsize.bmp');<br />

%for count = 1 :( m*n)<br />

%fB = f (: 3);<br />

%y = (255-fB);<br />

%f (: 6) = y;<br />

%count = count+1;<br />

%end<br />

%rowsofinputimage = 1000;<br />

%columnsofinputimage = 1000;<br />

%f = zeros (rowsofinputimage, columnsofinputimage,'double');<br />

%f (: 1) =0;<br />

%f (: 2) =0;<br />

%f (: 3) =0;<br />

%s = zeros (m, n,'uint8');<br />

%s (: 1) =0;<br />

%s (: 2) =0;<br />

%s (: 3) =0;<br />

%showzero = imresize(s, 10);<br />

%figure, imshow (showzero)<br />

rowhigh = rx + m -1;<br />

colhigh = cy + n -1;<br />

%xcount = 0;<br />

%for r = rx: rowhigh<br />

% xcount = xcount + 1;<br />

% ycount = 0;<br />

% for c = cy: colhigh<br />

% ycount = ycount + 1;<br />

% s (xcount, ycount, 1) = f(r, c, 1);<br />

% s (xcount, ycount, 2) = f(r, c, 2);<br />

% s (xcount, ycount, 3) = f(r, c, 3);<br />

% end<br />

%end<br />

r = rx: rowhigh;<br />

c = cy: colhigh;<br />

s (: 1) = f(r, c, 1);<br />

s (: 2) = f(r, c, 2);<br />

138 of 200

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!