Read MV-MIPI-SC130M with openCV
-
我尝试使用三个v4l2_opencv_show.py示例读取相机视频流,然而均无法打开摄像头,使用的是cv2.vedioCapture()方法:
cap = cv2.VideoCapture("v4l2src io-mode=dmabuf device=/dev/video0 ! video/x-raw, format=(string)GREY, width=(int)1280, height=(int)1024 ! appsink")SC130M支持GREY、Y10等格式,但V4L2的x-raw并不支持,我尝试使用cv2.vedioCapture(0)、缺省format参数,x-raw支持的format=GRAY8进行读取,但是结果显示
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (1824) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Device '/dev/video0' does not support 1:4:7:1 colorimetry我也尝试使用相机支持的GREY进行读取,但是gstreamer无法识别:
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (734) open OpenCV | GStreamer warning: Error opening bin: could not link v4l2src0 to appsink0, v4l2src0 can't handle caps video/x-raw, format=(string)GREY, width=(int)1280, height=(int)1024 [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (501) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created camera open failed -
@skyhorizon 你使用的主板是什么? 运行环境是什么版本?
-
@veye_xumm

RPI OS 5.15.84 驱动是本地编译的5.15_all。v4l2-ctl -d /dev/video0 --all Driver Info: Driver name : unicam Card type : unicam Bus info : platform:fe801000.csi Driver version : 5.15.84 Capabilities : 0x85a00001 Video Capture Metadata Capture Read/Write Streaming Extended Pix Format Device Capabilities Device Caps : 0x05200001 Video Capture Read/Write Streaming Extended Pix Format Media Driver Info: Driver name : unicam Model : unicam Serial : Bus info : platform:fe801000.csi Media version : 5.15.84 Hardware revision: 0x00000000 (0) Driver version : 5.15.84 Interface Info: ID : 0x03000005 Type : V4L Video Entity Info: ID : 0x00000003 (3) Name : unicam-image Function : V4L2 I/O Flags : default Pad 0x01000004 : 0: Sink Link 0x02000007: from remote pad 0x1000002 of entity 'mvcam 10-003b': Data, Enabled, Immutable Priority: 2 Video input : 0 (Camera 0: ok) Format Video Capture: Width/Height : 1280/1024 Pixel Format : 'GREY' (8-bit Greyscale) Field : None Bytes per Line : 1280 Size Image : 1310720 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1280, Height 1024 Default : Left 0, Top 0, Width 1280, Height 1024 Pixel Aspect: 1/1 Selection Video Capture: crop, Left 0, Top 0, Width 1280, Height 1024, Flags: Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 1024, Flags: Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 1024, Flags: Selection Video Capture: native_size, Left 0, Top 0, Width 1280, Height 1024, Flags: User Controls horizontal_flip 0x00980914 (bool) : default=0 value=0 vertical_flip 0x00980915 (bool) : default=0 value=0 trigger_mode 0x00981901 (int) : min=0 max=2 step=1 default=0 value=0 flags=volatile, execute-on-write trigger_src 0x00981902 (int) : min=0 max=1 step=1 default=1 value=1 flags=volatile, execute-on-write soft_trgone 0x00981903 (button) : flags=write-only, execute-on-write frame_rate 0x00981904 (int) : min=0 max=22 step=1 default=22 value=22 flags=volatile, execute-on-write Camera Controls camera_sensor_rotation 0x009a0923 (int) : min=0 max=0 step=1 default=0 value=0 flags=read-only Image Processing Controls pixel_rate 0x009f0902 (int64) : min=750000000 max=750000000 step=1 default=750000000 value=750000000 flags=read-only~ $ dmesg | grep mvcam [ 8.132715] veye_mvcam: loading out-of-tree module taints kernel. [ 8.648215] mvcam 10-003b: camera is: MV-MIPI-SC130M [ 8.649037] mvcam 10-003b: firmware version: 0x1260132 [ 8.657495] mvcam 10-003b: Consider updating driver mvcam to match on endpoints -
@skyhorizon 硬件平台是RPI 4B
-
-
@veye_xumm 能否提供一些在python或是c/c++中可用的读取接口或程序示例,我需要一个确定可用的程序对摄像头进行功能测试,最好能兼容opencv和gstreamer
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login