Skip to contents

randn replaces the content of an Image object with normally-distributed random pixel values.

Usage

randn(image, mean = 127, sd = 1)

Arguments

image

An Image object.

mean

A vector indicating the mean value (expectation) 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).

sd

A vector indicating the standard deviation 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)
randn(rnd)