Google Coral Camera
The i.MX 8M NAVQ + kit comes configured to support the Google Coral camera. The Coral camera connects to the kit through the MIPI-CSI2 interface and provides an easy way to bring visual input into the i.MX 8M Plus:
https://coral.ai/products/camera
The camera is based on the Omnivision OV5645 chip. It provides auto focus, focal length 2.5mm, range 10cm-infinity and an 84.0 degrees / 87.6 degrees field-of-view. Link to the i.MX 8M Plus is via the dual-lane MIPI-CSI2 interface.
Connecting Coral Camera
To connect the Coral camera to the NAVQ+ kit, plug the camera cable into the CSI1 or CSI2 connector on the carrier board. The following picture illustrates connection of the camera to the kit:
Software Setup
For correct functioning of the Coral camera with NAVQ+ kit BSP release 1.1.6-364 or higher is required.
Finding Camera Device Nodes
Depending on additional hardware connected to the NAVQ+, the Coral camera may not be the only V4L2 device present in the system. In order to access the camera the user needs to determine the correct video device file node.
The below command outputs video device node registered for two Coral cameras connected to the NAVQ+:
user@imx8mpnavq:~$ v4l2-ctl --list-devices | grep -A1 mxc-isi-cap mxc-isi-cap (platform:32e00000.isi:cap_devic): /dev/video3 -- mxc-isi-cap (platform:32e02000.isi:cap_devic): /dev/video4
In the above output, the /dev/video3 device node corresponds to the camera connected to the CSI1 slot, while the /dev/video4 node represents the camera in the CSI2 slot.
Streaming Video to HDMI Display
Use the “Cheese” program shipped as part of Gnome desktop environment for streaming video input from the Coral camera to the HDMI display connected to the NAVQ+:
user@imx8mpnavq:~$ cheese -d /dev/video3
At this point you should be getting GUI window with video stream displayed in real-time on your HDMI display:
Capturing Video Frames
Use the following Linux command to capture a single frame into a file:
user@imx8mpnavq:~$ gst-launch-1.0 v4l2src device='/dev/video3' num-buffers=1 ! jpegenc ! filesink location=capture1.jpeg
Use the following Linux command to capture a video stream into an h264 encoded file:
user@imx8mpnavq:~$ gst-launch-1.0 v4l2src device='/dev/video3' ! queue ! 'video/x-raw,widtgh=1920,height=1080' ! v4l2h264enc ! mpegtsmux ! filesink location=video.mp4