Cannot draw different fonts using addText

asked 2017-02-13 03:24:06 -0500

canius gravatar image

I've installed the opencv 3.2 from homebrew with qt5 supported on MacOS 10.12.2 I tried lots of different fonts in system but always showing the same font without any error/warning. What's wrong with my code ?

Mat m = Mat::zeros(200, 1000, CV_8UC3);
QtFont font1 = fontQt("Times",20,Scalar(0, 255, 0),QT_FONT_NORMAL);
QtFont font2 = fontQt("Courier New",20,Scalar(0, 255, 0),QT_FONT_NORMAL);
addText( m, "Hello World", Point(50,50), font1);
addText( m, "Hello World", Point(50,100), font2);
imshow("display", m);
edit retag flag offensive close merge delete