int main()
{
Mat src = imread("C:\\x.png");
putText(src, "Hello world,Who are you, Lord?", Point(10, 60), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 100), FONT_HERSHEY_PLAIN, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 150), FONT_HERSHEY_DUPLEX, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 200), FONT_HERSHEY_COMPLEX, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 250), FONT_HERSHEY_TRIPLEX, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 300), FONT_HERSHEY_COMPLEX_SMALL, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 350), FONT_HERSHEY_SCRIPT_SIMPLEX, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 400), FONT_HERSHEY_SCRIPT_COMPLEX, 1, Scalar(0, 0, 255), 1, 8);
putText(src, "Hello World,Who are you, Lord?", Point(10, 450), FONT_ITALIC, 1, Scalar(0, 0, 255), 1, 8);
imwrite("src.png", src);
imshow("src", src);
waitKey(0);
}
OpenCV 文字绘制字体样式
最新推荐文章于 2024-06-13 11:54:24 发布