# cv::error: (-215:Assertion failed) group_threshold > 0 in function 'groupRectangles'

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

## Root Cause

The group_threshold parameter passed to cv::groupRectangles must be positive; a non-positive value causes the function to reject the input.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.5.2 | active | — | — |
| 4.7.0 | active | — | — |
| 4.9.0 | active | — | — |

## Workarounds

1. **Set group_threshold to 1 or higher: cv::groupRectangles(rectList, weights, 1, 0.2);** (100% success)
   ```
   Set group_threshold to 1 or higher: cv::groupRectangles(rectList, weights, 1, 0.2);
   ```
2. **If grouping is not needed, use NMS separately (e.g., cv::dnn::NMSBoxes) instead of groupRectangles.** (95% success)
   ```
   If grouping is not needed, use NMS separately (e.g., cv::dnn::NMSBoxes) instead of groupRectangles.
   ```

## Dead Ends

- **** — The function explicitly requires group_threshold > 0; zero or negative values trigger the assertion error. Use cv::partition or manual merging instead. (100% fail)
- **** — The assertion checks group_threshold, not the rectangle list; an empty list may cause a different error, but the threshold check still fails first. (80% fail)
