# vpc_get_perspective_lut

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

根据输入、输出图片中的像素位置坐标点，获取透视变换像素位置重映射表。


#### 函数原型

- C函数原型
  1 hi_s32hi_mpi_vpc_get_perspective_lut(hi_point_pair_info *point_pair_info, hi_u32  interpolation, hi_remap_lut *remap_lut)

- python函数
  1 remap_lut, ret = acl.himpi.vpc_get_perspective_lut(point_pair_info, interpolation, remap_lut)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| point\_pair\_info | dict，包含四对输入、输出图片中的像素点坐标信息字典，每对中分别包含一个输入图片像素点坐标、一个输出图片像素点坐标，具体请参见hi\_point\_pair\_info。 |
| interpolation | int，支持如下缩放算法。 0：业界通用的Bilinear算法（与OpenCV算法的计算过程类似）。 1：业界通用的Nearest neighbor 算法（与OpenCV算法的计算过程类似）。 |
| remap\_lut | dict，透视变换像素位置重映射表字典，具体请参见hi\_remap\_lut。字典中的lut属性需由用户提前申请内存，内存大小“lut\_size”属性可调用acl.himpi.vpc\_get\_lut\_mem\_size接口获取。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| remap\_lut | dict，透视变换像素位置重映射表字典。在成功调用本接口后，用户可通过lut属性中的地址获取仿射变换LUT表信息。 |
| ret | int，错误码。 返回0表示成功。 返回非0表示失败，参见VPC图像处理返回码。 |
