【发布时间】:2021-12-04 18:45:38
【问题描述】:
当我将 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()
【问题讨论】:
-
首先使用
print()来查看你在行中的变量有什么问题。
标签: python augmented-reality detection opencv-python