This module shows how to add two image-processing filters between the capture and the display. The 2D filter and dense optical flow algorithm are implemented in hardware using the hardware-optimized xfopencv libaries.
This module requires the following components:
- zcu102_base_trd (Vitis_platform)
Build Flow Tutorials
Optical Flow and Filter 2D AcceleratorThis tutorial shows how to build both 2D filter and Optical Flow accelerator with HW acceleration based on the Base TRD Vitis platform.
Run Flow Tutorial
- See here for board setup instructions.
- Copy all the files from the
$TRD_HOME/sd_card/dm9 SD card directory to a FAT formatted SD card.
- Power on the board to boot the images; make sure INIT_B, done and all power rail LEDs are lit green.
- After ~30 seconds, the display will turn on and the application will start automatically, targeting the max supported resolution of the monitor (one of 3840x2160 or 1920x1080 or 1280x720). The application will detect whether DP Tx or HDMI Tx is connected and output on the corresponding display device.
To re-start the TRD application with the max supported resolution, run
To re-start the TRD application with a specific supported resolution use the -r switch e.g. for 1920x1080, run
% run_video.sh -r 1920x1080
- The user can now control the application from the GUI's control bar (bottom) displayed on the monitor.
- The user can select from the following video source options:
- TPG (SW): virtual video device that emulates a USB webcam purely in software
- USB: USB Webcam using the universal video class (UVC) driver
- TPG (PL): Test Pattern Generator implemented in the PL
- HDMI: HDMI input implemented in the PL
- CSI: MIPI CSI image sensor pipeline in the PL
- File: Raw video file source
- The user can select from the following accelerator options:
- Passthrough (no accelerator)
- 2D convolution filter with configurable coefficients
- Dense optical flow algorithm (shown in figure)
- The supported accelerator modes depend on the selected filter:
- SW - accelerator is run on A53 (filter2d only)
- HW - accelerator is run on PL
- The video info panel (top left) shows essential settings/statistics.
- The CPU utilization graph (top right) shows CPU load for each of the four A53 cores.