Difference between revisions of "PlayChessWithAWebCam/BoardFinder"

From BITPlan Wiki
Jump to navigation Jump to search
Line 9: Line 9:
 
=== Examples ===
 
=== Examples ===
 
see [https://github.com/WolfgangFahl/play-chess-with-a-webcam/tree/master/testMedia testMedia source folder]
 
see [https://github.com/WolfgangFahl/play-chess-with-a-webcam/tree/master/testMedia testMedia source folder]
==== Test Pictures ====
+
[[File:chessBoard001.jpg|400px]][[File:image001-corners-7x7.jpg|400px]]
<gallery>
+
[[File:chessBoard002.jpg|400px]][[File:image002-corners-5x5.jpg|400px]]
File:chessBoard001.jpg
+
[[File:chessBoard003.jpg|400px]][[File:image003-corners-4x5.jpg|400px]]
File:chessBoard002.jpg
+
[[File:chessBoard004.jpg|400px]][[File:image004-corners-7x7.jpg|400px]]
File:chessBoard003.jpg
+
[[File:chessBoard005.jpg|400px]][[File:image005-corners-5x5.jpg|400px]]
File:chessBoard004.jpg
+
[[File:chessBoard006.jpg|400px]][[File:image006-corners-5x5.jpg|400px]]
File:chessBoard005.jpg
+
[[File:chessBoard007.jpg|400px]][[File:image007-corners-5x5.jpg|400px]]
File:chessBoard006.jpg
+
[[File:chessBoard008.jpg|400px]][[File:image008-corners-7x7.jpg|400px]]
File:chessBoard007.jpg
+
[[File:chessBoard009.jpg|400px]][[File:image009-corners-7x7.jpg|400px]]
File:chessBoard008.jpg
+
[[File:chessBoard010.jpg|400px]][[File:image010-corners-6x7.jpg|400px]]
File:chessBoard009.jpg
+
[[File:chessBoard011.jpg|400px]][[File:image011-corners-7x7.jpg|400px]]
File:chessBoard010.jpg
+
[[File:chessBoard012.jpg|400px]][[File:image012-corners-4x6.jpg|400px]]
File:chessBoard011.jpg
+
[[File:chessBoard013.jpg|400px]][[File:image013-corners-5x7.jpg|400px]]
File:chessBoard012.jpg
 
File:chessBoard013.jpg
 
</gallery>
 
==== Chessboard Corners detected by OpenCV ====
 
[[File:image001-corners-7x7.jpg|400px]][[File:image002-corners-5x5.jpg|400px]][[File:image003-corners-4x5.jpg|400px]][[File:image004-corners-7x7.jpg|400px]][[File:image005-corners-5x5.jpg|400px]][[File:image006-corners-5x5.jpg|400px]][[File:image007-corners-5x5.jpg|400px]][[File:image008-corners-7x7.jpg|400px]][[File:image009-corners-7x7.jpg|400px]][[File:image010-corners-6x7.jpg|400px]][[File:image011-corners-7x7.jpg|400px]][[File:image012-corners-4x6.jpg|400px]][[File:image013-corners-5x7.jpg|400px]]
 

Revision as of 08:00, 1 December 2019

Source Code

see class BoardFinder in module boardfinder tests are in the: test_BoardFinder module

Algorithm

Finding the chessboard

OpenCV has a function findChessboardCorners which is usually used for camera calibration and not really intended for the use case of "real chessboards".

Still it is very helpful and uses as a basis for the BoardFinder.

Examples

see testMedia source folder ChessBoard001.jpgImage001-corners-7x7.jpg ChessBoard002.jpgImage002-corners-5x5.jpg ChessBoard003.jpgImage003-corners-4x5.jpg ChessBoard004.jpgImage004-corners-7x7.jpg ChessBoard005.jpgImage005-corners-5x5.jpg ChessBoard006.jpgImage006-corners-5x5.jpg ChessBoard007.jpgImage007-corners-5x5.jpg ChessBoard008.jpgImage008-corners-7x7.jpg ChessBoard009.jpgImage009-corners-7x7.jpg ChessBoard010.jpgImage010-corners-6x7.jpg ChessBoard011.jpgImage011-corners-7x7.jpg ChessBoard012.jpgImage012-corners-4x6.jpg ChessBoard013.jpgImage013-corners-5x7.jpg