CN102800116B - Method for rapidly creating large-scale virtual crowd - Google Patents
Method for rapidly creating large-scale virtual crowd Download PDFInfo
- Publication number
- CN102800116B CN102800116B CN201210204293.6A CN201210204293A CN102800116B CN 102800116 B CN102800116 B CN 102800116B CN 201210204293 A CN201210204293 A CN 201210204293A CN 102800116 B CN102800116 B CN 102800116B
- Authority
- CN
- China
- Prior art keywords
- wang
- sample
- tile
- crowd
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Processing Or Creating Images (AREA)
Abstract
本发明公开了一种快速创建大规模虚拟人群的方法,用于在用户输入的场景区域内创建虚拟人群,将人视为具有分布和角色信息的粒子,通过从真实图片中获取包含小规模人群粒子信息的样本,建立样本库,并基于王氏砖方法,使用样本制作王氏砖集合,使用王氏砖非周期性拼接覆盖场景区域,从而迅速生成任意规模场景内的多样虚拟人群。本发明的创建方法简单快速,用户只需输入若干样本和需要人群覆盖的场景区域,就可以快速完成创建工作,同时基于真实图片中具有真实复杂特征的人群做成样本,创建的虚拟人群形态各异,具有真实性和自然性。
The invention discloses a method for quickly creating a large-scale virtual crowd, which is used to create a virtual crowd in a scene area input by a user, regards people as particles with distribution and role information, and obtains a small-scale crowd from a real picture Samples of particle information, establish a sample library, and use the samples to make a collection of Wang’s bricks based on the Wang’s brick method, and use Wang’s bricks to cover the scene area with aperiodic splicing, so as to quickly generate diverse virtual crowds in scenes of any scale. The creation method of the present invention is simple and fast. The user only needs to input several samples and the scene area that needs to be covered by the crowd, and the creation work can be completed quickly. Different, with authenticity and naturalness.
Description
技术领域 technical field
本发明涉及虚拟现实领域,尤其涉及的是虚拟人群创作领域,用于在虚拟场景中逼真地再现多样的人群。The invention relates to the field of virtual reality, in particular to the field of creating virtual crowds, which is used to vividly reproduce various crowds in virtual scenes.
背景技术 Background technique
人是现实世界中最重要和最基本的组成元素之一,虚拟角色对于虚拟世界来说具有同样重要的意义,利用群体模拟技术,在计算机生成空间中创建并模拟现实世界中的群体及其运动,能够极大地提高虚拟世界的真实感和沉浸感。近年来,随着计算机群体模拟技术的不断发展,其应用也越来越广泛,涉及的领域包括模拟训练、计算机游戏动画、影视特效和公共安全辅助设计等。比如,影视画面中可以将包含大量人群活动的场景通过计算机模拟实现,从而提高特效制作的效率并降低制作成本;通过对日常人流或紧急情况下人群的运动过程进行模拟与分析,为建筑物结构设计、大型活动客流管理、公共场所应急预案制定起到很好的指导作用。People are one of the most important and basic elements in the real world, and virtual characters are equally important to the virtual world. Using group simulation technology, create and simulate groups and their movements in the real world in computer-generated spaces , which can greatly improve the sense of reality and immersion in the virtual world. In recent years, with the continuous development of computer group simulation technology, its application has become more and more extensive. The fields involved include simulation training, computer game animation, special effects for film and television, and auxiliary design for public safety. For example, scenes containing a large number of crowd activities can be realized through computer simulation in film and television screens, thereby improving the efficiency of special effects production and reducing production costs; It plays a very good guiding role in the design, passenger flow management of large-scale events, and the formulation of emergency plans for public places.
对于成千上万的人群,如果需要依次对每个人物角色进行位置、朝向等模拟相关属性进行设置和修改,对用户来说,将是一个巨大的繁琐的任务。如果只是随机设置这些属性,则会导致结果不符合真实人群特点,很难控制达到用户所需效果。如果采用简单规则对人群进行排列,会导致结果过于规整或重复,同时,复杂的人群分布规则难以用数学方程描述。For thousands of people, if it is necessary to set and modify simulation-related attributes such as position and orientation of each character in turn, it will be a huge and cumbersome task for users. If these attributes are only set randomly, the results will not conform to the characteristics of real people, and it is difficult to control to achieve the desired effect of users. If simple rules are used to arrange the crowd, the results will be too regular or repetitive. At the same time, complex crowd distribution rules are difficult to describe with mathematical equations.
对于大规模场景及人群模拟来说,如何快速高效地完成人群的初始分布及状态设置,并使其具有多样性和真实性,是一个急需解决的问题。For large-scale scenes and crowd simulations, how to quickly and efficiently complete the initial distribution and state settings of the crowd, and make it diverse and authentic, is an urgent problem to be solved.
在虚拟人群创作方面,已有部分模型被提出,例如Reynolds的flocking模型(Reynolds C.,Flocks,Herds and Schools:A distributed behavioralmodel[J].Computer Graphics,1987,21(4):25-34.),Helbing的社会力模型(Helbing D.,Molnar P.,Social force model for pedestrian dynamics.[J].Physical Review E,1995,51(5):4282-4286.),可以用于模拟生成具有一定复杂性的人群分布,但很难通过调整局部规则来控制最终效果,也难以模拟达到用户指定效果。Ulciny的Crowdbrush系统(Ulicny B.,Ciechomski O.and Thalmann D.,Crowdbrush:Interactive authoring of real-time crowdscenes[C].In Proceedings of ACM SIGGRAPH/Eurographics Symposium onComputer Animation,2004,243-252.)提供了用户实时创作和绘制人群的方法,通过使用笔刷来编辑和控制人物角色信息,由于操作更多的针对的是单个或若干个角色,需要大量用户交互。Yersin等人提出基于Crowd Patch的大规模场景人群创作及动画方法(Yersin B.,Maim J.,Pettre J.andThalmann D.,Crowd patches:populating large-scale virtual environments forreal-time applications [C].In Proceedings of the 2009symposium onInteractive 3D graphics and games,2009,207-214.),通过预先将人物角色的运动轨迹存储在Patch中,拼接得到最终效果,该方法中Patch的设计复杂,需要满足空间及时间连续,所能模拟的人群分布及动画种类十分有限,同时,用户无法修改拼接后的人群场景。Ju等人提出了基于数据驱动的人群模拟方法(Ju E.,Choi M.,Park,M.,Lee J.,Lee K.,Takahashi S.,Morphablecrowds[J].ACM Trans.Graph.,2010,29(6):Article 140.),从真实视频中分类学习获得小规模人群分布样本,模拟中,通过检测人群中每组的分布是否在样本集中来添加个体及控制运动,由于需要检测每个个体邻近区域与整个样本集的相似度,人群的合成速度很慢,合成结果十分规律,不适用于大规模多样人群的快速合成。Guy等人提出了基于心理学模型参数化描述人物角色行为特性的方法(Guy S.J.,Kim S.,Lin M.C.,Manocha D.,Simulating heterogeneous crowd behaviors using personality trait theory[C].In Proceedings of ACM SIGGRAPH/Eurographics Symposium on ComputerAnimation,2011,43-52.),生成多样的人群运动效果,关注的是控制角色运动相关的参数设置。另外,也有基于全局速度场的宏观方法,包括基于地图信息、用户交互控制导航、基于连续介质理论、基于流体模型等,这些方法只能用于全局运动控制效果,无法控制局部人群分布效果。In terms of virtual crowd creation, some models have been proposed, such as Reynolds' flocking model (Reynolds C., Flocks, Herds and Schools: A distributed behavioral model [J]. Computer Graphics, 1987, 21(4): 25-34. ), Helbing's social force model (Helbing D., Molnar P., Social force model for pedestrian dynamics. [J]. Physical Review E, 1995, 51(5): 4282-4286.), can be used for simulation generation with Crowd distribution with a certain complexity, but it is difficult to control the final effect by adjusting local rules, and it is also difficult to simulate to achieve user-specified effects. Ulciny's Crowdbrush system (Ulicny B., Ciechomski O. and Thalmann D., Crowdbrush: Interactive authoring of real-time crowdscenes [C]. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2004, 243-252.) provides The method for users to create and draw crowds in real time uses brushes to edit and control character information. Since the operations are more aimed at a single or several characters, a large amount of user interaction is required. Yersin et al proposed a large-scale scene crowd creation and animation method based on Crowd Patch (Yersin B., Maim J., Pettre J. and Thalmann D., Crowd patches: populating large-scale virtual environments for real-time applications [C].In Proceedings of the 2009symposium on Interactive 3D graphics and games, 2009, 207-214.), the final effect is obtained by pre-storing the movement trajectory of the characters in the Patch. In this method, the design of the Patch is complex and needs to meet the requirements of spatial and temporal continuity. , the crowd distribution and animation types that can be simulated are very limited, and at the same time, the user cannot modify the spliced crowd scene. Ju et al proposed a data-driven crowd simulation method (Ju E., Choi M., Park, M., Lee J., Lee K., Takahashi S., Morphablecrowds[J]. ACM Trans.Graph., 2010 , 29(6): Article 140.), classify and learn from real videos to obtain small-scale crowd distribution samples, in the simulation, add individuals and control movement by detecting whether the distribution of each group in the crowd is in the sample set, because it is necessary to detect each The similarity between the adjacent area of an individual and the entire sample set, the synthesis speed of the population is very slow, and the synthesis results are very regular, which is not suitable for the rapid synthesis of large-scale and diverse populations. Guy et al. proposed a method to parametrically describe the behavior characteristics of characters based on psychological models (Guy S.J., Kim S., Lin M.C., Manocha D., Simulating heterogeneous crowd behaviors using personality trait theory[C].In Proceedings of ACM SIGGRAPH /Eurographics Symposium on Computer Animation, 2011, 43-52.), generate a variety of crowd movement effects, and focus on controlling the parameter settings related to character movement. In addition, there are also macroscopic methods based on the global velocity field, including based on map information, user interactive control navigation, based on continuum theory, based on fluid models, etc. These methods can only be used for global motion control effects, and cannot control local crowd distribution effects.
发明内容 Contents of the invention
本发明的目的是为了解决在虚拟人群时操作复杂和过于规整的问题,提出一种基于真实图片的虚拟人群创建方法,用于快速创建大规模虚拟人群。The purpose of the present invention is to solve the problem of complicated and too regular operation in virtual crowd, and propose a virtual crowd creation method based on real pictures, which is used to quickly create large-scale virtual crowd.
本发明提供了一种快速创建大规模虚拟人群的方法,用于在用户输入的场景区域内创建虚拟人群,包括步骤:The present invention provides a method for quickly creating a large-scale virtual crowd, which is used to create a virtual crowd in a scene area input by a user, including steps:
(1)基于真实图片创建虚拟人群样本库;(1) Create a virtual crowd sample library based on real pictures;
(2)基于创建的虚拟人群样本库,合成王氏砖Wang Tile,建立王氏砖集合;(2) Synthesize Wang Tile based on the created virtual crowd sample library, and establish a collection of Wang Tile;
(3)使用王氏砖集合中的Wang Tile对用户输入的场景区域拼接覆盖。(3) Use the Wang Tile in the Wang brick collection to stitch and cover the scene area input by the user.
进一步地,所述步骤(1)基于真实图片创建虚拟人群样本库,具体包括步骤:Further, said step (1) creates a virtual crowd sample library based on real pictures, specifically including steps:
(1.1)初始化样本正方形;(1.1) Initialize the sample square;
(1.2)从真实图片中选取关注的正方形区域;(1.2) Select the square area of interest from the real picture;
(1.3)从选取的正方形区域中选定个体并采集其分布信息和角色属性信息,从三维人物模型库中选择符合角色属性信息的角色模型,根据采集的分布信息对角色模型进行位置和朝向的变换,放入样本正方形区域,作为一个样本;(1.3) Select individuals from the selected square area and collect their distribution information and role attribute information, select a role model that meets the role attribute information from the 3D character model library, and perform position and orientation adjustment on the role model according to the collected distribution information Transform, put into the sample square area, as a sample;
(1.4)为每个样本设置一个不同的颜色编码,将样本放入样本库。(1.4) Set a different color code for each sample, and put the sample into the sample library.
为了保证虚拟人群的真实性和自然性,本发明采用基于真实图片来创建样本库,样本库越大能提供越丰富的样本,因此可以尽可能多的采集真实照片中的个体的分布信息和角色属性信息来构建尽可能多的样本,根据后期要制作的虚拟人群的规模大小,来适当建立样本库也是可行的。In order to ensure the authenticity and naturalness of the virtual crowd, the present invention uses real pictures to create a sample library. The larger the sample library, the richer the samples can be provided, so the distribution information and roles of individuals in the real photos can be collected as much as possible It is also feasible to construct as many samples as possible based on the attribute information, and it is also feasible to properly establish a sample library according to the size of the virtual crowd to be produced later.
进一步地,所述步骤(2)中合成王氏砖Wang Tile的步骤包括:Further, the step of synthesizing Wang's brick Wang Tile in the described step (2) comprises:
(2.1)分四次从所述样本库中各挑选一个样本,将4个样本拼接组成一个较大的样本块,两两样本之间具有一定的重合区,重合边长为样本边长的0.1~0.35,4个样本正方形的对角线彼此相交组成的菱形区域即为Wang Tile;(2.1) Select one sample from the sample library in four times, splicing the four samples to form a larger sample block, there is a certain overlapping area between two samples, and the overlapping side length is 0.1 of the sample side length ~0.35, the diamond-shaped area formed by the intersection of the diagonals of the four sample squares is the Wang Tile;
(2.2)在菱形区域内,对相邻样本重叠区域内的粒子集进行Voronoi划分,选择一条由Voronoi边组成的分割线,使得所隔开的粒子距离最远,分别保留位于分割线左侧的左侧样本粒子和位于分割线右侧的右侧样本粒子,保证重叠区域内粒子分布的自然性;(2.2) In the rhombus area, Voronoi division is performed on the particle set in the overlapping area of adjacent samples, and a dividing line composed of Voronoi edges is selected so that the distance between the separated particles is the farthest. The left sample particles and the right sample particles on the right side of the dividing line ensure the naturalness of particle distribution in the overlapping area;
(2.3)旋转裁剪后的菱形区域及位于其内的粒子,得到正方形WangTile,其上、下、左、右边分别标记为N、S、W、E,根据样本颜色设置对应Wang Tile边的颜色编码;(2.3) Rotate the clipped diamond-shaped area and the particles inside it to obtain a square WangTile, whose top, bottom, left, and right sides are marked as N, S, W, and E respectively, and set the color code corresponding to the side of the Wang Tile according to the sample color ;
(2.4)、遍历所有的4个样本组合,建立王氏砖集合,使得建立的王氏砖集合为完全王氏砖集合。(2.4), traverse all 4 sample combinations, and establish a Wang's brick set, so that the established Wang's brick set is a complete Wang's brick set.
本发明通过遍历样本库中4个样本的组合,建立完全的王氏砖集合,使的每条边可选的颜色为整个样本库。The present invention establishes a complete set of Wang's bricks by traversing the combination of four samples in the sample library, so that the optional color of each side is the entire sample library.
进一步地,所述样本库包括第一子样本库和第二子样本库,将用于上下边拼接的样本放入第一样本库,将用于左右边拼接的样本放入第二样本库。采用所述样本库合成Wang Tile时,上下边可选的颜色只从第一子样本库中选择,左右边可选的颜色只从第二子样本库中选择。通过上述方法,可以使得人群横向和纵向分布特点不同。Further, the sample library includes a first sub-sample library and a second sub-sample library, the samples used for stitching the upper and lower edges are put into the first sample library, and the samples used for the left and right edges are put into the second sample library . When using the sample library to synthesize Wang Tile, the optional colors for the upper and lower sides are only selected from the first sub-sample library, and the optional colors for the left and right sides are only selected from the second sub-sample library. Through the above method, the characteristics of the horizontal and vertical distribution of the crowd can be made different.
进一步地,所述步骤(3)还包括:Further, the step (3) also includes:
(3.1)、用户指定需要虚拟人群覆盖的多边形场景区域,选择最长边作为覆盖需要对齐的边界,构建矩形区域包括用户指定需要人群覆盖的多边形场景区域;(3.1), the user specifies the polygonal scene area that needs to be covered by the virtual crowd, selects the longest side as the boundary that needs to be aligned to cover, and constructs a rectangular area including the polygonal scene area that the user specifies needs to be covered by the crowd;
(3.2)、指定需要对齐的约束边界上的颜色;(3.2), specify the color on the boundary of the constraint that needs to be aligned;
(3.3)、从约束边界开始选择满足匹配条件的Wang Tile铺排矩形区域;(3.3), select the Wang Tile layout rectangular area that meets the matching conditions from the constraint boundary;
(3.4)、根据原输入场景区域,删除位于其外的粒子,得到最终覆盖场景区域的虚拟人群。(3.4), according to the original input scene area, delete the particles located outside it, and obtain the virtual crowd that finally covers the scene area.
所述指定需要对齐的约束边界上的颜色是指定所述矩形区域的最上一整条和最左一整条边界上的颜色。所述从约束边界开始选择满足匹配条件的Wang Tile铺排矩形区域是指,铺排方向从上到下,从左到右;所述满足匹配条件的Wang Tile是指所选Wang Tile的上边颜色必须与其上方Wang Tile的下边相同、左边颜色必须与其左方Wang Tile的右边相同,剩下两条边的颜色由系统随机指定,但与周围已铺排好的Wang Tile的边的颜色不同。The color on the specified boundary of the constraint that needs to be aligned is the color on the uppermost entire boundary and the leftmost entire boundary of the specified rectangular area. The selection of Wang Tile that meets the matching conditions from the constraint boundary to lay out the rectangular area means that the layout direction is from top to bottom and from left to right; the Wang Tile that meets the matching conditions means that the upper color of the selected Wang Tile must match The lower side of the upper Wang Tile is the same, the left side must have the same color as the right side of the left Wang Tile, and the colors of the remaining two sides are randomly assigned by the system, but they are different from the colors of the surrounding Wang Tile.
优选地,将合成的Wang Tile记录到一张四维的索引表中,所述四维索引表的四个分量分别为合成该Wang Tile的4个样本的颜色,在拼接场景区域时,只需要给出所述Wang Tile的上下左右四条边的颜色,从所述四维索引表中找到对应的Wang Tile,可以快速完成拼接。Preferably, the synthesized Wang Tile is recorded into a four-dimensional index table, and the four components of the four-dimensional index table are respectively the colors of the four samples of the synthesized Wang Tile. When splicing the scene area, it is only necessary to give For the colors of the four sides of the Wang Tile, the upper, lower, left, and right sides, the corresponding Wang Tile can be found from the four-dimensional index table, and splicing can be quickly completed.
本发明公开了一种快速创建大规模虚拟人群的方法,将人视为具有分布和角色信息的粒子,通过从真实图片中获取包含小规模人群粒子信息的样本,建立样本库,并基于王氏砖方法,使用样本制作王氏砖集合,使用王氏砖非周期性拼接覆盖场景区域,从而迅速生成任意规模场景内的多样虚拟人群。本发明的创建方法简单快速,用户只需输入若干样本和需要人群覆盖的场景区域,就可以快速完成创建工作。The invention discloses a method for quickly creating a large-scale virtual crowd, which regards people as particles with distribution and role information, and establishes a sample library by obtaining samples containing particle information of small-scale crowds from real pictures, and based on Wang's The brick method uses samples to make a collection of Wang's bricks, and uses Wang's bricks to splicing aperiodically to cover the scene area, so as to quickly generate diverse virtual crowds in scenes of any scale. The creation method of the present invention is simple and fast, and the user only needs to input a number of samples and scene areas that need to be covered by crowds, and the creation work can be quickly completed.
本发明基于真实图片中具有真实复杂特征的人群做成样本,并采集多个不同的样本形成样本库,在后续的使用过程中,使用拼接、合成、复制等方式产生大量形态各异的大规模虚拟人群,为虚拟人群创作提供极大的便利,同时也具有了真实性和自然性。The present invention makes samples based on people with real and complex characteristics in real pictures, and collects a plurality of different samples to form a sample library. Virtual crowds provide great convenience for the creation of virtual crowds, and at the same time have authenticity and naturalness.
附图说明 Description of drawings
图1为本发明快速创作大规模虚拟人群方法流程图;Fig. 1 is a flow chart of the method for quickly creating large-scale virtual crowds in the present invention;
图2为本发明建立样本库步骤流程图;Fig. 2 is a flow chart of the steps of setting up a sample library in the present invention;
图3为本发明建立Wang Tile的步骤流程图;Fig. 3 is the flow chart of the steps of setting up Wang Tile for the present invention;
图4为本发明拼接Wang Tile的步骤流程图。Fig. 4 is a flow chart of the steps of splicing Wang Tile according to the present invention.
具体实施方式 Detailed ways
下面结合附图和实施例对本发明技术方案做进一步详细说明,以下实施例不构成对本发明的限定。The technical solution of the present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments, and the following embodiments do not constitute a limitation of the present invention.
本发明为了快速创作大规模虚拟人群,首先基于真实图片建立虚拟人群样本库,然后利用样本库建立王氏砖(Wang Tile),最后对Wang Tile进行拼接,形成大规模虚拟人群。具体实施方法如图1所示,包括以下步骤:In order to quickly create a large-scale virtual crowd, the present invention first establishes a virtual crowd sample library based on real pictures, then uses the sample library to build Wang Tile, and finally splices the Wang Tile to form a large-scale virtual crowd. The specific implementation method is shown in Figure 1, including the following steps:
步骤101、基于真实图片创建虚拟人群样本库。Step 101, create a virtual crowd sample library based on real pictures.
步骤102、基于创建的虚拟人群样本库,合成王氏砖Wang Tile,建立王氏砖集合。Step 102: Synthesize Wang Tile based on the created virtual crowd sample library, and establish a collection of Wang Tile.
其中王氏砖概念由数学逻辑家王浩在1961年提出,是一组大小相同的正方形Tile,对Tile的每条边都给定一种颜色,如果两个Tile的邻边颜色相同,则可以将这两个Tile拼接摆放。Among them, the concept of Wang’s brick was proposed by mathematical logician Wang Hao in 1961. It is a group of square tiles of the same size. Each side of the tile is given a color. If the adjacent sides of the two tiles have the same color, it can be Arrange the two tiles together.
合成的王氏砖Wang Tile,其上、下、左、右边分别标记为N、S、W、E,根据样本颜色设置对应Wang Tile边的颜色编码。建立的王氏砖集合为完全王氏砖集合,即每条边可选的颜色为整个样本库。The synthesized Wang Tile is marked with N, S, W, and E on its top, bottom, left, and right sides, and the color code corresponding to the side of the Wang Tile is set according to the sample color. The established Wang's brick set is a complete Wang's brick set, that is, the optional color of each side is the entire sample library.
步骤103、使用王氏砖集合中的Wang Tile对用户输入的场景区域拼接覆盖,得到场景区域内人群粒子集合。Step 103: Use Wang Tile in the Wang tile set to stitch and cover the scene area input by the user to obtain a crowd particle set in the scene area.
即根据用户输入的场景区域,使用王氏砖非周期性快速拼接覆盖,得到场景内人群粒子集合。That is, according to the scene area input by the user, the aperiodic fast splicing and coverage of Wang's bricks is used to obtain the crowd particle set in the scene.
为了保证虚拟人群的真实性和自然性,本发明采用基于真实图片来创建样本库,如图2所示,基于真实图片创建虚拟人群样本库包括以下步骤:In order to ensure the authenticity and naturalness of virtual crowds, the present invention uses real pictures to create a sample library, as shown in Figure 2, creating a virtual crowd sample library based on real pictures includes the following steps:
步骤201、初始化样本正方形,将边长置为1个单位长度,包含的人群位置信息对应缩放至0~1.0单位长度。Step 201: Initialize the sample square, set the side length to 1 unit length, and scale the included crowd location information to 0-1.0 unit length.
步骤202、从真实图片中选取关注的正方形区域。Step 202. Select a square area of interest from the real picture.
步骤203、从选取的正方形区域中选定个体并采集其分布信息和角色属性信息,从三维人物模型库中选择符合角色属性信息的角色模型,根据采集的分布信息对角色模型进行位置和朝向的变换,放入样本正方形区域,作为一个样本。Step 203: Select individuals from the selected square area and collect their distribution information and role attribute information, select a character model that conforms to the character attribute information from the 3D character model library, and perform position and orientation adjustment on the character model according to the collected distribution information Transform, put into the sample square area, as a sample.
具体地,就是将人群中的每个个体视为粒子,每个粒子包含其初始分布信息、角色属性信息。初始分布信息即为位置P(Px,Py)和朝向O(Ox,Oy),角色属性信息主要是人物三维模型属性信息,包括性别Gender、年龄Age、姿态Pose(即对应动作序列)。提取这些信息后,将这些信息应用到符合条件的角色模型上,然后将这些应用了真实照片中个体分布信息和角色属性信息的角色模型放入到样本正方形区域中,形成一个样本。Specifically, each individual in the crowd is regarded as a particle, and each particle contains its initial distribution information and role attribute information. The initial distribution information is the position P(P x , P y ) and the orientation O(O x , O y ). The character attribute information is mainly the attribute information of the 3D model of the character, including gender, age, and pose (that is, the corresponding action sequence ). After extracting the information, apply the information to qualified character models, and then put these character models applied with the individual distribution information and character attribute information in the real photos into the sample square area to form a sample.
步骤204、为每个样本设置一个不同的颜色编码,将样本放入样本库。Step 204, setting a different color code for each sample, and putting the samples into the sample library.
具体地,重复步骤201-步骤204,形成多个样本组成样本库,样本库越大能提供越丰富的样本,因此可以尽可能多的采集真实照片中的个体的分布信息和角色属性信息来构建尽可能多的样本,根据后期要制作的虚拟人群的规模大小,来适当建立样本库也是可行的。Specifically, repeat steps 201 to 204 to form a sample library composed of multiple samples. The larger the sample library, the richer the samples can be provided. Therefore, the distribution information and role attribute information of individuals in real photos can be collected as much as possible to construct It is also feasible to build as many samples as possible according to the size of the virtual crowd to be produced later.
在创建了样本库后,每个样本有一个颜色编码,接下来就可以基于创建的样本库合成王氏砖,并处理Wang Tile内部相邻样本重合区域内的粒子的分布,如图3所示,具体包括下列步骤:After the sample library is created, each sample has a color code, and then Wang’s bricks can be synthesized based on the created sample library, and the distribution of particles in the overlapping area of adjacent samples inside the Wang Tile can be processed, as shown in Figure 3 , including the following steps:
步骤301、分四次从样本库中各挑选一个样本,将4个样本拼接组成一个较大的样本块,两两样本之间具有一定的重合区,4个样本正方形的对角线彼此相交组成的菱形区域即为Wang Tile,重合部分的边长Overlap_size∈(0.1,0.35)。Step 301, select one sample from the sample library in four times, splice the four samples to form a larger sample block, there is a certain overlapping area between two samples, and the diagonal lines of the four sample squares intersect each other to form a The diamond-shaped area of is the Wang Tile, and the side length of the overlapping part is Overlap_size∈(0.1, 0.35).
步骤302、在菱形区域内,对相邻样本重叠区域内的粒子集进行Voronoi划分,选择一条由Voronoi边组成的分割线,使得所隔开的粒子距离最远,分别保留位于分割线左侧的左侧样本粒子和位于分割线右侧的右侧样本粒子,保证重叠区域内粒子分布的自然性。Step 302, in the diamond-shaped area, perform Voronoi division on the particle set in the overlapping area of adjacent samples, select a dividing line composed of Voronoi edges, so that the distance between the separated particles is the farthest, and respectively retain the particles located on the left side of the dividing line The left sample particle and the right sample particle located on the right side of the dividing line ensure the naturalness of the particle distribution in the overlapping area.
步骤303、旋转裁剪后的菱形区域及位于其内的粒子,得到正方形Wang Tile,其上、下、左、右边分别标记为N、S、W、E,根据样本颜色设置对应Wang Tile边的颜色编码。Step 303: Rotate the cropped diamond-shaped area and the particles inside it to obtain a square Wang Tile, whose upper, lower, left, and right sides are marked as N, S, W, and E respectively, and set the color corresponding to the side of the Wang Tile according to the sample color coding.
步骤304、遍历所有的4个样本组合,建立王氏砖集合,使得建立的王氏砖集合为完全王氏砖集合,即每条边可选的颜色为整个样本库。Step 304, traversing all 4 sample combinations to establish a Wang's brick set, so that the established Wang's brick set is a complete Wang's brick set, that is, the optional color of each edge is the entire sample library.
为了得到完全的王氏砖集合,需要遍历样本库中每一种4个样本的组合,将其合成的Wang Tile记录到一张四维的索引表中,该四维索引表的四个分量分别为4个样本的颜色,即这4个样本合成的Wang Tile的N/S/W/E四条边的颜色。在后续步骤中,只需要给出N/S/W/E四条边的颜色,就可以在四维索引表中找到对应的Wang Tile。In order to obtain a complete set of Wang tiles, it is necessary to traverse each combination of 4 samples in the sample library, and record the Wang Tile synthesized into a four-dimensional index table, the four components of which are 4 The color of the four samples, that is, the color of the N/S/W/E four sides of the Wang Tile synthesized by these four samples. In the next step, you only need to give the colors of the four sides N/S/W/E, and you can find the corresponding Wang Tile in the four-dimensional index table.
完全的王氏砖集合为大规模创建虚拟人群奠定了基础,在虚拟场景中,用户指定需要人群覆盖的多边形区域,选择最长边作为Wang Tile拼接需要对齐的边界,构建一个覆盖该多边形区域的矩形区域。然后根据矩形边界的长和宽和Wang Tile的边界长度计算该矩形区域中每行所需的Wang Tile个数H_NUM和每列所需的Wang Tile个数C_NUM,在矩形覆盖区域内,从王氏砖集合中随机挑选(或部分指定)H_NUM×C_NUM个Tile进行符合匹配规则的铺排拼接,所有的Wang Tile放在一起后,横向边(N/S边)共有HNUM+1行,每行C NUM个,用一个二维矩阵BN[H_NUM+1][C_NUM]来表示;竖直边(W/E边)共有C NUM+l列,每列HNUM个,用一个二维矩阵BW[C_NUM+1][H_NUM]来表示。The complete collection of Wang tiles lays the foundation for large-scale creation of virtual crowds. In the virtual scene, the user specifies a polygonal area that needs to be covered by the crowd, selects the longest side as the boundary that Wang Tile splicing needs to align, and constructs a polygon that covers the polygonal area. rectangular area. Then calculate the Wang Tile number H_NUM required for each row and the Wang Tile number C_NUM required for each column in the rectangular area according to the length and width of the rectangular border and the border length of Wang Tile. In the rectangular coverage area, from Wang Tile Randomly select (or partially specify) H_NUM×C_NUM tiles from the brick collection to arrange and splice according to the matching rules. After all Wang tiles are put together, there are HNUM+1 lines in the horizontal side (N/S side), and each line is C NUM , represented by a two-dimensional matrix B N [H_NUM+1][C_NUM]; the vertical side (W/E side) has a total of C NUM+1 columns, each column HNUM, with a two-dimensional matrix B W [C_NUM +1][H_NUM] for that.
随机非周期性拼接步骤如图4所示,包括步骤:The random aperiodic splicing steps are shown in Figure 4, including steps:
步骤401、用户指定需要虚拟人群覆盖的多边形场景区域,选择最长边作为覆盖需要对齐的边界,构建矩形区域包括用户指定需要虚拟人群覆盖的多边形场景区域;Step 401, the user specifies the polygonal scene area that needs to be covered by virtual crowds, selects the longest side as the boundary that needs to be aligned for coverage, and constructs a rectangular area including the polygonal scene area that needs to be covered by virtual crowds specified by the user;
步骤402、指定需要对齐的约束边界上的颜色,通常指定矩形区域的最上一整条和最左一整条边界上的颜色,即二维矩阵BN中的最上一行BN[H_NUM+1]和二维矩阵BW中的最左一列BW[C_NUM+1]的颜色值。边界约束既可以由用户指定,也可以由系统自动指定。Step 402, specify the color on the constraint boundary that needs to be aligned, usually specify the color on the uppermost and leftmost entire boundary of the rectangular area, that is, the uppermost row B N [H_NUM+1] in the two-dimensional matrix B N and the color value of the leftmost column B W [C_NUM+1] in the two-dimensional matrix B W. Boundary constraints can be specified by the user or automatically by the system.
步骤403、从约束边界开始选择满足匹配条件的Wang Tile铺排区域,铺排方向从N到S,从W到E。满足匹配条件的Wang Tile为:所选WangTile的N边颜色必须与其上方Wang Tile的S边相同、W边颜色必须与其左方Wang Tile的E边相同,剩下两条边的颜色可由系统随机指定,但要尽量与周围已铺排好的Wang Tile的边的颜色不同。当Wang Tile的四条边颜色都已经确定后,从索引表INDEX中获得该Wang Tile放入铺排区域。铺排结束后,得到矩形区域内的人群粒子CrowdParticles。Step 403: Select the Wang Tile laying area that meets the matching conditions from the constraint boundary, and the laying direction is from N to S, and from W to E. The Wang Tile that meets the matching conditions is: the color of the N side of the selected WangTile must be the same as the S side of the Wang Tile above it, the W side color must be the same as the E side of the Wang Tile to the left, and the colors of the remaining two sides can be randomly specified by the system , but try to be different from the color of the side of the Wang Tile that has been laid out around. When the colors of the four sides of the Wang Tile have been determined, the Wang Tile is obtained from the index table INDEX and placed in the layout area. After laying out, get the crowd particles CrowdParticles in the rectangular area.
步骤404、根据原输入场景区域,删除位于其外的粒子,如果场景区域内具有障碍物,删除位于障碍物多边形之内的粒子,得到最终覆盖场景的人群粒子CrowdParticles。Step 404: According to the original input scene area, delete the particles located outside it, if there are obstacles in the scene area, delete the particles located within the obstacle polygon, and finally obtain the crowd particles CrowdParticles covering the scene.
需要说明的是,由于王氏砖集合内的Tile按照其四条边的颜色作为四维索引表的分量保存在四维索引表中,通过四条边(N/S/W/E)的颜色可以快速查找其在索引表中位置,从而找到想要使用的Wang Tile来拼接覆盖场景区域。It should be noted that since the tiles in the Wang brick set are stored in the four-dimensional index table according to the colors of their four sides as components of the four-dimensional index table, the colors of the four sides (N/S/W/E) can be used to quickly search for other tiles. Position in the index table to find the Wang Tile you want to use to stitch and cover the scene area.
这里需要格外说明的是,由于样本的N边只与S边拼接,W边只与E边拼接,为了能够灵活地生成人群,也可以为N/S边设置一个可选子样本库1,而为W/E边设置另外一个子样本库2。当样本库进一步包括子样本库时,对于合成Wang Tile时挑选样本的组合方式有所变化,即当在合成Wang Tile时,N/S边可选的颜色只从子样本库1中选择,W/E边可选的颜色只从子样本库2中选择。What needs to be explained here is that since the N side of the sample is only spliced with the S side, and the W side is only spliced with the E side, in order to be able to flexibly generate crowds, an optional sub-sample library 1 can also be set for the N/S side, and Set up another subsample bank 2 for the W/E sides. When the sample library further includes a sub-sample library, the combination method of selecting samples when synthesizing Wang Tile is changed, that is, when synthesizing Wang Tile, the optional colors of N/S sides are only selected from sub-sample library 1, W /E Side optional colors are selected from subsample library 2 only.
用户也可以根据样本的特点从样本库中自主选择想要的样本放入子样本库1和子样本库2中(例如:子样本库1中的人群密度较大,子样本库2中的人群密度较小等等)。通过上述方法,可以使得人群横向和纵向分布特点不同。Users can also independently select desired samples from the sample library according to the characteristics of the samples and put them into sub-sample library 1 and sub-sample library 2 (for example: the population density in sub-sample library 1 is relatively large, and the population density in sub-sample library 2 is relatively high). smaller, etc.). Through the above method, the characteristics of the horizontal and vertical distribution of the crowd can be made different.
以上实施例仅用以说明本发明的技术方案而非对其进行限制,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。The above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and changes according to the present invention. deformation, but these corresponding changes and deformations should belong to the scope of protection of the appended claims of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210204293.6A CN102800116B (en) | 2012-06-18 | 2012-06-18 | Method for rapidly creating large-scale virtual crowd |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210204293.6A CN102800116B (en) | 2012-06-18 | 2012-06-18 | Method for rapidly creating large-scale virtual crowd |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102800116A CN102800116A (en) | 2012-11-28 |
| CN102800116B true CN102800116B (en) | 2014-11-05 |
Family
ID=47199213
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201210204293.6A Active CN102800116B (en) | 2012-06-18 | 2012-06-18 | Method for rapidly creating large-scale virtual crowd |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102800116B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2536734B (en) * | 2015-04-17 | 2017-08-02 | Imagination Tech Ltd | Image synthesis |
| CN109152097B (en) * | 2018-07-26 | 2021-08-17 | 东华大学 | Node layout method of wireless sensor network in agricultural sightseeing park based on social force model |
| CN110415326A (en) * | 2019-07-18 | 2019-11-05 | 成都品果科技有限公司 | A kind of implementation method and device of particle effect |
| CN113902868B (en) * | 2021-11-18 | 2024-04-26 | 中国海洋大学 | Wang Cubes-based large-scale ocean scene creation method and Wang Cubes-based large-scale ocean scene creation device |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7565276B2 (en) * | 2006-04-05 | 2009-07-21 | Seoul National University Industry Foundation | Method of simulating detailed movements of fluids using derivative particles |
| CN102157008B (en) * | 2011-04-12 | 2014-08-06 | 电子科技大学 | Large-scale virtual crowd real-time rendering method |
-
2012
- 2012-06-18 CN CN201210204293.6A patent/CN102800116B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN102800116A (en) | 2012-11-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Gaboury | Image objects: An archaeology of computer graphics | |
| CN109887084B (en) | A method of using immersive virtual reality technology for urban planning | |
| Kazi et al. | Draco: bringing life to illustrations with kinetic textures | |
| CN107018336A (en) | The method and apparatus of image procossing and the method and apparatus of Video processing | |
| CN106296815A (en) | The structure of a kind of interactive three-dimensional digital city and display packing | |
| Dezen-Kempter et al. | Towards a digital twin for heritage interpretation | |
| Lou | A Virtual Reality Teaching System for Graphic Design Course. | |
| Lai et al. | Development of a 3D virtual environment for improving public participation: Case study–The Yuansantze Flood Diversion Works Project | |
| CN102800116B (en) | Method for rapidly creating large-scale virtual crowd | |
| CN116012843A (en) | A method and system for generating virtual scene data annotation | |
| Cristie et al. | CityHeat: visualizing cellular automata-based traffic heat in Unity3D | |
| Flagg et al. | Video-based crowd synthesis | |
| Cantrell et al. | Modeling the environment: techniques and tools for the 3D illustration of dynamic landscapes | |
| Liu et al. | Design and implementation of virtual campus roaming system based on Unity3d | |
| CN117788689A (en) | Interactive virtual cloud exhibition hall construction method and system based on three-dimensional modeling | |
| Lu et al. | Design and implementation of virtual interactive scene based on unity 3D | |
| Banfi et al. | Virtual access to heritage through scientific drawing, semantic models and VR-experience of the Stronghold of Arquata del Tronto after the earthquake | |
| Baglivo et al. | X3D/X3DOM, Blender Game Engine and OSG4WEB: open source visualisation for cultural heritage environments | |
| CN103208130B (en) | Large-scale group performance animation synthetic method and equipment | |
| Cogo et al. | Survey of integrability of procedural modeling techniques for generating a complete city | |
| Montana et al. | Sketching for real-time control of crowd simulations | |
| KR101267570B1 (en) | Virtual character steering behaviors simulation method and apparatus based on attractive field with 2d texture image, and virtual ecology park visualization method | |
| CN117934705A (en) | Building model batch generation method and device, readable storage medium and electronic equipment | |
| CN110580743A (en) | A method of building a virtual reality movie theater based on artificial intelligence feedback | |
| CN108492354A (en) | A kind of methods of exhibiting and system of Agricultural Park scene |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant |