資源簡介
遙感圖像中的IMG格式圖像的讀取,可以讀取留個波段,已測試,可以運行,需要的可以下載
代碼片段和文件信息
clear?all
clc
lines=400;%遙感圖像的行數
samples=640;%數據的列數
N=6;%波段數
img=fopen(‘fychinasub.img‘‘rb‘);
for?i=1:N?
????
????bi=fread(imglines*samples‘uint8‘);%lines*samples為讀入數據的個數讀入的方式是先讀行再讀列???
????band_cov=reshape(bisampleslines);%重置圖像的行數和列數????
????band_cov2=band_cov‘;??
????band_uint8=uint8(band_cov2);
????tif=imadjust(band_uint8);%調整像素的范圍,使其有一定對比度??
????mkdir(‘.\‘‘tifbands1‘)
????name=[‘.\tifbands1\tif‘int2str(i)‘.tif‘];???
????imwrite(tifname‘tif‘);
????tilt=[‘波段‘int2str(i)];
????subplot(32i)imshow(tif);title(tilt);?
end
fclose(img);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-08-04?13:00??img格式讀取\
?????文件?????4449165??2009-08-21?14:51??img格式讀取\fy.img
?????文件?????3215918??2009-08-31?13:06??img格式讀取\fychinasub.img
?????文件?????????635??2014-08-04?13:01??img格式讀取\sample_BSQ.m
?????目錄???????????0??2014-08-04?13:00??img格式讀取\tifbands1\
?????文件??????257038??2014-08-07?17:10??img格式讀取\tifbands1\tif1.tif
?????文件??????246918??2014-08-07?17:10??img格式讀取\tifbands1\tif2.tif
?????文件??????246866??2014-08-07?17:10??img格式讀取\tifbands1\tif3.tif
?????文件??????246962??2014-08-07?17:10??img格式讀取\tifbands1\tif4.tif
?????文件??????247276??2014-08-07?17:10??img格式讀取\tifbands1\tif5.tif
?????文件??????258084??2014-08-07?17:10??img格式讀取\tifbands1\tif6.tif
- 上一篇:樸素貝葉斯分類模型完整代碼
- 下一篇:com 端口萬能驅動
評論
共有 條評論