Parallel Camera

This guide will show you how to connect and use the VM-011-COL-M12 phyCAM-P module on the phyCORE-i.MX8X development kit.

../_images/pcm-065_para-camera.png

Requirements

Hardware Setup

  • With the board powered off, connect the phyCAM-P module to the camera connector (X33) on the carrier board.

  • Power on the development kit and stop in U-Boot.

  • Load the device tree overlay required for the parallel camera interface and then boot the board

    Target (U-Boot)
    setenv overlay_files phytec-imx8qxp-parallel-camera.dtbo
    boot
    

Picture Time!

  • To capture a JPEG, use the following gstreamer pipeline.

    Target (Linux)
    gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! 'video/x-bayer, format=grbg, width=2592, height=1944' ! bayer2rgb ! videoscale ! 'video/x-raw, width=259, height=518' ! jpegenc ! filesink location=snap.jpeg
    
    Expected Output
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    [  340.554739] bypass csc
    [  340.557115] input fmt RGB4
    [  340.559885] output fmt GRBG
    Got EOS from element "pipeline0".
    Execution ended after 0:00:02.391455375
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...
    

Viewing the Image

There are a few options to view the image.

  1. Capacitive Touch Display (LCD-018-070-KAP)

    • Using the LCD you can display the image on the LCD using the built in weston software.

      Note

      Either tap the “X” on the LCD display picture window or press “ctrl+c” to return to normal console usage.

    • Once the following command is run you should see your picture on the display.

      Target (Linux)
      weston-image snap.jpeg
      

    Note

    The ‘weston-image’ utility will display the image to the LVDS0 interface by default.

  2. Local Network

    • If you do not have a display, you can use a local network and copy the file from the development kit to your host machine (Linux/Ubuntu).

    • Connect the development kit to your local network using eth0 or eth1.

    • Find the given ip address using “ifconfig” command.

      Target (Ubuntu)
      ifconfig
      
    Expected Output
    eth0      Link encap:Ethernet  HWaddr 3e:c0:4b:d9:5e:fe
              inet addr:<your_ip_address>  Bcast:<your_bcast_address>  Mask:255.255.255.0
              inet6 addr: fe80::3cc0:4bff:fed9:5efe/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:6983 errors:0 dropped:1511 overruns:0 frame:0
              TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:2283310 (2.1 MiB)  TX bytes:13190 (12.8 KiB)
    
    eth1      Link encap:Ethernet  HWaddr 22:20:a1:64:cf:ba
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:2 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:140 (140.0 B)  TX bytes:140 (140.0 B)
    
    • Use secure copy (scp) on your host machine (Ubuntu/Linux) to copy the file from the development kit to a local directory.

    Host Machine Terminal
    sudo scp root@<devkit_ip_address>:/home/root/snap.jpeg /home/user/Downloads/
    
  3. Local Machine

    • View the image from a local machine.

    • Power off the kit and remove the SD card

    • Plug the SD card into your host machine and copy the snap.jpeg image from the card to your local machine for viewing.

Make a Video

Note

Video stream capture is not yet supported in this BSP.

Fast enough conversion from the Bayer data output by the camera to RGB requires the use of the ISP (which is not yet supported).