DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Image Scaling

This section explains how to utilize the ImageTransformation module to downscale an image's ROI.

Creating an Image

To create an image for where the output should be copied:

dwImageProperties imgProperties{};
imgProperties.width /= 2;
imgProperties.height /= 2;
dwImage_create(&imageSmall, imgProperties, m_context);

Initializing the ImageTransformation Module

The dwImageTransformationHandle_t handle initializes the ImageTransformation module with the following parameters:

For a complete description of all parameters, please refer to dwImageTransformationParameters.

dwImageTransformationHandle_t imageTransformationEngine = DW_NULL_HANDLE;
params.ignoreAspectRatio = false;
dwImageTransformation_initialize(&imageTransformationEngine, params, context);
dwImageTransformation_setInterpolationMode(m_interpolation, imageTransformationEngine);

Performing the Transformation

dwImageTransformation_copyFullImage(imageSmall, imageInput, imageTransformationEngine);

Releasing the Handle

To release the handle:

dwImageTransformation_release(imageTransformationEngine);

To see a full demonstration of this workflow, please refer to Image Transformation Sample.