Some things to try to build on this experiment:
Edit the host code to play with the image sizes. How does the run time change if you scale up more? Down more? Where is the crossover point where it no longer makes sense to use an accelerator?
Add in color conversion to the FPGA accelerator (note that a hardware rebuild will be required). See if it takes longer to process.
Key Takeaways
More computationally complex O(N) operations can be good candidates for acceleration, although you will not see amazing gains vs. a CPU
Using FPGA-optimized libraries like xf::OpenCV allows you to easily trade off processing speed versus resources, without having to re-implement common algorithms on your own. Focus on the interesting parts of your application!
Some library optimizations you can choose can impose constraints on your design — double check the documentation for the library function(s) you choose before you implement the hardware.
We mentioned briefly earlier that doing additional processing in the FPGA fabric is very “cheap”, time-wise. In the next section, do an experiment to see if that is true.
Read Example 8: Pipelining Operations with Vitis Vision
Copyright © 2020–2023 Advanced Micro Devices, Inc