# cv::error: (-28:Insufficient number of valid points) in function 'cv::findHomography'

- **ID:** `opencv/feature-matching-insufficient-matches`
- **Domain:** opencv
- **Category:** computation_error
- **Error Code:** `-28`
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

The number of matched feature points between two images is below the minimum required for homography estimation.

## Version Compatibility

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

## Workarounds

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.** (85% success)
   ```
   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.** (80% success)
   ```
   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.
   ```

## Dead Ends

- **Lowering the RANSAC reprojection threshold to 1.0 to force more inliers** — Excessively low threshold rejects valid matches, reducing inlier count further. (85% fail)
- **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% fail)
