0

Yellow everyone!!

I'm trying to get letters that contain diacritics, or accents, such as "é", "ä" or "ô" to be displayed on a screen as a webcam video is recorded.

I am using Python 3 / UTF-8, and when I print to the console the message I want to display, the message is written correctly, with all the diacritics in place. However, on screen the letters with diacritics get replaced by question marks "?".

To get this done I am using the following lines

  cv2.putText(frame, message,
                (20,180), cv2.FONT_HERSHEY_SIMPLEX,
                1, (0,255,0), 3);
  # Display the resulting frame
  cv2.imshow('Webcam',frame)

and where "message" is the string variable to be displayed, containing all funny letters. Can anyone make a suggestion?

Many thanks, MD

  • You can't do that with `cv2.putText`... the Hershey fonts as included in OpenCV contain only a very limited set of glyphs. – Dan Mašek Jun 09 '20 at 16:43
  • It seems that one has to use some functionality from "Pillow" https://stackoverflow.com/questions/50854235/how-to-draw-chinese-text-on-the-image-using-cv2-puttextcorrectly-pythonopen – Materia Dura Jun 09 '20 at 19:17

0 Answers0