element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Path II Programmable
  • Challenges & Projects
  • Design Challenges
  • Path II Programmable
  • More
  • Cancel
Path II Programmable
Blog PIIP Project - Creating xfOpenCV IP using Vivado HLS
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 25 Nov 2019 5:23 AM Date Created
  • Views 1336 views
  • Likes 2 likes
  • Comments 1 comment
  • embedded vision
  • ultra96-v2
  • xfopencv
  • path ii programmable
  • vivado hls
  • displayport
Related
Recommended

PIIP Project - Creating xfOpenCV IP using Vivado HLS

ralphjy
ralphjy
25 Nov 2019

The next element that I need to tackle for my embedded vision project is the creation of accelerated vision processing IP using Vivado HLS and the xfOpenCV function library.  That would allow me to create a component that I could include in my design.  There are a lot of examples of this but it was much harder to accomplish process than I expected.  I found a Hackster project that essentially demonstrated what I wanted to do Accelerating Image Processing with Ultra96  https://www.hackster.io/dhq/accelerating-image-processing-with-ultra96-caebe6 but I soon discovered that it was missing a lot of detail for an inexperienced user (me).

 

Accelerating Image Processing with Ultra96

This Hackster project runs through creating the Filter2D IP from the Xilinx xfOpenCV library https://github.com/Xilinx/xfopencv.  This seemed like it would be a good tutorial on using Vivado HLS but it proved to be a very frustrating experience.  As I expected mismatches in tools versions and libraries and environment make learning really painful.

 

The first issue was that if you look at the xfOpenCV examples, there is no Filter2D example.  It turns out it is in the customconv (custom convolution) example but you actually have to drill down into the C++ code to find the Filter2d_accel function.  Not sure why they chose to obfuscate it like this.  The example tcl script provided for building the IP with Vivado_HLS is for the dilation function so you need to edit it for each different example.

 

The example script is fairly simple.  In addition to changing the ip and function names, you also need to set the correct part (for the ultra96 it is xczu3eg-sbva484-1-e) and specify the test image.

############################################################
## Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved.
############################################################
open_project dilation_project
set_top ip_accel_app
add_files ./xf_ip_accel_app.cpp -cflags "-D__SDSVHLS__ -I../../include --std=c++0x"
add_files ./xf_dilation_accel.cpp -cflags "-D__SDSVHLS__ -I../../include --std=c++0x"
add_files -tb ./testcase55.jpg
add_files -tb ./xf_dilation_tb.cpp -cflags "-D__SDSVHLS__ -I../../include --std=c++0x"
open_solution "solution1"
set_part {xczu9eg-ffvb1156-2-i} -tool vivado
create_clock -period 10 -name default
#source "./dilation_color/solution1/directives.tcl"
csim_design -argv {testcase55.jpg} -clean -compiler gcc
csynth_design
cosim_design -argv {testcase55.jpg}
#export_design -format ip_catalog

 

My first try at running the script failed because I was missing the libOpenCL and libjpeg62 libraries.  I installed those libraries but then the build failed for an "unknown error".  I was puzzled until I realized that the repository had been updated to the 2019.1 version of xfOpenCV and I am still using 2018.3.  Luckily it is easy to back up to an earlier version of the repository and I downloaded the latest 2018.3 version.  Finally I was able to get a successful build.  Quite a demoralizing experience for something that should have been extremely simple.  I'm now thinking that it might be worth learning SDSoC because that will not just generate the IP but it will also interconnect it.

 

 

I decided that I needed to do something more satisfying and I found a couple of articles by Adam Taylor on using the DisplayPort on the Ultra96v2.  Finally an example that can be used directly.

 

MicroZed Chronicles: DisplayPort Controller

https://www.hackster.io/news/microzed-chronicles-displayport-controller-part-one-25734db13fad

https://www.hackster.io/news/microzed-chronicles-displayport-controller-part-two-1fa042f7a242

 

Code on github: https://github.com/ATaylorCEngFIET/Ultra96V2_DisplayPort

 

This example uses the Test Pattern Generator (TPG) IP to send test patterns to the display port.  I had some fun trying out the different patterns and I made a short video showing a few of them.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply
  • aspork42
    aspork42 over 5 years ago

    Nice post. I too had lots of issues in doing my project; and not having experience outside of the training it took some perseverance (and a lot of Googling) to get through them. I had almost 30 hours in the project just to read the accelerometer and post to MQTT; something that would have taken an afternoon with a simpler Arduino / ESP32 setup.

     

    That was really all due to my own issues through just since I am still learning the ins and outs of the system.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube