设计并实现了一种可快速运算基于哈尔小波变换的KNN(K nearest neighbors)算法且具备可重构能力的硬件结构。该硬件结构通过增减哈尔小波变换组件即可适应不同维度样本的哈尔小波变换;对同样维度样本的计算则可以通过调整并行度满足对逻辑资源和处理时间的不同需求,克服了现有软件KNN计算速度慢、硬件实现的KNN不够灵活的缺陷。通过在Xilinx VC707 FPGA开发板上实现该硬件结构,实验结果展示了不同维度及并行度下算法实现在逻辑资源耗费及运算时间方面的变化。此外,将该硬件结构作为一种高质量轮廓提取算法硬件加速器的纹理分类模块时,在保持计算准确度的情况下获得了远高于软件运行的速度。
This paper proposed a reconfigurable hardware structure to accelerate KNN based on Haar wavelet transform. This hardware structure was able to fit in computing with different dimensions through changing components of the wavelet transform. It could also meet different requirements for logic resources utilization and time performance through adjusting hardware parallelism when the specific dimension was considered. This hardware structure solved the low-speed computing problem existed in software KNN and the low-feasibility problem in hardware KNN. Experimental results demonstrate the requirement about logic resources utilization and time performance related to different dimensions and different parallelism through implementing it in a VC707 FPGA board provided by Xilinx. Additionally,it obtains a far more than speed-up without much loss of precision over that of CPU when this structure is used as the texture classification module for a high-quality hardware contour detection accelerator.