3

Hi everyone i have a problem of being able to identify numbers in an image using netlogo programming, Please any ideas or techniques on how to be able to identify numbers in a cell? I am making a sudoku game using netlogo coding. First i need to import an image into the screen and be able to setup the image.

I need to be able to use the image(s) to generate random sudoku puzzles without any repetitions. But first to make the sudoku game i have to be able to use the numbers from the image.

I have got this code so far

to setup
    clear-all
    import-pcolors "s1.png"
    reset-ticks
end

to go
    ask patches with [pcolor != black]
    [ set pcolor white ]
end

Please i need a simple algorithm for recognizing numbers in sudoku netlogo

girish946
  • 745
  • 9
  • 24

3 Answers3

1

It seems like what you are asking is how to do OCR (optical character recognition) in NetLogo.

This is not something that NetLogo does "out of the box", and as far as I know, there is currently no NetLogo extension that does that either.

And no, there is no "simple algorithm for recognising numbers" that you can just copy-paste in your NetLogo code.

So what can you do?

In theory, you could write a new NetLogo extension that interfaces with an existing OCR package, but that's not a trivial task.

You could also ask the NetLogo users group if anyone has ever tried to do that before. Maybe someone there will have more insight for you.

Nicolas Payette
  • 14,847
  • 1
  • 27
  • 37
0

If I were doing this I would do 10 breads of turtles with shapes "0".."9". So I would not have to recognize numbers but simply recognize breed of turtles.

Ivan Sopov
  • 2,300
  • 4
  • 21
  • 39
  • 10 breeds of turtles with shapes 0..9. But how would it work with the sudoku image. and how would i be able to form a generated sudoku using this method – Mr Anderson Dec 04 '12 at 14:06
0

You could try and build the pattern recognition within NetLogo, provided your individual Sudoku cells have a decent resolution (say at least 9x9 patches). Then match each cell to a predefined 9x9 patch pattern representing each of the 9 digits. Save your result as the 9 different breeds of turtles.

(I have not tried this myself)