我正在查看脚本,我想插入一个打印函数,但是Python给了我名字错误:&& count < _buffer.size()
未定义。
这是代码
i
我只想打印循环中的for i in xrange(1, len(pts)):
# if either of the tracked points are None, ignore
# them
if pts[i - 1] is None or pts[i] is None:
continue
# otherwise, compute the thickness of the line and
# draw the connecting lines
#print ('coord: {}'.format(pts[i]))
thickness = int(np.sqrt(args["buffer"] / float(i + 1)) * 2.5)
cv2.line(frame, pts[i - 1], pts[i], (0, 0, 255), thickness)
#print (pts[i])
# show the frame to our screen
cv2.imshow("Frame", frame)
key = cv2.waitKey(1) & 0xFF
# if the 'q' key is pressed, stop the loop
if key == ord("q"):
break
和pts[i]
元素,但是当我尝试插入时:
pts[i-1]
我在print (pts[i])
上收到名称错误。
错误是什么?