title: What algorithm for chessboard recognition (w/opencv)?
body: <p>I am playing around with OpenCV. The task I made up for myself to make the process interesting is recognizing the chess board with random set of pieces on it, they can be placed between the squares as well or even on top of each other.</p>
  
  <p>There are complications: the piece's colors are very close to chessboard's. The final goal is to mark intersections (know their coordinates) and fill the cells according to their color (black/white). With perspective support, shadows etc.</p>
  
  <p><a href="https://i.stack.imgur.com/MDYue.png" rel="nofollow noreferrer">example</a></p>
  
  <p><a href="https://i.stack.imgur.com/FzgFR.jpg" rel="nofollow noreferrer">another example</a></p>
  
  <p>red squares are created automatically by my current code. But it is not as good as I expected.</p>
  
  <p>Any recommendations? What image processing algorithms?</p>