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

Too many values to unpack? #31

Open
ghost opened this issue Feb 23, 2018 · 1 comment
Open

Too many values to unpack? #31

ghost opened this issue Feb 23, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 23, 2018

> sudo python2 sudoku.py /home/jokerowaty/SnapSudoku/test/test1.jpg
> Image loaded.
> Preprocessing... done.
> Cropping out Sudoku... done.
> Straightening image...
> Traceback (most recent call last):
>   File "sudoku.py", line 42, in <module>
>     snap_sudoku(image_path=sys.argv[1])
>   File "sudoku.py", line 32, in snap_sudoku
>     grid = ''.join(cell for cell in get_cells(image_path))
>   File "sudoku.py", line 32, in <genexpr>
>     grid = ''.join(cell for cell in get_cells(image_path))
>   File "sudoku.py", line 23, in get_cells
>     for row in Extractor(os.path.abspath(image_path)).cells:
>   File "/home/jokerowaty/SnapSudoku/scripts/sudokuExtractor.py", line 22, in __init__
>     sudoku = self.straighten(sudoku)
>   File "/home/jokerowaty/SnapSudoku/scripts/sudokuExtractor.py", line 50, in straighten
>     largest = self.helpers.largest4SideContour(sudoku.copy())
>   File "/home/jokerowaty/SnapSudoku/scripts/helpers.py", line 53, in largest4SideContour
>     image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
> ValueError: too many values to unpack

Any ideas? opencv2 installed, numpy installed. Python2.7.14+

@BSatyaKishore
Copy link

You're using openCV v3, please update the 49th line in scripts/helpers.py to
_, contours, h = cv2.findContours(

And it will work.

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

No branches or pull requests

1 participant