Skip to main content

A library for remote sensing image pansharpening and enhancement

The goal is to assemble all the known good methods within one useful python library

The data processing is based on rasterio bindings to GDAL binaries. Big files are supported via windowed IO.

Use of library:

Worker class is initialized with a list of methods that are applied to the pair of images (pan, ms) consequently. Some of the methods may need the setup stage where they gather the image statistics before processing, use worker.setup_methods() before worker.process() to do it. The setup is also carried out with windowed reading.

worker.process_single and worker.process_separate() applies to the set of files and includes methods' setup and application.

Pansharpening methods:

By the moment, only the very basic methods are supported:

  1. IHS
  2. Brovey
  3. Generalized IHS for any number of channels

Preprocessing methods:

  1. Linear brightness scaling allowes to stretch the brightness to the whole range of the data format or fit to 8bit. The initial values range can be defined in the following variants:

    • min - max,
    • mean +- WIDTH*std

Adding your own method:

You can inherit ImgProc class, implementing process() function to add any preprocessing, pansharpening or postprocessing function you need.

Command line interface:

CLI contains a subset of the methods that can be used off the shelf, but for full functionality it is better to use the library

pysharpen [--method METHOD] [--preprocessing PREPROCESSING] [--resampling RESAMPLING] [--nogeo] [--noclean] pan_file ms_file out_file

Options:

  • method : the main pansharpening method, allowed options are ihs, brovey, gihs, default ihs
  • preprocessing: the optional step of image preparation before pansharpening allowed options are minmax and meanstd (the latter with parameter WIDTH=3), default none
  • resampling: a method for multispectral image resampling to the resolution of panchrom image. Allowed options are bilinear, nearest, cubic etc., default bilinear
  • nogeo: if checked, the images are opened and resampled without regard to the georeference. It is necessary when the data is not georeferenced at all, or can be used if the image is small and windowed IO is not necessary
  • noclean: if checked, the intermediate files are not removed. This can be useful if you need the separated channel-by-channel to separate files multispectral data

Known issues

The windowed georeferenced IO gives not the same result as whole image IO without georeference, this is caused by the subpixel misplacement and will be addressed in the next updates.

Contributing

You can describe any problem with the package via issues at github. Your contributions are always welcome, especially new widely-used pansharpening methods.

Release files for pysharpen 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pysharpen 0.2.8
File Interpreter ABI Platform
pysharpen-0.2.8-py3-none-any.whl Python 3 none any Details

Release files / pysharpen-0.2.8-py3-none-any.whl

Download URL pysharpen-0.2.8-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
934e10907e853cb59a2dfaa860ed2b5473a289ce9593271474f8e219bf3106bd
BLAKE2b-256 checksum
How to use checksums
a896810a418a442180728b5ab31b24b6fd296fac99ec1289b358967fcb8da062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.2.8 This release

1 release file

0.2.7

2 release files

0.2.6

2 release files

0.2.5

3 release files

0.2.4

2 release files

0.2.3

3 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page