树莓派CM4+imx327S MIPI x2 运行python demo如何同时打开两个摄像头
-
我将 capture2opencv.py 中 camera.init_camera() 添加参数0或1,即 camera.init_camera(0) 或 camera.init_camera(1),始终报错:"Invalid camera_interface "
-
@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] }; -
@veye_xumm 我理解要传入类似(0,0,(0,0),(0,0))这样的参数对吧,那么sda_pins和scl_pins这两个参数的具体含义是什么(注释没看懂)能否解释一下?谢谢
-
@sjchen
这两个是预留参数,实际底层没有用到,传0进去就可以。 -
@veye_xumm 谢谢,现在传入(0,0,(0,0),(0,0)) 和 (1,1,(1,1),(1,1)) 就可以了。
-
@sjchen 不客气。
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