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.
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()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With