Re: Image output display from IDL [message #60822] |
Sat, 21 June 2008 16:31 |
Raghu
Messages: 3 Registered: June 2008
|
Junior Member |
|
|
On Jun 20, 3:51 pm, Yaswant Pradhan <Yaswant.Prad...@gmail.com> wrote:
> On Jun 20, 5:36 am, Raghu <geor...@gmail.com> wrote:
>
>
>
>
>
>> Hi Chris,
>
>> These are just gray scale images. I just narrowed down the actual
>> problem. My images are in ERDAS Imagine (.img) floating point data
>> type. When i convert these into floating point again using
>> float(images) in ENVI , the resulting images are in ENVI format. When
>> these ENVI float images are used in the script, the output looks fine.
>> It seems like IDL treats ERDAS' floats differently or i don't quite
>> know if there's something else thats wrong here. I have tried it a few
>> times now and although the header file in ENVI reads the ERDAS files
>> as float, the IDL script seems to do something else when i read the
>> ERDAS files directly.
>
>> I'm wondering if i'd have to import all my images into an IDL float
>> type before i start processing. I'd still think that float
>> irrespective of the software would be the same, but i might be wrong.
>
>> Ram
>
>> On Jun 19, 8:38 pm, Chris <cnb4s...@gmail.com> wrote:
>
>>> Are they truecolor images?
>
>>> If so, it may be an issue with how the image is passed back and forth
>>> in IDL. An n pixel by n pixel color image read into idl (usually) gets
>>> stored as a n x n x 3 data cube (plane 0 is R, plane 1 is G, and plane
>>> 2 is B). You have to tell IDL which dimension of the array stores
>>> these color slices when working with them. In the above example, the
>>> third dimension stores the color slices so, if I wanted to display the
>>> image in IDL, I would use tvscl,im,true=3. Similarly, if you write out
>>> a color image, you usually have to specify which dimension runs
>>> through the different colors. Perhaps during the reading and writing
>>> stages, you switched this index, meaning that the final image would
>>> have all of these weird color/stripe patterns.
>
>>> Try scanning the IDL help for the "TRUE" keyword
>
>>> Chris
>
>>> On Jun 19, 1:42 pm, Raghu <geor...@gmail.com> wrote:
>
>>>> Hi all,
>
>>>> I wrote a script in IDL which reads multiple images and outputs an
>>>> image according to some conditions i specified.
>>>> The code works, seemingly with no errors and outputs the required
>>>> image. However, when i display the image in ENVI, the output image
>>>> looks like a series of tiles/bands as if the values are grouped line-
>>>> by-line. The statistics are right, but the display looks really weird.
>
>>>> I had read something about how IDL stores images but i can't quite
>>>> find the keywords to search for it.
>>>> Does this have to do with any machine settings or is it a setting
>>>> within IDL itself ? Any ideas ?
>
>>>> I can attach a graphic if it helps.
>
>>>> Thanks in advance,
>>>> Ram- Hide quoted text -
>
>>> - Show quoted text -
>
> Unless you change the OS, IDL should treat the floating point grey-
> scale images (from ERDAS) correctly. Few points you could check - (i)
> number of pixels and scan-lines (and the size of the file), (ii) how
> the bands are stored, BIL/BSQ/BIP?
> If you are reading Erdas .img files straight in IDL, remember that
> there will be few bytes recorded as file header. Perhaps you want to
> export the images/bands as binary flat file(s) before reading in IDL.- Hide quoted text -
>
> - Show quoted text -
Hi,
It looks like IDL doesn't support ERDAS IMG files. It supports TIFF
and my program works with TIFF. As you said, i might have to import
the files into a compatible format before i read them in.
Thanks,
Ram
|
|
|
Re: Image output display from IDL [message #60823 is a reply to message #60822] |
Fri, 20 June 2008 15:51  |
yp
Messages: 42 Registered: February 2005
|
Member |
|
|
On Jun 20, 5:36 am, Raghu <geor...@gmail.com> wrote:
> Hi Chris,
>
> These are just gray scale images. I just narrowed down the actual
> problem. My images are in ERDAS Imagine (.img) floating point data
> type. When i convert these into floating point again using
> float(images) in ENVI , the resulting images are in ENVI format. When
> these ENVI float images are used in the script, the output looks fine.
> It seems like IDL treats ERDAS' floats differently or i don't quite
> know if there's something else thats wrong here. I have tried it a few
> times now and although the header file in ENVI reads the ERDAS files
> as float, the IDL script seems to do something else when i read the
> ERDAS files directly.
>
> I'm wondering if i'd have to import all my images into an IDL float
> type before i start processing. I'd still think that float
> irrespective of the software would be the same, but i might be wrong.
>
> Ram
>
> On Jun 19, 8:38 pm, Chris <cnb4s...@gmail.com> wrote:
>
>> Are they truecolor images?
>
>> If so, it may be an issue with how the image is passed back and forth
>> in IDL. An n pixel by n pixel color image read into idl (usually) gets
>> stored as a n x n x 3 data cube (plane 0 is R, plane 1 is G, and plane
>> 2 is B). You have to tell IDL which dimension of the array stores
>> these color slices when working with them. In the above example, the
>> third dimension stores the color slices so, if I wanted to display the
>> image in IDL, I would use tvscl,im,true=3. Similarly, if you write out
>> a color image, you usually have to specify which dimension runs
>> through the different colors. Perhaps during the reading and writing
>> stages, you switched this index, meaning that the final image would
>> have all of these weird color/stripe patterns.
>
>> Try scanning the IDL help for the "TRUE" keyword
>
>> Chris
>
>> On Jun 19, 1:42 pm, Raghu <geor...@gmail.com> wrote:
>
>>> Hi all,
>
>>> I wrote a script in IDL which reads multiple images and outputs an
>>> image according to some conditions i specified.
>>> The code works, seemingly with no errors and outputs the required
>>> image. However, when i display the image in ENVI, the output image
>>> looks like a series of tiles/bands as if the values are grouped line-
>>> by-line. The statistics are right, but the display looks really weird.
>
>>> I had read something about how IDL stores images but i can't quite
>>> find the keywords to search for it.
>>> Does this have to do with any machine settings or is it a setting
>>> within IDL itself ? Any ideas ?
>
>>> I can attach a graphic if it helps.
>
>>> Thanks in advance,
>>> Ram- Hide quoted text -
>
>> - Show quoted text -
>
>
Unless you change the OS, IDL should treat the floating point grey-
scale images (from ERDAS) correctly. Few points you could check - (i)
number of pixels and scan-lines (and the size of the file), (ii) how
the bands are stored, BIL/BSQ/BIP?
If you are reading Erdas .img files straight in IDL, remember that
there will be few bytes recorded as file header. Perhaps you want to
export the images/bands as binary flat file(s) before reading in IDL.
|
|
|
Re: Image output display from IDL [message #60843 is a reply to message #60823] |
Thu, 19 June 2008 21:36  |
Raghu
Messages: 3 Registered: June 2008
|
Junior Member |
|
|
Hi Chris,
These are just gray scale images. I just narrowed down the actual
problem. My images are in ERDAS Imagine (.img) floating point data
type. When i convert these into floating point again using
float(images) in ENVI , the resulting images are in ENVI format. When
these ENVI float images are used in the script, the output looks fine.
It seems like IDL treats ERDAS' floats differently or i don't quite
know if there's something else thats wrong here. I have tried it a few
times now and although the header file in ENVI reads the ERDAS files
as float, the IDL script seems to do something else when i read the
ERDAS files directly.
I'm wondering if i'd have to import all my images into an IDL float
type before i start processing. I'd still think that float
irrespective of the software would be the same, but i might be wrong.
Ram
On Jun 19, 8:38 pm, Chris <cnb4s...@gmail.com> wrote:
> Are they truecolor images?
>
> If so, it may be an issue with how the image is passed back and forth
> in IDL. An n pixel by n pixel color image read into idl (usually) gets
> stored as a n x n x 3 data cube (plane 0 is R, plane 1 is G, and plane
> 2 is B). You have to tell IDL which dimension of the array stores
> these color slices when working with them. In the above example, the
> third dimension stores the color slices so, if I wanted to display the
> image in IDL, I would use tvscl,im,true=3. Similarly, if you write out
> a color image, you usually have to specify which dimension runs
> through the different colors. Perhaps during the reading and writing
> stages, you switched this index, meaning that the final image would
> have all of these weird color/stripe patterns.
>
> Try scanning the IDL help for the "TRUE" keyword
>
> Chris
>
> On Jun 19, 1:42 pm, Raghu <geor...@gmail.com> wrote:
>
>
>
>> Hi all,
>
>> I wrote a script in IDL which reads multiple images and outputs an
>> image according to some conditions i specified.
>> The code works, seemingly with no errors and outputs the required
>> image. However, when i display the image in ENVI, the output image
>> looks like a series of tiles/bands as if the values are grouped line-
>> by-line. The statistics are right, but the display looks really weird.
>
>> I had read something about how IDL stores images but i can't quite
>> find the keywords to search for it.
>> Does this have to do with any machine settings or is it a setting
>> within IDL itself ? Any ideas ?
>
>> I can attach a graphic if it helps.
>
>> Thanks in advance,
>> Ram- Hide quoted text -
>
> - Show quoted text -
|
|
|
Re: Image output display from IDL [message #60844 is a reply to message #60843] |
Thu, 19 June 2008 20:38  |
Chris[5]
Messages: 16 Registered: May 2008
|
Junior Member |
|
|
Are they truecolor images?
If so, it may be an issue with how the image is passed back and forth
in IDL. An n pixel by n pixel color image read into idl (usually) gets
stored as a n x n x 3 data cube (plane 0 is R, plane 1 is G, and plane
2 is B). You have to tell IDL which dimension of the array stores
these color slices when working with them. In the above example, the
third dimension stores the color slices so, if I wanted to display the
image in IDL, I would use tvscl,im,true=3. Similarly, if you write out
a color image, you usually have to specify which dimension runs
through the different colors. Perhaps during the reading and writing
stages, you switched this index, meaning that the final image would
have all of these weird color/stripe patterns.
Try scanning the IDL help for the "TRUE" keyword
Chris
On Jun 19, 1:42 pm, Raghu <geor...@gmail.com> wrote:
> Hi all,
>
> I wrote a script in IDL which reads multiple images and outputs an
> image according to some conditions i specified.
> The code works, seemingly with no errors and outputs the required
> image. However, when i display the image in ENVI, the output image
> looks like a series of tiles/bands as if the values are grouped line-
> by-line. The statistics are right, but the display looks really weird.
>
> I had read something about how IDL stores images but i can't quite
> find the keywords to search for it.
> Does this have to do with any machine settings or is it a setting
> within IDL itself ? Any ideas ?
>
> I can attach a graphic if it helps.
>
> Thanks in advance,
> Ram
|
|
|