putText: multiple lines?
Can I use newline characters in cv::putText to write multiple lines on an image? My \n characters are not recognized.
Sample Code: std::string outputText = "Left \n Right \n"; cv::putText(imageOutput, outputText, cvPoint(30, 20), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(0,0,0));
My final image ends up with the following text on one line: Left ? Right ?
I'm using Mac OS X Mavericks, OpenCV 2.4.5, xCode
Thanks!
AFAIK it doesn't work. You know the font size so you can easily split it up with two putText() commands.
Thanks. That's what I was thinking. I was just hoping there was a cleaner way to do this since I have about 10 lines to write.
I had found this post about newline (\n) characters, but I guess it hasn't yet been implemented (see the response by OpenCV in the comments).
https://github.com/Itseez/opencv/pull/313