Gaussian pyramid generator takes one input image and fills the output image pyramid with downscaled versions of the input.
| Input | Gaussian kernel | Output |
|---|---|---|
| 7x7 support, \[ \sigma=1.7 \] | ![]() |
The function is implemented by generating the Gaussian pyramid from the base (level 0) to coarser levels.
For the first level, if the underlying image is different from input, it is an exact copy of the latter.
The coarser levels are generated by taking the previous level, convolving it using a clamp boundary condition with the following kernel:
\[ k = \begin{bmatrix} 1 \\ 4 \\ 6 \\ 4 \\ 1 \end{bmatrix} \cdot \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \end{bmatrix} \]
Because only 2x downscaling is supported, the result is then downsampled by keeping all pixels with even coordinates.
The algorithms repeats until all levels are generated.
Constraints for specific backends superceed the ones specified for all backends.