16 GueeSang Lee: Chessboard and Pieces Detection for Janggi Chess Playing Robot International Journal of Contents, Vol.9, No.4, Dec. 2013 Chessboard and Pieces Detection for Janggi Chess Playing Robot Vo Quang Nhat, GueeSang Lee* Department of Electronics and Computer Engineering Chonnam National University, Gwangju, 500-757, Korea ABSTRACT Vision system is an indispensable part of constructing the chess-playing robot. Chessboard detection and pieces localization in the captured image of robot's camera are important steps for processes followed such as pieces recognition, move calculation, and robot controlling. We present a method for detecting the Janggi chessboard and pieces based on the edge and color feature. Hough transform combined with line extraction is used for segmenting the chessboard and warping it to form the rectangle shape in order to detect and interpolate the lines of chessboard. Then we detect the existence of pieces and their side by applying the saliency map and checking the color distribution at piece locations. While other methods either work only with the empty chessboard or do not care about the piece existence, our method could detect sufficiently side and position of pieces as well as lines of the chessboard even if the occlusion happens. Key words: Hough Transform, Chessboard Detection, Pieces Detection, Canny. 1. INTRODUCTION As technology develops rapidly in present day, robot systems are gradually being applied into every aspect of normal life. Among those, robot applications for playing physical chess currently attract a large amount of research interests. The system of chess playing robots usually consists of four main modules: image processing module for detecting the board and localizing pieces, pattern recognition module for recognizing the piece type, artificial intelligence module for deciding the chess moves, and controlling module for handling movements of robot's arm. Our work focuses on detecting the Janggi chessboard and pieces which supports for modules followed. Although there are many researches in board detection, they all either work with western chessboard or do not consider the pieces. With Janggi and Chinese chessboards, which are mainly drawn with lines, the situation is quite different. We could divide the methods of board detection into two categories: corner-based and line-based detection. The first class of researches [1]-[5] tries to find the corners of squares by using algorithms like Harris or SUSAN corner detection with post processing steps to remove fake corners. As mentioned by Tam et al. [6], the advantage of these approaches is that it has high tolerance against camera distortion. However, in case of Janggi chess game in which the corners are occluded by pieces, these methods are not appropriate. The second class of researches [6]-[8] focuses on detecting lines instead of corners. These * Corresponding author, Email: gslee@chonnam.ac.kr Manuscript received Jul. 18, 2012; revised Oct. 22, 2013; accepted Oct. 31, 2013 approaches are inaccurate with image distortion. One solution for this problem is to apply a pre-processing step to undistort the image beforehand. Line-based methods could accept small occlusion. However, in case the line is fully filled with pieces, we could have missing lines. Tam et al. [6] proposed a method for calculating corner points of the western chessboard. From the intersection points of detected lines, they try to predict other corner points of the chessboard by using geometric calculations. The problem is that because we do not know exactly the area of the chessboard in the image, we could not verify whether predicted points are the right corners or not. With pieces detection, a simple approach is to apply image subtraction [1]. The empty chessboard image will be subtracted from the image having both pieces and board. However, this method requires the stability of camera and chessboard which is hard to apply because of the illumination changes, the movability of the robot, and chessboard displacements. In this paper, we propose a method for detecting the Janggi chessboard and pieces by making use of the edge and color features. Lines of the chessboard are located in the image with line filtering and Hough transform. The chessboard is then segmented and warped to rectangular shape in which we could easily reconstruct the missing lines of chessboard. Supposing that the pieces always locate at intersection points, as soon as the grid is formed, we could apply the saliency map to find out the pieces locations. Finally, we analyse the color distribution at image areas of pieces and divide them into two groups. Fig. 1 illustrates the overview of our detection work. Our contribution consists of four main parts: (1) a new framework for detecting the location and side of pieces, (2) a novel line filtering and detection method based on the structure of inner lines and the distribution of local maximum points in http://dx.doi.org/10.5392/IJoC.2013.9.4.016