1

Python (with OpenCV) throws the following TypeError. But I have no idea which argument is throwing it. How can I tell?

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

For background, here is my code:

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
2
  • Which ever one is not a float Commented Apr 15, 2014 at 12:05
  • 1
    None of them are floats- and AFAIK none of them are meant to be. Commented Apr 15, 2014 at 12:06

1 Answer 1

2

you got the args for logPolar wrong (probably from the older cv api wrapper)

>>> import cv2
>>> help(cv2.logPolar)
Help on built-in function logPolar in module cv2:

logPolar(...)
    logPolar(src, center, M, flags[, dst]) -> dst

(M is the float in question)

Sign up to request clarification or add additional context in comments.

2 Comments

Amazing! You are my HERO! :)
;) unfortunately the docs are outdated on this. so better rely on the builtin help, which will at least query the module you're using

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.