[Index for tmp_for_tar/imgio] [Return to Master Index]

readgrayjpg

(tmp_for_tar/imgio/readgrayjpg.m)


Function Synopsis

[im, isPpm,maxval] = readgrayjpg(fname)

Help text

       im = readgrayjpg(fname)

 readjpg	Read a JPEG image file into a gray-level image in Octave.

		[im, isPpm, maxval] = readgrayjpg(fname)
		fname  - JPEG filename.
		im     - image values as Octave variable.
              isPpm  - Should be 0
              maxval - Maximum gray value

 Modified: June   2000 by Etienne Grossmann <etienne@isr.ist.utl.pt>
           to return isPpm and maxval.
 Created: 27.6.98.
 Version: 1.0



Listing of function file tmp_for_tar/imgio/readgrayjpg.m

##       im = readgrayjpg(fname)
##
## Copyright (C) 1998 Ariel Tankus
## 
## This program is free software.
## This file is part of the Image Processing Toolbox for Octave
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##

## readjpg	Read a JPEG image file into a gray-level image in Octave.
##
##		[im, isPpm, maxval] = readgrayjpg(fname)
##		fname  - JPEG filename.
##		im     - image values as Octave variable.
##              isPpm  - Should be 0
##              maxval - Maximum gray value

## Author: Ariel Tankus <arielt@math.tau.ac.il>
## Modified: June   2000 by Etienne Grossmann <etienne@isr.ist.utl.pt>
##           to return isPpm and maxval.
## Created: 27.6.98.
## Version: 1.0

function [im, isPpm,maxval] = readgrayjpg(fname)

  command = sprintf('djpeg -pnm -greyscale %s', fname);
  fid = popen(command, 'r');
  [im, isPpm,maxval] = readpnm(fid);

endfunction

Produced by oct2html on Sat Sep 14 9:47:03 2002
Cross-Directory links are: ON