Ask Your Question
1

LaTeX in OpenCV

asked 2016-07-18 08:48:02 -0600

orest gravatar image

Hello, I'm using OpenCV for Python 3, and I would like to know if there's any method to put LaTeX symbols on images.

I'm using something like this cv2.putText(img,'OpenCV',(10,500), font, 4,(255,255,255),2,cv2.LINE_AA)(as it is in the tutorials here: [Drawing functions tutorial] (http://opencv-python-tutroals.readthe..., and I want to draw something like:

cv2.putText(img,'\alpha={}^\circ'.format(alpha),(10,500), font, 4,(255,255,255),2,cv2.LINE_AA).

But, of course, this code doesn't work (it could work in matplotlib with '#' instead of '\', but I would rather want to show the pictures using only OpenCV libraries).

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-07-18 08:54:20 -0600

berak gravatar image

unfortunately, putText() can handle only a small (printable) ascii subset, any unknown character will be replaced by a ?

(and ofc, don't expect it to expand latex tags, mathjax, or whatever..)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-18 08:48:02 -0600

Seen: 2,026 times

Last updated: Jul 18 '16