跳转到主要内容

rio-pansharpen

项目描述

https://img.shields.io/pypi/v/rio-pansharpen.svg https://circleci.com/gh/mapbox/rio-pansharpen.svg?style=shield&circle

对Landsat 8场景进行多尺度融合。

什么是多尺度融合?

多尺度融合是一种使用高分辨率灰度带(全色,或pan波段)中的空间信息和多光谱带中的颜色信息来创建单个高分辨率彩色图像的过程。

P pan-pixel cluster + M single multispectral pixel = M pan-sharpened pixel

更多示例和信息请参阅Mapbox多尺度融合博客文章

安装

我们强烈建议在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

pansharpen.worker

worker模块对Landsat 8进行多尺度融合。有关Landsat 8波段设计的更多信息,请访问USGS Landsat页面

1. worker.pansharpen

worker.pansharpen函数接受以下作为输入

  • 形状为 == (3, vis_height, vis_width) 的numpy 3D数组

  • 定义vis数组地理参考的仿射变换

  • 形状为 == (pan_height, pan_width) 的numpy 2D数组

  • 定义pan数组地理参考的仿射变换

  • 多尺度融合方法

并输出

  • 形状为 == (3, pan_height, pan_width) 的numpy 3D数组

>>> 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)

命令行界面

pansharpen

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.

不同多尺度融合方法的比较

我们实现了适用于像Landsat这样的数据的加权Brovey变换,其中全色波段与颜色波段具有相对相似的分辨率。

有关其他多尺度融合方法(如IHS、PCA、P+XS、小波、VWP、带有Canny边缘检测器的小波等)的更多信息,请阅读我们的笔记这里

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分布

rio-pansharpen-0.2.0.tar.gz (6.6 kB 查看哈希值)

上传时间 源代码

由以下提供支持