What is the replacement of cv2.cv.fromarray in opencv 3.2?

opencv3.0, python

Solution

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()`.

Problem

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.

Original source