里约热内卢
rio-pansharpen的Python项目详细描述
潘沙彭陆地卫星8个场景。
什么是平底琴?
泛化是利用高分辨率灰度带(全色或泛色带)中的空间信息和多光谱带中的颜色信息来创建单个高分辨率彩色图像的过程。
P pan-pixel cluster + M single multispectral pixel = M pan-sharpened pixel
在Mapbox pansharpening blog post中查找更多示例和信息。
安装
我们强烈建议安装在virtualenv中。一旦激活,
pip install -U pip pip install rio-pansharpen
或从源安装
git checkout https://github.com/mapbox/rio-pansharpen.git cd rio-pansharpen pip install -U pip pip install -r requirements.txt pip install -e .
python api
潘沙彭。工人
pansharpens landsat 8的{tt1}$模块。请访问USGS Landsat page页,了解有关陆地卫星8波段名称的更多信息。
一。worker.pansharpen
worker.pansharpen函数接受以下输入:
- Numpy 3D阵列,形状==(3,可视高度,可视宽度)
- 定义VIS数组地理参考的仿射变换
- numpy 2d数组,shape==(平移高度,平移宽度)
- 定义泛数组地理参考的仿射变换
- 摇摄法
输出:
- Numpy 3D阵列,形状==(3,平移高度,平移宽度)
>>> from pansharpen import worker >>> from pansharpen.methods import Brovey ... >>> pansharpened = worker.pansharpen(vis, vis_transform, pan, pan_transform, pan_dtype, r_crs, dst_crs, weight, method="Brovey", src_nodata=0)
2.worker.calculate_landsat_pansharpen
>>> from pansharpen import worker >>> from pansharpen.utils import _calc_windows >>> import riomucho ... >>> worker.calculate_landsat_pansharpen(src_paths, dst_path, dst_dtype, weight, verbosity, jobs, half_window, customwindow)
cli
潘沙芬
Usage: rio pansharpen [OPTIONS] [SRC_PATHS]... DST_PATH Pansharpens a landsat scene. Input is a panchromatic band (B8), plus 3 color bands (B4, B3, B2) rio pansharpen B8.tif B4.tif B3.tif B2.tif out.tif Or with shell expansion rio pansharpen LC80410332015283LGN00_B{8,4,3,2}.tif out.tif Options: --dst-dtype [uint16|uint8] -w, --weight FLOAT Weight of blue band [default = 0.2] -v, --verbosity -j, --jobs INTEGER Number of processes [default = 1] --half-window Use a half window assuming pan in aligned with rgb bands, default: False -c, --customwindow INTEGER Specify blocksize for custom windows > 150[default=src_blockswindows] --help Show this message and exit. --help Show this message and exit.
不同拨片方法的比较
我们已经实现了用于泛色的加权brovey变换,这适用于像landsat这样的数据,其中全色波段在分辨率上与色带相对相似。
有关其他泛化方法(如ihs、pca、p+xs、小波、vwp、带canny边缘检测器的小波等)的更多信息,请阅读我们的注释here。