Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    1. Home
    2. Dangal
    3. Posts
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 27
    • Best 0
    • Groups 0

    Posts made by Dangal

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

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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

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

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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

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

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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

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

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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

      @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

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

      @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设置并没有生效

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

      @veye_xumm
      现在有一个问题就是opencv无法设置到2560,我试过了 如果v4l2设置了2448,但是opencv宽度改成2304,那么用qv4l2打开发现,最后的宽度还是2304,现在有个问题是我这边需要大于500w像素,24482048=5013504,但是这个在jetson系列上显示不正常,如果用v4l2-ctl的话,则它只能抓一帧存到本地文件里,无法达到实时预览的效果,2304虽然正常,但是23042048=4718592,和我想要达到大于500w还是有一定的差距.
      如果用c++开发,能不能提供c++的例程或者是相关SDK?

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

      @veye_xumm
      在测量过程中,还存在一个问题,即设置了v4l2-ctl的这些参数后 只有第一路/dev/video0 是不正常的,其他路都是正常的,开始怀疑是摄像头的问题,但是发现对调后仍然是/dev/video0 显示不正常,看起来就像是参数设置没有生效一样 但实际用opencv的show_grey.py例程 /dev/video0是显示正常的 是这些参数有什么先后顺序的问题吗?我也调整过参数的设置顺序,但还是会出现问题

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

      @veye_xumm 我猜,应该是 opencv它获取了sensor的最大宽度,你不能设置比它传感器更大的宽度,因为2448是可以设置的,但是显示不正常,我把width设置成2304,也是可以的

      posted in Jetson App Software
      D
      Dangal
    • RE: SC535M设置默认相机参数画面显示不正常的问题

      @veye_xumm

      jetson-tx2@ubuntu:/usr/local/src/nvidia_jetson_veye_bsp/samples/opencv/raw_camera$ cat 5wb-cam.py
      import cv2
      import argparse
      import subprocess
      
      def main():
          # Set up command-line argument parser
          parser = argparse.ArgumentParser(description='Real-time display of GREY image from /dev/video0')
          parser.add_argument('--roix', type=int, default=0, help='roi start x (default: 0)')
          parser.add_argument('--roiy', type=int, default=0, help='roi start y (default: 0)')
          parser.add_argument('--width', type=int, default=2448, help='image width (default: 1280)')
          parser.add_argument('--height', type=int, default=2048, help='image height (default: 960)')
          parser.add_argument('--fps', type=int, default=30, help='frame rate (default: 30)')
          parser.add_argument('--preferred_stride', type=int, default=2560,help='preferred stride(default: 2560)')
          args = parser.parse_args()
      
          v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-ctrl roi_x=%d" % args.roix
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-ctrl roi_y=%d" % args.roiy
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-ctrl frame_rate=%d" % args.fps
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
          subprocess.call(v4l2_cmd, shell=True)
      
      
          v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-ctrl roi_x=%d" % args.roix
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-ctrl roi_y=%d" % args.roiy
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-ctrl frame_rate=%d" % args.fps
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-ctrl roi_x=%d" % args.roix
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-ctrl roi_y=%d" % args.roiy
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-ctrl frame_rate=%d" % args.fps
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-ctrl roi_x=%d" % args.roix
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-ctrl roi_y=%d" % args.roiy
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-ctrl frame_rate=%d" % args.fps
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-ctrl roi_x=%d" % args.roix
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-ctrl roi_y=%d" % args.roiy
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-ctrl frame_rate=%d" % args.fps
          subprocess.call(v4l2_cmd, shell=True)
      
          v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
          subprocess.call(v4l2_cmd, shell=True)
      
      
          # Open the /dev/video0 device
          cap0 = cv2.VideoCapture('/dev/video0',cv2.CAP_V4L)
          cap1 = cv2.VideoCapture('/dev/video1',cv2.CAP_V4L)
          cap2 = cv2.VideoCapture('/dev/video2',cv2.CAP_V4L)
          cap3 = cv2.VideoCapture('/dev/video3',cv2.CAP_V4L)
          cap4 = cv2.VideoCapture('/dev/video4',cv2.CAP_V4L)
          if not cap0.isOpened():
              print("Failed to open /dev/video0")
              return
      
          if not cap1.isOpened():
              print("Failed to open /dev/video1")
              return
      
      
          if not cap2.isOpened():
              print("Failed to open /dev/video2")
              return
      
      
          if not cap3.isOpened():
              print("Failed to open /dev/video3")
              return
      
          if not cap3.isOpened():
              print("Failed to open /dev/video4")
              return
          # Set the image size
          cap0.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
          cap0.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)
      
          cap1.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
          cap1.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)
      
          cap2.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
          cap2.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)
      
          cap3.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
          cap3.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)
      
          cap4.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
          cap4.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)
      
          # Calculate the aligned width
          #aligned_width = (args.width + 3)& ~3
      
          # Loop over frames and display them
          while True:
              # Read a frame
              ret0, frame0   = cap0.read()
              ret1, frame1   = cap1.read()
              ret2, frame2   = cap2.read()
              ret3, frame3   = cap3.read()
              ret4, frame4   = cap4.read()
              # Check if reading was successful
              if not ret0:
                  print("Failed to read frame from /dev/video0")
                  break
      
              if not ret1:
                  print("Failed to read frame from /dev/video1")
                  break
      
              if not ret2:
                  print("Failed to read frame from /dev/video2")
                  break
      
              if not ret3:
                  print("Failed to read frame from /dev/video3")
                  break
      
              if not ret4:
                  print("Failed to read frame from /dev/video4")
                  break
              #if frame.shape[1]!= aligned_width:
              #    aligned_frame = np.zeros((args.height, aligned_width), dtype=np.uint8)
              #    aligned_frame[:, args.width] = frame
              #    frame = aligned_frame
              # Display the frame
              cv2.imshow('preview (video0)', frame0)
              cv2.imshow('preview (video1)', frame1)
              cv2.imshow('preview (video2)', frame2)
              cv2.imshow('preview (video3)', frame3)
              cv2.imshow('preview (video4)', frame4)
              # Exit if 'q' key is pressed
              if cv2.waitKey(1) & 0xFF == ord('q'):
                  break
      
          # Release resources
          cap0.release()
          cap1.release()
          cap2.release()
          cap3.release()
          cap4.release()
          cv2.destroyAllWindows()
      
      if __name__ == '__main__':
          main()
      jetson-tx2@ubuntu:/usr/local/src/nvidia_jetson_veye_bsp/samples/opencv/raw_camera$ python 5wb-cam.py
      VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
      VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
      VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
      VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
      VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
      VIDIOC_STREAMON: Invalid argument
      VIDIOC_STREAMON: Invalid argument
      VIDIOC_STREAMON: Invalid argument
      VIDIOC_STREAMON: Invalid argument
      VIDIOC_STREAMON: Invalid argument
      Failed to read frame from /dev/video0
      jetson-tx2@ubuntu:/usr/local/src/nvidia_jetson_veye_bsp/samples/opencv/raw_camera$
      
      

      这样修改之后 opencv就报错了 它不支持2560这样一个比较大的参数

      posted in Jetson App Software
      D
      Dangal
    • SC535M设置默认相机参数画面显示不正常的问题

      5wb-cam .py.txt
      @veye_xumm 你好,这是我根据你们给出的python例程写的一拖五的python例程,其中参数都是按照sensor的实际尺寸来,同时也按照wiki设置了preferred_stride,但是在jetson tx2 预览出的画面不正常 表现为有花纹,我初步判断是内存没对齐的问题,因为jetson需要256位对齐,但我已经设置了preferred_stride,请帮忙看下是什么问题,我写的源码已上传,python版本为3.6.9,opencv版本为4.1.1

      posted in Jetson App Software
      D
      Dangal
    • RE: jetson tx2 + SC535M 一拖五 jetpack 4.6.x的驱动问题

      @veye_xumm
      现在我已经把我的jetpack刷到了4.6.4
      b0ed6af1-8db1-4a2c-a0d1-7d2c3953af98-image.png
      也映射出了video0
      d754e348-c18a-4a72-87c2-838fe1c0d597-image.png
      但是,dmesg还是一堆报错信息
      a1784fb6-53b7-4aaa-ad40-9288a269e254-image.png

      posted in Jetson App Software
      D
      Dangal
    • RE: jetson tx2 + SC535M 一拖五 jetpack 4.6.x的驱动问题

      @veye_xumm 好的 更新完了 请还按原邮箱发送驱动文件 也请在论坛上告知我

      posted in Jetson App Software
      D
      Dangal
    • RE: jetson tx2 + SC535M 一拖五 jetpack 4.6.x的驱动问题

      @veye_xumm 06b65e68-8a8a-4b28-acbe-eaceb1d91394-image.png
      我重新编译了image 并断电重启 现在camera id 能够被识别成RAW_MIPI_SC535M,固件版本号也出来了,但是仍有一堆报错信息

      posted in Jetson App Software
      D
      Dangal
    • RE: jetson tx2 + SC535M 一拖五 jetpack 4.6.x的驱动问题

      @veye_xumm 已经收到驱动文件,请删除我的私人邮箱相关帖子。

      posted in Jetson App Software
      D
      Dangal
    • RE: jetson tx2 + SC535M 一拖五 jetpack 4.6.x的驱动问题

      @veye_xumm 052727b2-b69b-4501-a710-05b0f9a70816-image.png
      看上去 确实有问题 按照你给的命令后 并没能识别到

      posted in Jetson App Software
      D
      Dangal
    • RE: jetson tx2 + SC535M 一拖五 jetpack 4.6.x的驱动问题

      5bac8f69-531e-4a8e-8b47-e786147c710e-img_v3_02g4_f52f1a17-3e1f-443a-957b-98dde3b5317g.jpg
      我的硬件接入方式如上图所示
      dd78cde8-c547-45a4-92d1-9bb25995e871-image.png
      我的dev下设备文件如图所示。
      b3e2f19c-6e0b-4722-b60f-b53cddb4135a-image.png
      我尝试跑通这个例程

      posted in Jetson App Software
      D
      Dangal