Learn R Programming

imager (version 0.14)

haar: Compute Haar multiscale wavelet transform.

Description

Compute Haar multiscale wavelet transform.

Usage

haar(im, inverse = FALSE, nb_scales = 1L)

Arguments

im
an image
inverse
Compute inverse transform (default FALSE)
nb_scales
Number of scales used for the transform.

Examples

Run this code
#Image compression: set small Haar coefficients to 0
hr <- haar(boats,nb=3)
mask.low <- threshold(abs(hr),"75%")
mask.high <- threshold(abs(hr),"95%")
haar(hr*mask.low,inverse=TRUE,nb=3) %>% plot(main="75% compression")
haar(hr*mask.high,inverse=TRUE,nb=3) %>% plot(main="95% compression")

Run the code above in your browser using DataLab