title: How to crop or remove white background from an image
body: <p>I am trying to compare images using OpenCV and Python.</p>
  
  <p>Consider these images:</p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/WMAkv.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/WMAkv.jpg" alt="Image  900 x 726"></a></p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/QL8Ti.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/QL8Ti.jpg" alt="Image 900 x 675"></a></p>
  
  <hr>
  
  <p>Both feature an identical pair of shoes, set to a white background. The only difference being that the first has a taller background than the second.</p>
  
  <p>I want to know how to programmatically crop the white backgrounds of both so that I'm left with only the pair of shoes.</p>
  
  <p>I must add that it won't be possible for me to manually crop the backgrounds.</p>