MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Digital Image Processing: showing graylevel images in

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64300] Re: Digital Image Processing: showing graylevel images in
  • From: "Mariusz Jankowski" <mjankowski at usm.maine.edu>
  • Date: Fri, 10 Feb 2006 02:13:37 -0500 (EST)
  • Organization: University of Southern Maine
  • References: <ds6vqe$8of$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Maarten, yes, to avoid autoscaling use the PlotRange option:

Show[Graphics[img, PlotRange->{0,255}] ]

see Section 2.5 of the documentation (User's Guide) for another example.


Regards, Mariusz



>>> On 2/6/2006 at 3:02 am, in message <ds6vqe$8of$1 at smc.vnet.net>, Maarten
van
der Burgt<maarten.vanderburgt at icos.be> wrote:
> After loading the Digital Image Processing package (<<imageprocessing`)
> The following command generates a 100 x 100 pixel  graylevel image with
> gray values (GV) in the range of 50 ot 180.
> 
> img =ToGrayLevel[Table[Random[Integer, {50, 180}], {100},{100}]]
> 
> The default way to show this image on screen is:
> 
> Show[Graphics[img]];
> 
> 
> But, assuming the complete GV range I am working with is 0-255, I want to
> display the image with  0 as black and 255 as white.
> 
> I know this can be done using:
> 
> Show[Graphics[Raster[RawImageData[img],{{0,0},{100,100}},{0,255}]],
> AspectRatio->Automatic]
> 
> But, compared to the firste Show[...] expression,  this is a rather
> cumbersome way of doing this.
> 
> Is there a shorter way to display a graylevel images properly scaled
> (0-255). I did not find anything in the Digital Image Processing
> documentation.
> 
> Thanks for your help.
> 
> Maarten


  • Prev by Date: Re: Mathlink
  • Next by Date: Re: Remove Indeterminate elements
  • Previous by thread: Re: Digital Image Processing: showing graylevel images in
  • Next by thread: Re: Problem plotting high-order Laguerre polynomials