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: [mg64226] Re: [mg64208] Digital Image Processing: showing graylevel images in
  • From: "Maarten van der Burgt" <maarten.vanderburgt at icos.be>
  • Date: Tue, 7 Feb 2006 03:35:54 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Meanwhile I did come across the answer:

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

and not

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

what I tried earlier.

Maarten



                                                                                                                                               
                    Maarten van                                                                                                                
                    der Burgt            To:     "Maarten van der Burgt" <maarten.vanderburgt at icos.be>                                         
                                         cc:     mathgroup at smc.vnet.net                                                                        
                    06/02/2006           Subject: [mg64226]     Re: [mg64208] Digital Image Processing: showing graylevel images in(Document link:       
                    10:06                Maarten Van Der Burgt)                                                                                
                                                                                                                                               
                                                                                                                                               



I forgot one fairly essential sentence in my first mail. I added it below
after: >>>>!

Maarten



                                                                                                                                                     
                    "Maarten van der                                                                                                                 
                    Burgt"                     To:     mathgroup at smc.vnet.net                                                                        
                    <maarten.vanderburg        cc:                                                                                                   
                    t at icos.be>                 Subject: [mg64226]     [mg64208] Digital Image Processing: showing graylevel images in                          
                                                                                                                                                     
                    06/02/2006 08:49                                                                                                                 
                                                                                                                                                     
                                                                                                                                                     




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 this shows GV = 50 as black and GV = 180 as white.


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: Using Get in a Module
  • Next by Date: Using Map with a function of more than 1 argument
  • Previous by thread: Re: Digital Image Processing: showing graylevel images in
  • Next by thread: Re: Digital Image Processing: showing graylevel images in