acl.himpi.vpc_get_affine_lut

C Prototype

hi_s32 hi_mpi_vpc_get_affine_lut(hi_point_pair_info *point_pair_info, hi_u32 interpolation, hi_remap_lut *remap_lut)

Python Function

remap_lut, ret = acl.himpi.vpc_get_affine_lut(point_pair_info, interpolation, remap_lut)

Function Usage

Obtains a pixel position remapping LUT of affine transformation according to the pixel position coordinates in the input and output images.

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Input Description

point_pair_info: dict, dictionary that contains three pairs of pixel coordinates in the input and output images. Each pair contains pixel coordinates of an input image and an output image, respectively. For details, see hi_point_pair_info.

interpolation: int, resizing algorithm. The following resizing algorithms are supported:
  • 0: conventional bilinear algorithm, whose compute process is close to that of OpenCV.
  • 1: conventional nearest neighbor algorithm, whose compute process is close to that of OpenCV.

remap_lut: dict, dictionary of information about the pixel position remapping LUT of affine transformation. For details, see hi_remap_lut. You need to allocate buffer for the lut attribute in advance. The lut_size attribute of the buffer size can be obtained by calling acl.himpi.vpc_get_lut_mem_size.

Return Value

remap_lut: dict, dictionary of information about the pixel position remapping LUT of affine transformation. After this API is successfully called, you can obtain the LUT information of affine transformation by using the address in the lut attribute.

ret: int, error code.