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:
img_size (tuple) – size of the input images, e.g. (H, W) or (C, H, W).
pattern (str) –
bayer
(see https://en.wikipedia.org/wiki/Bayer_filter) or other patterns.device (torch.device) –
gpu
orcpu
- 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