{
  "id": "opencv/dnn-softnms-parameter-error",
  "signature": "cv::error: (-215:Assertion failed) !nms_iou_threshold.empty() && nms_iou_threshold > 0 && nms_iou_threshold <= 1 in function 'NMSBoxes'",
  "signature_zh": "cv::error: (-215:断言失败) !nms_iou_threshold.empty() && nms_iou_threshold > 0 && nms_iou_threshold <= 1 在函数 'NMSBoxes' 中",
  "regex": "Assertion failed.*nms_iou_threshold.*NMSBoxes",
  "domain": "opencv",
  "category": "assertion_error",
  "subcategory": null,
  "root_cause": "Non-maximum suppression (NMS) called with an invalid or out-of-range IoU threshold parameter.",
  "root_cause_type": "generic",
  "root_cause_zh": "非极大值抑制 (NMS) 调用时使用了无效或超出范围的 IoU 阈值参数。",
  "versions": [
    {
      "version": "4.5.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.8.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting nms_iou_threshold to 0 to disable NMS",
      "why_fails": "IoU threshold must be strictly greater than 0; 0 triggers the assertion.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a negative value like -0.5 for aggressive suppression",
      "why_fails": "Negative values fail the '> 0' check in the assertion.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Passing a string or list instead of a float",
      "why_fails": "The empty() check on a non-scalar type passes, but the comparison fails with type error.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure nms_iou_threshold is a float between 0.01 and 1.0, e.g., cv::NMSBoxes(boxes, scores, 0.5, 0.4) where 0.4 is the IoU threshold.",
      "success_rate": 0.95,
      "how": "Ensure nms_iou_threshold is a float between 0.01 and 1.0, e.g., cv::NMSBoxes(boxes, scores, 0.5, 0.4) where 0.4 is the IoU threshold.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Validate the parameter before calling NMSBoxes: if (iou_threshold <= 0.0 || iou_threshold > 1.0) { iou_threshold = 0.5; }",
      "success_rate": 0.9,
      "how": "Validate the parameter before calling NMSBoxes: if (iou_threshold <= 0.0 || iou_threshold > 1.0) { iou_threshold = 0.5; }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure nms_iou_threshold is a float between 0.01 and 1.0, e.g., cv::NMSBoxes(boxes, scores, 0.5, 0.4) where 0.4 is the IoU threshold.",
    "Validate the parameter before calling NMSBoxes: if (iou_threshold <= 0.0 || iou_threshold > 1.0) { iou_threshold = 0.5; }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/d6/d0f/group__dnn.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}