How do I display a language like Hindi, Marathi that don't have English characters in an open cv feed?

39 Views Asked by At

I am currently working on a project and need to display Hindi, Marathi translations on my open cv feed but it displays "?????" for the translation. To be clear I'm using googletrans library which translates the word and stores it in a 'translated' list.

font_path = font_path = "C:\\Marathi-Lekhani Normal\\Marathi-Lekhani Normal.ttf"
font = cv2.FONT_HERSHEY_SIMPLEX 
cv2.putText(image, ' '.join(translated).encode('utf-8').decode('utf-8'), (3, image.shape[0] - 10), font, 1, (255, 255, 255), 2, cv2.LINE_AA)

This is the code I'm using currently which I found after some research but it still gives out "????" for Hindi, Marathi translations. How do I fix this? Is it actually possible to do so in realtime?

0

There are 0 best solutions below