title: AttributeError: 'module' object has no attribute 'InitFont'
body: <p>Run on Python 2.7 OpenCV 3.2 Windows 10 
  The below code is throwing <a href="https://i.stack.imgur.com/p6hBe.png" rel="nofollow noreferrer">error</a></p>
  
  <p>AttributeError: 'module' object has no attribute 'InitFont'</p>
  
  <p>My best guess is due to OpenCV 3 as it was working fine in below version.</p>
  
  <pre><code>import cv2
  import numpy as np
  
  recognizer = cv2.face.createLBPHFaceRecognizer()
  recognizer.load('trainner/trainner.yml')
  cascadePath = "haarcascade_frontalface_default.xml"
  faceCascade = cv2.CascadeClassifier(cascadePath);
  
  
  cam = cv2.VideoCapture(0)
  font = cv2.InitFont(cv2.CV_FONT_HERSHEY_SIMPLEX, 1, 1, 0, 1, 1)
  while True:
      ret, im =cam.read()
      gray=cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
      faces=faceCascade.detectMultiScale(gray, 1.2,5)
      for(x,y,w,h) in faces:
          cv2.rectangle(im,(x,y),(x+w,y+h),(225,0,0),2)
          Id, conf = recognizer.predict(gray[y:y+h,x:x+w])
          if(conf&lt;50):
              if(Id==1):
                  Id="Prosper"
  
          else:
              Id="Unknown"
          cv2.cv.PutText(cv2.cv.fromarray(im),str(Id), (x,y+h),font, 255)
      cv2.imshow('im',im) 
      if cv2.waitKey(10) &amp; 0xFF==ord('q'):
          break
  cam.release()
  cv2.destroyAllWindows()
  </code></pre>