Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to take a picture of a sudoku board and convert into into a board object #1

Open
Zambrella opened this issue Nov 15, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Zambrella
Copy link
Collaborator

The format of the data can be whatever is easiest. We can convert it on a board of object from a JSON file or list of numbers or w/e.

@Zambrella Zambrella added the enhancement New feature or request label Nov 15, 2020
@joeyda3rd
Copy link
Contributor

joeyda3rd commented Nov 25, 2020

I'm thinking we can generally follow this example in Python. https://medium.com/swlh/how-to-solve-sudoku-using-artificial-intelligence-8d5d3841b872
We can't follow it directly because OpenCV doesn't have the same functionality in the only available Flutter package https://pub.dev/packages/opencv, so we may need to find another package or extend the opencv one to include their findcontours() method. https://docs.opencv.org/4.5.0/d3/dc0/group__imgproc__shape.html#gadf1ad6a0b82947fa1fe3c3d497f260e0

There is one package that does have shape detection support for rectangles that @Goober0329 pointed out https://pub.dev/packages/image_feature_detector

Besides that, I think the only other option unless someone can find an on-device method for detecting the sudoku puzzle or we go a different route altogether, is to create a serverless function with some faas service to upload the image to and do the work and pass back the answer. There is obviously operating costs involved in that method, so hopefully we can avoid that at this stage.

@slovnicki or @Zambrella if you wanted to follow along here, take a look at those packages above and see if either the opencv can be extended and we can use the opencv method in the python version or if that image_feature_detector will do the trick or maybe there's a way to make it work with both packages.

I've branched main and creating an image capture and/or upload feature to the current version of the app, I'll push the branch when that's done and we can start on the grid recognition and digit recognition to get our board object. @slovnicki if you have an implementation of image upload or image capture with preview, I'd love to get a look at your work. I'm building one with image_picker package with a snapshot preview from video_player package.

@Zambrella
Copy link
Collaborator Author

I don't have the bandwidth at the moment to take this journey with you, but I look forward to the outcome!

@slovnicki
Copy link
Contributor

I don't have an implementation of image upload, never have done something like that.
I'll take a look at those opencv and image_feature_detector packages during this week. Also, compare it to that python project to see what can be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants