Monday, June 21, 2010
Sunday, June 20, 2010
To import the image file into vector and save it into a file.
To import the image file into vector and save it into a file.
matlab
function [] = process_img(J,iname)
%%
%filename0 = ['C:\Documents and Settings\amiza\Desktop\airplanepart\noiseImage\st\' iname '.st'];
filename0 = ['C:\Documents and Settings\amiza\Desktop\testflat.dat'];
file_1 = fopen(filename0,'w')
[m,n] = size(J);
%fh = fopen(...);
for i = 1:m
for j = 1:n
fprintf(file_1,'%d',J(i,j));
end
fprintf(file_1,'\n');
end
fclose(file_1);
%close(fh);\
at command window:
J= imread('C:\Documents and Settings\amiza\My Documents\My Dropbox\myphotos\flattopo.bmp')
process_img(J)
matlab
function [] = process_img(J,iname)
%%
%filename0 = ['C:\Documents and Settings\amiza\Desktop\airplanepart\noiseImage\st\' iname '.st'];
filename0 = ['C:\Documents and Settings\amiza\Desktop\testflat.dat'];
file_1 = fopen(filename0,'w')
[m,n] = size(J);
%fh = fopen(...);
for i = 1:m
for j = 1:n
fprintf(file_1,'%d',J(i,j));
end
fprintf(file_1,'\n');
end
fclose(file_1);
%close(fh);\
at command window:
J= imread('C:\Documents and Settings\amiza\My Documents\My Dropbox\myphotos\flattopo.bmp')
process_img(J)
Subscribe to:
Posts (Atom)