Chessboards arise frequently in computer vision theory and practice because their highly structured geometry is well-suited for algorithmic detection and processing. In this paper, we present an algorithm that can correctly recognize the state of a Chinese chess game by processing a photo of the chessboard. Some major steps of the algorithm include chessboard rectification using Hough transformation, geometric operation and edge detection, chess piece detection using circular Hough transformation, chess piece recognition using color classification and template matching.