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.
Constraints for specific backends supersede the ones specified for all backends.
For further information on how performance was benchmarked, see Performance Measurement.
size | type | scale | levels | CPU | CUDA | PVA |
---|---|---|---|---|---|---|
1920x1080 | u8 | 0.5 | 4 | 0.65 ms | 0.098 ms | n/a |
1920x1080 | u16 | 0.5 | 4 | 0.74 ms | 0.1130 ms | 1.0756 ms |
size | type | scale | levels | CPU | CUDA | PVA |
---|---|---|---|---|---|---|
1920x1080 | u8 | 0.5 | 4 | 1.8 ms | 0.256 ms | n/a |
1920x1080 | u16 | 0.5 | 4 | 2.3 ms | 0.255 ms | n/a |
size | type | scale | levels | CPU | CUDA | PVA |
---|---|---|---|---|---|---|
1920x1080 | u8 | 0.5 | 4 | 3.441 ms | 0.3375 ms | n/a |
1920x1080 | u16 | 0.5 | 4 | 3.710 ms | 0.463 ms | n/a |