opencv-python
opencv-python copied to clipboard
Imshow incorrect title if non ascii characters
Expected behaviour
I put a title on imshow like 'Données du ministère de la santé' and I expect to show it
Actual behaviour
The title show is 'Données du ministère de la santé'
Steps to reproduce
- example code
from cv2 import imshow, waitKey, destroyAllWindows, imread
from PIL import Image, ImageDraw, ImageFont
filename = "tmp.png"
fnt = ImageFont.truetype('arial.ttf', 20)
image = Image.new(mode = "RGB", size = (400,40), color = "blue")
draw = ImageDraw.Draw(image)
draw.text((10,10), "Données du ministère de la santé", font=fnt, fill=(255,0,0))
image.save(filename)
image = imread(filename)
imshow("Données du ministère de la santé", image)
if waitKey(0) == ord('q'):
destroyAllWindows()
- operating system - windows 10
- architecture (e.g. x86) - X86
- opencv-python version
- 4.5.5.62
Issue submission checklist
- [ ] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
- [ ] I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
- [ ] The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
- [ ] I'm using the latest version of
opencv-python