JPEG2000 Performances and Multispectral Images

Help
Anonymous
2014-08-19
2014-08-26
  • Anonymous - 2014-08-19

    Hello Ruven,

    I wanted to know if there is a way to stream multispectral JPEG2000 with IIPImage. I've already stream simples .JP2 Images but when I'm trying to stream multispectral Images the server fails.

    In addition I also wanted to know what do you think are the better parameters for compressing TIFF into JPEG2000 in order to obtain the best performances (I'm using Kakadu and the only obligation I've is to use reversible compression).

    Thanks,

    Leo.

     
  • Ruven

    Ruven - 2014-08-19

    How exactly are you encoding your multispectral data within JPEG2000?

    And for encoding parameters, use something like:

    Clayers=1 Creversible=yes Clevels=7 "Corder=RPCL" "ORGgen_plt=yes" "ORGtparts=R"  Cuse_sop=yes
    

    And if your images are large, use a codeblock size of 64x64 and precinct sizes of 256x256.

     
  • Anonymous - 2014-08-20

    After some additional tests it seems to me that the problem isn't especially linked to the multispectral nature but rather to the number of channels composing the file

    In fact I can finally read multispectral Iimages as long as they have only 3 channels (RGB). The problem seems to appear when a fourth channel (alpha) is present.

    Any clues concerning this issue ?

     
  • Ruven

    Ruven - 2014-08-20

    Are you using the latest version of iipsrv from github? If not, try again using this. By default it will strip any extra channels. But you can also use the CTW command to give a matrix to compose an output color image mixing some or all the channels from a multi-band input image. At least this works with TIFF: I've not tried with JPEG2000.

     
  • Anonymous - 2014-08-21

    Thanks Ruven, the latest version has indeed resolved the problem.

    However, some of the images which were displayed on 0.9.9 are no longer available on 1.0.0 (Apparently this concern 16 bit images).

    Here is one of the concerned images (the panchromatic one) : http://www.astrium-geo.com/en/24-download-sample-imagery?product=17340
    So, with the latest version I'm no longer capable of displaying this image. The only thing I can see is blank tiles.

     
  • Ruven

    Ruven - 2014-08-21

    Your link is behind some registration system. Please send me a direct link to the image or send via Dropbox etc.

     
  • Anonymous - 2014-08-21

    Sorry but I can't share a direct link to the product. It's an image from http://www.astrium-geo.com/en/23-sample-imagery (Pléiades Primary Product - Bundle)

     
  • Ruven

    Ruven - 2014-08-22

    OK, I managed to download it and try it out and I've uploaded a fix to github - it should now work perfectly.

    This set of images is not multispectral, however. Is there a set of JP2 multispectral images available from that site?

     
  • Anonymous - 2014-08-22

    Thanks a lot Ruven ! I'll test this fix as soon as possible.

    For multispectral images you normally have one of these in the bundle (under the IMG_PHR1A_MS_002 folder). On top of that you can get informations about the Image (compression type,number of channels,...) using the XML file present in the same folder (check the 'Raster_Data' tag).

    Otherwise you can get plenty of panchromatic,multispectral and pan-multispectral images from the link I've shared in my last post.

     
  • Anonymous - 2014-08-22

    Apparently, according to my latest results the 12bit multispectral images are now working.

    However I'm still not able to use pan-sharpened 12bit images. I was thinking that pan-sharpened images were very similar to multispectral images but maybe I'm wrong.

    You have one of theses images at : http://www.astrium-geo.com/en/24-download-sample-imagery?product=33549

    (It seems to me this is the same type of problem you just fixed because the 8bit pan-sharpened Images are working perfectly)

     
  • Ruven

    Ruven - 2014-08-22

    I just uploaded another minor fix to read these multi-band images correctly. Your multi-band and pan-sharpened images now work fine and you can append, for example: CTW=[0,0,0,1;0,0,0,1;0,0,0,1] to your path to view only the 4th IR band. Or CTW=[0,0,0,1;0,1,0,0;0,0,1,0] to get a false color image by replacing the red channel with the IR channel. I have it all working very nicely with the image comparison interface in iipmooviewer.

    Are there any JP2 images around with more than 4 bands?

     
  • Anonymous - 2014-08-25

    Hi Ruven I just tested your last fix but it doesn't seem to work for me. I'm still getting black tiles on 12bit pan-sharpened images (I'm using url generated by iipmooviewer2.0). I'm also not able to get the CSW parameter working.

    Checking the github project I can see that only one line has been changed since the last commit. Is this normal or did I miss a part of the fix ?

    (I'm still able to view 8 bit pan-sharpened images and 8/12 bit multispectral and panchromatic images)

    For JP2 with more than 4 bands I don't have one at the moment but I'll inform you if I find something of this kind.

     
  • Ruven

    Ruven - 2014-08-25

    I used the IMG_PHR1A_PMS_201308191759419_ORT_815633101-001_R1C1.JP2 image from your link and it works fine. Or is your non-working example from somewhere else?

    Checking the github project I can see that only one line has been
    changed since the last commit. Is this normal or did I miss a part
    of the fix ?

    There were in fact two commits - the last one was to properly count the components in multi channel data.

    For JP2 with more than 4 bands I don't have one at the moment but
    I'll inform you if I find something of this kind.

    I generated one myself using 13 band multispectral data and it works fine. But I wanted to make sure IIPImage can work with multispectral data from elsewhere.

     
  • Anonymous - 2014-08-25

    I used this same image. I'll try to re-download it but I'm pretty sure that this is the same file.

     
  • Anonymous - 2014-08-25

    OK. It seems that this was my fault .The 12-bit pan-sharpened JP2 works perfectly now.

    However when I try to works with the original TIFF image (http://www.astrium-geo.com/en/24-download-sample-imagery?product=33545)
    I'm experiencing the same problem that with the JP2 before the fix (I can get only black tiles).

    As the TIFF image is not tiled and pyramided I use the following vips command to make it available (this works perfectly with 8-bit TIFF images).

    vips im_vips2tiff source.tif target.tif:deflate,tile:256x256,pyramid

    Moreover I'm still not able to get the CWT parameter work. If I clearly understand you use this feature as a GET parameter in the iipsrv url (&CWT=XXXX). Is it right ?

    I've not found JP2 with more than 4 bands yet but apparently you can get 8 band TIFF images from this link (http://www.digitalglobe.com/product-samples)
    (check 'Stereo Satellite Imagery' and 'Standard Satellite Imagery' images)

    Thanks a lot for your help Ruven !

     
  • Ruven

    Ruven - 2014-08-26

    Did you get a tiled TIFF from that vips command? I tried myself and it did not work with 12 bit TIFF as libtiff, as far as I understand, does not support 12 bit encoding.

    Yes, CTW (not CWT) allows you to select and combine bands arbitrarily into an output image and works as a GET parameter. So, for example:

    /fcgi-bin/iipsrv.fcgi?FIF=image.tif&CTW=[0,0,0,1;0,0,0,1;0,0,0,1]&WID=500&CVT=JPEG
    

    will export the 4th band as a 500px wide JPEG.

    I've not found JP2 with more than 4 bands yet but apparently you can get 8 band TIFF images from this link (http://www.digitalglobe.com/product-samples)

    OK, I see they use the TIFF "extra samples" tags to add these bands. These don't work with vips, nor iipsrv for the moment.

     
  • Anonymous - 2014-08-26

    I'm very confusing with the use of the CTW parameter. It seems that the order of the parameters affects the feature. This is very unusual in web programming so maybe the fault is mine.

    This url works :

    /iipsrv?FIF=image.tif&CTW=[0,0,0,1;0,0,0,1;0,0,0,1]&WID=500&CVT=JPEG
    

    This one doesn't work :

    /iipsrv?FIF=image.tif&WID=500&CVT=JPEG&CTW=[0,0,0,1;0,0,0,1;0,0,0,1]
    

    First I was thinking this was some cache problem but I've clear both local and server cache and the response is still the same.

    Apart from this minor problem, this is a very interesting functionality. Did you plan to implement something related to this in iipmooviewer?

    Moreover, if you're still looking for multispectral JP2 images with more than 4 bands you should perhaps check this website : http://earthexplorer.usgs.gov/ you can get here plenty of earth observation data in various formats including JPEG2000.

     
  • Ruven

    Ruven - 2014-08-26

    It seems that the order of the parameters affects the feature

    In fact the order is only relevant for the CVT=jpeg parameter, which must be the final parameter in the URL. FIF also must be first. Otherwise the order of every other parameter is flexible.

    Did you plan to implement something related to this in iipmooviewer?

    Yes, I plan to add some controls

    http://earthexplorer.usgs.gov/ you can get here plenty of earth observation
    data in various formats including JPEG2000.

    There's a lot of data there. Do you know which sets are likely to be multispectral?

     
  • Anonymous - 2014-08-26

    I know for sure that Landsat 4 to 8 are providing images with more than 4 bands but they generally use the TIFF format. You can also have a look to the Aerial Imagery data which are likely to provide multispectral images.

    You can found all the technical information about the data sets at :
    https://lta.cr.usgs.gov/products_overview

     


Anonymous

Cancel  Add attachments