Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


RStoolbox (version 0.1.1)

pifMatch: Pseudo-Invariant Features based Image Matching

Description

Match one scene to another based on linear regression of pseudo-invariant features (PIF).

Usage

pifMatch(img, ref, method = "cor", quantile = 0.95, returnPifMap = FALSE,
  returnSimMap = TRUE, returnModels = FALSE)

Arguments

img
RasterStack or RasterBrick. Image to be adjusted.
ref
RasterStack or RasterBruck. Reference image.
method
Method to calculate pixel similariry. Options: euclidean distance ('ed'), spectral angle
quantile
Numeric. Threshold quantile used to identify PIFs
returnPifMap
Logical. Return a binary raster map ot pixels which were identified as pesudo-invariant features.
returnSimMap
Logical. Return the similarity map as well
returnModels
Logical. Return the linear models along with the adjusted image.

Value

  • Returns a RasterStack with the adjusted image (img) by default.

    If further return arguments are specified the following intermediate products will be returned in a list along with the adujsted image:

    • returnModels = TRUE: returns the linear models; one for each layer.
    • returnPifMap = TRUE: returns binary map of pixels which were selected as pseudo-invariant features.
    • returnSimMap = TRUE: returns the pixel-wise similarity.

Details

The function consists of three main steps: First, it calculates pixel-wise similarity between the two rasters and identifies pseudo-invariant pixels based on a similarity threshold. In the second step the values of the pseudo-invariant pixels are regressed against each other in a linear model for each layer. Finally the linear models are applied to all pixels in the img, thereby matching it to the reference scene.

Pixel-wise similarity can be calculated using one of three methods: euclidean distance (method = "ed"), spectral angle ("sam") or pearsons correlation coefficient ("cor"). The threshold is defined as a similarity quantile. Setting quantile=0.95 will select all pixels with a similarity above the 95% quantile as pseudo-invariant features.

Model fitting is performed with simple linear models (lm); fitting one model per layer.

Examples

Run this code
library(gridExtra)
## Import Landsat example data
data(lsat)

## Create fake example data
## In practice this would be an image from another acquisition date
lsat_b <- log(lsat)
## Run pifMatch
lsat_b_adjusted <- pifMatch(lsat_b, lsat)

## Run pifMatch and return similarity layer and pifMap
lsat_b_adjusted <- pifMatch(lsat_b, lsat, returnPifMap = TRUE, returnSimMap = TRUE)
grid.arrange(
ggR(lsat_b_adjusted$simMap, geom_raster = TRUE) ,
ggR(lsat_b_adjusted$pifMap),
ncol=2)

Run the code above in your browser using DataLab