Ticket #3531 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Data is different depending on which band is requested

Reported by: gbriggs Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: JPIP JPIPKAK JPEG2000
Cc:

Description

The following two commands give completely different data results for band 2 (the only band in the first case, and the middle band in the second):

gdal_translate.exe -of ENVI -b 2 -srcwin 27200 6450 501 451  jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_band2.img"

gdal_translate.exe -of ENVI -srcwin 27200 6450 501 451  jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_all_bands.img"

If you replace the -b 2 with -b 1, the results appear fine.

Change History

in reply to: ↑ description   Changed 3 years ago by gbriggs

Replying to gbriggs:

The following two commands give completely different data results for band 2 (the only band in the first case, and the middle band in the second): gdal_translate.exe -of ENVI -b 2 -srcwin 27200 6450 501 451  jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_band2.img" gdal_translate.exe -of ENVI -srcwin 27200 6450 501 451  jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_all_bands.img" If you replace the -b 2 with -b 1, the results appear fine.

I suspect this issue may be related to the fact that the region decompressor being utilized by JPIPKAK performs color conversions automatically. But I have not confirmed this.

  Changed 3 years ago by warmerdam

  • status changed from new to assigned

I have had no problem reproducing serious issues with the situation described above.

  Changed 3 years ago by warmerdam

The problem seems to be particular to handling of YCbCr images. Boulder_Foothills uses YCbCr as the underlying color space. If three bands are requested at once things are automatically transformed to RGB by the region decompressor. But if you request just band 2 then you get the "Cb" component which does not look like much.

Note that requesting band 1 was not *really* working - it is just that the Y component (intensity) is similar in appearance to any of the red, green or blue channel results.

I *think* the solution is to ensure that all components are fetched from the JPIP server for YCC color model images. I'm going to try this out.

  Changed 3 years ago by warmerdam

  • status changed from assigned to closed
  • resolution set to fixed

This strategy has been implemented in trunk (r19426) and appears to be working properly.

Note: See TracTickets for help on using tickets.