opencv python没有足够的值来解包

2024-05-15 23:05:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我想做一个手势控制的智能镜子。但是当我试着运行test.py时,相机打开了一秒钟,然后突然关上了。这是我得到的输出

DEBUG:asyncio:Using selector: SelectSelector
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "test.py", line 85, in ManageMotion
    gesture = motion.GetGesture()
  File "C:\Users\admin\Desktop\SmartMirror\Motion\motion.py", line 192, in GetGesture
    self.TryToTrackHand()
  File "C:\Users\admin\Desktop\SmartMirror\Motion\motion.py", line 116, in TryToTrackHand
    foundPalm = search_hand.SearchPalmFromMask(search_hand_mask)
  File "C:\Users\admin\Desktop\SmartMirror\Motion\gesture.py", line 134, in SearchPalmFromMask
    if self.InitFromMask(search_hand_mask):
  File "C:\Users\admin\Desktop\SmartMirror\Motion\gesture.py", line 101, in InitFromMask
    (_, contours, _) = cv2.findContours(search_hand_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)

[ WARN:0] global D:\Build\OpenCV\opencv-4.1.2\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback

Tags: inpyselfsearchadminlinemaskusers