Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    树莓派CM4+imx327S MIPI x2 运行python demo如何同时打开两个摄像头

    VEYE MIPI camera
    2
    6
    455
    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
      sjchen last edited by

      我将 capture2opencv.py 中 camera.init_camera() 添加参数0或1,即 camera.init_camera(0) 或 camera.init_camera(1),始终报错:"Invalid camera_interface "

      veye_xumm 1 Reply Last reply Reply Quote 0
      • veye_xumm
        veye_xumm @sjchen last edited by

        @sjchen
        你好,根据D_mipicamera.py文件,init_camera函数的参数

        class CAMERA_INTERFACE(Structure):
            _fields_ = [
                ("i2c_bus",c_int),
                ("camera_num",c_int),
                ("sda_pins",c_int * 2),
                ("scl_pins",c_int * 2),
            ]
        

        后面两个配置pin的没有用到,前面的需要都传入一下。
        参考c库接口文件的注释:

        // i2c is reserved,because we use shell script to do do param setting
        struct camera_interface {
            int i2c_bus;        // /dev/i2c-0  or /dev/i2c-1
            int camera_num;     // mipi interface num,-1 for mode B, 0,1 for mode CM the only used param in this struct
            int sda_pins[2];    // enable sda_pins[camera_num], disable sda_pins[camera_num ? 0 : 1]
            int scl_pins[2];    // enable scl_pins[camera_num], disable scl_pins[camera_num ? 0 : 1]
        
        };
        
        S 1 Reply Last reply Reply Quote 0
        • S
          sjchen @veye_xumm last edited by sjchen

          @veye_xumm 我理解要传入类似(0,0,(0,0),(0,0))这样的参数对吧,那么sda_pins和scl_pins这两个参数的具体含义是什么(注释没看懂)能否解释一下?谢谢

          veye_xumm 1 Reply Last reply Reply Quote 0
          • veye_xumm
            veye_xumm @sjchen last edited by

            @sjchen
            这两个是预留参数,实际底层没有用到,传0进去就可以。

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

              @veye_xumm 谢谢,现在传入(0,0,(0,0),(0,0)) 和 (1,1,(1,1),(1,1)) 就可以了。

              veye_xumm 1 Reply Last reply Reply Quote 0
              • veye_xumm
                veye_xumm @sjchen last edited by

                @sjchen 不客气。

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post