Learn R Programming

IFC (version 0.1.1)

objectResize: Object Resizing

Description

Resizes mat to new dimensions.

Usage

objectResize(
  mat,
  size = c(0, 0),
  add_noise = TRUE,
  random_seed = NULL,
  bg = 0,
  sd = 0
)

Arguments

mat

a numeric matrix.

size

a length 2 integer vector of final dimensions of the image, height 1st and width 2nd. Default is c(0,0) for no change.

add_noise

if TRUE adds normal noise when size is larger than mat dimensions using rnorm(), from Rcpp. Default is TRUE.

random_seed

a single value, interpreted as an integer, or NULL to be used with set.seed() from base when 'add_noise' is set to TRUE. Default is NULL.

bg

mean value of the background added if add_noise is TRUE. Default is 0.

sd

standard deviation of the background added if add_noise is TRUE. Default is 0.

Value

a resized matrix with padding background if desired size is larger than original mat dimensions.