Gaussian pyramid generator takes one input image and fills the output image pyramid with downscaled versions of the input.
Input | Output |
---|---|
![]() | ![]() ![]() ![]() ![]() |
The function is implemented by generating the Gaussian pyramid from the base (level 0) to coarser levels.
If the input image actually wraps the first level of the image pyramid, nothing is done for this level. If not, the input image contents will be copied to the first image pyramid level.
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 algorithm repeats until all levels are generated.
For more details, consult the Gaussian Pyramid API reference.
Constraints for specific backends supersede the ones specified for all backends.
For information on how to use the performance table below, see Algorithm Performance Tables.
Before comparing measurements, consult Comparing Algorithm Elapsed Times.
For further information on how performance was benchmarked, see Performance Measurement.