Converts the Tensor class on the host to the Image class on the host, or converts the Tensor class on the device to the Image class on the DVPP.
During the conversion, the width of Image is 16-pixel aligned upwards, and the height of Image is 2-pixel aligned upwards. The converted Image class object has a padding region.
The converted Image class can call the member function GetSize() to return the Size class object to view the width and height after padding, and call the member function GetOriginalSize() to return the Size class object to view the original width and height of the image.
Example:
1 | static APP_ERROR Image::TensorToImage(const Tensor& inputTensor, Image& Image, const ImageFormat& imageFormat); |
Parameter |
Input/Output |
Description |
|---|---|---|
inputTensor |
Input |
Tensor class, input tensor. The input must meet the following requirements:
|
Image |
Output |
Image class, outputs. The memory is allocated on the DVPP side. |
imageFormat |
Input |
ImageFormat class that specifies the image format, which must match the image format corresponding to the inputTensor data. |
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |