The Vivado HLS tool was used to synthesise hardware
coprocessors for implementation in the FPGA fabric from C++
functions describing the threshold generation and mean filter
algorithms. This process was an iterative one to achieve the
best performance by directing the hardware synthesis through
a combination of directive pragmas and code refactoring, as
shown in figure 1.