SudokuSolver Forum

A forum for Sudoku enthusiasts to share puzzles, techniques and software
It is currently Thu Mar 28, 2024 9:06 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: SudokuGrabber
PostPosted: Sun Mar 25, 2012 1:13 pm 
Offline
Site Admin

Joined: Sun Apr 13, 2008 1:50 pm
Posts: 191
Location: London
For those that might be interested, I've been working on a Sudoku Grabber program to extract puzzle definitions from images.

I started this on the basis that most Futoshiki puzzles (which I have just about finished building in SudokuSolver) only seem to exist in image format or proprietary programs.

I attach a short video to show the kind of functionality I'm building. Fairly basic - load a graphics file (BMP, JPG, TIF; PNG), or paste from clipboard or grab from the screen. Scroll and select the puzzle area of the scanned image and then extract the definition.

It's currently working for standard puzzles and both "boxed" Futoshiki and also those with the greater/less built into standard cell borders.

I'd welcome any thoughts and comments before I complete a first version for release.

http://www.rcbroughton.co.uk/sudoku/forum/files/SudokuGrabber.swf

Rgds
Richard


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Mar 29, 2012 9:44 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
Looks interesting! I'm looking forward to seeing it.


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Apr 05, 2012 3:34 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Tue Aug 05, 2008 11:43 am
Posts: 251
This is indeed interesting and useful :applause: . Sudoku Monkey has had limitations despite being very useful.

The ability to Manually select/manipulate the focus window is MOST useful

This is also an opportunity to say well done for your recent SudokuSolver update & your continued support of this Forum :applause: .

Tarek


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Jun 14, 2012 3:33 am 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
Any updates on this project? Will you at some point include multi-grid puzzles?


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Jun 14, 2012 12:30 pm 
Offline
Site Admin

Joined: Sun Apr 13, 2008 1:50 pm
Posts: 191
Location: London
Hi -

Enxio wrote:
Any updates on this project?

here's a WIP version: http://www.rcbroughton.co.uk/sudoku/SudokuGrabber.msi

still a lot of bugs and issues to iron out.

It particularly doesn't like those Ninja grids - struggles with the double border around the cells, which I will need to try to figure out. Hopefully, you'd be able to train it to understand the underlined digits.

Quote:
Will you at some point include multi-grid puzzles?

Sadly, no, it won't. There are too many possibilities for me to get my head around! Being able to select different parts of the source image is the only way to isolate the individual grids.

Rgds
Richard


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Jun 14, 2012 2:23 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
rcbroughton wrote:
here's a WIP version:


Thanks so much! Can you give a brief set of instructions? The flash movie that you posted at the top of the thread goes too fast, and it's for an older version.

Quote:
Quote:
Will you at some point include multi-grid puzzles?

Being able to select different parts of the source image is the only way to isolate the individual grids.

I can deal with that if I don't have to crop each grid into a separate image file first. So far, though, I just haven't been able to figure out how to zoom in on just one grid.


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Jun 14, 2012 4:14 pm 
Offline
Site Admin

Joined: Sun Apr 13, 2008 1:50 pm
Posts: 191
Location: London
enxio27 wrote:
Can you give a brief set of instructions?

Sure - haven't got around to a help file, as it is still very much an alpha Work In Progress

First thing is to get the grid image into the left hand window.
1) "Load" will pop up a file dialog to load an image file
2) "Paste" or Ctrl-V will paste an image from the clipboard
3) Drag and drop an image file
4) Click "Grab" - this will minimise the window and show a transparent selector window. Move and Resize this to contain an on-screen image and click the little tick mark (or press Enter).

With an image in the left window you can move it around with Left-Mouse and drag, and you can rotate left/right with the little arrow buttons. If the image is more than just a single grid, you can select the grid area using Right-Mouse and drag which will draw out a rectangular lasso (it will scroll the image if needed and you can start at any corner of the image). With a region highlighted, click "Crop" to get the area selected, zoomed and centred. If you got it wrong, click "Reset" to revert to the original image.

If it's a nice image, you can just go ahead and click "Interpret" and you should get the puzzle string in bottom right text box.

The options on the right panel control whether you're trying to read a Futoshiki or a standard Sudoku grid. Mainly they're there for me to play around with to try to optimise the selection process where the program tries to convert the image into numbers. It does this by converting to Black and White, doing some Edge Detection and then trying to work out where the cell borders are.

After pressing "Interpret" - you can take a look to see where it thinks the cells are by clicking "Cells" and you can take a look at how it has converted to black and white by clicking "Show". Again - this is mainly for me to play around with to see what's going on in the background and will probably be removed in the final version.

The program will then take each found cell and try to do a character match on it. If the character interpretation is wrong - assuming the grid ha been correctly identified - you can "Train" the program on the incorrect characters. This pops up a window showing on the left all the "Reference" images I use for character matching and on the right the "Detected" images. You can then persuade the program what the actual "Detected" images should have been interpreted as. Save the Training and you can go back and try to "Interpret" again.

Rgds
Richard


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Jun 14, 2012 4:35 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
Cool!! Thanks! I'm hoping this is going to save me some work over using SudokuOCR. That one is great for single, standard-grid puzzles, but it's a total pain to have to make a separate image file for each grid in a multi-grid puzzle in order for it to work.


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Thu Jun 14, 2012 4:46 pm 
Offline
Site Admin

Joined: Sun Apr 13, 2008 1:50 pm
Posts: 191
Location: London
enxio27 wrote:
Cool!! Thanks! I'm hoping this is going to save me some work over using SudokuOCR. That one is great for single, standard-grid puzzles, but it's a total pain to have to make a separate image file for each grid in a multi-grid puzzle in order for it to work.

send me an example of the image you want to process - and I'll check it out to see how it works


Top
 Profile  
Reply with quote  
 Post subject: Re: SudokuGrabber
PostPosted: Fri Jun 15, 2012 2:17 am 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
rcbroughton wrote:
send me an example of the image you want to process - and I'll check it out to see how it works

My apologies--perhaps I was unclear. It's not Sudoku Grabber I was finding tedious, it was Sadman's SudokuOCR, although the latter is certainly an improvement over entering puzzles by hand!

Your Sudoku Grabber is SOOOOO AMAZING!! I assume that it will work from a PDF image, or even on a Web site? Can it interpret jigsaw, greater-than/less-than, odd-even, etc., or does that part have to be done manually?

I LOVE it that I don't have to save each grid of a multi-grid puzzle as a separate file before I can process them. It remembers the crop size from one grid to the next. And the OCR training function is simply phenomenal!

If you could get it to do a multi-grid in one pass (perhaps with user input as to number and arrangement of grids), I would be over the moon! Even standard Samurai would be very helpful.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group