MATLAB CODE FOR Reading a RAW format gray scale image from disk

windows

Guest
Hi All<br /><br />I have this code here<br /><br />it is for Reading a RAW format gray scale image <br /><br />
Code:
<br /><br />fid = fopen(filename,'rb');<br />if (fid==1)<br />   error('Cannot open image file...press CTRL-C to exit ');pause<br />end<br />temp = fread(fid, nSize, 'uchar');<br />fclose(fid);<br />result = reshape(temp, [nRow nColumn])';<br /><br />Where<br />        input:    filename : input file<br />           nSize : size of the output image<br />          nRow : row of the output image<br />         nColumn : column of the output image<br />        output:   result : output data in matrix format<br /><br />### <br /><br />My Questions are:<br />1. Filename can be .bmp/.jpg right ? I am using lena ( 128X128)<br />2. if I give nsize as 128 then what should be filled in [ nrow ncolumn] matrix? <br />it is giving me errors saying " elements should be same " <br /><br /><br />PLEASE HELP !!!!
</div>
 
Back
Top