{
  "id": "opencv/tracker-init-no-bbox",
  "signature": "cv::error: (-215:Assertion failed) !boundingBox.empty() in function 'init'",
  "signature_zh": "cv::error: (-215:断言失败) !boundingBox.empty() 在函数 'init' 中",
  "regex": "Assertion failed \\(!boundingBox.empty\\(\\)\\)",
  "domain": "opencv",
  "category": "assertion_error",
  "subcategory": null,
  "root_cause": "The bounding box passed to cv::Tracker::init is empty (width or height is zero), often due to invalid detection or user input.",
  "root_cause_type": "generic",
  "root_cause_zh": "传递给 cv::Tracker::init 的边界框为空（宽度或高度为零），通常是由于无效的检测或用户输入。",
  "versions": [
    {
      "version": "4.5.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.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The empty() check only verifies width and height are zero; negative coordinates are allowed but may cause later issues; however, the assertion still passes if width/height > 0.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "empty() returns true if width <= 0 or height <= 0; both must be positive for the assertion to pass.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Validate bounding box before init: if (bbox.width > 0 && bbox.height > 0) { tracker->init(frame, bbox); } else { /* handle error */ }",
      "success_rate": 1.0,
      "how": "Validate bounding box before init: if (bbox.width > 0 && bbox.height > 0) { tracker->init(frame, bbox); } else { /* handle error */ }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure bbox is computed correctly from detection; for example, if using cv::selectROI, check that the user actually selected a region.",
      "success_rate": 0.9,
      "how": "Ensure bbox is computed correctly from detection; for example, if using cv::selectROI, check that the user actually selected a region.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 init 之前验证边界框：if (bbox.width > 0 && bbox.height > 0) { tracker->init(frame, bbox); } else { /* 处理错误 */ }",
    "确保从检测中正确计算边界框；例如，如果使用 cv::selectROI，检查用户是否实际选择了区域。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/d0/d0a/classcv_1_1Tracker.html#a5b5c5d5e5f5a5b5c5d5e5f5a5b5c5d5",
  "official_doc_section": null,
  "error_code": "-215",
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}