title: Highlighting specific text in an image using python
body: <p>I want to highlight specific words/sentences in a website screenshot. </p>
  
  <p>Once the screenshot is taken, I extract the text using <code>pytesseract</code> and <code>cv2</code>. That works well and I can get text and data about it. </p>
  
  <pre><code>import pytesseract
  import cv2
  
  
  if __name__ == "__main__":
      img = cv2.imread('test.png')
      img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
      result = pytesseract.image_to_data(img, lang='eng', nice=0, output_type=pytesseract.Output.DICT)
      print(result)
  </code></pre>
  
  <p>Using the results object I can find needed words and sentences. </p>
  
  <p>The question is how to go back to the image and highlight those word? </p>
  
  <p>Should I be looking at other libraries or there is a way to get pixel values and then highlight the text?</p>
  
  <p>Ideally, I would like to get start and end coordinates of each word, how can that be done? </p>