Coder Social home page Coder Social logo

chinese-chess's Introduction

Chinese Chess Recognition

To solve this problem, the first step is to identify the beginning point and the end point of the pieces movement. The second step is to crop a square image on the begin/end point and pass it to convolutional neural network (CNN) to do the chess pieces classification. Flow Chart

Test Video

Usage

  • CNN_Classification_Model contains the codes I used to train the classification model, it is ok to use the .h5 model named new_model_v2.h5 in the h5_file.
  • Dataset contains the dataset I made by taking pictures by Phone and using HoughCircle to roughly extract some chess pieces from the picture.
  • The .h5 file model works for those images in the Dataset with nearly 100% accuracy, if it is used to detect other kinds of test image with different light intensity or different size, the accuracy may get lower.
  • Temporary_Model and Test_Image are two necessary directory used in the codes.
  • AdjustCameraLocation.py is used to adjust the camera to maximize the area of the chess board in the picture.
  • real_time_test.py is the main function of this project.

Notes

  • The training data in Dataset/train lost some images because of some unknown reasons, if you need to re-train you model, you can generate more data by yourself or just move some data from valid to train :).
  • The location of the phone need to be right over the chess board, it is very hard to fix it (I used the mobile phone holder like this). So I provide a video named test.avi in the Sources directory. If you want to do the real time test, you need to change the code in line 240, real_time_test.py.

Test on iPad

IMG1 IMG2

Reference

[1] https://github.com/itlwei/Chess
[2] https://github.com/evanchien/chinese_chess_recognition

chinese-chess's People

Contributors

zhwuer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.