histmatch: Histogram matching of an image

View source: R/histmatch.R

histmatchR Documentation

Histogram matching of an image

Description

Force image x to match target image by matching their histograms.

Usage

histmatch(master, tofix, mask, minval = 0, maxval = 255, by = 1)

Arguments

master

The target image, in SpatialGridDataFrame, data frame, matrix or vector format.

tofix

The image to be normalized, in any format.

mask

Areas to be omitted, if any, such as a cloud mask. Only NA values within the mask will be used.

minval

Lower bound of the possible range of values in target and tofix images.

maxval

Upper bound of the possible range of values in target and tofix images.

by

Step size to use in constructing histograms. Should be appropriate for minval and maxval of the images.

Details

The histogram of the tofix image will be forced to match that of the target image.

Value

recode

The transformation table used to match the histograms.

newimage

The transformed image, in the same format in which tofix was provided.

Author(s)

Sarah Goslee

See Also

relnorm

Examples

## Not run: 
	data(nov3)
	data(july3)
	par(mfrow=c(2,2))
	image(nov3)
	image(july3)

	nov3.newR <- relnorm(master=july3, tofix=nov3)
	image(nov3.newR$newimage)

	nov3.newH <- histmatch(master=july3, tofix=nov3)
	image(nov3.newH$newimage)

## End(Not run)

landsat documentation built on Aug. 25, 2023, 1:07 a.m.