Reputation: 73
I am writing a face recognition program and the reference that I got from web was using previous OpenCV version. I am using OpenCV 3.2.0 build from source. In the reference to put the name just below the face in a video. My reference code looks like
cv2.putText(cv2.cv.fromarray(img), str(id), (x, y + h), font, 2, 255);
I get an error:
AttributeError: 'module' object has no attribute 'cv'
Please help.
Upvotes: 6
Views: 28446
Reputation: 9701
For the Python API for OpenCV images are numpy
arrays so fromarray()
is not required (if available at all in the cv
module).
See here for an example. You can just pass img
to cv2.putText()
.
Upvotes: 9