Raspberry Pi 4 build
Introduction
The Raspberry Pi 4 project announced back in November 2020 that the Vulkan 1.0 conformance tests successfully passed for its GPU driver. More recently in August 2022, Vulkan 1.2 conformance testing has been completed.
The conformance tests are a large set of tests run against a driver implementation to see if it conforms with the Vulkan specification. This is essential to maintain the Vulkan API portable across platforms and GPU vendors.
In addition, LunarG announced support of the Vulkan SDK on the Raspberry Pi 4. With this, the two most important requirements to build Lluvia on the RPi4 became available.
Build instructions
The build instructions are available in the Getting started page. They can be summarized as:
- Prepare the operating system.
- Build the Vulkan SDK following the official documentation.
- Build and install OpenCV (for running demos).
- Install Bazel.
- Build and install Lluvia.
Optical flow demo
There is a new demo shipped with the Lluvia source code to run pipelines with images captured from a camera. Currently, the demo uses OpenCV VideoCapture class to capture images from the Raspberry camera module.
The demo app, which can be run from the repository root folder as
|
|
configures the camera to capture images at 320x240
resolution and runs the webcam/HornSchunck
container node defined in the horn_schunck.lua
script. The container node creates the pipeline illustrated below:
@startuml
skinparam linetype ortho
state BRGA2Gray
state HS as "HornSchunck"
state Flow2RGBA
state RGBA2BGRA
BRGA2Gray -down-> HS: in_gray
HS -down-> Flow2RGBA: in_flow
Flow2RGBA -down-> RGBA2BGRA: out_rgba
@enduml
with the HornSchunck
node containing the algorithm implementation as discussed in a previous article.
OpenCV BGR color ordering
By default, OpenCV used BGRA channel ordering for color images. On the other hand, Lluvia uses RGBA ordering to store color images. The last node in the demo pipeline converts to the color order OpenCV expects to render into the screen.Discussion
This post introduced the instructions for building Lluvia on the Raspberry Pi 4. A new demo application for running pipelines with images captured from the Pi’s camera module is also presented.
As of now, Lluvia is supported in four platforms:
- Linux x86_64.
- Windows.
- Android through the mediapipe integration.
- Raspberry Pi 4.
Future work can include support for other platforms such as:
- Nvidia Jetson hardware.
- MacOS and iOS.
With these many platforms, an interesting topic for future work is running benchmarks across all of them for assessing the runtime performance of different computer vision algorithms.