【发布时间】:2019-09-28 08:19:30
【问题描述】:
我下载了 BigEarthNet 数据集,并使用 gdal 在 python 中读取了 TIFF 图像。代码如下。结果数组的值远高于我预期的 0-255 范围,那么值的范围是多少?
band1 = imagePath + "/" + img + "/" + img + "_B02.tif"
band_ds = gdal.Open(band1, gdal.GA_ReadOnly)
raster_band = band_ds.GetRasterBand(1)
blue = raster_band.ReadAsArray()
print(blue)
这是输出
[[284 388 554 ... 325 318 325]
[211 213 297 ... 319 300 318]
[227 206 245 ... 305 318 332]
...
[309 612 920 ... 710 643 554]
[259 626 862 ... 654 646 536]
[260 608 730 ... 501 629 526]]
【问题讨论】:
-
范围从
blue.min()到blue.max()。