Can someone give me a pointer on how to solve this scenario:

1) I have an image of a chessboard (8x8) with black and white squares. I need to analyze the image and create a 8x8 matrix corresponding to the chessboard.

2) Store 0 if the corresponding chessboard cell is white, store 1 if the corresponding chessboard is black

The chessboard images have constant size, color depth and resolution. The image might be rotated.