Current Issue Cover
采用邻域直方图匹配的矢量纹理图案合成

徐婵婵, 杨刚(北京林业大学信息学院, 北京 100083)

摘 要
矢量纹理图案是指由一种或几种矢量图案元素按照一定的规则进行分布而形成的纹理图案。这种纹理图案在日常生活中随处可见,对其进行自动合成是非真实感绘制中的一个重要研究课题。提出一种基于样本的矢量纹理图案合成方法,可以根据一小块样本图案自动合成与该样本图案有类似分布规则的大面积图案。在此方法中,采用一种“邻域直方图”的策略来进行元素邻域信息的匹配与合成:将矢量元素的邻域空间用以该元素为中心的射线束和同心圆簇划分为一定数量的小格;统计每个小格中出现的邻域元素数量就可以形成一幅直方图;以此直方图信息作为当前元素的邻域信息在样本图案中进行匹配搜索,从而完成图案的合成。该方法不仅可以应用于仅有一种图案元素的分布合成,还可扩展至多种元素图案的复杂分布合成。与以往的矢量纹理图案合成方法相比,本文方法不需要复杂的元素关系分析和频繁的元素位置比较,实现简单,效率较高。实验结果表明,本文方法对于规则、半规则及随机的图案分布,都可达到较好的合成效果,这对于非真实感绘制中的风格图案生成、笔划分布计算等都将具有很好的应用意义。
关键词
Vector texture pattern synthesis based on neighborhood histogram matching

Xu Chanchan, Yang Gang(Department of Computer Applied Technology, Beijing Forestry University, Beijing 100083, China)

Abstract
In non-photorealistic rendering research, people found that many arts' textures or backgrounds are composed of many small elements with repetitive distribution. Many researchers tried to use procedure based approaches to simulate those pattern effects, but those methods could only generate limited kinds of patterns even after a tedious complex and difficult parameters' adjustment. Some researchers considered sample-based methods and have been proved to be very effective in non-photorealistic effects simulation. Vector texture pattern means the pattern which consists of limited types of elements which are arranged with certain rules or features. Those patterns are very common in our daily life, both from natural objects and manmade patterns. Vector texture pattern synthesis can obtain the rules of the elements' distribution from a given sample pattern and generate a large pattern which shares the same rules with the sample pattern. The element in those texture patterns can represent any independent visual information geometry or texture. The study of automatic synthesis method of these patterns has become an important topic, as these patterns not only plays a significant role in hand-painting simulation but also be used in virtual scene generation such as the generation of a forest. Furthermore, automatic synthesis of pattern means we use the computer, a machine, not a human being to analyze and understand the rules of the elements distribution, this involves in some artificial intelligence which also makes the study of vector texture patterns synthesis a more meaningful research topic. In this paper, a new sample based vector texture synthesis method is proposed. In our method, we put forward a Neighborhood Histogram for the comparison and matching of element's neighborhood. The neighborhood space of an element is divided into small grids by a bunch of radials and a series of concentric circles centered at this element. A histogram can be generated by counting the number of elements positioned in each grid. The histogram represents the neighborhood information of current element. It is used to search the matching element in sample pattern through histogram comparison, and hence synthesize the destination pattern with the matching element. The method includes three stages: sample acquisition, sample analysis and pattern synthesis. A sample pattern can be obtained by reading in a pattern file with specified format or being constructed interactively. We also need to obtain the elements information from the sample pattern, including position, types etc. The main task of sample analysis is acquiring the neighborhood information between elements in the sample pattern and building histogram for each element. We first estimate the radius of the element's neighborhood region according to the space arrangement among elements in sample pattern;then we will construct each element's neighborhood and build the histogram of the neighborhood. In the pattern synthesis process, first, we select an element in random, put it in the center of the synthetic area and copy its neighborhood elements to the corresponding positions in the synthetic area. The first element is named as the center element, and the center element and its neighborhood elements form an init pattern of our synthesis pattern. Next, we will extend the synthesis pattern step by step. In each extension, we choose the element nearest to the center element as an extending-element;then search the matching element in sample pattern whose histogram is the most similar to extending one's;copy the neighborhood elements of the matching element to the synthetic area. Repeating the process to extend the synthesis pattern, we can get the final result.We employ our method on regular, near-regular and random patterns respectively. We find that our method can accurately grasp the rules of sample pattern distribution and get good synthesis results. Most of the previous methods use Delaunay triangulation to get the relationship of elements in sample pattern, which means the relatively position of two close elements are defined in an accurate and fixed form. In synthesis process, as there is no element in sample pattern which shares the exact same neighborhood information with the one in the synthesis pattern, this usually causes difference accumulated and affects the final synthesis pattern. Some realization will slow down the speed of the program. Our method divides the neighborhood of an element into small grids and counts the number of elements positioned in each grid which used as a parameter in synthesis process. We use a certain range in relative orientation not an accurate relative orientation to calculate the neighborhood information of the element, making it some fuzzy in boundary, which can reduce the difference accumulation in synthesis process. Our method doesn't need complex elements relationship analysis and frequently comparison of elements positions, achieving higher performance. Our method can guarantee the local similarity between sample pattern and synthesis pattern, but as we didn't take the overall elements' density into consideration, this may lead to imbalance in element proportion. How to add this parameter into the synthesis process to achieve similarity between sample pattern and the synthesis pattern on the whole level is our first priority at present. For further extension, we could take vector field into consideration and generate effects with controllable gradual changes. In addition, our method doesn't involve in elements' parameters such as orientation, color, size and so on. Taking these factors into consideration and achieving good results with more expressive force is another extension we are trying to accomplish.
Keywords

订阅号|日报