randu: Random Uniform Image

View source: R/ImageClass.R

randuR Documentation

Random Uniform Image

Description

randu replaces the content of an Image object with uniformly-distributed random pixel values.

Usage

randu(image, low = 0, high = 256)

Arguments

image

An Image object.

low

A vector indicating the inclusive lower boundary of the generated random numbers. It can have as many elements as the number of channels in the image. If it has less elements than the number of channels, it is recycled to match the number of channels. If it has more elements than the number of channels, the extra elements are ignored without warning (default: 0).

high

A vector indicating the exclusive upper boundary of the generated random numbers. It can have as many elements as the number of channels in the image. If it has less elements than the number of channels, it is recycled to match the number of channels. If it has more elements than the number of channels, the extra elements are ignored without warning (default: 256).

Value

This function returns nothing and modifies image in place.

Author(s)

Simon Garnier, garnier@njit.edu

See Also

Image, randn

Examples

rnd <- zeros(100, 100)
randu(rnd)


swarm-lab/Rvision documentation built on Feb. 7, 2024, 4:59 a.m.