1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page imagetransformation_usecase1 Image Scaling
6 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
8 This section explains how to utilize the ImageTransformation module to downscale an image's ROI.
10 @section imagetransformation_usecase1_creating Creating an Image
12 To create an image for where the output should be copied:
15 dwImageProperties imgProperties{};
16 dwSensorCamera_getImageProperties(&imgProperties, DW_CAMERA_OUTPUT_NATIVE_PROCESSED, camera);
18 imgProperties.width /= 2;
19 imgProperties.height /= 2;
21 dwImageHandle_t imageSmall = DW_NULL_HANDLE;
22 dwImage_create(&imageSmall, imgProperties, m_context);
25 @section imagetransformation_usecase1_initializing Initializing the ImageTransformation Module
27 The ::dwImageTransformationHandle_t handle initializes the ImageTransformation module with the following parameters:
29 For a complete description of all parameters, please refer to ::dwImageTransformationParameters.
32 dwImageTransformationHandle_t imageTransformationEngine = DW_NULL_HANDLE;
33 dwImageTransformationParameters params{};
34 params.ignoreAspectRatio = false;
35 dwImageTransformation_initialize(&imageTransformationEngine, params, context);
37 dwImageTransformation_setBorderMode(DW_IMAGEPROCESSING_BORDER_MODE_ZERO, imageTransformationEngine);
38 dwImageTransformation_setInterpolationMode(m_interpolation, imageTransformationEngine);
41 @section imagetransformation_usecase1_transforming Performing the Transformation
44 dwImageTransformation_copyFullImage(imageSmall, imageInput, imageTransformationEngine);
47 @section imagetransformation_usecase1_releasing_handle Releasing the Handle
49 To release the handle:
52 dwImageTransformation_release(imageTransformationEngine);
55 To see a full demonstration of this workflow, please refer to @ref dwx_imagetransformation.