Contact me: hankecnc@gmail.com

RPi3 的网络摄像头/摄像头配置 #452

推推 grbl 3年前 (2023-02-01) 261次浏览
关闭
CCSnell 开启了这个问题 2016 年 10 月 12 日 · 10 条评论
关闭

RPi3 的网络摄像头/摄像头配置#452

CCSnell 开启了这个问题 2016 年 10 月 12 日 · 10 条评论

注释

RPi3 的网络摄像头/摄像头配置 #452

我有一个树莓派 3,运行在 Protoneer 的图像版本 3.00 上。PIL、ImageTk 和 OpenCV 所有设置(在 IDLE 中导入不会返回错误)。v2.1 相机通过带状电缆连接,bCNC 中的图标不再灰显。使用以下命令显示相机正常运行

$ raspistill -o output.jpg

但是我无法让相机显示在吊坠视图或程序中。我认为问题出在 .BCNC 或 BCNC.INI 设置中。在 wiki 中,它说手动编辑 .BCNC 以启用相机。我无法弄清楚哪些参数需要更改或也需要更改哪些参数。任何指导将不胜感激。

RPi3 的网络摄像头/摄像头配置 #452
所有者

opencv 是否识别 rpi 相机?
您可以在 python 中尝试以下操作
$ python
import cv2
camera = cv2.VideoCapture(0)

camera.read()

RPi3 的网络摄像头/摄像头配置 #452
作者

运行以下命令不会出现错误:

$ python
import cv2
camera = cv2.VideoCapture(0)

运行以下命令会给我一个直播:

# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2

# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
camera.resolution = (640, 480)
camera.framerate = 32
rawCapture = PiRGBArray(camera, size=(640, 480))

# allow the camera to warmup
time.sleep(0.1)

# capture frames from the camera
for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True):
    # grab the raw NumPy array representing the image, then initialize the timestamp
    # and occupied/unoccupied text
    image = frame.array

    # show the frame
    cv2.imshow("Frame", image)
    key = cv2.waitKey(1) & 0xFF

    # clear the stream in preparation for the next frame
    rawCapture.truncate(0)

    # if the `q` key was pressed, break from the loop
    if key == ord("q"):
        break

仍然没有在 bCNC 工作。

RPi3 的网络摄像头/摄像头配置 #452

我有一个类似的问题:在我的例子中,它也与 Raspberry Pi 3 有关,但带有 raspbian 图像。OpenCV 和 python 绑定来自 Debian,使用打包系统安装。

当插入 Raspberry Pi 时,USB 摄像头 (UVC) 可以按预期工作(bCNC 中的图像),但 rpi 摄像头(在我的例子中是 v1.3 NoIR)没有(例如,当它与 raspistill/raspivid 一起工作时)。

RPi3 的网络摄像头/摄像头配置 #452

我遇到了同样的问题,raspistill 工作正常。即使插入了 USB 摄像头,bCNC 中的摄像头仍然是灰色的。

RPi3 的网络摄像头/摄像头配置 #452
所有者

@DaveDischord你安装了 python-imaging-tk pakage 吗?
@CCSnell显然默认的 opencv 无法识别 RPi 相机