Resizing and Scaling
Ocean provides several functions to resize or scale images. Each function comes with a difference execution performance and image quality.
The simplest solution to resize/down-sample an image is by usage of CV::FrameInterpolator::resize()
. This function allows to specified the desired resize algorithm via a function parameter.
Currently, the function supports the following algorithms. Floating point data types are not supported:
RM_NEAREST_PIXEL
, an interpolation applying a nearest pixel (nearest neighbor) lookup.RM_BILINEAR
, an interpolation applying a bi-linear interpolation.RM_NEAREST_PYRAMID_LAYER_11_BILINEAR
, a two-step interpolation, first applying a pyramid down-sampling with a 11 filtering, followed by bilinear interpolation from pyramid layer to target image.RM_NEAREST_PYRAMID_LAYER_14641_BILINEAR
, a two-step interpolation, first applying a pyramid down-sampling with a 14641 filtering, followed by bi-linear interpolation from pyramid layer to target image. A simple nearest neighbor lookup is commonly significantly faster than a two-step approach using a pyramid and subsequent (bi-linear) interpolation. However, pyramid-based down-sampling approaches create significantly better image qualities. Below, you can find a comparison of the individual resize methods.