11
1 Playing Chess: Playing Chess: Recognition and Simulation Recognition and Simulation COMP 290-075 COMP 290-075 Computer Vision Computer Vision B. Danette Allen B. Danette Allen Paul J. McLaurin Paul J. McLaurin May 03, 2000 May 03, 2000

1 Playing Chess: Recognition and Simulation COMP 290-075 Computer Vision B. Danette Allen Paul J. McLaurin May 03, 2000

Embed Size (px)

Citation preview

1

Playing Chess: Playing Chess: Recognition and SimulationRecognition and Simulation

COMP 290-075COMP 290-075Computer VisionComputer Vision

B. Danette AllenB. Danette Allen

Paul J. McLaurinPaul J. McLaurin

May 03, 2000May 03, 2000

2

ObjectivesObjectives

• Track individual chess piecesTrack individual chess pieces

• Maintain state of boardMaintain state of board

• Graphically represent state changes and Graphically represent state changes and statestate

3

Lab Set-upLab Set-up

• 1 to 3 cameras1 to 3 cameras

– Panasonic Panasonic GP-LM7TAGP-LM7TA

– 1 overhead (min)1 overhead (min)

– 2 side view2 side view

• PCPC

• Matrox imaging board and Matrox imaging board and librarieslibraries

• C++, OpenGL, GLVUC++, OpenGL, GLVU

• Chessboard and piecesChessboard and pieces

4

System ConstraintsSystem Constraints

• Single move per imageSingle move per image

–move, capture, en passant, castlemove, capture, en passant, castle

• Shadow minimizationShadow minimization

–currently using halogen lamp currently using halogen lamp (no overhead)(no overhead)

• Not constrained to legal chess movesNot constrained to legal chess moves

• Must start game from beginningMust start game from beginning

5

Calibration of chess boardCalibration of chess board

6

• A A blobblob is a set of connected pixels that have the is a set of connected pixels that have the same intensity valuesame intensity value

• There are five steps in this process: There are five steps in this process: 1. Acquire an image1. Acquire an image

2. Analyze foreground and background pixels to determine optimum 2. Analyze foreground and background pixels to determine optimum threshold required to segment objects from their backgroundthreshold required to segment objects from their background

3. Apply a threshold to create a binary image with objects shown in 3. Apply a threshold to create a binary image with objects shown in white and background shown in blackwhite and background shown in black

4. Analyze areas of connected white pixels and assign a label or number 4. Analyze areas of connected white pixels and assign a label or number to each discrete group of connected pixels to each discrete group of connected pixels

5. Extract physical measurements from objects. 5. Extract physical measurements from objects.

Blob AnalysisBlob Analysis

7

Grayscale and Binarized ImagesGrayscale and Binarized Images

8

Rendered chessboard and Rendered chessboard and piecespieces

9

Problems EncounteredProblems Encountered

• Black on black not detectableBlack on black not detectable

–white ring around base of black pieceswhite ring around base of black pieces

–black ring around bases of white piecesblack ring around bases of white pieces

• Multiple responsesMultiple responses

–Added code to filter out redundant responsesAdded code to filter out redundant responses

• Noisy difference imagesNoisy difference images

–Gaussian filterGaussian filter

10

Future EnhancementsFuture Enhancements

• Multiple/Side camerasMultiple/Side cameras

• Tracking of individual piecesTracking of individual pieces

–““discrete” tracking of posediscrete” tracking of pose

–““continuous” tracking (6 DOF)continuous” tracking (6 DOF)

• Handle shadowsHandle shadows

• Increase code robustnessIncrease code robustness

–Verify legal moves in all cases Verify legal moves in all cases

» Handle “nudged” pieces automaticallyHandle “nudged” pieces automatically

11

DemonstrationsDemonstrations

• Video of chess game in labVideo of chess game in lab

• Simulated chess gameSimulated chess game