Current Issue Cover
采用面积采样的反走样字符旋转算法

郑凯文, 刘文波(南京航空航天大学自动化学院, 南京 210016)

摘 要
目的 针对现有字符反走样算法中灰度分配不准确导致的字符抖动、实时性较差等问题,提出一种高效的反走样算法.方法 首先,算法基于面积采样原理,根据周围邻域的像素点来分配灰度,使像素点的坐标定位更加准确,从而解决了字符动态显示时抖动的问题;其次,通过反向坐标变换消除了字符旋转后出现的空洞现象;最后,算法充分利用了FPGA的并行计算能力,在时间和空间上都做到了优化.结果 实验结果表明,本文算法很好地解决了字符抖动问题,并且新算法的仿真速度约为传统算法的6倍以上,比五株排列算法提高了30%.结论 相比其他算法,新算法的优势体现在两个方面,一是字符的灰度过渡平滑,反走样效果更好;二是速度快,实时性高,新算法适用于工程中各种场合下点阵字符的显示,尤其是实时性要求高的环境.
关键词
Anti-aliasing algorithm for character rotation based on area sampling

Zheng Kaiwen, Liu Wenbo(College of Automation Engineering, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China)

Abstract
Objective Character is a basic element of graphics. Its anti-aliasing algorithm is one of the basic content of computer graphic research. To solve the jitter and bad real-time capability problems caused by inaccurate grayscale distribution in the traditional anti-aliasing algorithm for character rotation, an efficient anti-aliasing algorithm is proposed. Method First, the algorithm is based on the principle of area sampling and assigns grayscales according to the four pixels around the neighborhood.This feature increases the preciseness of the coordinate positioning of each pixel and solves jitter problems when the character is dynamically displayed. Second, the void phenomenon appearing after the character rotation is eliminated by the reverse coordinate transformation. Finally, the algorithm makes full use of the parallel computing ability of FPGA and is optimized in time and space. Result Experimental results show that the proposed algorithm solves the problem of character jitter well. The simulation speed obtained by the new algorithm is nearly six times more than that obtained by the traditional algorithm and is also faster than that of the Quincunx algorithm by 30%. Conclusion Compared with other algorithms, the advantages of the new algorithm are reflected in two aspects. On one hand, the grayscale of characters has smooth transitions and better anti-aliasing effects; on the other, it is fast and operates in real time. The new algorithm is applicable to the display of dot matrix characters on various occasions in engineering, particularly in high real-time environments.
Keywords

订阅号|日报