Ask Your Question
0

cv::putText without a GUI thread, or named window?

asked 2018-10-20 07:56:23 -0600

soroush gravatar image

I would like to put a UTF8 text using a specific font on my cv::Mat and I don't want to use OpenCV's GUI elements (windows). I compiled OpenCV 3.4.3 against Qt 5.11.1 and it works fine.

I understand that calling cv::addText function crashes duo to lack of GUI thread, in case no window is created by cv::namedWindow or cv::window. So I want to know if there is a way to somehow hide a previously created window, or even start GUI thread without actually having a window?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-10-24 07:27:13 -0600

berak gravatar image

you cannot use cv::addText with out a (qt) window context.

you can still use putText() without any gui, but you're limited to the builtin hershey font.

there is a freetype/harbuzz module in opencv_contrib for extra (bitmap) fonts.

last but not least: opencv is a computer-vision library. drawing text is only a utility, not the main means.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-10-20 07:56:23 -0600

Seen: 344 times

Last updated: Oct 24 '18