Slovodel is a Russian version of the well-known Scrabble game. In brief, the rules are as follows. Each participant has 7 letters during his turn, his goal is to make up a word that would give as many points as possible. Rare letters give more points, intersection with the coloured cells give extra points - with the green ones points for the letter are doubled, with the yellow ones points for the letter are tripled, with the blue ones points for the word are doubled, with the red ones points for the word are tripled.
This repository presents the module which automatically recognizes letters, their position on the board and the colour of the cells where the words are situated. All these steps can be combined to calculate the final score of the proposed word automatically.
There are two main parts in the solution.
- Detect four corner points to transform the picture
- Warp the picture
- Detect the center of the board cells
- Define masks and center of contours
- Combine masks centers' and cells centers' to define the colour of each cell
- Warp the picture
- Detect letters contours' with OpenCV function minAreaRect
- Predict letters with the pretrained Cyrillic Alphabet Classifier
- Combine cell centers with the predicted letters to understand at what cell of the board you're situated
- Iterate over the horizontal and vertical rows to detect the whole word
- Intersect colour grid and letters grid to predict the final score