Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017...

24
Geometry-Based Populated Chessboard Recognition William Hoff My co-authors: Youye Xie, Gongguo Tang Colorado School of Mines [email protected] Colorado School of Mines Golden, Colorado, USA [email protected] DAQRI Vienna, Austria

Transcript of Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017...

Page 1: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Geometry-Based PopulatedChessboard Recognition

William Hoff

My co-authors:Youye Xie, Gongguo TangColorado School of Mines

[email protected] School of MinesGolden, Colorado, USA

[email protected]

Vienna, Austria

Page 2: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Chessboard Recognition

• Recognizing board useful for camera calibration

2November 13, 2017

Page 3: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Chessboard Recognition

• Recognizing board useful for camera calibration

• But we are not addressing this problem!

3November 13, 2017

• Want to do recognition for chess games

• Finding the board is the first step in finding the pieces

Page 4: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Populated Chessboard Recognition

• Challenges– Occlusion– Lighting– Clutter

4November 13, 2017

Methods developed for camera calibration do not work on populated chessboards!

Result from OpenCV’s“findChessboardCorners”

Page 5: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Approach

• Main ideas– Look for two groups of lines– Find correspondence by fitting observed lines to the model of a

chessboard

• Key techniques– Canny edge detector– Hough transform– K-means clustering– Homography transformation

5November 13, 2017

LinesDetection

LinesClustering

Outlier Elimination

Geometric Projection

ReferenceMatching

InputImage

BoardLocations

False

True

Page 6: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Line Detection

• Canny edge detection + Hough transform

6November 13, 2017

• Edges vote for lines into a Hough space, indexed by

and

• Lines are represented using the equation

Size of Hough space:Width = 180 ( ∈ 90°. . 89°Height = 2d, where d is image diagonal

x

y

min max

min

max

H(,)

Page 7: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Line Clustering

• Find two groups of lines– Corresponding to the two sets of

lines on a chessboard

• Use k-means clustering in H-space

• Need to scale the H-space– So that distance between two

adjacent lines in the direction and the direction are weighted equally

7November 13, 2017

Page 8: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Line Clustering

8November 13, 2017

Hough space5040 x 180

Image space4030 x 3024

Scaled Hough space180 x 180

(weight ρ and θ equally)

Two clusters

Page 9: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Outlier Elimination

• Eliminate lines that are far from the other lines in its own group, in H-space

9November 13, 2017

Avg. Euclidean distance between sets: 64.9462

< 3x average distance

Avg. Euclidean distance within sets:Green: 3.3107 Red: 3.8320

Page 10: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Outlier Elimination (image space)

10November 13, 2017

Before After (with intersections)

Page 11: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Finding Correspondence

• Model of chessboard: 81 intersection points

• Find transformation that maps observed intersections to model intersections

• Use a homography(projective transform)– Maps image points to model

points

11November 13, 2017

1333231

232221

131211

3

2

1

yx

hhhhhhhhh

xxx

Page 12: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Finding Correspondence (continued)

• Compute transform from four corner points and count inliers

• Search from outer corners to inner corners

12November 13, 2017

Reference image Intersections on transformed image

Original image

Page 13: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Experiments - Conditions

• Occlusion1. No pieces on board2. A chess middle game3. All pieces in initial positions

• Viewing angles– [10,20, …, 90] degrees

• Testing– 4 different chess sets– 20 to 30 test images for each combination

13November 13, 2017

viewing angle

center of the chessboard

Page 14: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Example Results

14November 13, 2017

Input OutputIntersectionsH-space

Page 15: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Processing Time

• Processing time dominated by correspondence search– Search time depends on the number of lines to be searched

15November 13, 2017

Test image

• Using the top 35 lines, processing time is about 4 seconds • MATLAB implementation on i7 processor

Page 16: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Detection Success Rate

16November 13, 2017

No pieces on board

Test image example

Page 17: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Detection Success Rate

17November 13, 2017

Chess middle game

Test image example

Page 18: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Detection Success Rate

18November 13, 2017

Pieces in initial positions

Test image example

Page 19: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Failure Cases

• Very low viewing angle• Strong occlusion• Strong spurious edges

19November 13, 2017

Page 20: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Piece Recognition

• Once the board is recognized, we can use a model-based method to recognize the pieces

• We use chamfer matching to match observed edges to predicted edges in a template

20November 13, 2017

Recognized boardTemplate of

bishopPredicted

edges

Page 21: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Example Results

21November 13, 2017

Page 22: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Piece Recognition Evaluation

22November 13, 2017

Confusion matrix

~94% accuracy

Page 23: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

Conclusions

• Developed algorithm for populated chessboard recognition– Detect lines using Hough transform – Cluster lines in H-space– Find correspondence using model-based projection

• Achieves high accuracy for >45 viewing angle • Takes about 4 seconds for a high resolution

(4032x3042 pixels) image• Result can enable piece recognition

23November 13, 2017

Page 24: Geometry-Based Populated Chessboard Recognitionyouyexie/paper/ICMV2017ppt.pdf · November 13, 2017 4 Methods developed for camera calibration do not work on populated chessboards!

24September 25, 2017