help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading and average PGM files


From: Laurent Hoeltgen
Subject: Re: Loading and average PGM files
Date: Mon, 18 Jun 2012 14:42:40 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 06/18/2012 01:38 PM, Mathieu wrote:
> Hi,
> 
> 
> My pgm files are depth images of 640 over 480 pixels. I already tried imread
> function typing: imread('1.pgm') 
> 
> and I get this error:
> 
> error: imread: invalid image file: Magick++ exception: Magick: Invalid
> colormap
> index (index 65287 >= 256 colors,
> /home/mja/Documents/test/Following/d/1.pgm)
> reported by magick/colormap.c:239 (MagickConstrainColormapIndex)
> error: called from:
> error: /usr/share/octave/3.2.4/m/image/imread.m at line 74, column 7
> 
> Any ideas on what's going wrong? 
> 
> Regards,
> 
> 
> Mathieu 
> 
> --
> View this message in context: 
> http://octave.1599824.n4.nabble.com/Loading-and-average-PGM-files-tp4630784p4630786.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
> 

PGM files may have values ranging from 0-255 or from 0-65535. The former
being much more common than the latter. Usually the value range is
defined in the header of the file. My guess is that you have pgm files
with values up to 65535 and that imagemagick can't handle them properly.
Can you try to read (convert, process) the file with imagemagick directly?

Regards,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]