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

    SC535M设置默认相机参数画面显示不正常的问题

    Scheduled Pinned Locked Moved Jetson App Software
    24 Posts 2 Posters 12.6k Views 1 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.
    • veye_xummV Offline
      veye_xumm @Dangal
      last edited by

      @dangal 注意下你的v4l2-ctl 需使用 -d /dev/video* 参数来指明配置到哪个摄像头。

      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.)

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

        @dangal 参考一下8.1和8.2 https://wiki.veye.cc/index.php/Mv_series_camera_appnotes_4_jetson/zh#Application_demo

        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.)

        D 1 Reply Last reply Reply Quote 0
        • D Offline
          Dangal @veye_xumm
          last edited by Dangal

          @veye_xumm

          a0f5ac24-fb5e-44e5-acfa-334c4c4864ef-image.png
          你好 在使用了

          v4l2-ctl -d /dev/video3 --set-ctrl preferred_stride=2560 --set-fmt-video=width=2448,height=2048,pixelformat=GREY --stream-mmap --stream-count=30 --stream-to=v3.raw
          

          之后,我得到了v3.raw,然后我发现效果像是preferred_stride设置并没有生效

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

            @dangal 这个文件你按照多大分辨率播放预览的?你可以抓一张,然后看看文件大小是多少字节?

            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.)

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              Dangal @veye_xumm
              last edited by Dangal

              @veye_xumm 我按照2448*2048预览的
              dce0db06-e46c-4ad9-9825-3449f3c504f8-image.png
              文件大小一共150M 我抓了30帧 所以一张是5M
              1369e23e-eb5a-4f47-a23b-c64fa615d972-image.png
              一张是5242880字节
              cdd1d63a-8598-4e97-a2dd-94912a9a2cbe-image.png

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

                @dangal
                你还是没有理解stride的意思。
                preferred_stride指一行图像数据需要的内存大小。为了硬件处理图像数据速度考虑,jetson平台设计了stride这个参数。换句话说,2448的width,实际给按照2560分配的内存大小,右侧补数据0。

                你需要按照25602048来预览。25602048=5242880字节

                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.)

                D 2 Replies Last reply Reply Quote 0
                • D Offline
                  Dangal @veye_xumm
                  last edited by Dangal

                  @veye_xumm
                  got it!
                  但是,要怎么解释我上面那个代码设置preferred_stride之后,/dev/video0的成像还是不正常呢?
                  我按照你的说法指定了每个设备,即每个命令 --set-ctrl preferred_stride=2560 之前都加了指定的 -d /dev/video*, 但是,当这样设置后,我opencv imshow的全部都不正常了,而且qv4l2也全部不正常,在没有指定-d的情况下 仅/dev/video0 第一路不正常

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    Dangal @veye_xumm
                    last edited by Dangal

                    @veye_xumm 我有一个猜想,不知道对不对,那就是实际预览的时候 程序只会按照你设置的width和height去分配内存大小去展示图片,preferred_stride 这个参数只适用于硬件层面去分配图片内存大小?

                    但是,这样的话,虽然一张图片被分配了25602048个字节,但其实像素还是只有24482048?

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

                      @dangal
                      设置stride之后,实际底层是按照stride的设置值分配buffer,一路回调上来。但是python库和qv4l2依然按照上层设置的width去理解这个图片,因此造成了问题。
                      stride这个参数如果重新编译内核,应该是可以缩小的。具体英伟达的官网上我印象中是有写。 或者直接查找一下kernel源码更改也可以。
                      比如改成64

                      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.)

                      D 1 Reply Last reply Reply Quote 0
                      • D Offline
                        Dangal @veye_xumm
                        last edited by Dangal

                        @veye_xumm 091d578c-8097-4d9e-91e9-ebca030b84ca-image.png
                        你好 能否给出相关的keyword,nVidia的官方doc体量太大了 搜索stride就找到这两个东西 看起来都不相关

                        如果在Google和baidu bing等上搜索stride的话,出来的全是深度学习的步长stride

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

                          @dangal
                          我意思是到kernel源码里面找一下preferred_stride关键字。

                          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.)

                          D 1 Reply Last reply Reply Quote 0
                          • D Offline
                            Dangal @veye_xumm
                            last edited by Dangal

                            @veye_xumm
                            我并不打算折腾更改linux源码,因为这样存在风险。除非你们已经试验过,请确认一下这样做不会导致后续有潜在的内存问题。
                            我现在正在考虑要不要换更好的图像传感器代替535M,比如我问你家客服的这款
                            3686f838-1ca7-4c9d-8361-089c25eecf71-image.png
                            这款能不能同样用ADP-N5转接板呢? 如果能,我就把535退了,换这个型号的传感器

                            我刚刚找了linux代码仓库 发现没有preferred_stride 的关键字相关搜索结果
                            441e9e88-7b75-4768-921d-a08053345d51-image.png

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

                              @dangal 这款是rolling shutter的。不能直接用到ADP-N5上,这个适配ADP-N4

                              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.)

                              D 1 Reply Last reply Reply Quote 0
                              • D Offline
                                Dangal @veye_xumm
                                last edited by

                                @veye_xumm
                                rolling shutter 我可以理解为滑动窗口吗 我其实只关注这个镜头能不能摄制出大于500w像素的黑白原始照片 还有就是能不能同样适配到jetson tx2上,只要重新更新dtbs和img就能在我不改变我代码的基础上直接用 其他的方面我不是很关心

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

                                  @dangal
                                  还是用sc535,你测试一下配置prefer_stride为64,分辨率是2432x2048的大小。

                                  v4l2-ctl --set-ctrl preferred_stride=64
                                  python ./v4l2dev_2_opencv_show_grey.py --width 2432--height 2048
                                  

                                  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.)

                                  D 1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    Dangal @veye_xumm
                                    last edited by Dangal

                                    @veye_xumm
                                    哦 这样是不行的 刚刚是我忘记把args.width从2304改回默认值了,2432的内存还是撕裂的
                                    c9ba0cdf-cad6-44a8-8625-3436d0611e89-image.png
                                    3f390221-61ed-4a3c-87de-e2db20910401-image.png

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

                                      经过验证,xavier平台可以通过设置配置prefer_stride为64,分辨率是2432x2048的大小。但是tx2平台不行,还是得要求256的整数倍。

                                      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.)

                                      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