1

I read the documentation of the OpenCV function putText(). I could not find there any parameter or returned value that tells where each printed letter is located.

Is there some OpenCV API that gives this data while adding text to images, or maybe in some different library?

SomethingSomething
  • 11,491
  • 17
  • 68
  • 126

2 Answers2

1

You can calculate the width and height of the text you're putting on image by:

cv::Size textSize = cv::getTextSize(text, fontFace, fontScale, thickness, &baseline);

Check for example here.

zindarod
  • 6,328
  • 3
  • 30
  • 58
1

Take a look at my answer, the code may be interesting for your purpose: Detect space between text (OpenCV, Python)

It is used to recognize handwriting text and do ROI on given image.

lucians
  • 2,239
  • 5
  • 36
  • 64