Top Banner
Chess Playing Bot
14

Chess Playing Bot. Detecting Green coloured squares using Blobs.

Jan 13, 2016

Download

Documents

Jessie Potter
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chess Playing Bot. Detecting Green coloured squares using Blobs.

Chess Playing Bot

Page 2: Chess Playing Bot. Detecting Green coloured squares using Blobs.
Page 3: Chess Playing Bot. Detecting Green coloured squares using Blobs.

Detecting Green coloured squares using Blobs

Page 4: Chess Playing Bot. Detecting Green coloured squares using Blobs.

Detecting white coloured squaresUsing these two images, centroids of each square are

computed and stored

Page 5: Chess Playing Bot. Detecting Green coloured squares using Blobs.

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 1 1

0 0 1 1

0 0 1 1

0 0 1 1

0 0 1 1

0 0 1 1

0 0 1 1

0 0 1 1

Detecting which positions are occupied by black pieces

Page 6: Chess Playing Bot. Detecting Green coloured squares using Blobs.

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

10

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0

Detecting which positions are occupied by black pieces after making a move

Page 7: Chess Playing Bot. Detecting Green coloured squares using Blobs.

1

-1

Subtracting the two configurations gives us the move->-1 =initial position and 1=final position

Page 8: Chess Playing Bot. Detecting Green coloured squares using Blobs.

Initial configuration of board, printed by program

Final configuration of board, printed by program

Page 9: Chess Playing Bot. Detecting Green coloured squares using Blobs.

• After Detecting the move of the human, it is sent to the chess playing algorithm which then calculates a move and prints it as its output

• User’s move is written in a file from where the algorithm reads it and

• Outputs its move in a different file from where our algorithm reads and passes it to the bot to execute

• This move is then executed by the bot

Calculating The Move

Page 10: Chess Playing Bot. Detecting Green coloured squares using Blobs.

ALGORITHM

Executing the move using the Robot

Calculating best possible move using chess playing program

Detecting the Move of human

Page 11: Chess Playing Bot. Detecting Green coloured squares using Blobs.

• The bot communicates with the PC with the help of an IR tower which we were able to run on windows7 (32 bit)

• To program the bot using a software called BricxCC which uses a gcc-H8 cross compiler to compile C++ files and transfer them to the bot to execute.

Page 12: Chess Playing Bot. Detecting Green coloured squares using Blobs.

• Even though we succeeded in communicating with the RCX module, we were unable to fully control the arm because we weren't able to calculate the angles through which the motors should be rotated to pick up the pieces.

Page 13: Chess Playing Bot. Detecting Green coloured squares using Blobs.

The Camera

Our Bot

Page 14: Chess Playing Bot. Detecting Green coloured squares using Blobs.