comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: create image in background
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: create image in background [message #61073] Thu, 03 July 2008 18:28 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Jul 3, 9:20 pm, frankosuna <frankos...@gmail.com> wrote:
> I fixed the problem.. I needed to load color table 0 so the new code
> looks like this in case anybody else has any problems on doing
> this. Thanks to everybody for the suggestions and help. Maybe I can
> finish my Thesis now!! Well appreciated!!
>
> LOADCT, 0
> mydevice = !D.NAME
>
> SET_PLOT, 'Z'
>
> ERASE
>
> DEVICE, SET_RESOLUTION=[1024,1024]
>
> filteredImage = SOBEL(img)
>
> filteredImage=ROTATE(filteredImage, 2)
> TVSCL, filteredImage
>
> oplot, filteredImage[*,*]
>
> image = TVRead(Filename='edgeDetect',/NODIALOG,/BMP)
>
> image = READ_BMP('/home/users/fjosuna/CASVU_ISS/edgeDetect.bmp')
> OPENW, lun, 'edgeDetect.dat', /GET_LUN
> WRITEU, lun, image
> FREE_LUN, lun
> ERASE
> SET_PLOT, mydevice

Hi,

I guess I don't understand what you are trying to do. But I am glad
it works for you. Just a note, here's an example that creates a
filtered image, writes it as a TIFF, reads it back in and then
displays it. Note that to create and save the image no device was
used. I think this is what you requested originally.

Cheers,
Ben

;read the image into an IDL variable
file = FILEPATH('mineral.png', $
SUBDIRECTORY = ['examples', 'data'])
img = READ_IMAGE(file)

;transform the image
filteredImage = SOBEL(img)
filteredImage=ROTATE(filteredImage, 2)

;write the image to a file - SOBEL returns a signed integer
WRITE_TIFF,"edgeDetect.tif", filteredImage,/SHORT

;to read in the image, use READ_IMAGE - then display with scaling
restoredImage = READ_TIFF("edgeDetect.tif")
TVSCL, restoredImage
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: input box ?
Next Topic: total newbie seeks to interact with data language

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 11:31:03 PDT 2025

Total time taken to generate the page: 0.96820 seconds