java - Print Name Near Detected Face in Opencv? -


i need print name/text near face detected face rectangle below code detect face. can suggest me method that?

websource.retrieve(frame); graphics g = jpanel2.getgraphics(); matofrect facedetections =   new matofrect(); facedetector.detectmultiscale(frame, facedetections); rect rectcrop = null; (rect rect : facedetections.toarray()) {      system.out.println("ttt");      core.rectangle(frame, new point(rect.x, rect.y), new point(rect.x + rect.width, rect.y + rect.height),      new scalar(0, 255,0));      rectcrop = new rect(rect.x, rect.y,125, 150);       //facedetector.detectmultiscale(frame, facedetections);      int fcz= facedetections.toarray().length;      system.out.println("fcz="+fcz);      system.out.println(string.format("detected %s faces", facedetections.toarray().length)); } 

i used core.puttext , worked below code

core.puttext(frame,"name", new point(rect.x + rect.width, rect.y + rect.height),core.font_hershey_plain,10,new scalar(0, 255,0)); 

Comments

Popular posts from this blog

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -