# cv::error: (-215:Assertion failed) objectPoints.size() == imagePoints.size() && objectPoints.size() >= 4 in function 'cv::solvePnP'

- **ID:** `opencv/calib3d-solvepnp-empty-points`
- **Domain:** opencv
- **Category:** assertion_error
- **Error Code:** `-215`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The number of 3D object points does not match the number of 2D image points, or there are fewer than 4 point correspondences required for PnP solving.

## Version Compatibility

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

## Workarounds

1. **Ensure both vectors have equal size and contain at least 4 points. Use a checkerboard detection to generate at least 4 corners: cv::findChessboardCorners returns a vector of corners that can be paired with known 3D object points.** (90% success)
   ```
   Ensure both vectors have equal size and contain at least 4 points. Use a checkerboard detection to generate at least 4 corners: cv::findChessboardCorners returns a vector of corners that can be paired with known 3D object points.
   ```
2. **If using ArUco markers, ensure at least 4 markers are detected and their corners are properly paired with 3D model points using cv::aruco::estimatePoseSingleMarkers for each marker.** (85% success)
   ```
   If using ArUco markers, ensure at least 4 markers are detected and their corners are properly paired with 3D model points using cv::aruco::estimatePoseSingleMarkers for each marker.
   ```

## Dead Ends

- **Adding random extra points to objectPoints to match imagePoints size without verifying correspondence** — Incorrect correspondences lead to wildly wrong pose estimates or solver failure; PnP requires accurate point pairs. (95% fail)
- **Using only 3 points because the user thinks 3 is enough for pose estimation** — solvePnP requires at least 4 non-coplanar points for a unique solution; 3 points can only provide up to 4 possible solutions. (100% fail)
