# cv::error: (-215:断言失败) group_threshold > 0 在函数 'groupRectangles' 中

- **ID:** `opencv/group-rectangles-empty`
- **领域:** opencv
- **类别:** assertion_error
- **错误码:** `-215`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

传递给 cv::groupRectangles 的 group_threshold 参数必须为正数；非正数值会导致函数拒绝输入。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 4.5.2 | active | — | — |
| 4.7.0 | active | — | — |
| 4.9.0 | active | — | — |

## 解决方案

1. ```
   将 group_threshold 设置为 1 或更高：cv::groupRectangles(rectList, weights, 1, 0.2);
   ```
2. ```
   如果不需要分组，使用单独的 NMS（例如 cv::dnn::NMSBoxes）代替 groupRectangles。
   ```

## 无效尝试

- **** — The function explicitly requires group_threshold > 0; zero or negative values trigger the assertion error. Use cv::partition or manual merging instead. (100% 失败率)
- **** — 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% 失败率)
