VEYE IMAGING Forum
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    • Register
    • Login

    Read MV-MIPI-SC130M with openCV

    Scheduled Pinned Locked Moved Machine Vision camera
    6 Posts 2 Posters 2.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      skyhorizon
      last edited by

      我尝试使用三个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
      
      veye_xummV 1 Reply Last reply Reply Quote 0
      • veye_xummV Offline
        veye_xumm @skyhorizon
        last edited by

        @skyhorizon 你使用的主板是什么? 运行环境是什么版本?

        Questions will be answered as soon as possible, please be patient.
        如果你使用中文,请直接用中文提问。
        May the force be with YOU. (This is the translation of the mysterious Chinese symbol above.)

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          skyhorizon @veye_xumm
          last edited by

          @veye_xumm a6d6c694-11aa-4fac-ac25-82bb547656f6-image.png
          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
          
          S 1 Reply Last reply Reply Quote 0
          • S Offline
            skyhorizon @skyhorizon
            last edited by

            @skyhorizon 硬件平台是RPI 4B

            veye_xummV 1 Reply Last reply Reply Quote 0
            • veye_xummV Offline
              veye_xumm @skyhorizon
              last edited by

              @skyhorizon
              请参考以下这个回复
              http://forum.veye.cc/topic/304/求助树莓派mv-mipi-imx178m-使用python调用cv2-videocapture显示can-t-open-camera-by-index/2

              Questions will be answered as soon as possible, please be patient.
              如果你使用中文,请直接用中文提问。
              May the force be with YOU. (This is the translation of the mysterious Chinese symbol above.)

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                skyhorizon @veye_xumm
                last edited by

                @veye_xumm 能否提供一些在python或是c/c++中可用的读取接口或程序示例,我需要一个确定可用的程序对摄像头进行功能测试,最好能兼容opencv和gstreamer

                1 Reply Last reply Reply Quote 0

                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
                • First post
                  Last post