# cv::error: (-215:断言失败) (map1.type() == CV_32FC2 || map1.type() == CV_16SC2) 在函数 'remap' 中

- **ID:** `opencv/remap-invalid-map-type`
- **领域:** opencv
- **类别:** type_error
- **错误码:** `-215`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

传递给 cv::remap 的映射数组数据类型不受支持；第一个映射仅接受 CV_32FC2 或 CV_16SC2。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 4.5.0 | active | — | — |
| 4.8.1 | active | — | — |
| 4.10.0 | active | — | — |

## 解决方案

1. ```
   确保 map1 使用 CV_32FC2 类型创建：cv::Mat map1(rows, cols, CV_32FC2); 然后填充浮点坐标。
   ```
2. ```
   如果使用 initUndistortRectifyMap，通过检查传递给函数的 m1type 参数，验证输出映射类型为 CV_32FC2 或 CV_16SC2。
   ```

## 无效尝试

- **** — remap requires exactly CV_32FC2 (two-channel float) or CV_16SC2 (two-channel signed short) for the first map; other types cause assertion failure regardless of conversion. (75% 失败率)
- **** — The function expects map1 to contain (x,y) coordinates; swapping reverses the mapping logic and may produce distorted output or a different assertion error. (90% 失败率)
