%% % @file convert_to_pgm % @author Nicholas Heckman (nth@andrew) % @date 2008-01-24 % % @brief MATLAB function to convert any image file supported % by MATLAB to a 8-bit ASCII filetype % % @param filename_open absolute path or local path to the image % file that will be converted to PGM % % @param filename_write file name to save the PGM image to; this % filename can be a local path or an absolute path %% function convert_to_pgm(filename_open, filename_write) img = imread(filename_open); imwrite(img, filename_write, 'pgm', 'Encoding', 'ASCII');