# cv::error: (-28:有效点数量不足) 在函数 'cv::findHomography' 中

- **ID:** `opencv/feature-matching-insufficient-matches`
- **领域:** opencv
- **类别:** computation_error
- **错误码:** `-28`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

两幅图像之间匹配的特征点数量低于单应性矩阵估计所需的最小值。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 4.8.0 | active | — | — |
| 4.9.0 | active | — | — |
| 4.10.0 | active | — | — |

## 解决方案

1. ```
   Increase the number of keypoints detected by using SIFT with nfeatures=5000 and then apply ratio test (Lowe's ratio < 0.75) to filter matches.
   ```
2. ```
   Use FLANN-based matcher with k=2 and then apply cross-check filtering (e.g., cv::BFMatcher with crossCheck=true) to retain only robust matches.
   ```

## 无效尝试

- **Lowering the RANSAC reprojection threshold to 1.0 to force more inliers** — Excessively low threshold rejects valid matches, reducing inlier count further. (85% 失败率)
- **Using ORB detector with default parameters without tuning** — ORB may generate too few or low-quality matches for scenes with low texture or large viewpoint changes. (75% 失败率)
