Skip to contents

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.

See also

Author

Simon Garnier, garnier@njit.edu

Examples

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