1
我想打開一個envi .img文件並且有一個.hdr文件具有相同的名稱。 .img文件中有兩個圖像,我可以使用下面的代碼讀取它們。閱讀.img與光譜python envi文件
from spectral import *
img = open_image('LC08_L1TP_029029_20130330_20170310_01_T1_sensor_B05.img')
和IMG的屬性(BSQ文件)如下圖所示
In[352] img
Out[352]:
Data Source: '.\LC08_L1TP_029029_20130330_20170310_01_T1_sensor_B05.img'
# Rows: 7311
# Samples: 7371
# Bands: 2
Interleave: BSQ
Quantization: 16 bits
Data format: int16
我想從IMG提取這兩個圖像是什麼。但是,當我與
img[:,:,1]
努力,這讓我的大小(7311,7371,1)的陣列,但在陣列內所有的值是零,但我知道他們應該是非零值。
我的問題是如何從BSQ文件中提取這兩個圖像?