Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: replaced image under Video Qt Application for 2018.2 sdx


Zynq UltraScale MPSoC Base TRD 2018.2 - Design Module 7


Design Overview


This module shows how to add a 2D convolution filter between the capture pipeline and the display. The 2D filter is implemented in two ways:
  1. software implementation using the OpenCV library
  2. hardware-optimized implementation which is run in software. The next module shows how to accelerate this code using FPGA logic.





Design Components


This module requires the following components:
  • zcu102_base_trd (SDSoC)
  • filter2d (accelerator)
  • sdxfilter2d (gstreamer plugin)
  • video_qt2
    • video_lib
    • gst_lib



Build Flow Tutorials


2D Filter Sample and GStreamer Plugin


This tutorial shows how to build the 2D filter sample without HW acceleration based on the Base TRD SDSoC platform.

  • Set the build environment variables. This requires that you have previously completed the PetaLinux SDK installation step from DM5.
    Note 1: Make sure you set the env variables in the same shell that is used to launch SDx. Also make sure the env variables are set before starting SDx, otherwise close and re-start SDx.
    Note 2: The below command might ask you execute unset LD_LIBRARY_PATH and then re-execute the command. Go ahead and follow those steps.

    Code Block
    themeMidnight
    % source $TRD_HOME/petalinux/sdk/environment-setup-aarch64-xilinx-linux


  • Create a new workspace for the filter2d sdsoc and gstreamer plugin projects.

    Code Block
    themeMidnight
    % cd $TRD_HOME/workspaces/ws_f2d
    % sdx -workspace . &&


  • Click 'Import Project' from the welcome screen, select "Eclipse workspace or zip file" as Import type, browse to the current working directory and make sure all projects are selected as shown in the figure. Click finish.
  • Click 'File -> New SDx Project'. Select 'Application Project' as project type and click 'Next'. Enter filter2d as project name and click 'Next'.
  • Click 'Add Custom Platform', browse to the $TRD_HOME/zcu102_base_trd folder and click OK. Select the "zcu102_base_trd [custom]" platform from the list and click 'Next'.
  • Select "Shared Library" as output type and click 'Next'.
  • Select "Filter2D" from the template list and click 'Finish'.
  • In the "Application Project Settings" panel, set the active build configuration to "Release" and remove the pre-selected Hardware Functions by clicking the red 'X' symbol until the pane is empty. Make sure the 'Generate SD card image' box is checked.
  • Right-click the filter2d project in the explorer pane and select 'Build Project'. This should take less than a minute. Copy the generated SD card image.

    Code Block
    themeMidnight
    % cp -r filter2d/Release/sd_card $TRD_HOME/sd_card/dm7


  • When the build is finished, right-click the gstsdxfilter2d project and select "Build Project". Copy the generated libraries and the plugin.
    Note: This project has a dependency on filter2d and the build will fail if filter2d was not built previously.

    Code Block
    themeMidnight
    % mkdir $TRD_HOME/sd_card/dm7/lib $TRD_HOME/sd_card/dm7/gstreamer-1.0
    % cp gst/allocators/Debug/libgstsdxallocator.so gst/base/Debug/libgstsdxbase.so $TRD_HOME/sd_card/dm7/lib
    % cp gst/plugins/filter2d/Debug/libgstsdxfilter2d.so $TRD_HOME/sd_card/dm7/gstreamer-1.0



Video Qt Application


This tutorial shows how to build the video library and the video Qt application.

  • Make sure the build environment is set (see DM5 tutorial). Generate a Makefile for the Qt project for DM7.

    Code Block
    themeMidnight
    % cd $TRD_HOME/workspaces/ws_video/video_qt2
    % qmake video_qt2-dm7.pro -r -spec linux-oe-g++


  • If not already open from a previous module, browse to the Qt workspace and open it.

    Code Block
    themeMidnight
    % cd ..
    % sdx -workspace . &&


  • Right-click the video_qt2 project and click 'Build Project'.
    Image RemovedImage Added
  • Copy the generated video_qt2 executable to the dm7 SD card directory.

    Code Block
    themeMidnight
    % cp $TRD_HOME/workspaces/ws_video/video_qt2/video_qt2 $TRD_HOME/sd_card/dm7


Note: If you are building the video Qt application for the second time, you might try clean project before build project.

...