Clone this wiki locally
Trying to catch board background by filtering image for range of black and white colors of the borad. To do that instead of patter recognition we are clearing all colors from screen not in hardcoded range (you have to fix source code if for OS/game have different gamma settings)
function BufferedImage filterMask(Image img) at
Simplify and remove noise from screen.
function BufferedImage filterNoise(BufferedImage bi) at
Result board match (calculed by medium points load in each horisontal and vertical lines). I choised optimal values between 10 and 100.
function Rectangle getBounds(BufferedImage bi) at
Capture full table image, we need only capture and recognize part of the screen to save CPU time.
Next step is to create puzzle map (devide all by 8 and 8).
constructor public Recognition() at
Estimate average color in each puzzle.
function int getMatrix() at
And detect image type.
function String getType(int rgb) at
Next step is to make optimal move.