Re: image on map [message #58033] |
Sat, 12 January 2008 12:49 |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Sat, 12 Jan 2008, skymaxwell@gmail.com wrote:
> Thanks for your reply, David
>
> but now another question
> now i want to create BMP file
> i was looked at one of your tips
>
> http://www.dfanning.com/color_tips/howjpeg.html
>
> and some forum messages here. So here is my code
>
> ;read image from idl window
> image=TVRD(TRUE=1)
> help,image
> ;something wrong with microsoft ? RGB to BGR
> newImage=Transpose(image[2,1,0])
newImage=Transpose(image,[2,1,0])
regards,
lajos
> ;try create bmp
> WRITE_BMP,'file_src.bmp',newImage;,/RGB
>
>
> and i got the error
>
> IMAGE BYTE = Array[3, 600, 360]
> TRANSPOSE: Expression must be an array in this context: <BYTE
> ( 0)>.
> Execution halted at: $MAIN$ 58 C:\Documents and Settings
> \user\Desktop\bmpwindow.pro
|
|
|
Re: image on map [message #58034 is a reply to message #58033] |
Sat, 12 January 2008 12:23  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
skymaxwell@gmail.com writes:
> but now another question
> now i want to create BMP file
> i was looked at one of your tips
>
> http://www.dfanning.com/color_tips/howjpeg.html
>
> and some forum messages here. So here is my code
>
> ;read image from idl window
> image=TVRD(TRUE=1)
> help,image
> ;something wrong with microsoft ? RGB to BGR
> newImage=Transpose(image[2,1,0])
> ;try create bmp
> WRITE_BMP,'file_src.bmp',newImage;,/RGB
>
>
> and i got the error
>
> IMAGE BYTE = Array[3, 600, 360]
> TRANSPOSE: Expression must be an array in this context: <BYTE
> ( 0)>.
> Execution halted at: $MAIN$ 58 C:\Documents and Settings
> \user\Desktop\bmpwindow.pro
I don't know. Did you try creating the BMP file with
TVRead? That always works for me. Even on Windows.
IDL> void = TVRead(/BMP)
You can find it here:
http://www.dfanning.com/programs/tvread.pro
You could dissect the code to see how it is I'm writing the
BMP file. This could be a version issue, too. What version of
IDL are you using?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: image on map [message #58035 is a reply to message #58034] |
Sat, 12 January 2008 11:44  |
skymaxwell@gmail.com
Messages: 127 Registered: January 2007
|
Senior Member |
|
|
Thanks for your reply, David
but now another question
now i want to create BMP file
i was looked at one of your tips
http://www.dfanning.com/color_tips/howjpeg.html
and some forum messages here. So here is my code
;read image from idl window
image=TVRD(TRUE=1)
help,image
;something wrong with microsoft ? RGB to BGR
newImage=Transpose(image[2,1,0])
;try create bmp
WRITE_BMP,'file_src.bmp',newImage;,/RGB
and i got the error
IMAGE BYTE = Array[3, 600, 360]
TRANSPOSE: Expression must be an array in this context: <BYTE
( 0)>.
Execution halted at: $MAIN$ 58 C:\Documents and Settings
\user\Desktop\bmpwindow.pro
|
|
|
Re: image on map [message #58037 is a reply to message #58035] |
Sat, 12 January 2008 06:31  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
skymaxwell@gmail.com writes:
> I have 'world.bmp' file. I load it to IDL. Set map projection by
> MAP_SET. Then use MAP_IMAGE,
> but image there must be 2D array so before i use REFORM. If i display
> image by TV, it's now same colors as origin BMP file. So how fix it ?
Here is an article that describes how to put a true-color
image on a map projection:
http://www.dfanning.com/tips/map_image24.html
> and another question. My BMP file have size (600,360) when i use
> MAP_SET some pixels on top and bottom don't used. i was looked in help
> - MAP_SET use only [+80;-80] degrees on latitude. how use [-90;+90] ?
I've never heard of this, and doubt that it is true. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|