bijection / sistine

Turn a MacBook into a Touchscreen with $1 of Hardware
https://www.anishathalye.com/2018/04/03/macbook-touchscreen/
MIT License
3.25k stars 192 forks source link

Sistine.py in crash when I run it #12

Open LolloMazzy opened 5 years ago

LolloMazzy commented 5 years ago

I run with the command python2 sistine.py but the window with the picture of webcam, remains open for only 2 seconds. In the terminal i can see this message: Traceback (most recent call last): File "sistine.py", line 397, in <module> main() File "sistine.py", line 383, in main if not currStage(segmented, debugframe, options, ticks, drawframe, calib, state): File "sistine.py", line 223, in _calibration x, y, touch = find(segmented, debugframe=drawframe, options=options) File "sistine.py", line 152, in find _, cnts, _ = cv2.findContours(segmented_image.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) ValueError: need more than 2 values to unpack

bijection commented 5 years ago

Which version of OpenCV do you have?

LolloMazzy commented 5 years ago

OpenCV 3 I have follow the instructions

LolloMazzy commented 5 years ago

Can you help me ?

ashok2ashok commented 5 years ago

I have a similar issue. Followed instructs in readme and when I run sistine.py, getting a ValueError. I'm running MacOS Mojave v10.14.5.


$ python2 sistine.py  
Traceback (most recent call last):  
  File "sistine.py", line 397, in <module>  
    main()  
  File "sistine.py", line 383, in main  
    if not currStage(segmented, debugframe, options, ticks, drawframe, calib, state):  
  File "sistine.py", line 223, in _calibration  
    x, y, touch = find(segmented, debugframe=drawframe, options=options)  
  File "sistine.py", line 152, in find  
    _, cnts, _ = cv2.findContours(segmented_image.copy(), cv2.RETR_EXTERNAL,   cv2.CHAIN_APPROX_SIMPLE)  
ValueError: need more than 2 values to unpack 
mark0425luke commented 5 years ago

I've tried to change line152 to something like the below, and the sistine.py did not shut down

( cnts, _ )= cv2.findContours(segmented_image.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

void-robotics commented 4 years ago

This worked for me too.