Sensor

dnois.sensor implements image sensor models with frequently used functions, such as Bayer CFA, noise simulation, Gamma correction, quantization, saturation, etc.

Sensor model

cfa_collect(image[, unit_size])

Rearrange all the pixels in an image with shape \((\cdots,H,W)\) into channels-wise form \((\cdots,C,H/h,W/w)\), where \(C=hw\) is the number of channels and \(h\) and \(w\) are the size of a unit of a regular color filter array (CFA).

cfa_flatten(image[, unit_size])

Flatten the pixels in a channel-wise image with shape \((\cdots,C,H,W)\) into CFA units with size \((h,w)\) to form an image with shape \((\cdots,H\times h,W\times w)\), where \(C=hw\).

quantize(signal[, levels, differentiable])

Quantize continuous-valued signal, emulating an analogous-to-digital conversion.

rgb2raw(image, pattern)

Convert an RGB image into a single-channel image using Bayer CFA pattern.

spectral_integrate_cfa(radiance, srf[, ...])

Integrate given radiance field across wavelengths with given spectral response function (SRF).

Sensor(pixel_num, pixel_size)

A basic sensor model.

StandardSensor(pixel_num, pixel_size[, rgb, ...])

A simple RGB or grayscale sensor model, which processes the radiance field reaching the sensor plane as follows:

Noise

gaussian(signal, sigma[, noise_only, dims])

Applying gaussian noise to signal:

poisson(signal, a[, noise_only])

Applying poissonian noise to signal: