kochsebastian / ChessVisionBot

Chessbot using computer vision to play on any chess website
GNU General Public License v3.0
43 stars 22 forks source link

ValueError: not enough values to unpack (expected 3, got 2) #7

Closed nirmalveer closed 4 years ago

nirmalveer commented 4 years ago

Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\LiveL\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__ return self.func(*args) File "C:/Users/LiveL/Desktop/ChessVisionBot-master/code/main.py", line 59, in start_playing found_chessboard, position = chessboard_detection.find_chessboard() File "C:\Users\LiveL\Desktop\ChessVisionBot-master\code\chessboard_detection.py", line 72, in find_chessboard is_found, current_chessboard_image,minX,minY,maxX,maxY,test_image = find_chessboard_from_image(img) File "C:\Users\LiveL\Desktop\ChessVisionBot-master\code\chessboard_detection.py", line 109, in find_chessboard_from_image bin, contours, _hierarchy = cv2.findContours(bin, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) ValueError: not enough values to unpack (expected 3, got 2)

nirmalveer commented 4 years ago

Should I change the code or downgrade opencv?

kochsebastian commented 4 years ago

What opencv version are you using?

nirmalveer commented 4 years ago

opencv-contrib-python-headless 4.2.0.34

kochsebastian commented 4 years ago

As you can see in requirements.txt or environment.yml I was using opencv 3.4. Maybe there was a change in the findContours() function you are free to change the code and stay with opencv 4.2 but there maybe other versioning problems then

nirmalveer commented 4 years ago

Do you have a discord where I can directly chat with you? I have a few more questions

kochsebastian commented 4 years ago

I won't hold your hand while you set this project especially not with these easy questions. Try to learn to read error messages and you can fix problems by yourself