我正在尝试在运行 Raspbian GNU/Linux 11(牛眼)的 Raspberry Pi 3B+ 上使用 OpenCV 并使用以下代码裁剪相机拍摄的图像,我得到以下输出:
Traceback (most recent call last):
File "/home/pi/Desktop/test-code-elias/camquali.py", line 141, in <module>
right_wall = img[1:1944, 1:1000]
TypeError: tuple indices must be integers or slices, not tuple
Run Code Online (Sandbox Code Playgroud)
我的代码:
img = cam.read()
right_wall = img[0:1944, 0:1000]
Run Code Online (Sandbox Code Playgroud)