title: Detect location(s) of objects in an image
body: <p>I have an input image that looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/MPN90.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MPN90.png" alt="input image"></a></p>
  
  <p>Notice that there are 6 boxes with black borders. I need to detect the location (upper-left hand corder) of each box. Normally I would use something like <a href="http://docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/template_matching/template_matching.html" rel="nofollow noreferrer">template matching</a> but the contents (the colored area inside the black border) of each box is distinct.</p>
  
  <p>Is there a version of template matching that can configured to ignore the inner area of each box? Is the an algorithm better suited to this situation?</p>
  
  <p>Also note, that I have to deal with several different resolutions... thus the actual size of the boxes will be different from image to image. That said, the ratio (length to width) will always be the same.</p>
  
  <p>Real-world example/input image per request:</p>
  
  <p><a href="https://i.stack.imgur.com/WsD2A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WsD2A.png" alt="input image"></a></p>