Function Usage

Functions

The following tables Table 1 and Table 2 describe the functions of the vision preprocessing core (VPC) and the function support of each version.

APIs described in this section are asynchronous APIs. The API call delivers a task rather than executes a task. After this API is called, call the synchronization API (for example, acl.rt.synchronize_stream) to ensure that the task is complete.

Table 1 Introduction

Functionality

Description

Cropping

Crops one or more selected regions of interest (ROIs) from one or more images.

Resizing

8K resizing and non-8K resizing are supported for images based on resolutions.

Resizes an ROI (supporting uncompressed format) or multiple ROIs from a single image (supporting uncompressed format).

Supports other resizing modes, such as resizing an image without cropping it and resizing an image with the aspect ratio preserved.

Pasting

Crops an image out of an input image, resizes the cropped image, and places it in a specified area of the output image.

The output image may be a blank image (when the output buffer allocated by the user is empty) or an existing image (when an image has been read into the output buffer allocated by the user). Note that the pasting concept here refers only to the case when the output image is an existing image.

Stitching

Crops selected ROIs from the input image, resizes the cropped images, and loads them to specified areas in the output buffer.

Image pyramid

Successively downsamples an image using a Gaussian filter.

Histogram analysis

Collects statistics on the pixel value distribution of each image channel (RGB/YUV).

Remapping

Remaps an image to a new one based on the given configuration.

Border making

Creates a border around an image (also referred to as padding).

Format conversion

Converts between RGB and YUV.

Image grayscale

Converts a color image into a grayscale image. Note that grayscale input images produce only grayscale output images.

Table 2 Supported product functions

Function

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

Cropping

Resizing

Pasting

Stitching

Image pyramid

x

x

x

x

Histogram analysis

x

Remapping

x

Border making

x

Format conversion

Image grayscale

Only the data of the Y component is extracted from the YUV420SP output image.

The operation of implementing image grayscale is to output an image in YUV400 format.

The operation of implementing image grayscale is to output an image in YUV400 format.

The operation of implementing image grayscale is to output an image in YUV400 format.

The operation of implementing image grayscale is to output an image in YUV400 format.

Reference

The following figure shows the component layout of the RGB and YUV formats. Two YUV420SP images are used as examples for the semi-planar format and an ARGB image is used as an example for the Packed and RGB formats.