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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: create image in background [message #61073] Thu, 03 July 2008 18:28
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
Re: create image in background [message #61074 is a reply to message #61073] Thu, 03 July 2008 18:20 Go to previous message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
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
Re: create image in background [message #61075 is a reply to message #61074] Thu, 03 July 2008 16:26 Go to previous message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
I have the following code and I am generating an image. However, for
some reason the image is in colors and is not black and white. It
doesn't look like it has been edge detected.

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
Re: create image in background [message #61084 is a reply to message #61075] Thu, 03 July 2008 06:20 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Jul 3, 8:57 am, Bruce Bowler <bbow...@bigelow.org> wrote:
> On Thu, 03 Jul 2008 05:28:27 -0700, ben.bighair wrote:
>> Any array representing an image can be written with displaying it. Use
>
> insert "out" after with?
>
>> the WRITE_IMAGE for easy image writing.
>
> Bruce :-)

Yes indeed! And, if you see any marbles rolling down the hall past
your door - please catch 'em as they are surely mine!

Cheers,
Ben

P.S. I have been making many more of these kind of missing-word-
mishaps recently. It will be OK just as long as my wife continues to
find them endearing.
Re: create image in background [message #61086 is a reply to message #61084] Thu, 03 July 2008 05:57 Go to previous message
Bruce Bowler is currently offline  Bruce Bowler
Messages: 128
Registered: September 1998
Senior Member
On Thu, 03 Jul 2008 05:28:27 -0700, ben.bighair wrote:

> Any array representing an image can be written with displaying it. Use

insert "out" after with?

> the WRITE_IMAGE for easy image writing.

Bruce :-)
Re: create image in background [message #61087 is a reply to message #61086] Thu, 03 July 2008 05:28 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Jul 2, 7:27 pm, frankosuna <frankos...@gmail.com> wrote:
> Hello,
>
> I am doing some edge detection work and I wanted to be able to do this
> without having to display or open any windows. I want to be able to
> write the edge detected image in the background. Any suggestions will
> be greatly appreciated.


Hi,

Any array representing an image can be written with displaying it.
Use the WRITE_IMAGE for easy image writing.

Cheers,
Ben
Re: create image in background [message #61098 is a reply to message #61087] Thu, 03 July 2008 02:59 Go to previous message
Ivan Zimine is currently offline  Ivan Zimine
Messages: 40
Registered: February 1999
Member
window, /pixmap
Re: create image in background [message #61100 is a reply to message #61098] Wed, 02 July 2008 22:31 Go to previous message
russell.grew is currently offline  russell.grew
Messages: 74
Registered: February 2005
Member
set_plot, 'ps'
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 18:41:37 PDT 2025

Total time taken to generate the page: 0.00671 seconds