putText for UTF-8 characters (C++)

2019-05-03 06:46发布

问题:

I am using putText OpenCV method for writing text on images. But it only works for ASCII characters. I need to print characters such as šŠčČŽž. Can anybody help?

回答1:

Unfortunately, cv::putText() only supports ASCII. There is an open bug report which requests special character support for this function, but it appears that this feature will not be implemented soon.

If you have compiled OpenCV with Qt support, you may be able to use cv::addText() instead.