Overview
The Rescale algorithm is used to scale the input image by means of resampling its content to make it conform to the output image dimensions.
No pre-filtering is applied, it's expected that the input content doesn't have frequencies higher than the Nyquist limit to avoid aliasing artifacts when downsampling.
Several interpolation methods are available, allowing trade-offs between quality and performance.
Input Factor Output
\begin{align*} f_x &= 2/3 \\[5pt] f_y &= 3/2 \end{align*}
Implementation
For every output pixel, calculate the corresponding input pixel using the formula:
\[ \mathit{out}[x,y] = P(f_x x, f_y y) \]
where P depends on the interpolation method used.
Sampling operation considers that whole coordinates fall on pixel center.
Usage
Initialization phase
Include the header that defines the rescale function.
Define the input image object.
Create an output image with the new required size and same format as input.
Create the stream where the algorithm will be submitted for execution.
Processing phase
Submit the algorithm to the stream along with all parameters. It'll be executed by the CUDA algorithm.
Optionally, wait until the processing is done.
Cleanup phase
Free resources held by the stream and the input and output images.
Consult the Rescale for a complete example.
For more details, consult the Rescale API reference .
Limitations and Constraints
Constraints for specific backends supersede the ones specified for all backends.
All Backends
Input and output images must have the same dimensions and type.
The following interpolation methods are supported:
The following image formats are accepted:
The following boundary conditions are accepted.
CPU
CUDA
Only accepts the following image formats:
VIC
Only available on Jetson devices.
Only accepts the following image formats:
Only accepts the following interpolators:
PVA
Performance
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 .
clear filters
Device:
Jetson AGX Xavier
Jetson TX2
Jetson Nano
-
Streams:
1
4
8
References
Daniel Ruijters, Bart M. ter Romeny, Paul Suetens (2008) "Efficient GPU-Based Texture Interpolation using Uniform B-Spline"
Journal of Graphics Tools, 13:4 61-69.