pool_band: This function is to be used in conjunction with...

Description Usage Arguments Value Examples

View source: R/compression_perrrfect.R

Description

The function applies a lossy pooling algorithm to compress the specified colour band and the resulting cimg object is returned.

Usage

1
pool_band(img, kernel_size, pooling_func)

Arguments

img

A 'matrix' 'array' type object of 2 dimensions representing a color band of either a greyscale image or a colour image.

kernel_size

The size of the length and width of the kernel to be passed over the image. Default: 2

pooling_func

The pooling algorithm to be used. Three options: "max", "min", and "mean". Default: "max"

Value

A cimg type image of 4 dimensions representing a greyscale or colour image.

Examples

1
2
img <- imager::as.cimg(imager::boats)
pool_band(img[,,,1], kernel_size=2, pooling_func="max")

UBC-MDS/pictureperrrfect documentation built on March 28, 2021, 1:28 p.m.