Using OpenCV and HOG to scan chess diagrams

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using OpenCV and HOG to scan chess diagrams

opencv-users mailing list
Hi,
 I am very new to computer vision and OpenCV. I have been experimenting with using OpenCV to scan chess diagrams. The program is supposed to scan the diagram and generate Forsyth-Edwards Notation (FEN), which is simply a string describing a board position in a chess game. However, the accuracy in identifying the pieces on the diagram is unimpressive (often mistaking the color of the piece ie a black pawn for a white pawn). I am hoping to get some pointers to improve the accuracy of the program. Currently, the program is able to crop out the background of the diagram and segment the board into individual squares. The program is fairly accurate in determining whether a square is empty or occupied by a piece, but identifying the type (pawn, knight, bishop, rook, queen or king) and color (black or white) of the piece is less accurate (perhaps 70-80% accurate).
 

 I have tried both the SVM and KNeighbors Classifiers from sklearn. I have been using Histogram of Oriented Gradients (HOG) as the feature descriptor. I have trained the classifiers with 1100 images of squares (both empty, and occupied by various pieces). I would greatly appreciate it if anyone could provide suggestions for improving the accuracy of the identification of the chess pieces.
 

 Thanks,
 Eugene Tsai
 

 

 
Reply | Threaded
Open this post in threaded view
|

Re:[OpenCV] Using OpenCV and HOG to scan chess diagrams

opencv-users mailing list
 

The paramters of svm are the key to this problem.



发自我的小米手机
在 "[hidden email] [OpenCV]" <[hidden email]>,2015年6月16日 上午9:50写道:

 

Hi,

I am very new to computer vision and OpenCV. I have been experimenting with using OpenCV to scan chess diagrams. The program is supposed to scan the diagram and generate Forsyth-Edwards Notation (FEN), which is simply a string describing a board position in a chess game. However, the accuracy in identifying the pieces on the diagram is unimpressive (often mistaking the color of the piece ie a black pawn for a white pawn). I am hoping to get some pointers to improve the accuracy of the program. Currently, the program is able to crop out the background of the diagram and segment the board into individual squares. The program is fairly accurate in determining whether a square is empty or occupied by a piece, but identifying the type (pawn, knight, bishop, rook, queen or king) and color (black or white) of the piece is less accurate (perhaps 70-80% accurate).


I have tried both the SVM and KNeighbors Classifiers from sklearn. I have been using Histogram of Oriented Gradients (HOG) as the feature descriptor. I have trained the classifiers with 1100 images of squares (both empty, and occupied by various pieces). I would greatly appreciate it if anyone could provide suggestions for improving the accuracy of the identification of the chess pieces.


Thanks,

Eugene Tsai



 

__._,_.___

Posted by: =?UTF-8?B?55m95Zu96Iej?= <[hidden email]>
Reply via web post [hidden email] [hidden email] Start a New Topic Messages in this topic (2)
Change settings: http://www.yahoogroups.com/mygroups, select
   Get Emails (get all posts)
   Daily Digest (one summary email per day)
   Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]

.

__,_._,___
Reply | Threaded
Open this post in threaded view
|

Re: Using OpenCV and HOG to scan chess diagrams

opencv-users mailing list
In reply to this post by opencv-users mailing list
Hi,

the project looks great!

Have you tried to rely more on the empty/occupied squares? Given the
initial state then you could predict the pieces that moved.
However, if you want to do a pure cv algorithm maybe adding a second camera
you improve the results like in this project.
https://www.youtube.com/watch?v=xi09-0qQ-jk


Edgar

*EDGAR RIBA*

On 16 June 2015 at 03:50, [hidden email] [OpenCV] <
[hidden email]> wrote:

>
>
> Hi,
>
> I am very new to computer vision and OpenCV. I have been experimenting
> with using OpenCV to scan chess diagrams. The program is supposed to scan
> the diagram and generate Forsyth-Edwards Notation (FEN), which is simply a
> string describing a board position in a chess game. However, the accuracy
> in identifying the pieces on the diagram is unimpressive (often mistaking
> the color of the piece ie a black pawn for a white pawn). I am hoping to
> get some pointers to improve the accuracy of the program. Currently, the
> program is able to crop out the background of the diagram and segment the
> board into individual squares. The program is fairly accurate in
> determining whether a square is empty or occupied by a piece, but
> identifying the type (pawn, knight, bishop, rook, queen or king) and color
> (black or white) of the piece is less accurate (perhaps 70-80% accurate).
>
>
> I have tried both the SVM and KNeighbors Classifiers from sklearn. I have
> been using Histogram of Oriented Gradients (HOG) as the feature descriptor.
> I have trained the classifiers with 1100 images of squares (both empty, and
> occupied by various pieces). I would greatly appreciate it if anyone could
> provide suggestions for improving the accuracy of the identification of the
> chess pieces.
>
>
> Thanks,
>
> Eugene Tsai
>
>
>
>
>
>  
>
Reply | Threaded
Open this post in threaded view
|

Re: Using OpenCV and HOG to scan chess diagrams

opencv-users mailing list
Thanks for the video. My project is less ambitious... I am taking pictures of chess diagrams in books or magazines like....  http://www.gilith.com/chess/diagrams/images/rnbqkbnr_pppppppp_8_8_8_8_PPPPPPPP_RNBQKBNR.png http://www.gilith.com/chess/diagrams/images/rnbqkbnr_pppppppp_8_8_8_8_PPPPPPPP_RNBQKBNR.png 
 
 http://www.gilith.com/chess/diagrams/images/rnbqkbnr_pppppppp_8_8_8_8_PPPPPPPP_RNBQKBNR.png 
 
 http://www.gilith.com/chess/diagrams/images/rnbqkbnr_ppp... http://www.gilith.com/chess/diagrams/images/rnbqkbnr_pppppppp_8_8_8_8_PPPPPPPP_RNBQKBNR.png 
 
 
 View on www.gilith.com http://www.gilith.com/chess/diagrams/images/rnbqkbnr_pppppppp_8_8_8_8_PPPPPPPP_RNBQKBNR.png 
 Preview by Yahoo
 
 
 
to generate notation that is compatible with a chess engine. Since a black piece has a similar shape to its white counterpart, will their corresponding HOG histograms be similar as well? Do I need to include additional information to distinguish a white versus a black piece?
 

 Thanks,
 Eugene