Re: reading in images [message #54019] |
Mon, 14 May 2007 08:26 |
grubab
Messages: 2 Registered: May 2007
|
Junior Member |
|
|
On May 14, 3:48 pm, David Fanning <d...@dfanning.com> wrote:
> Ingo von Borstel writes:
>> newimage = dblarr(xsize,ysize)
>> newimage[(xsize-imageSize[0])/2:(xsize-imageSize[0])/2+image Size[0],(ysize-imageSize[1])/2:(ysize-imageSize[1])/2+imageS ize[1]]
>> = image
>> tv, newimage
>>> end
>
>> Create a new image that is the size of your window. Place the old image
>> within the centre of the newly created image and then display it. I hope
>> I didn't do any mistake within the implementation above; you might need
>> to adjust the indices slightly, I haven't tested it.
>
> Oh, for heaven's sake. Download TVIMAGE and use that.
>
> http://www.dfanning.com/programs/tvimage.pro
>
> Then,
>
> IDL> TVImage, image
>
> It will be big enough for you to see it. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
thanks alot, i already found your tvimage program.
|
|
|
Re: reading in images [message #54020 is a reply to message #54019] |
Mon, 14 May 2007 06:48  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ingo von Borstel writes:
> newimage = dblarr(xsize,ysize)
> newimage[(xsize-imageSize[0])/2:(xsize-imageSize[0])/2+image Size[0],(ysize-imageSize[1])/2:(ysize-imageSize[1])/2+imageS ize[1]]
> = image
> tv, newimage
>> end
>
> Create a new image that is the size of your window. Place the old image
> within the centre of the newly created image and then display it. I hope
> I didn't do any mistake within the implementation above; you might need
> to adjust the indices slightly, I haven't tested it.
Oh, for heaven's sake. Download TVIMAGE and use that.
http://www.dfanning.com/programs/tvimage.pro
Then,
IDL> TVImage, image
It will be big enough for you to see it. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: reading in images [message #54024 is a reply to message #54020] |
Mon, 14 May 2007 03:41  |
Ingo von Borstel
Messages: 54 Registered: September 2006
|
Member |
|
|
Hi,
>
> pro image
> device, decomposed=0
> imageSize = [137,103]
> read_jpeg, 'images.jpeg', image
> loadct, 0 ;it's a greyscale picture
> window, xsize=200, ysize =150
newimage = dblarr(xsize,ysize)
newimage[(xsize-imageSize[0])/2:(xsize-imageSize[0])/2+image Size[0],(ysize-imageSize[1])/2:(ysize-imageSize[1])/2+imageS ize[1]]
= image
tv, newimage
> end
Create a new image that is the size of your window. Place the old image
within the centre of the newly created image and then display it. I hope
I didn't do any mistake within the implementation above; you might need
to adjust the indices slightly, I haven't tested it.
HTH & Regards,
Ingo
--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc
If you need an urgent reply, replace newsgroups by vgap.
|
|
|