title: MATLAB Auto Crop
body: <p>I am trying to automatically crop the image below to a bounding box. The background will always be the same colour. I have tried the answers at 
  <a href="https://stackoverflow.com/questions/11121657/find-the-edges-of-image-and-crop-it-in-matlab/">Find the edges of image and crop it in MATLAB</a>
  and various applications and examples on Mathworks' file exchange but I get stuck at getting a proper boundingbox.</p>
  
  <p>I was thinking to convert the image to black and white, converting it to binary and removing everything that's closer to white than black, but I'm not sure how to go about it.</p>
  
  <p><img src="https://i.stack.imgur.com/ZuiEt.jpg" alt="PencilCase"></p>