title: Algorithms to classify and extract crossword grids from an image
body: <p>I am looking for algorithms to, given an image containing a crossword</p>
  
  <ol>
  <li>crop the image to just the crossword</li>
  <li>distinguish between <a href="http://crossword.info/sample/cryptic_demo" rel="noreferrer">regular</a> and <a href="http://crossword.info/sample/barred_demo/" rel="noreferrer">barred</a> crosswords</li>
  <li>extract the grid size and the positions of the black squares/bars</li>
  </ol>
  
  <p>The crossword itself can be assumed to be regular (i.e. I am interested in crosswords that have been generated by some program and published as an image, rather than scanned paper-based crosswords), and I would like the program to run without needing any inputs other than the image bitmap.</p>
  
  <p>I can think of some brute-force multi-pass ways to do this (essentially using variants of imagemagick's <a href="http://www.imagemagick.org/Usage/morphology/#hitmiss" rel="noreferrer">hit-and-miss filter</a> and then looping over the image looking for leftover dots) but I'm hoping for better ideas from people who actually know about image processing.</p>