Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
SnapSudoku
-
I presume you know that Google Goggles does this now. Of course having it in Pythonista running locally would be very nice.
-
I loved Peter Norvig's section on Why?... especially the quote that Sudoku is "a denial of service attack on human intellect"!!
@Webmaster4o Yes. Section 8.4 Optical Character Recognition starting on pg. 228 of the book you mention above seems to be very applicable but as you say, it requires SciPy which Pythonista does not currently support. Would there be a way to OCR a Sudoku puzzle on the current Pythonista i.e. without OpenCV and SciPy.
@wradcliffe I am not an expert on this but I do not believe that Apple will allow Pythonista to access a third party shared library. I would love to be proven wrong but I believe the shared library would need to be signed with the same digital signature as Pythonista.
@ihf I did not know that Google Goggles did this. It is still a cool challenge.
-
@ccc - you may be right but at least we can agree that this is just a decision that Apple can make now as part of the deployment process through the App store. By opening up the discussion again - I was hoping that @omz could share what he has learned recently that may change the picture. I think that @omz has formally sanctioned using PythonistaKit framework outside of the template indicates he is thinking of providing it as its own 3rd party shared library at some point. Maybe soon!
-
You could use PIL and a Nueral Network to read the sudoku ad solve it. The problem would be making a nureal network with out using a libaray that uses c code. And also then there is the actual solving.
-
From what I have read the solving is the easy part.,a lot of Python code out there for this. Seems the problematic thing is converting a pic/photo into a sudoku puzzle grid with the entries. That's the challenge
-
Could this library potentially help?
I know it is in ObjC however converting it to Python doesn't look to difficult.
It would only provide the points, however writing an algorithm to determine where those points are and what they represent shouldn't be too difficult. -
Note that I've written maze-cv, an app that scans and solves mazes.
The code for recognizing box-shaped objects is probably applicable to the soduku application (though maze-cv requires big red markers on the corners)
maze-cv
includes code for perspective transformations using PIL and numpy that works in Pyyhonista. It also has code for thresholding and segmenting the resulting image. So it really implements everything besides the OCR on individual characters, which I think there are objective c libraries for rendering.Anyway, that's probably useful code, especially since it was all written for Pythonista.
-
SnapSudoku now uses the Norvig code to solve the Sudoku puzzle. Now we need a version that works on Pythonista. @Webmaster4o can you work your magic like you did with maze-cv or @omz can we get OpenCV or SciPy in Pythonista?
-
I am working on a simple Nuertal Network for reading numbers to help with this project. If you can break the image into the boxes I can read the number in each one.
-
http://sudokugrab.blogspot.com/2009/07/how-does-it-all-work.html
has a good summary of puzzle detection algorothms, and some refernces on number recognition. -
Looks like some of the stuff in PCV will run with just
matplotlib
andnumpy
, not sure how much though.