usm: Unsharp Mask Filter

View source: R/usm.R

usmR Documentation

Unsharp Mask Filter

Description

Sharpen image with unsharp mask algorithm

Usage

usm(x, radius = 50, amount = 0.2, inputRange)

Arguments

x

An Image object or array of Image objects

radius

Integer value to determine Gaussian blur effect, default value of 50

amount

A numeric fraction between 0 and ~2 specifying the amount of blur to apply, default value of 0.2

inputRange

value A optional numeric vector of 2 values handed to normalize to normalize the final image. If missing, the range of the input object will be used

Details

The unsharp mask algorithm is applied. The value for amount controls the magnitude of the contrast added at the edges. The value for radius determines the size of the edges to be enhanced where a smaller radius enhances details on a smaller scale.

Value

A sharpened Image object of the same size as the input

Examples

x <- readImage(system.file("images", "sample-color.png", package="EBImage"))
x <- x[156:265, 166:300,]
y <- usm(x, radius = 15, amount = 0.8)
plotStack(combine(x, y), label = c("Original", "Unsharp mask"), cex = 2)


ornelles/EBImageExtra documentation built on Aug. 10, 2022, 11:44 p.m.