Learn R Programming

satellite (version 0.1.0)

calcHistMatch: Illumination correction across scenes using histogram matching

Description

This function adjusts the illumination of individual bands across two scenes using a histogram match.

Usage

## S3 method for class 'Satellite':
calcHistMatch(x, target, bcde = NULL, minv = 0L,
  maxv = 1023L, use_cpp = TRUE)

## S3 method for class 'RasterStack': calcHistMatch(x, target, minv = 0L, maxv = 1023L, use_cpp = TRUE)

## S3 method for class 'RasterLayer': calcHistMatch(x, target, minv = 0L, maxv = 1023L, use_cpp = TRUE)

Arguments

x
Satellite or raster::Raster* object providing the source band(s) to be adjusted.
target
The target band as raster::RasterLayer.
bcde
Band code which should be alligned
minv
Lower limit of the possible range for transformation (if not provided, defaults to the minimum of both layers).
maxv
Upper limit of the possible range for transformation (if not provided, defaults to the maximum of both layers).
use_cpp
Logical. If TRUE, C++ functionality (via Rcpp) is enabled, which leads to a considerable reduction of both computation time and memory usage.

Value

  • Satellite object with added atmospheric corrected layers

    raster::RasterStack object with atmospheric corrected layers

    raster::RasterLayer object with atmospheric corrected layer

Details

The function is based on a histogram matching technique described by Morovic et al. (2002).

References

Morovic J, Shaw J, Sun P-L (2002) A fast, non-iterative and exact histogram matching algorithm. Pattern Recognition Letters 23/1-3: 127-135, doi:10.1016/S0167-8655(01)00107-6.

Examples

Run this code
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
target <- getSatDataLayer(sat, "B003n")

## histogram matching
calcHistMatch(sat, target, bcde = "B002n")

Run the code above in your browser using DataLab