2

i am working on an Android app that will recognize a GO board and create a SGF file of it.

i need to detect the whole board in order to warp it and to be able to find the correct lines and stones like below.

filledboard
(source: eightytwo.axc.nl)

right now i use an Opencv RGB Mat and do the following:

  • separate the channels
  • canny the separate channels

    Imgproc.Canny(channel, temp_canny, 30, 100);
    
  • combine (bitwise OR) all channels.

    Core.bitwise_or(temp_canny, canny, canny);
    
  • find the board contour

Still i am not able to detect the board consistently as some lines tend to disappear as you can see in the picture below, black lines on the board and stones are clearly visible but the board edge is missing at some places.

filledboard
(source: eightytwo.axc.nl)

how can i improve this detection? or should i implement multiple ways of detecting it and switching between them when one fails..

* Important to keep in mind *

  • go boards vary in color
  • go boards can be empty or completely filled with stones
    this implies i can't rely on detecting the outer black line on the board
  • backgrounds are not always plain white

this is a small collection of pictures with go boards i would like to detect

* Update * 23-05-2016

I kinda ran out of inspiration using opencv to solve this, so new inspiration is much appreciated!!! In the meantime i started using machine learning, first results are nice and i'll keep you posted but still having high hopes creating a opencv implementation.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
MaMiFreak
  • 789
  • 2
  • 11
  • 26
  • If I understood properly, you want to detect *only* the outer boundaries of the board, right? If not, and you want to detect everything, the question would become too broad and much more complicated. – Imanol Luengo May 23 '16 at 07:32
  • the goal is to detect the position of all black and white stones on the board. One way is: detect the exact board corners, warp the board to a square and then detect the stones. The second step is quite easy(first image in my question shows a working detection algorithm for that) – MaMiFreak May 23 '16 at 12:25
  • @MaMiFreak do you still have the database? The link is not active anymore. Did you manage to solve the problem? – DavidS1992 Mar 24 '20 at 09:39
  • @DavidS1992 what database are you talking about? i only have a few images of go boards – MaMiFreak Apr 13 '20 at 20:49
  • @DavidS1992 I have made a lot of progress, i have a working app that demonstrates my current solution (trained with 2d data). unfortunately it involves getting a 3d model and rendering a lot of realistic images and i have some troubles finding somebody to help me with that. With a bit of luck i will soon be able to put up a small job offer to get some models and setup the automated randomized renderings – MaMiFreak Apr 13 '20 at 20:57
  • @MaMiFreak I was thinking maybe you have some database if you are working on it – DavidS1992 Apr 14 '20 at 08:31
  • Ah no, that is exactly what i am working on now. To generate a dataset with labeled images using a 3d model. – MaMiFreak Apr 14 '20 at 17:15

1 Answers1

1

I'm working on the same problem!

My approach is to assume two things:

  1. The camera is steady
  2. The board is steady

That allows me to deduce the warping parameters from a single frame when the board is still empty (before playing). Use these parameters to warp every frame, no matter how many stones are occluding the board edges.

  • Thank you for the suggestion! I am working on an adroid app and my goal is to be able to detect it at any time during a game. dropped openCV implementation and went with machine learning, currently compiling a good dataset but the results with a small set already look promising: http://stackoverflow.com/questions/35410997/opencv-different-approach-on-detecting-go-board/35417145?noredirect=1#comment59488984_35417145 (Last edit) – MaMiFreak Nov 15 '16 at 11:04