I am working on a project [ Creating an AI for playing chess ] in which I have to capture the whole screen or a particular window in real time. I saw a question in stack exchange about taking fast screenshots using X11 and using it in OpenCV QUESTION to display those screen shots. Unknowingly I started the project and now I am having a problem using at method to access pixels of the image captured.
Here's what I have to do:
- Capture the image of the screen [ Image of a chess board ]
- Break it into equal parts and detect the position of the chess pieces.
- Store these positions and puttext on the image captured and display it on the screen. [For detection purpose I have the images of the chess pieces which I cropped from the chess board. Each one of the chess piece have a size of 4747 pixels. Similarly the chessboard has a size of 474788 ]
Is there any way I can detect these chess pieces?
Links of the source files [ C++ ] : maya.cpp pieces.cpp pieces.h
Thanks in advance!