Machine Vision: Part 5 Install IMX219-160 Camera

Never could get the Arducam IMX477 to work. So let’s try an IMX219:

Hardware connection

  1. Connect the camera to CSI interface of Jetson Nano.Set the metal side of FFC into Heat-sink
  2. Connect a HDMI LCD to Jetson Nano

Software setting

  1. Power on Jetson Nano and open the Terminal (Ctrl+ALT+T)
  2. Test camera with command:
    DISPLAY=:0.0 gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' ! nvoverlaysink -e

    If you find that the image captured is red. You can try to download .isp file and installed:

    wget https://www.waveshare.com/w/upload/e/eb/Camera_overrides.tar.gz
    tar zxvf Camera_overrides.tar.gz 
    sudo cp camera_overrides.isp /var/nvidia/nvcam/settings/
    sudo chmod 664 /var/nvidia/nvcam/settings/camera_overrides.isp
    sudo chown root:root /var/nvidia/nvcam/settings/camera_overrides.isp

See https://www.waveshare.com/wiki/IMX219-160_Camera
Theoretically it should now work, but I found I had to perform the following additional steps:

  1. Install the video 4 linux utils
    sudo apt-get install v4l-utils
  2. Run the command v4l2-ctl to check the device. It should show this output:
    $ v4l2-ctl --list-devices
    vi-output, imx219 6-0010 (platform:54080000.vi:0):
     /dev/video0
    
  3. Further check using v4l2-ctl. This command must be run on a local terminal (not a remote terminal via SSH). Something like this should output
    $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=300
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.02 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.01 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.01 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.01 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.01 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.01 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<
    
  4. Finally, run this command and the live stream window should pop up:
    gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e

(See https://medium.com/@jonathantse/troubleshooting-imx219-camera-for-jetson-nano-7524dfc9a0ce)

Success!