我怎么知道哪个参数在Python中抛出异常(使用OpenCV)



Python(带OpenCV)抛出以下TypeError。但我不知道是哪个论点在抛出它。我该怎么说呢?

Traceback (most recent call last):
  File "u.py", line 18, in <module>
    out = unravel2(img,pupil)
  File "/home/chris/code/opencv/iris/support.py", line 57, in unravel2
    cv2.logPolar(img, out, center, cv2.WARP_FILL_OUTLIERS)
TypeError: a float is required

背景,这里是我的代码:

def unravel2(img, pupil):
  out = np.zeros((max_radius-min_radius,720,3), np.uint8)
  center = (297.5,234.5)
  cv2.logPolar(img, out, center, cv2.WARP_FILL_OUTLIERS)
  return out

logPolar的args错误(可能来自旧的cv-api包装器)

>>> import cv2
>>> help(cv2.logPolar)
Help on built-in function logPolar in module cv2:
logPolar(...)
    logPolar(src, center, M, flags[, dst]) -> dst

(M是有问题的浮点值)

相关内容

  • 没有找到相关文章

最新更新