title: Algorithm to detect solid image
body: <p>What is the best way to detect and mark it with rectangle on the images? Like picture below :</p>
  
  <p><img src="https://i.stack.imgur.com/p7kXA.png" alt="enter image description here"></p>
  
  <p>I am working with QtImage.
  What i am thinking now is just find the first non transparent pixel then create 1x1 rect, then make it bigger and bigger until don't get the transparent pixel. Not sure if it really optimize. Please let me know if some of you have another method to do it.</p>