---
title: Transform
description: "计算仿射变换矩阵。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0346.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0346.html
indexId: e0f76197a249441bde7fef9062ab64ef83ceada06134f3abd864fa967c4d79f6102
---
# Transform

#### 函数功能

计算仿射变换矩阵。


#### 函数原型

```
cv::Mat Transform(const std::vector<cv::Point2f> &srcPoint, const std::vector<cv::Point2f> &dstPoint) const;
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| srcPoint | 输入 | 转换前数组。向量中point个数不超过10000，坐标范围为[0，8192]。 |
| dstPoint | 输入 | 转换后数组。 长度需要与srcPoint一致。向量中point个数不超过10000，坐标范围为[0，8192]。 |


#### 返回参数说明

| 数据结构 | 说明 |
| --- | --- |
| cv::Mat | 返回仿射变换矩阵。 |
