{
  "id": "opencv/calib3d-solvepnp-empty-points",
  "signature": "cv::error: (-215:Assertion failed) objectPoints.size() == imagePoints.size() && objectPoints.size() >= 4 in function 'cv::solvePnP'",
  "signature_zh": "cv::error: (-215:断言失败) objectPoints.size() == imagePoints.size() && objectPoints.size() >= 4 在函数 'cv::solvePnP' 中",
  "regex": "cv::error: \\(-215:Assertion failed\\) objectPoints\\.size\\(\\) == imagePoints\\.size\\(\\) && objectPoints\\.size\\(\\) >= 4 in function 'cv::solvePnP'",
  "domain": "opencv",
  "category": "assertion_error",
  "subcategory": null,
  "root_cause": "The number of 3D object points does not match the number of 2D image points, or there are fewer than 4 point correspondences required for PnP solving.",
  "root_cause_type": "generic",
  "root_cause_zh": "3D 物体点的数量与 2D 图像点的数量不匹配，或者点对应关系少于 PnP 求解所需的 4 个。",
  "versions": [
    {
      "version": "4.8.0",
      "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"
    },
    {
      "version": "4.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding random extra points to objectPoints to match imagePoints size without verifying correspondence",
      "why_fails": "Incorrect correspondences lead to wildly wrong pose estimates or solver failure; PnP requires accurate point pairs.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using only 3 points because the user thinks 3 is enough for pose estimation",
      "why_fails": "solvePnP requires at least 4 non-coplanar points for a unique solution; 3 points can only provide up to 4 possible solutions.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure both vectors have equal size and contain at least 4 points. Use a checkerboard detection to generate at least 4 corners: cv::findChessboardCorners returns a vector of corners that can be paired with known 3D object points.",
      "success_rate": 0.9,
      "how": "Ensure both vectors have equal size and contain at least 4 points. Use a checkerboard detection to generate at least 4 corners: cv::findChessboardCorners returns a vector of corners that can be paired with known 3D object points.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using ArUco markers, ensure at least 4 markers are detected and their corners are properly paired with 3D model points using cv::aruco::estimatePoseSingleMarkers for each marker.",
      "success_rate": 0.85,
      "how": "If using ArUco markers, ensure at least 4 markers are detected and their corners are properly paired with 3D model points using cv::aruco::estimatePoseSingleMarkers for each marker.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure both vectors have equal size and contain at least 4 points. Use a checkerboard detection to generate at least 4 corners: cv::findChessboardCorners returns a vector of corners that can be paired with known 3D object points.",
    "If using ArUco markers, ensure at least 4 markers are detected and their corners are properly paired with 3D model points using cv::aruco::estimatePoseSingleMarkers for each marker."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga549c2075d5aa0ed5f5a6e6d7f3e4b5b9",
  "official_doc_section": null,
  "error_code": "-215",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-07-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}