快捷导航
您好, 在Apex 二代的用户手册中提供了这个链接 https://riptutorial.com/opencv/e ... t-image-from-webcam 作为仅用opencv读取图片的参考. 然而除去编译问题,
  1. cv::VideoCapture camera("/dev/video3");
复制代码

这种方法并不能打开gmsl摄像头.  还行您指点一下

举报 使用道具
| 回复

共 14 个关于本帖的回复 最后回复于 2021-6-2 10:37

Hcheng 游客 发表于 2021-4-26 19:52 | 显示全部楼层
您好

请问一下,您用的是哪款摄像头?
此时使用SDK能获取到摄像头数据么?
jimmymiji 游客 发表于 2021-4-27 10:14 | 显示全部楼层
我用的森云ar0143, sdk可以打开
Hcheng 游客 发表于 2021-4-27 11:04 | 显示全部楼层
jimmymiji 发表于 2021-4-27 10:14
我用的森云ar0143, sdk可以打开

您好:

为了方便您进行验证,我们专门拍了一段视频。
您可以首先根据以下的方法来先确认,v4L是否工作正常。

1. 确认GMSL相机设置正确
2. 打开Cheese
3. 确认分辨率设置正常
4. 选中Cheese相机对应的设备名字。(视频中选中的是video4)

您的情况,应该选择从上往下数第三个设备。
视频可以参考以下链接,快速验证的部分。

https://doc.miivii.com/pages/viewpage.action?pageId=5276045
jimmymiji 游客 发表于 2021-4-27 12:08 | 显示全部楼层
我用cheese可以正常打开, 用opencv的话是要和cheese里那个device name保持一致么, 而不是 /dev/video3
Hcheng 游客 发表于 2021-4-27 12:42 | 显示全部楼层
jimmymiji 发表于 2021-4-27 12:08
我用cheese可以正常打开, 用opencv的话是要和cheese里那个device name保持一致么, 而不是 /dev/video3
...

您好

Cheese可以打开的话,就说明v4L正常工作了。
意味着所有通过V4L去访问的方法,都可以工作(opencv 就是通过v4l去访问的)。
因此主要确认还是得确认opencv的代码部分。

您有通过opencv的示例打开USB的相机么?
因为已经通过V4L了,因此打开USB相机,和打开gmsl相机是一样的。
jimmymiji 游客 发表于 2021-4-27 14:16 | 显示全部楼层
解决了, 那个外部连接的代码不是很准确, 应该这样开
  1. char Gstring[256];
  2.     sprintf(Gstring,"v4l2src device=/dev/video3 ! video/x-raw, width=1280, height=720 ! videoconvert ! appsink");
  3.     cv::VideoCapture camera(Gstring,cv::CAP_GSTREAMER);
复制代码
jimmymiji 游客 发表于 2021-4-27 14:24 | 显示全部楼层
还有个问题和这个帖子类似https://forum.miivii.com/forum.p ... page%3D1&page=8, 但是它回复不了了, 我在这里问您吧.
我在调用基于sdk获取图片和时间戳的函数的时候, 有时会出现两帧的时间戳相同的情况, 请问这个是什么原因
log: 我在代码里把默认频率改成了20
  1. sudo ./bin/cameras_sdk_demo -d /dev/video3 -s 1280x720
  2. attestationVerify [18] succeed.
  3. MiiVii GMSL-Camera SDK Version: 1.1.5  
  4. fmt.fmt.pix.width 1280
  5. fmt.fmt.pix.height 720
  6. fmt.fmt.pix.pixelformat 1448695129
  7. libv4l2_nvvidconv (0):(802) (INFO) : Allocating (10) OUTPUT PLANE BUFFERS Layout=0
  8. libv4l2_nvvidconv (0):(818) (INFO) : Allocating (10) CAPTURE PLANE BUFFERS Layout=0
  9. UYVY 4:2:2
  10. Y/CbCr 4:2:2
  11. UYVY 4:2:2
  12. device like buffer count: 4
  13. Camera v4l2mmbuffer buf length is not expected: Invalid argument
  14. Camera v4l2mmbuffer buf length is not expected: Invalid argument
  15. Camera v4l2mmbuffer buf length is not expected: Invalid argument
  16. Camera v4l2mmbuffer buf length is not expected: Invalid argument
  17. Gtk-Message: 11:34:57.188: Failed to load module "canberra-gtk-module"
  18. Time diff two big 1619494497149814720 548415029248 diff: 16827250124974766144
  19. Timestamp for two frames are the same 1619494576599814432
  20. Timestamp for two frames are the same 1619494576599814432
  21. Timestamp for two frames are the same 1619494639399814368
  22. Timestamp for two frames are the same 1619494639399814368
  23. Timestamp for two frames are the same 1619494639399814368
  24. Timestamp for two frames are the same 1619494828449814432
  25. Timestamp for two frames are the same 1619494828449814432
  26. Timestamp for two frames are the same 1619494891549814368
  27. Timestamp for two frames are the same 1619494891549814368
  28. Timestamp for two frames are the same 1619494954399814368
  29. Timestamp for two frames are the same 1619494954399814368
  30. Timestamp for two frames are the same 1619494954399814368
  31. Timestamp for two frames are the same 1619495080549814432
  32. Timestamp for two frames are the same 1619495080549814432
  33. Timestamp for two frames are the same 1619495080549814432
  34. Timestamp for two frames are the same 1619495143549814432
  35. Timestamp for two frames are the same 1619495143549814432
  36. Timestamp for two frames are the same 1619495143549814432
  37. Timestamp for two frames are the same 1619495206399814368
  38. Timestamp for two frames are the same 1619495206399814368
  39. Timestamp for two frames are the same 1619495206399814368
  40. Timestamp for two frames are the same 1619495269549814336
  41. Timestamp for two frames are the same 1619495395549814304
  42. Timestamp for two frames are the same 1619495395549814304
  43. Timestamp for two frames are the same 1619495395549814304
  44. Timestamp for two frames are the same 1619495458549814432
  45. Timestamp for two frames are the same 1619495458549814432
  46. ^Cwill exit..
复制代码
Hcheng 游客 发表于 2021-4-27 16:19 | 显示全部楼层
jimmymiji 发表于 2021-4-27 14:24
还有个问题和这个帖子类似https://forum.miivii.com/forum.php?mod=viewthread&tid=438&extra=page%3D1&pag ...

您好

由于0231的分辨率是1080p,要比大部分GMSL1的相机,如0143的分辨率要高。
因此在我们的SDK中,出现了一些问题。

我们很快会通过OTA来进行SDK的升级,届时正式支持的相机都会解决这个问题。
jimmymiji 游客 发表于 2021-4-27 16:25 | 显示全部楼层
我们用的0143的,  video 和 image 的size 都是1280 x 720. 是预期之内么
您需要登录后才可以回帖 登录 | 点我注册

精彩推荐

  • canbus与vcu相连接,出现bus-off状态
  • 有线连接失败
  • Apex 串口通讯
  • 关于SPI通信问题咨询
  • MIIVII APEX DUAL ORIN米文域控制器产品合

明星用户