title: Why are the Bounding Boxes from Tesseract not aligned on the image text?
body: <p>I'm using the tesseract R package to recognize text within an image file. However, when plotting the bounding box for a word, the coordinates don't seem to be right.</p>
  <ol>
  <li>Why is the bounding box for the word &quot;This&quot; not aligned with the text &quot;This&quot; in the image? <a href="https://i.stack.imgur.com/RhTGY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RhTGY.png" alt="Output" /></a></li>
  <li>Is there an easier way to plot all bounding box rectangles on the image?</li>
  </ol>
  <pre><code>library(tesseract)
  library(magick)
  library(tidyverse)
  
  text &lt;- tesseract::ocr_data(&quot;http://jeroen.github.io/images/testocr.png&quot;)
  image &lt;- image_read(&quot;http://jeroen.github.io/images/testocr.png&quot;)
  
  text &lt;- text %&gt;% 
    separate(bbox, c(&quot;x1&quot;, &quot;y1&quot;, &quot;x2&quot;, &quot;y2&quot;), &quot;,&quot;) %&gt;% 
    mutate(
      x1 = as.numeric(x1),
      y1 = as.numeric(y1),
      x2 = as.numeric(x2),
      y2 = as.numeric(y2)
    )
  
  plot(image)
  rect(
    xleft = text$x1[1], 
    ybottom = text$y1[1], 
    xright = text$x2[1], 
    ytop = text$y2[1])
  </code></pre>