Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

LaTeX in OpenCV

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.readthedocs.io/en/latest/py_tutorials/py_gui/py_drawing_functions/py_drawing_functions.html#drawing-functions)), 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).