cax52492
@cax52492 (Satoki)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Jetson Xavier NXでUSBカメラを認識させたい!

解決したいこと

Jetson Xavier NXでUSBカメラ(BU1203)で撮像しようとしていますが、
Cannot identify device '/dev/video0'.より
カメラを認識しないというエラーは理解しており、
まずカメラを認識させたいのですが、方法をご存知ないでしょうか?

発生している問題・エラー

 $ python camTest.py

[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Cannot identify device '/dev/video0'.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
VIDEOIO ERROR: V4L: can't open camera by index 0
Traceback (most recent call last):
  File "camTest.py", line 7, in <module>
    cv2.imshow("frame", frame)
cv2.error: OpenCV(4.1.1) /home/nvidia/host/build_opencv/nv_opencv/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'

該当するソースコード

import cv2

capture = cv2.VideoCapture(0)

while(True):
    ret, frame = capture.read()
    cv2.imshow("frame", frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

capture.release()
cv2.destroyAllWindows()

これがcamTest.pyの中身です。

自分で試したこと

ここに問題・エラーに対して試したことを記載してください。
・lsusbでみたところ
Bus 002 Device 003: ID 0e70:0000 Tokyo Electronic Industry Co., Ltd
Bus 002 Device 002: ID 0bda:0489 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13d3:3549 IMC Networks
Bus 001 Device 005: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
Bus 001 Device 004: ID 1bcf:0005 Sunplus Innovation Technology Inc. Optical Mouse
Bus 001 Device 002: ID 0bda:5489 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
とは出てきて、ちょっと調べている最中です
・GStreamerとはなんぞやと調べております
・pip install opencvやってみましたが、特に変わらず

0

No Answers yet.

Your answer might help someone💌