title: Find squares / rectangles from image that has overlay using opencv
body: <p>I am trying to find squares of an image based on overlays that streamers use to stream in applications like OBS, and I would like to know if someone knows a better approach than the one that I am doing.</p>
  <p>Example of image and result of my code using cv2 and python (notice that I am not allowed to add images, so link is provided instead):</p>
  <p><a href="https://i.stack.imgur.com/EAqA0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EAqA0.jpg" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/VnzDt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VnzDt.png" alt="enter image description here" /></a></p>
  <p>My strategy is:</p>
  <ul>
  <li>Resize and blur the image</li>
  <li>Find all lines in the image based on cv2.HoughLinesP</li>
  <li>Get common lines and then get points from them</li>
  <li>Try to find possible squares / rectangles from points</li>
  </ul>
  <p>I'm trying to find all squares/rectangles and then retrieve only the big one, but I'm not having good results. Does someone know any library or strategy that could I use to get biggest square/rectangle from image that has an overlay.</p>