Shortcuts

mmagic.datasets.transforms.gcp_unprocess

Module Contents

Functions

random_ccm()

Generates random RGB -> Camera color correction matrices.

random_gains([rgb_gain_ratio, red_gain_range, ...])

Generates random gains for brightening and white balance.

inverse_smoothstep(image)

Approximately inverts a global tone mapping curve.

gamma_expansion(image)

Converts from gamma to linear space.

apply_ccm(image, ccm)

Applies a color correction matrix.

safe_invert_gains(image, rgb_gain, red_gain, blue_gain)

Inverts gains while safely handling saturated pixels.

mosaic(image)

Extracts RGGB Bayer planes from an RGB image.

random_noise_levels_kpn()

add_noise(image[, shot_noise, read_noise, ...])

Adds random shot (proportional to image) and read (independent)

unprocess(image)

Unprocesses an image from sRGB to realistic raw data.

unprocess_gt(image)

Unprocesses an image from sRGB to realistic raw data.

unprocess_meta_gt(image, rgb_gains, red_gains, ...)

Unprocesses an image from sRGB to realistic raw data.

random_noise_levels()

Generates random noise levels from a log-log linear distribution.

add_noise_test(image[, shot_noise, read_noise, count])

Adds random shot (proportional to image) and read (independent)

mmagic.datasets.transforms.gcp_unprocess.random_ccm()[source]

Generates random RGB -> Camera color correction matrices.

mmagic.datasets.transforms.gcp_unprocess.random_gains(rgb_gain_ratio=1.0, red_gain_range=[1.9, 2.4], blue_gain_range=[1.5, 1.9])[source]

Generates random gains for brightening and white balance.

mmagic.datasets.transforms.gcp_unprocess.inverse_smoothstep(image)[source]

Approximately inverts a global tone mapping curve.

mmagic.datasets.transforms.gcp_unprocess.gamma_expansion(image)[source]

Converts from gamma to linear space.

mmagic.datasets.transforms.gcp_unprocess.apply_ccm(image, ccm)[source]

Applies a color correction matrix.

mmagic.datasets.transforms.gcp_unprocess.safe_invert_gains(image, rgb_gain, red_gain, blue_gain)[source]

Inverts gains while safely handling saturated pixels.

mmagic.datasets.transforms.gcp_unprocess.mosaic(image)[source]

Extracts RGGB Bayer planes from an RGB image.

mmagic.datasets.transforms.gcp_unprocess.random_noise_levels_kpn()[source]
mmagic.datasets.transforms.gcp_unprocess.add_noise(image, shot_noise=0.01, read_noise=0.0005, read_noise_exponent=2)[source]

Adds random shot (proportional to image) and read (independent) noise.

mmagic.datasets.transforms.gcp_unprocess.unprocess(image)[source]

Unprocesses an image from sRGB to realistic raw data.

mmagic.datasets.transforms.gcp_unprocess.unprocess_gt(image)[source]

Unprocesses an image from sRGB to realistic raw data.

mmagic.datasets.transforms.gcp_unprocess.unprocess_meta_gt(image, rgb_gains, red_gains, blue_gains, rgb2cam, cam2rgb)[source]

Unprocesses an image from sRGB to realistic raw data.

mmagic.datasets.transforms.gcp_unprocess.random_noise_levels()[source]

Generates random noise levels from a log-log linear distribution.

mmagic.datasets.transforms.gcp_unprocess.add_noise_test(image, shot_noise=0.01, read_noise=0.0005, count=0)[source]

Adds random shot (proportional to image) and read (independent) noise.