# cv::error: (-215:Assertion failed) distCoeffs.type() == CV_32FC1 || distCoeffs.type() == CV_64FC1 in function 'undistortPoints'

- **ID:** `opencv/undistort-points-empty`
- **Domain:** opencv
- **Category:** type_error
- **Error Code:** `-215`
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

The distortion coefficients matrix passed to cv::undistortPoints must be of type CV_32FC1 or CV_64FC1; other types cause an assertion failure.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.5.0 | active | — | — |
| 4.8.0 | active | — | — |
| 4.10.0 | active | — | — |

## Workarounds

1. **Convert distCoeffs to CV_32FC1: distCoeffs.convertTo(distCoeffs, CV_32F);** (95% success)
   ```
   Convert distCoeffs to CV_32FC1: distCoeffs.convertTo(distCoeffs, CV_32F);
   ```
2. **If no distortion, pass a zero matrix: cv::Mat::zeros(1, 5, CV_64FC1) or cv::Mat::zeros(1, 8, CV_64FC1).** (90% success)
   ```
   If no distortion, pass a zero matrix: cv::Mat::zeros(1, 5, CV_64FC1) or cv::Mat::zeros(1, 8, CV_64FC1).
   ```

## Dead Ends

- **** — The function expects a single-channel matrix for distortion coefficients; multi-channel types are not accepted and trigger the assertion. (90% fail)
- **** — An empty Mat has type CV_8UC1 by default; the assertion fails because it is neither CV_32FC1 nor CV_64FC1. Use cv::Mat() with proper type or a zero matrix. (70% fail)
