Demosaicing#

class deepinv.physics.Demosaicing(img_size, pattern='bayer', device='cpu', **kwargs)[source]#

Bases: Inpainting

Demosaicing operator.

The operator chooses one color per pixel according to the pattern specified.

Parameters:


Examples:

Demosaicing operator using Bayer pattern for a 4x4 image:

>>> from deepinv.physics import Demosaicing
>>> x = torch.ones(1, 3, 4, 4)
>>> physics = Demosaicing(img_size=(4, 4))
>>> physics(x)[0, 1, :, :] # Green channel
tensor([[0., 1., 0., 1.],
        [1., 0., 1., 0.],
        [0., 1., 0., 1.],
        [1., 0., 1., 0.]])

Examples using Demosaicing:#

A tour of forward sensing operators

A tour of forward sensing operators