TypeError: Only integer scalar arrays can be converted to a scaler index

TypeError: Only integer scalar arrays can be converted to a scaler index

我将OpenCV从1.4.1更新到1.5.2时出现错误。 描述:我正在尝试制作一个 AR 鼠标(相机会检测到你的手指,然后它会充当鼠标)。 要右键单击,您必须将中指和食指放在一起。但是这样做时出现错误:

cv2.circle(img, (lineInfo[4], lineInfo[5]),
TypeErro: only integer scaler arrays can be converted to a scaler index 

这部分出现错误:

if fingers[1] == 1 and fingers[2] == 1:

            # 9. Find distance between fingers
            length, img, lineInfo = detector.findDistance(lmList[8], lmList[12], img)

            # 10. Click mouse if distance short
            if length < 40:
                cv2.circle(img, (lineInfo[4], lineInfo[5]), 15, (0, 255, 0), cv2.FILLED)
                autopy.mouse.click()

如果删除

cv2.circle(img, (lineInfo[4], lineInfo[5]), 15, (0, 255, 0), cv2.FILLED)

代码会起作用。它确实会导致圆圈滞后,但代码有效。这符合您的需求吗?