Zynq UltraScale MPSoC Base TRD 2016.3 - Design Module 7
Return to the Design Tutorials Overview
This module shows how to add a 2D convolution filter between the capture pipeline and the display. The 2D filter is implemented purely in software using the OpenCV library.
This module requires the following components:
- zcu102_base_trd (SDSoC)
- device tree
- filter2d (SW)
Build Flow Tutorials
2D Filter Sample
This tutorial shows how to build the OpenCV version of the 2D filter sample based on the Base TRD SDSoC platform.
Follow the steps in design module 5 to create a new workspace and to import the video_lib and video_qt2 projects. Otherwise, open the existing XSDK workspace only this time using the SDx tool instead of XSDK.
% cd $TRD_HOME/apu/video_app
% sdx -workspace . &&
- Change the eclipse perspective to 'SDx' instead of 'C/C++' which is the current selection.
- Create a new SDx Project
- Enter 'filter2d' as project name
- Click 'Add Custom Platform', browse to the $TRD_HOME/apu/zcu102_base_trd directory and confirm. Select the newly added 'zcu102_base_trd (custom)' platform from the list and click 'Next'.
- Check the 'Linux Root File System' box and browse to the $TRD_HOME/apu/petalinux_bsp/build/linux/rootfs/stage directory. This assumes the petalinux-build command has been run in a previous module.
- Check the 'Shared Library' box and click 'Next'.
- Select the '2D Filter' template and click 'Finish'.
- Change the 'Active build configuration' to Release in the SDx Project Settings window.
- Remove the filter2d_sds HW function by highlighting the function name and clicking the red X symbol.
- Right-click the filter2d project, select 'C/C++ Build Settings'. Navigate to the 'Build Artifacts' tab and add the output prefix 'lib'. Click OK.
- Right-click the filter2d project and select 'Build Project'.
Copy the content of the generated sd_card folder to the dm7 SD card directory
% mkdir -p $TRD_HOME/images/dm7/bin
% cp -rf filter2d/Release/sd_card $TRD_HOME/images/dm7/
Video Qt Application
This tutorial shows how to build the video library and the video Qt application.
- Right-click the video_lib project, select 'C/C++ Build Settings'. Add the symbol 'WITH_SDSOC' and click OK.
- Open the file $TRD_HOME/apu/video_app/video_qt2/video_qt2.pro with an editor and modify the highlighted lines as shown in the screenshot by removing the '#' symbol to un-comment those lines we had previously commented in module 5.
Source the Qt setup script to re-generate the Qt Makefile reflecting these changes.
% cd video_qt2
% source qmake_set_env.sh
- Right-click the video_qt project and click 'Build Project'.
Copy the generated video_qt2 executable to the dm7 SD card directory.
% cp -f video_qt2 $TRD_HOME/images/dm7/bin/
Copy the video_qt2 wrapper scripts from the pre-built dm9 SD card directory.
% cp $TRD_HOME/images/dm9/bin/run_video.sh $TRD_HOME/images/dm9/bin/video_qt2_wrap.sh $TRD_HOME/images/dm7/bin/
Copy the file autostart.sh from the pre-built dm9 SD card directory.
% cp $TRD_HOME/images/dm9/autostart.sh $TRD_HOME/images/dm7
Run Flow Tutorial