📅 2015-Mar-11 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ fonts, opencv ⬩ 📚 Archive
OpenCV can be used to render text on an image buffer using the putText
function. Several simple fonts are available in OpenCV which can be used to write text.
The available fonts can be seen defined in modules/imgproc/include/opencv2/imgproc.hpp
header file:
enum HersheyFonts {
0, //!< normal size sans-serif font
FONT_HERSHEY_SIMPLEX = 1, //!< small size sans-serif font
FONT_HERSHEY_PLAIN = 2, //!< normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX)
FONT_HERSHEY_DUPLEX = 3, //!< normal size serif font
FONT_HERSHEY_COMPLEX = 4, //!< normal size serif font (more complex than FONT_HERSHEY_COMPLEX)
FONT_HERSHEY_TRIPLEX = 5, //!< smaller version of FONT_HERSHEY_COMPLEX
FONT_HERSHEY_COMPLEX_SMALL = 6, //!< hand-writing style font
FONT_HERSHEY_SCRIPT_SIMPLEX = 7, //!< more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX
FONT_HERSHEY_SCRIPT_COMPLEX = 16 //!< flag for italic font
FONT_ITALIC = };
FONT_ITALIC
is not a font, but is a flag that can be combined with the other fonts to get italic text.
Tried with: OpenCV 2.4.9 and Ubuntu 14.04