Skip to content

Latest commit

 

History

History
72 lines (47 loc) · 1.73 KB

README.md

File metadata and controls

72 lines (47 loc) · 1.73 KB

Go Chessboard and Piece Recognition API

This is a REST API project built using C++, OpenCV and Crow framework.

It is able to detect the Go chessboard and its game composition.

The API accepts a Base64-encoded image input, then returns the color and the relative [x,y] position of Go chess pieces on the chessboard.

Installation

  1. Clone the repository:
https://github.com/heihei4c/goChessDetect.git
  1. Install the necessary dependencies using vcpkg:
vcpkg install opencv
vcpkg install crow
vcpkg integrate install
  1. Build and run the API in Visual Studio

Usage

The API listens on https by default. To send a request to the API, you can use a tool such as curl or Postman:

curl -X POST https://localhost/goChessDetectAPI -H "Content-Type: text/plain" --data "${BASE64_IMAGE_DATA}"

Replace BASE64_IMAGE_DATA with the Base64-encoded image data you wish to send.

The API will respond with a JSON object containing an lis of a boolean variable (isBlack) and 2 integer variables (xPos, yPos):

[
    {
      "isBlack": true,
      "xPos": 8,
      "yPos": 9
    },
    ...
    {
      "isBlack": false,
      "xPos": 2,
      "yPos": 6
    },
]

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

This project was built using the following libraries: