Re: Writing JPEG2000 file [message #45406 is a reply to message #45402] |
Thu, 08 September 2005 16:26   |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
Haje Korth wrote:
> Raval,
> If displayed on a single monitor, the image will not reflect the resolution
> of the data set and thereofre you can safely used 'rebin' to turn the data
> into a 1000x1000 array, which inturn should work with your code. If this
> resolution is insuffient, try tiling the image.
>
> Haje
>
>
> <raval.chintan@gmail.com> wrote in message
> news:1126087454.579398.30090@g44g2000cwa.googlegroups.com...
>> Hello,
>>
>> I want to generate the JPEG2000 file from the tiff file which is
>> containing 20000 samples and 20000 lines, I am writing the following
>> code.
>>
>>
>> jp2filename = 'abc'
>> Data = read_tiff('c:\satellite.tif')
>> imageDims = Size(data,/Dimension)
>>
>> ; Prepare JPEG2000 object property values.
>> ncomponents = 3
>> nLayers = 20
>> nLevels = 6
>> offset = [0,0]
>> jp2TileDims = [1024, 1024]
>> jp2TileOffset = [0,0]
>> bitdepth = [8,8,8]
>>
>> ; Create the JPEG2000 image object.
>> oJP2File = OBJ_NEW('IDLffJPEG2000',jp2filename , WRITE=1)
>> oJP2File->SetProperty, N_COMPONENTS=nComponents, $
>> N_LAYERS=nLayers, $
>> N_LEVELS=nLevels, $
>> OFFSET=offset, $
>> TILE_DIMENSIONS=JP2TileDims, $
>> TILE_OFFSET=JP2TileOffset, $
>> BIT_DEPTH=bitDepth, $
>> DIMENSIONS=[imageDims[1],ImageDims[2]]
>>
>>
>> oJP2FILE->SetData, Data
>> OBJ_DESTROY, oJP2FILE
>>
>>
>>
>> Now the problem is that IDL 6.2 is unable to allocate the memory for
>> storing the data.
>>
>> Is there any other way to do this? If yes Then How one can do it?
>>
>> Thanks In Advance.
>>
>> Chintan Raval.
>>
Haje,
Raval's code comes from RSI's example tilingjp2.pro, which demonstrates
progressive zooming into more detailed image layers using the pyramid
functionality of JPEG2000 files.
Hence rebinning the image down probably won't tie in with why Raval is
using
that code.
I've tried using the same code for a *large* chunk of SRTM 3 arcsec
data,
and have concluded that using a 32 bit OS (Windows) just ain't gonna do
it for me.
I'll be switching to 64 bit IDL on Linux.
Andrew
|
|
|