如何将HDR Envi图像转换为PNG图像(使用GDAL)

时间:2015-08-10 04:37:21

标签: image image-processing gdal envi

我试图通过将ENVI图像转换为PNG图像(即RGB文件)来显示4GB的ENVI图像。根据.hdr头文件,执行此操作的默认波段为:{55,41,12}

我正在使用gdal_translate;我得到了一个黑色图像,但有一些空白的风险。

我使用以下命令行:

gdal_translate -of PNG D:\files\hdr\image D:\file\hdr\test.png -b 55 -b 41 -b 12

我做错了什么?我试图改变乐队的顺序,把选项-ot Byte,-ot Uint16,但没有成功......

我还尝试使用java语言转换此图像,但是也没有成功。如有必要,我也可以在这里提供源代码。

更新1

图像的完整信息是(通过使用gdalinfo):

Driver: ENVI/ENVI .hdr Labelled
Files: D:\files\hdr\image
       D:\files\hdr\image.hdr
PROJCS["UTM_Zone_19S",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_84",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",10000000.0],
    PARAMETER["Central_Meridian",-69.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1]]
Origin = (320055.641999999990000,6309280.342000000200000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  Band_100=Resize (band*100 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.770900)
  Band_101=Resize (band 101 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.774500)

......  

[%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.767300)
  Band_9=Resize (band 9 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.440300)
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  320055.642, 6309280.342) ( 70d56' 0.93"W, 33d20'26.27"S)
Lower Left  (  320055.642, 6308398.842) ( 70d56' 1.56"W, 33d20'54.88"S)
Upper Right (  324115.142, 6309280.342) ( 70d53'23.97"W, 33d20'28.69"S)
Lower Right (  324115.142, 6308398.842) ( 70d53'24.58"W, 33d20'57.30"S)
Center      (  322085.392, 6308839.592) ( 70d54'42.76"W, 33d20'41.79"S)
Band 1 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 1 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.411200)
  Metadata:
    wavelength=0.411200
Band 2 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 2 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.414800)
  Metadata:
    wavelength=0.414800
...
Band 11 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 11 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.447500)
  Metadata:
    wavelength=0.447500
Band 12 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 12 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.451200)
  Metadata:
    wavelength=0.451200
....
Band 41 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 41 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.556500)
  Metadata:
    wavelength=0.556500
Band 42 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 42 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.560200)
  Metadata:
    wavelength=0.560200
....
Band 54 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 54 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.603800)
  Metadata:
    wavelength=0.603800
Band 55 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 55 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.607400)
  Metadata:
    wavelength=0.607400
...
Band 160 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band*160 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.988900)
  Metadata:
    wavelength=0.988900

由于Body限制,我省略了一些信息。

0 个答案:

没有答案