spectral_integrate_cfa

dnois.sensor.spectral_integrate_cfa(radiance: Tensor, srf: Tensor, unit_size: int | tuple[int, int] = 1, channel_dim: bool = False) Tensor

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

This function supports regular color filter array (CFA), where the vanilla 2D pixel array is divided into contiguous and non-overlapping pixel groups. ‘Regular’ means all the pixel groups are identical. See cfa_collect() and cfa_flatten() for more details.

Parameters:
  • radiance (Tensor) – A tensor of shape \((\cdots,N_\lambda,H,W)\).

  • srf (Tensor) – A tensor of shape \((N_C, N_\lambda)\).

  • unit_size – Height and width of a pixel group, in pixels. Note that their product should be equal to \(N_C\). Default: (1, 1).

  • channel_dim (bool) – If True, last three dimension of returned tensor will be (N_C, H // unit_size[0], W // unit_size[1]); otherwise (H, W). Default: False.

Type:

int or tuple[int, int]

Returns:

Integrated radiance field, of shape (..., N_C, H // unit_size[0], W // unit_size[1]) or (..., H, W).

Return type:

Tensor