{
  "id": "opencv/calib3d-fisheye-undistort-points-dtype",
  "signature": "cv::error: (-215:Assertion failed) src.type() == CV_32FC2 || src.type() == CV_64FC2 in function 'cv::fisheye::undistortPoints'",
  "signature_zh": "cv::error: (-215:断言失败) src.type() == CV_32FC2 || src.type() == CV_64FC2 在函数 'cv::fisheye::undistortPoints' 中",
  "regex": "cv::error: \\(-215:Assertion failed\\) src\\.type\\(\\) == CV_32FC2 \\|\\| src\\.type\\(\\) == CV_64FC2 in function 'cv::fisheye::undistortPoints'",
  "domain": "opencv",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "fisheye::undistortPoints requires input points as a 2-channel float or double array, but the input has wrong type or channel count.",
  "root_cause_type": "generic",
  "root_cause_zh": "fisheye::undistortPoints 要求输入点为双通道浮点或双精度数组，但输入类型或通道数错误。",
  "versions": [
    {
      "version": "4.5.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Single-channel float (CV_32F) is not a 2-channel array; the function expects interleaved x,y coordinates.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Python list of tuples is not a numpy array with correct dtype; OpenCV expects np.ndarray with shape (N,1,2) or (N,2).",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "OpenCV does not support float16 for this function; only float32 or float64.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "pts = np.array([[x1, y1], [x2, y2]], dtype=np.float32)\nundistorted = cv2.fisheye.undistortPoints(pts, K, D)",
      "success_rate": 0.95,
      "how": "pts = np.array([[x1, y1], [x2, y2]], dtype=np.float32)\nundistorted = cv2.fisheye.undistortPoints(pts, K, D)",
      "condition": "",
      "sources": []
    },
    {
      "action": "pts = np.array([[[x1, y1]], [[x2, y2]]], dtype=np.float64)\nundistorted = cv2.fisheye.undistortPoints(pts, K, D, P=K)",
      "success_rate": 0.9,
      "how": "pts = np.array([[[x1, y1]], [[x2, y2]]], dtype=np.float64)\nundistorted = cv2.fisheye.undistortPoints(pts, K, D, P=K)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "pts = np.array([[x1, y1], [x2, y2]], dtype=np.float32)\nundistorted = cv2.fisheye.undistortPoints(pts, K, D)",
    "pts = np.array([[[x1, y1]], [[x2, y2]]], dtype=np.float64)\nundistorted = cv2.fisheye.undistortPoints(pts, K, D, P=K)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/db/d58/group__calib3d__fisheye.html#ga3b8e9c3c3c3c3c3c3c3c3c3c3c3c3c3",
  "official_doc_section": null,
  "error_code": "-215",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}