Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    1. Home
    2. barbanevosa
    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 7
    • Best 0
    • Groups 0

    barbanevosa

    @barbanevosa

    0
    Reputation
    1
    Profile views
    7
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Email sergei.kasaurov@gmail.com

    barbanevosa Follow

    Latest posts made by barbanevosa

    • RE: Assistance Needed with RAW-MIPI-IMX462M Camera Integration on NVIDIA AGX Orin

      @veye_xumm
      I'm experiencing issues with capturing a still image from my RAW-MIPI-IMX462M camera.

      Current image processing pipeline:

      v4l2-ctl -d 0 -v width=1920,height=1080,pixelformat=XY12 --stream-mmap --stream-count 1 --stream-to captured_frame.raw
      
      magick -size 1920x1080 -depth 16 -endian LSB gray:captured_frame.raw -depth 8 frame.png
      

      The problem:

      • First capture after boot produces correct image:frame_good.png

      • All subsequent captures yield corrupted images:
        frame_bad.png

      • Camera reboot restores proper functionality.

      ./mv_mipi_i2c_new.sh -w reboot -b 9
      

      Troubleshooting performed:

      • Tested both XY10 and XY12 pixel formats

      • Used different conversion tools (ImageMagick, ffmpeg)

      • Tried 8-bit and 16-bit grayscale output

      • Applied pixel bit shifting (both pixel_layer_convert and custom scripts)

      • Compared camera settings pre/post capture using:

      v4l2-ctl -d 0 -L
      
      • Read internal camera registers via ./mv_mipi_i2c.sh

      No configuration differences were detected between "working" and "failing" camera states.

      What could cause this single-good-frame behavior, and how can it be resolved?

      posted in Machine Vision camera
      B
      barbanevosa
    • RE: Assistance Needed with RAW-MIPI-IMX462M Camera Integration on NVIDIA AGX Orin

      @veye_xumm
      The camera is detected by the system, but I can't seem to get a video stream from it. I keep running into issues, and I'm not sure what I'm doing wrong.

      Could you please help me with the following:

      • What is the correct way to capture video from this specific camera model?

      • Are there any common pitfalls or specific settings I should be aware of?

      • What might I be missing in my current setup?

      Any advice, examples, or pointers to relevant documentation would be immensely helpful.

      Thank you in advance for your support and expertise.

      posted in Machine Vision camera
      B
      barbanevosa
    • Assistance Needed with RAW-MIPI-IMX462M Camera Integration on NVIDIA AGX Orin

      I am using the RAW-MIPI-IMX462M camera module on an NVIDIA AGX Orin platform for my project. Below are my system details:

      $ uname -r
      5.15.148-tegra
      
      $ cat /etc/nv_tegra_release 
      # R36 (release), REVISION: 4.4, GCID: 41062509, BOARD: generic, EABI: aarch64, DATE: Mon Jun 16 16:07:13 UTC 2025
      # KERNEL_VARIANT: oot
      TARGET_USERSPACE_LIB_DIR=nvidia
      TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
      

      Previously, I successfully used the MV-MIPI-IMX178M camera with VLC and GStreamer via v4l2 without any issues.

      I have recently updated the device tree overlay (*.dtbo) for the new RAW-MIPI-IMX462M, and the camera is detected correctly as shown below:

      $ ./mv_mipi_i2c_new.sh -r model -b 9
      model is RAW-MIPI-IMX462M
      
      $ v4l2-ctl --device=/dev/video0 --all
      Driver Info:
              Driver name      : tegra-video
              Card type        : vi-output, mvcam 9-003b
              Bus info         : platform:tegra-capture-vi:0
              Driver version   : 5.15.148
              Capabilities     : 0x84200001
                      Video Capture
                      Streaming
                      Extended Pix Format
                      Device Capabilities
              Device Caps      : 0x04200001
                      Video Capture
                      Streaming
                      Extended Pix Format
      Media Driver Info:
              Driver name      : tegra-camrtc-ca
              Model            : NVIDIA Tegra Video Input Device
              Serial           : 
              Bus info         : 
              Media version    : 5.15.148
              Hardware revision: 0x00000003 (3)
              Driver version   : 5.15.148
      Interface Info:
              ID               : 0x03000017
              Type             : V4L Video
      Entity Info:
              ID               : 0x00000015 (21)
              Name             : vi-output, mvcam 9-003b
              Function         : V4L2 I/O
              Pad 0x01000016   : 0: Sink
                Link 0x0200001b: from remote pad 0x1000003 of entity '13e00000.host1x:nvcsi@15a00000-' (Unknown sub-device (0002000a)): Data, Enabled
      Priority: 2
      Video input : 0 (Camera 0: no power)
      Format Video Capture:
              Width/Height      : 1920/1080
              Pixel Format      : 'XY10' (XAVIER 10-bit/16-bit Greyscale)
              Field             : None
              Bytes per Line    : 3840
              Size Image        : 4147200
              Colorspace        : sRGB
              Transfer Function : Default (maps to sRGB)
              YCbCr/HSV Encoding: Default (maps to ITU-R 601)
              Quantization      : Default (maps to Full Range)
              Flags             : 
      
      User Controls
      
                         trigger_mode 0x00981901 (int)    : min=0 max=2 step=1 default=0 value=0 flags=volatile, execute-on-write
                          trigger_src 0x00981902 (int)    : min=0 max=1 step=1 default=1 value=1 flags=volatile, execute-on-write
                          soft_trgone 0x00981903 (button) : value=0 flags=write-only, execute-on-write
                           frame_rate 0x00981904 (int)    : min=0 max=61 step=1 default=60 value=60 flags=volatile, execute-on-write
                                roi_x 0x00981905 (int)    : min=0 max=1576 step=8 default=0 value=0
                                roi_y 0x00981906 (int)    : min=0 max=792 step=4 default=0 value=0
      
      Camera Controls
      
      error 22 getting ext_ctrl Sensor configuration
      error 22 getting ext_ctrl Sensor mode I2C packet
      error 22 getting ext_ctrl Sensor control I2C packet
                          bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0 (0 0x0)
                                      0: 0 (0x0)
                                      1: 1 (0x1)
                      override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0 (0 0x0)
                                      0: 0 (0x0)
                                      1: 1 (0x1)
                         height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                           size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0 (1 0x1)
                                      0: 1 (0x1)
                                      1: 65536 (0x10000)
                                      2: 131072 (0x20000)
                     write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
             sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 dims=[30][18] flags=read-only, has-payload
              sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 dims=[30][16] flags=read-only, has-payload
            sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 dims=[30][36] flags=read-only, has-payload
                    sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 dims=[30][16] flags=read-only, has-payload
                     low_latency_mode 0x009a206d (bool)   : default=0 value=0
                     preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
          override_capture_timeout_ms 0x009a206f (int)    : min=-1 max=2147483647 step=1 default=2500 value=2500
                  vi_time_out_disable 0x009a2078 (bool)   : default=0 value=0
                         sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=1 flags=read-only
      
      Image Processing Controls
      
                           pixel_rate 0x009f0902 (int64)  : min=750000000 max=750000000 step=1 default=750000000 value=750000000 flags=read-only
      

      Currently, I am having difficulty capturing video streams in the XY10 or XY12 formats using VLC, GStreamer, or other players. I can capture raw images with v4l2-ctl that require conversion to a suitable format, but my intended workflow involves capturing video with Python, OpenCV, and the CUDA toolchain.

      Could you please assist me in setting up the correct workflow to capture and process video from this camera using these tools?

      Thank you for your support.

      posted in Machine Vision camera
      B
      barbanevosa
    • Capture MV-MIPI-IMX178M with OpenCV

      I use MV-MIPI-IMX178M with Jetson AGX Orin to capture it with my Python script using OpenCV.

      My pre-configuration v4l2-ctl commands are:

      v4l2-ctl -d 0 -c roi_x=0,roi_y=0,preferred_stride=3136,frame_rate=22
      v4l2-ctl -d 0 -v width=3088,height=2064,pixelformat=GREY
      
      Format Video Capture:
              Width/Height      : 3088/2064
              Pixel Format      : 'GREY' (8-bit Greyscale)
              Field             : None
              Bytes per Line    : 3136
              Size Image        : 6472704
              Colorspace        : sRGB
              Transfer Function : Default (maps to sRGB)
              YCbCr/HSV Encoding: Default (maps to ITU-R 601)
              Quantization      : Default (maps to Full Range)
              Flags
      

      In my Python script I use GStreamer and the simplified code looks like this:

      import cv2
      
      pipeline = f"v4l2src device=/dev/video0 ! appsink"
      cap = cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER)
      
      while True:
          ret, frame = cap.read()
          if not ret:
              print("Capture error")
              break
          cv2.imshow("Cam", frame)
          if cv2.waitKey(45) & 0xFF == ord("q"):
              break
      
      cap.release()
      cv2.destroyAllWindows()
      

      It works fine!

      Then I try to switch capture API from GStreamer to v4l2:

      import cv2
      
      cap = cv2.VideoCapture(0, cv2.CAP_V4L2)
      
      cap.set(cv2.CAP_PROP_FRAME_WIDTH, 3088)
      cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 2064)
      cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'GREY'))
      
      while True:
          ret, frame = cap.read()
          if not ret:
              print("Capture error")
              break
          cv2.imshow("Cam", frame)
          if cv2.waitKey(45) & 0xFF == ord("q"):
              break
      
      cap.release()
      cv2.destroyAllWindows()
      

      And I see stripes in the video window. I guess the reason is how the v4l2 considers the frame width and the prefered stride.

      I try to set:

      cap.set(cv2.CAP_PROP_FRAME_WIDTH, 3136)
      

      ...and get 'Capture error'.

      My attempts to change prefered_stride property by v4l2-ctl were not successful.

      The only workaround I've managed to find so far is to reduce the width of the captured frame to a multiple of 64 so that matches the prefered_stride. The closest such value to 3088 is 3072. So I preconfigure the cam with width=3072,prefered_stride=3072. And set in my Python program:

      cap.set(cv2.CAP_PROP_FRAME_WIDTH, 3072)
      

      That works fine!

      But what if I had to read all 3088 pixels of width? Is there any solution for v4l2 (not GStreamer)?

      posted in Machine Vision camera
      B
      barbanevosa
    • V4l2 capture by OpenCV doesn't work for IMX462

      I use VEYE-MIPI-IMX462 with RPI 3B+ (bullsye, 5.10.92-v7+). Kernel module veyecam2m is installed. V4l2 preview by VLC player and GStreamer works fine.
      When I tried to read from Python script by OpenCV with cv.VideoCapture() no frames captured (cv.VideoCapture.isOpened() returns False). I've tried to downgrade the kernel to v5.10.17 and use previous veye327 module but this hasn't solved the problem.

      import cv2 as cv
      
      
      cap = cv.VideoCapture(0)
      print(cap.isOpened())
      
      while cv.waitKey(10) != 27:
          ret, img = cap.read()
          cv.imshow("video", img)
      
      cap.release()
      cv.destroyAllWindows()
      

      How to capture video by OpenCV and v4l2 for IMX462? And why it works fine with VLC and doesn't work with Python + OpenCV?

      posted in VEYE MIPI camera
      B
      barbanevosa
    • RE: Load libdmipicam fail.

      From Python:

      from ctypes import *
      cdll.LoadLibrary("libdmipicam.so")

      =============================
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.9/ctypes/init.py", line 452, in LoadLibrary
      return self._dlltype(name)
      File "/usr/lib/python3.9/ctypes/init.py", line 374, in init
      self._handle = _dlopen(self._name, mode)
      OSError: /lib/libdmipicam.so: undefined symbol: mmal_log_category

      posted in VEYE MIPI camera
      B
      barbanevosa
    • Load libdmipicam fail.

      I try to use VEYE-MIPI-IMX462 with RPI 3B+ (bullsye, x32). Unfortunately v4l2 rendering was too laggy (I hope to resume experiments with it later), so I use the legacy library. veye_raspipreview works pretty good.
      I followed the instruction and build libdmipicam (no errors, only warnings), install it with 644 into /usr/lib. But when I tried python_demo/preview.py I get Load libdmipicam fail. I tried different versions of libdmipicam.so - bundled and compiled - the same result.
      Please, help me with that problem.

      posted in VEYE MIPI camera
      B
      barbanevosa