Loading [MathJax]/jax/output/HTML-CSS/config.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.20.37 Release
    For Test and Development only

    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    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);
    DW_API_PUBLIC dwStatus dwSensorCamera_getImageProperties(dwImageProperties *const imageProperties, dwCameraOutputType const outputType, dwSensorHandle_t const sensor)
    Gets information about the image properties for a given 'dwCameraImageOutputType'.
    @ DW_CAMERA_OUTPUT_NATIVE_PROCESSED
    processed images (usually be YUV420 planar or RGB planar)
    Definition: Camera.h:80
    #define DW_NULL_HANDLE
    Definition: Types.h:80
    struct dwImageObject * dwImageHandle_t
    Definition: Image.h:105
    DW_API_PUBLIC dwStatus dwImage_create(dwImageHandle_t *const image, dwImageProperties properties, dwContextHandle_t const ctx)
    Creates and allocates resources for a dwImageHandle_t based on the properties passed as input.
    Defines the properties of the image.
    Definition: Image.h:495

    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);
    uint8_t ignoreAspectRatio
    Boolean indicating whether the aspect ratio of the input image should be kept (0) or the image should...
    DW_API_PUBLIC dwStatus dwImageTransformation_initialize(dwImageTransformationHandle_t *handle, dwImageTransformationParameters params, dwContextHandle_t context)
    Initializes an Image Transformation Engine with the given parameters.
    struct dwImageTransformationObject * dwImageTransformationHandle_t
    The image transformation handle.

    Performing the Transformation

    dwImageTransformation_copyFullImage(imageSmall, imageInput, imageTransformationEngine);

    Releasing the Handle

    To release the handle:

    dwImageTransformation_release(imageTransformationEngine);
    DW_API_PUBLIC dwStatus dwImageTransformation_release(dwImageTransformationHandle_t handle)
    Releases the passed Transformation Engine, deallocating all the resources used.

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

    人人超碰97caoporen国产