Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The imread function for reading images and the imshow function for setting image titles should support Chinese characters #969

Open
1 of 4 tasks
loli0123456789 opened this issue Apr 2, 2024 · 0 comments

Comments

@loli0123456789
Copy link

loli0123456789 commented Apr 2, 2024

Expected behaviour

The functions imread for reading images and imshow for setting image titles can support Chinese characters

Actual behaviour

1.When using the imread function to read an image with a path that includes Chinese characters, the function returns None.
2.When using the imshow function to display an image with a Chinese title set, the displayed title appears as corrupted text.

After reviewing the relevant documentation, I remain unclear on how to resolve the issue.

Steps to reproduce

  • example code

`import cv2

def read_img(img_path):
img = cv2.imread(img_path)
return img

def show_img(img,title):
cv2.imshow(title,img)
cv2.waitKey()

img=read_img(r'D:\测试\lenna.png')
print(img) # the result is None

img=read_img(r'D:\Test\lenna.png')
show_img(img,'测试')`

  • operating system windows 11
  • architecture (e.g. x86) x64
  • opencv-python version 4.9
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant