Display text in plot in python application

1

I'm developing an application that counts people per video, but it's displaying the count by the terminal, how do I display "Found N people" on the video screen? follow my code:

print help_message

hog = cv2.HOGDescriptor()
hog.setSVMDetector( cv2.HOGDescriptor_getDefaultPeopleDetector() )


capture = cv2.VideoCapture(0)
while(True):

  ret, img = capture.read()
# img = cv.fromarray(img)

  found, w = hog.detectMultiScale(img, winStride=(8,8), padding=(32,32), scale=1.05)
  found_filtered = []
  for ri, r in enumerate(found):
for qi, q in enumerate(found):
  if ri != qi and inside(r, q):
    break
  else:
    found_filtered.append(r)
  draw_detections(img, found)
  draw_detections(img, found_filtered, 3)
  print ' (%d) Pessoas na imagem' %  (len(found))
  font = cv2.FONT_HERSHEY_SIMPLEX
    cv2.putText(img,'OpenCV',(10,500), font, 4,(255,255,255),2,cv2.LINE_AA)

  cv2.imshow('TELA DE CAPTURA', img)
  ch = 0xFF & cv2.waitKey(1)
  if ch == 27:
break
capture.release()
cv2.destroyAllWindows()
    
asked by anonymous 08.06.2016 / 22:00

0 answers