Using the xfOpenCV Library

This section describes using thexfOpenCVlibrary in the SDx development environment.

Note:The instructions in this section assume that you have downloaded and installed all the required packages. For more information, see the Prerequisites.

Use the following steps to run a unit test for bilateral filter on zcu102_es2_reVISION:

  1. Launch the SDx development environment using the desktop icon or theStartmenu.
    The Workspace Launcherdialog appears.
  2. ClickBrowseto enter a workspace folder used to store your projects (you can use workspace folders to organize your work), then clickOKto dismiss theWorkspace Launcherdialog.
    Note:Before launching the SDx IDE on Linux, ensure that you use the same shell that you have used to set the $SYSROOTenvironment variable. This is usually the file path to the Linux root file system.
    The SDx development environment window opens with the Welcometab visible when you create a new workspace. The Welcometab can be closed by clicking the Xicon or minimized if you do not wish to use it.
  3. SelectFile>New>Xilinx SDx Project.from the SDx development environment menu bar.
    The New Projectdialog box opens.
  4. Specify the name of the project. For exampleBilateral.
  5. ClickNext.
    The the Choose Hardware Platformpage appears.
  6. From theChoose Hardware Platformpage, click theAdd Custom Platformbutton.
  7. Browse to the directory where you extracted the reVISION platform files. Ensure that you select thezcu102_es2_reVISIONfolder.
  8. From theChoose Hardware Platformpage, selectzcu102_es2_reVISION (custom).
  9. ClickNext.
    The Templatespage appears, containing source code examples for the selected platform.
  10. From the list of application templates, selectbilateral - File I/Oand clickFinish.
  11. Click theActive build configurationsdrop-down from theSDx Project Settingswindow, to select the active configuration or create a build configuration.

    The standard build configurations are Debug and Release. To get the best runtime performance, switch to use theReleasebuild configuration as it uses a higher compiler optimization setting than the Debug build configuration.

    Figure:SDx Project Settings - Active Build Configuration



  12. Set theData motion network clock frequency (MHz)to the required frequency, on theSDx Project Settingspage.
  13. Select theGenerate bitstreamandGenerate SD card imagecheck boxes.
  14. Right-click the project and selectBuild Projector press Ctrl+B keys to build the project, in theProject Explorerview.
  15. Copy the contents of the newly createdsd_cardfolder to the SD card.
    The sd_cardfolder contains all the files required to run designs on the ZCU102board.
  16. Insert the SD card in theZCU102board card slot and switch it ON.
    Note:A serial port emulator (Teraterm/ minicom) is required to interface the user commands to the board.
  17. Upon successful boot, run the following command in the Teraterm terminal (serial port emulator):
    #cd /media/card
  18. Run the.elffile for the respective functions.
    For more information, see the Using the xfOpenCV Library Functions on Hardware.