rgb2raw¶
- dnois.sensor.rgb2raw(image: Tensor, pattern: Literal['RGGB', 'GRBG', 'BGGR', 'GBRG']) Tensor ¶
Convert an RGB image into a single-channel image using Bayer CFA pattern.
- Parameters:
image (Tensor) – The RGB image, a tensor of shape
(..., 3, H, W)
.pattern (BayerPattern) – Bayer CFA pattern, either
'RGGB'
,'GRBG'
,'BGGR'
or'GBRG'
, specifying how are pixels arranged in the order of upper left, upper right, lower left, lower right.
- Returns:
A single-channel image with shape
(..., 1, H, W)
.- Return type:
Tensor