Chess Vision - NUS Computing

1y ago
5 Views
3 Downloads
954.86 KB
23 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Laura Ramon
Transcription

Chess VisionChua HuiyanLe VinhWong Lai Kuan

Outlinez Introductionz Background Studiesz 2D Chess Vision{ Real-time Board Detection{ Extraction and Undistortion of Board{ Board Configuration Recognitionz 3D Chess Vision{ Board Pre-Calibration{ Extraction and Undistortion of Board{ Board Configuration Recognitionz Problems Encounteredz Conclusionz Reference

Introductionz Main Objective:{Real time recognition of perspective distorted chessboard configuration.z Our achievement:{Real-time recognition of the configuration of a 2D chessboard that can be moved or rotated anytime.{Real-time recognition of the configuration of a 3D chessboard that is pre-calibrated.

Previous Workz To simplify the problem, previous chess visionalgorithms [1, 2] have the following constraints /assumptions:{Camera is mounted directly on top of the board¾Minimal perspective distortion.{Stationary chess boardz Allow pre-calibration of chessboard.{Clean / plain backgroundz Enable easy chessboard corner detection.{Known initial configurationz Configuration of the previous board configuration can beused to assist in determining the next board configuration.

Challenge of our projectz 2D chessboard recognition{Camera / board position and orientation can be changedin real-time.z Requires real-time tracking of chessboard corners andcalibration of chessboard.{Unknown initial configurationz Allow any initial configuration that will be determined inreal-time.z 3D chessboard recognition{Camera mounted on a perspective viewz Occlusion of chess pieces.

2D Chess Vision

Step 1: Real-time Board Detection1a. Board corners detection-Combination of line detectionand corner detection:Hough transform to detect lines andcheck for crosses with the detectedcorners to filter the outliners. Then 4intersections by the borders areextracted.-This method minimizes theerrors caused by noise andoutliers but it’s slower than othermethods. However, the speed isadequate for our chess gamecontext.

Step 1: Real-time Board Detection1b. Board orientation detection-We mark the top-left corner with blue color.After 4 corners are found, we detect the one with blue color, then sort themin clockwise sequence to send to next phase.

Step 2: Extraction & Undistortion of Boardz Using board corners detected from Step 1, extract and transform the board toa square board of size 480 x 480.z This requires finding the perspective distortion, T of the captured board usingthe formula: x' t11 t12 y ' t 21 t 22 1 t31 t32t13 x t 23 y 1 1 z Destination scan was then used to undistort the image.

Step 3: Board Configuration Recognitionz Initially implemented method proposed by Farahat et al. [1].z This method is very senstive to changing light condition.z Need to use a difference operator (between two consecutiveimage to compensate for lighting change) – even then it workbest under lamp light.z We improved on this method to allow it to work on differentlighting environment without using any difference operator orprevious images.

Step 3: Board Configuration Recognition3a. 1st Pass: Filter out non-occupied chess squareAfter getting the undistorted chessboard, Canny edge detection is applied tothe whole undistorted image.Divide the canny chess board image into 8 x 8 chess square images andapply threshold to detect whether a chess square is occupied.Square without chess piece is represented as 0 in the systemUndistorted imageImage with Canny detection

Step 3: Board Configuration Recognition3b. 2nd Pass: Determining color of chess piece inoccupied chess squarezzzzzImage is first converted to HSVValue plane is used to determine whether the chess piece is black or whitePixels are classified into 256 bins in the histogramBlack pixels are classified to range from the zero to the tenth binNumber of pixels found in the first 10 bins were summed up to track the numberof black pixels in each chess squarez Chess piece is determined to be black (represented as 2) when the number ofblack pixels found in the chess square is above a threshold, else chess piece iswhite (represented as 1)

3D Chess Vision

3D Chess VisionStep 1: Real-time Board Detectionz Same as 2D chess but it’s pre-calibrated.Step 2: Extraction & Undistortion of Boardz Same as 2D chess.

Step 3: Board Configuration RecognitionSetupz Use two webcams positioned perpendicular to each other sothat pieces appear occluded in one view may be seen fromanother view.z Inititial configuration of board is provided.1st view2nd view

Step 3: Board Configuration RecognitionStep 3a: Determine the two chess squarez Divide the chess board image into 8 x 8 chess square imagesz For each chess square{ Obtain the abs difference images of both views for two consecutiveframes.{ Perform binary threshold – set difference value above 30 for each pixelto 1, otherwise 0.{ Compute the total sum square difference for both difference image.z Find the two chess squares with maximum total sum squaredifference.

Step 3: Board Configuration RecognitionStep 3b: Determine the changed configurationz If the original states one of the selected chess square 0(unoccupied){ Swap the states of the two squarez Else (both squares are occupied){ Use Laplace to find edges of the current image for both squares.{ Replace the state of chess square with more edges with the previousstate of the chess square with less edges.{ Set the state of the chess square with less edges to 0 (unoccupied).

Implementation & Testingz Implementation:{ C , OpenCV, OpenGL for Vision part.{ Java socket programming for interface with gameengine.z Testing:{ Perform stress tests to test for worst case scenario.{ Perform testing under changing light condition.

Problems encounteredz Some image analysis methods work well for static images but very unstablewhen implemented in real-time.z Real-time corner detection{ Trivial methods such as simple corner / color / corners detection is very unstable.{ Solution: Use a combination of various methods to determine the corners.z Real-time integration{ Sensitive to change of lightings / flickering fluorescent light / reflection.{ Solution: Iteratively change our methods to be more robust to changingenvironment conditions.z Crashing{ Caused by two threads trying to access a same image file.{ Solution: Implement a semaphore for locking the files accessed by the twothreads.

ConclusionzWhat we achieve?{ Concrete implementation of the game Lines of Action with chessvision and AI module (2D version).{ Successfully implemented both the 2D and 3D chessrecognition.{ Improved on the robustness of the lighting{ Camera do not need to be mounted directly on top of the board{ Chess board can be moved around in the middle of game play inthe 2D version without affecting chess recognition{ 2D version can take in any input configuration{ Background can allow for some noise

Conclusionz What we have learnt?{Learnt to develop a computer vision system andimplement in real-time.{Learnt to deal with increased noise in real time videodue to change of light condition.{Applied theories that we have learnt in class: Cannyedge detection, corner detection, Hough transform,homography, color spaces.

Reference[1] A. K. Farahat, A. M. Hassan and M. A. El-Nagar, A Vision Systemfor Chess Playing Robots, 46th IEEE Midwest Symposium OnCircuits and Systems, December 27-30, 2003.[2]David Urting, Yolande Berbers (2003), MarineBlue: A Low-CostChess Robot, Proceedings of the IASTED International Conferenceon Robotics and Applications (Hamza, M.H., ed.), pp. 76-81.

Thank youChua HuiyanLe VinhWong Lai Kuan

3a. 1st Pass: Filter out non-occupied chess square After getting the undistorted chessboard, Canny edge detection is applied to the whole undistorted image. Divide the canny chess board image into 8 x 8 chess square images and apply threshold to detect whether a chess square is occupied. Square without chess piece is represented as 0 in the system

Related Documents:

The NUS Executive MBA (EN) NUS Executive MBA (English) NUS-HEC Master of Business Adm NUS-HEC MBA NUS-PKU Master of Business Adm NUS-PKU MBA NUS-Yale Master of Biz Adm NUS-YALE MBA Doctor of Philosophy (IORA) Operations Research& Analytics Students are reading modules from Doctor of Phil

UNCLASSIFIED PEO EIS 2 Agenda CHESS Organization Relation to PEO EIS, ASA(ALT) and HQDA CIO/G-6 CHESS Organizational Structure CHESS Operational Concept CHESS Authority CHESS Statement of Non-Availability (SoNA) CHESS IT e-mart SharePoint License Tracker System (LTS) CHESS Training CHESS Business/Contracts Report

Comparing Solitaire Chess to Standard Chess: Solitaire Chess is a single-player logic puzzle, not a chess game. Recreational mathematicians classify it as a “chess task,” meaning that it uses the rules of chess with appropriate adaptations. With Solitaire Chess, the basic piece movements are the same as with standard chess.

Millions of chess games have been recorded from the very beginning of chess history to the last tournaments of top chess players. Meanwhile chess engines have continuously improved up to the point they cannot only beat world chess champion

a chess teacher, Vladimir Pafuutieff, said to me, "Chess Combinations are the punch in chess. You have to develop your chess skills by understanding combinations. Virtually every chess game has a chess combination. You have to learn to recognize when a combination is available and you must land the blow! If you do this you will win a lot of .

109 Chess Endgame Study - A Comprehensive Introduction, The Roycroft 1972 370 pb 110 Chess Endings: Essential Knowledge Averbakh 1966 135 pb 111 Chess Exam and Training Guide: Tactics Khmelnitsky 2007 207 pb 112 Chess For Beginners Horowitz 1950 132 pb 113 Chess For Fun & Chess For Blood Lasker 1942 224 pb

When the elderly play chess, a robotic chess system including a simple and low-cost camera and a small robotic arm can be used to implement an automatic chess-placing system to help the elderly place the chessmen and reduce some chores. People may even play chess with a chess robot that includes the robotic chess system and software for playing.

Because black holes have no hair, as the scientist John Wheeler put it, one can't tell from the outside what is inside a black hole, apart from its mass, electric charge, and rotation. This means that a black hole contains a lot of information that is hidden from the outside world. If the amount of hidden information inside a black hole depends on the size of the hole, one would expect from .