Chinese encoding in python OpenCV(cv2) putText method

后端 未结 1 926
你的背包
你的背包 2021-01-23 14:21

For some reason, I need to put Chinese text in an cropped image. I have used the method \"putText\" in cv2 to achieve the goal.

Here is the code I use:

c         


        
1条回答
  •  时光说笑
    2021-01-23 15:02

    The problem is that OpenCV only has the Hershey font, which does not include Chinese characters. So you need something else. There is an OpenCV extension library that appears to address the issue.

    The program at http://opencv-extension-library.googlecode.com/svn/doc/r263/classCvxText.html#2b5076328cd67ffffd5a4eecc8e00cba3e certainly looks like it is trying to load a font and draw characters in an image.

    0 讨论(0)
提交回复
热议问题