CN102509357A - Pencil sketch simulating and drawing system based on brush stroke - Google Patents

Pencil sketch simulating and drawing system based on brush stroke Download PDF

Info

Publication number
CN102509357A
CN102509357A CN2011103000283A CN201110300028A CN102509357A CN 102509357 A CN102509357 A CN 102509357A CN 2011103000283 A CN2011103000283 A CN 2011103000283A CN 201110300028 A CN201110300028 A CN 201110300028A CN 102509357 A CN102509357 A CN 102509357A
Authority
CN
China
Prior art keywords
path
hachure
strokes
sampled point
pencil
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.)
Granted
Application number
CN2011103000283A
Other languages
Chinese (zh)
Other versions
CN102509357B (en
Inventor
王宁
胡包钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN201110300028.3A priority Critical patent/CN102509357B/en
Publication of CN102509357A publication Critical patent/CN102509357A/en
Application granted granted Critical
Publication of CN102509357B publication Critical patent/CN102509357B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

本发明公开了一种基于笔触的铅笔素描模拟和绘制系统。该系统以三维几何模型作为输入,采用自动生成结合交互式的方式生成铅笔素描图片。该系统将铅笔素描绘画中的笔触分为特征笔触和影线笔触,并分别进行模拟和绘制。系统主要包含五个模块:用户交互模块、特征路径自动生成模块、影线路径自动生成模块、由路径生成笔触模块、绘制输出模块。该发明具有符合人类实际铅笔素描创作机理、绘制效果真实、易于编辑修改等特点,在计算机辅助设计、艺术设计、特效制作、数字娱乐等方面具有重要的应用价值。

Figure 201110300028

The invention discloses a pencil sketch simulation and drawing system based on strokes. The system takes a 3D geometric model as input, and generates pencil sketch pictures by means of automatic generation combined with interactive methods. The system divides the strokes in pencil sketch drawing into characteristic strokes and hatched strokes, and simulates and draws them respectively. The system mainly includes five modules: user interaction module, feature path automatic generation module, hatch path automatic generation module, stroke generation module from path, and drawing output module. The invention has the characteristics of conforming to the actual creation mechanism of human pencil sketches, realistic drawing effects, and easy editing and modification, and has important application value in computer-aided design, art design, special effect production, digital entertainment, etc.

Figure 201110300028

Description

基于笔触的铅笔素描模拟和绘制系统Stroke-based Pencil Sketch Simulation and Drawing System

技术领域 technical field

本发明属于计算机图形学、计算机辅助设计和艺术设计相结合的交叉学科技术领域,涉及一种根据输入三维几何模型自动或者交互式生成基于笔触的铅笔素描的方法。The invention belongs to the interdisciplinary technical field of combining computer graphics, computer-aided design and art design, and relates to a method for automatically or interactively generating pencil sketches based on strokes according to an input three-dimensional geometric model.

背景技术 Background technique

各种艺术媒体的模拟仿真一直在数字艺术设计、数字娱乐、电影动画制作以及数字图像处理等邻域有着广泛的应用价值,而铅笔素描绘画作为绘画的基础内容更是受到了广泛关注。现有的铅笔素描模拟绘制方法大体可以分为四类:基于体绘制的方法、基于纹理映射的方法、基于图像的方法和基于笔触的方法。The simulation of various art media has been widely used in the fields of digital art design, digital entertainment, film animation production, and digital image processing, and pencil sketch drawing, as the basic content of painting, has attracted extensive attention. The existing pencil sketch simulation drawing methods can be roughly divided into four categories: methods based on volume rendering, methods based on texture mapping, methods based on images and methods based on strokes.

铅笔素描模拟绘制工作中最早期的工作是Takagi等人建立的体绘制模型。体绘制方法通常需要较高的存储量和计算量,且只能用于铅笔绘画材质的模拟。The earliest work in the pencil sketch simulation rendering work is the volume rendering model established by Takagi et al. Volume rendering methods usually require a high amount of storage and calculation, and can only be used for the simulation of pencil drawing materials.

基于纹理映射的方法通常预先生成一些铅笔素描纹理,并将生成的纹理按照曲率方向贴到几何体表面。由于目前图形硬件设备对纹理映射支持度较好,这种方法可以在三维几何上实现铅笔素描的实时绘制。纹理映射方法的缺点是,由于该方法仅在三维对象空间中对物体进行描述,没有二维图像空间信息,因而结果过于规整,缺少手绘效果。The method based on texture mapping usually generates some pencil sketch textures in advance, and pastes the generated textures on the geometry surface according to the curvature direction. Since current graphics hardware devices have good support for texture mapping, this method can realize real-time drawing of pencil sketches on 3D geometry. The disadvantage of the texture mapping method is that because this method only describes the object in the three-dimensional object space and has no two-dimensional image space information, the result is too regular and lacks the hand-painted effect.

基于图像的铅笔素描模拟均以二维数字图像作为输入,首先根据输入图像生成噪声图像和二维向量场,然后运用线性积分卷积(LIC)生成最终的铅笔素描图片。与纹理映射方法相反,这类方法仅在二维图像空间中对绘制对象进行描述,无法利用对象三维空间的几何信息。由于缺少结构信息,数据表示一般较为松散,不利于编辑。Image-based pencil sketch simulations all take a two-dimensional digital image as input, first generate a noise image and a two-dimensional vector field based on the input image, and then use linear integral convolution (LIC) to generate the final pencil sketch image. Contrary to the texture mapping method, this kind of method only describes the drawing object in the two-dimensional image space, and cannot utilize the geometric information of the object's three-dimensional space. Due to the lack of structural information, data representation is generally loose, which is not conducive to editing.

基于纹理映射的方法和基于图像的方法均将铅笔素描线条作为集合体(纹理或者图像)对待,缺少单独的铅笔线条信息,因而不能反映人类的绘画过程和绘画习惯。基于笔触的铅笔素描模拟绘制方法则克服了上述缺点。笔触(strokes)拥有自己的几何描述,每一条笔触对应于绘画中的一笔。笔触中还可以存储各种属性,例如绘画时使用的压力、颜色等,这为涉及模拟绘制和交互的应用提供了方便。用户也可以通过拾取、编辑、删除等操作对笔触进行更改。由笔触构成的图片几乎保存了绘画时的全部信息。另外由于笔触具有几何结构,可以将绘制结果以任意精度进行输出。这些优点使得基于笔触的方法具有很高的实用性,被广泛用在各种艺术设计软件中。Both the texture-mapping-based method and the image-based method treat the pencil sketch lines as a collection (texture or image), lacking individual pencil line information, and thus cannot reflect human's drawing process and drawing habits. Pencil sketch simulation drawing method based on stroke then overcomes above-mentioned shortcoming. Strokes have their own geometric description, and each stroke corresponds to a stroke in the painting. Various attributes can also be stored in strokes, such as the pressure used when drawing, color, etc., which provides convenience for applications involving simulated drawing and interaction. Users can also change strokes through operations such as picking, editing, and deleting. A picture composed of brush strokes preserves almost all the information of painting. In addition, due to the geometric structure of strokes, the drawing results can be output with arbitrary precision. These advantages make the stroke-based method highly practical and widely used in various art design software.

发明内容 Contents of the invention

本发明的目的在于,针对目前广泛存在的各种商业三维几何模型库或者自由三维几何模型文件(文件格式有.obj,.max,.3ds等),提供了一个基于笔触的、能够从输入三维几何模型全自动或者交互式生成铅笔素描绘画的系统。该系统生成的铅笔素描绘画由笔触(stroke)构成,能够反映真实铅笔素描的创作机理和过程,且易于被用户编辑和修改,可用于各种铅笔素描绘画的虚拟创作。The purpose of the present invention is to provide a stroke-based tool that can input three-dimensional A system for automatically or interactively generating pencil sketch drawings from geometric models. The pencil sketch generated by the system is composed of strokes, which can reflect the creation mechanism and process of a real pencil sketch, and is easy to be edited and modified by users, and can be used for virtual creation of various pencil sketches.

本发明提出一种基于笔触的铅笔素描模拟和绘制系统,该系统包括五个模块:The present invention proposes a pencil sketch simulation and drawing system based on strokes, the system includes five modules:

用户交互模块,用于为用户提供界面进行三维几何模型选择并将选择的三维几何模型输出至特征路径自动生成模块和影线路径自动生成模块;The user interaction module is used to provide an interface for the user to select a 3D geometric model and output the selected 3D geometric model to the feature path automatic generation module and the hatch path automatic generation module;

特征路径自动生成模块,用于根据输入的三维几何模型自动生成特征路径;A feature path automatic generation module is used to automatically generate a feature path according to the input 3D geometric model;

影线路径自动生成模块,用于根据输入的三维几何模型自动生成影线路径;The hatch path automatic generation module is used for automatically generating the hatch path according to the input 3D geometric model;

由路径生成笔触模块,用于根据特征路径自动生成模块生成的特征路径和影线路径自动生成模块生成的影线路径,生成特征笔触和影线笔触的几何及其属性;Generate a stroke module from the path, for generating the geometry and attributes of the feature stroke and the hatch stroke according to the feature path generated by the feature path automatic generation module and the hatch path automatically generated by the hatch path automatic generation module;

绘制输出模块,用于根据笔触的几何和属性,采用铅笔物理模型绘制出铅笔笔触。The drawing output module is used for drawing pencil strokes by using the pencil physical model according to the geometry and attributes of the strokes.

本发明的有益效果是提出了一种基于笔触的铅笔素描模拟和绘制系统,根据输入的三维几何模型,利用全自动生成算法或者交互式工具生成铅笔素描绘画。本发明与前人方法的区别主要体现在,可以生成更多种类的特征笔触,并且提出了一种利用采样算法、全自动生成影线笔触的新方法,另外提供了一种利用影线架(hatching carrier)进行笔触设计的交互式工具。用户还可以利用系统提供的交互式工具对自动生成的特征笔触和影线笔触进行编辑修改或者删除操作,也可以添加新的特征笔触和影线笔触。从最终生成的铅笔素描结果可以看出,系统可以快速生成真实、具有手绘效果的铅笔素描绘画作品。由于系统具有辅助设计作用,降低了用户的绘画技能要求,且加快了铅笔素描作品的创作速度。另外由于数字虚拟设计相对于使用纸张和铅笔的传统创作,在传输、复制、保存等方面具有优势,因而该系统在数字艺术设计、电影动画特效、数字娱乐等领域具有很高的应用价值。The beneficial effect of the present invention is to propose a stroke-based pencil sketch simulation and drawing system, which generates pencil sketch drawing by using a fully automatic generation algorithm or an interactive tool according to an input three-dimensional geometric model. The difference between the present invention and previous methods is mainly reflected in that more types of characteristic strokes can be generated, and a new method for fully automatic generation of hatched strokes by using sampling algorithm is proposed, and a new method of using hatching frame ( hatching carrier) interactive tool for stroke design. Users can also use the interactive tools provided by the system to edit, modify or delete the automatically generated feature strokes and hatch strokes, and can also add new feature strokes and hatch strokes. It can be seen from the results of the final pencil sketch that the system can quickly generate realistic pencil sketch drawings with hand-painted effects. Because the system has an auxiliary design function, it reduces the user's drawing skill requirements and accelerates the creation speed of pencil sketch works. In addition, compared with the traditional creation using paper and pencil, digital virtual design has advantages in transmission, reproduction and preservation, so the system has high application value in digital art design, film animation special effects, digital entertainment and other fields.

附图说明 Description of drawings

图1为本发明系统的模块化流程图。Fig. 1 is a modular flow chart of the system of the present invention.

图2为由三角面片提取的路径的示意图。Fig. 2 is a schematic diagram of paths extracted from triangular patches.

图3为自动生成铅笔影线笔触的流程图。Fig. 3 is a flow chart of automatically generating pencil hatch strokes.

图4为基于累积概率密度的采样算法流程图。Fig. 4 is a flowchart of a sampling algorithm based on cumulative probability density.

图5为基于Metropolis-Hastings的采样算法流程图。Figure 5 is a flowchart of the sampling algorithm based on Metropolis-Hastings.

图6为两种采样点修正策略的示意图。Fig. 6 is a schematic diagram of two sampling point correction strategies.

图7为采样点修正效果图。Figure 7 is a diagram of the sampling point correction effect.

图8为由系统自动生成的茶壶铅笔素描效果图。Figure 8 is the rendering of the teapot pencil sketch automatically generated by the system.

图9为由系统自动生成的植物铅笔素描效果图。Fig. 9 is an effect diagram of a pencil sketch of a plant automatically generated by the system.

图10为由路径构造笔触的示意图。Fig. 10 is a schematic diagram of constructing strokes from paths.

图11为构造路径的不同笔头形状的示意图。Fig. 11 is a schematic diagram of different tip shapes for constructing paths.

图12为系统提供的交互式笔触设计工具的示意图。Fig. 12 is a schematic diagram of the interactive stroke design tool provided by the system.

图13为交互式笔触设计工具中控制粒子的运动轨迹的示例。Figure 13 is an example of the trajectory of the control particles in the interactive stroke design tool.

图14为使用交互式笔触设计工具在参考图像上绘制影线笔触的示例。Figure 14 is an example of drawing hatched strokes on a reference image using the interactive stroke design tool.

图15为交互式笔触设计工具绘制的各种笔触的示例。Figure 15 is an example of various strokes drawn by the interactive stroke design tool.

图16为交互式铅笔素描设计各个步骤的效果图。Fig. 16 is an effect diagram of each step of interactive pencil sketch design.

图17为交互式生成的植物铅笔素描效果图。Figure 17 is an interactively generated pencil sketch rendering of a plant.

图18为绘制的彩色铅笔素描效果图。Figure 18 is the rendering of the colored pencil sketch.

具体实施方式 Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

图1给出了整个系统的模块化流程图。整个系统主要包括五个模块:用户交互模块、特征路径自动生成模块、影线路径自动生成模块、由路径生成笔触模块、绘制输出模块。其中特征路径自动生成模块、影线路径自动生成模块、由路径生成笔触模块、绘制输出模块由系统自动控制,用户交互模块主要提供各种交互式工具供用户使用。Figure 1 shows the modular flow chart of the whole system. The whole system mainly includes five modules: user interaction module, feature path automatic generation module, hatch path automatic generation module, stroke generation module from path, and drawing output module. Among them, the feature path automatic generation module, the hatch path automatic generation module, the stroke generation module from the path, and the drawing output module are automatically controlled by the system, and the user interaction module mainly provides various interactive tools for users to use.

系统首先由特征路径自动生成模块和影线路径自动生成模块生成特征路径和影线路径,然后输出的特征路径和影线路径作为输入进入由路径生成笔触模块。由路径生成笔触模块根据笔触构造规则,由输入的特征路径和影线路径生成笔触几何和属性,并输出至绘制输出模块。最后绘制输出模块根据输入的笔触几何和属性,以及铅笔绘制的物理模型,生成最终的铅笔素描图片。用户交互模块对整个生成过程提供交互式工具,使得用户可以对自动生成的结果进行补充、删除和编辑。The system first generates feature paths and hatch paths by the feature path automatic generation module and hatch path automatic generation module, and then the output feature path and hatch path are input into the stroke generation module from path. The brush stroke generation module from path generates stroke geometry and attributes from the input feature path and hatch path according to the stroke construction rules, and outputs them to the drawing output module. Finally, the drawing output module generates the final pencil sketch image according to the input stroke geometry and attributes, as well as the physical model drawn by the pencil. The user interaction module provides interactive tools for the entire generation process, enabling users to supplement, delete and edit the automatically generated results.

在本发明说明书中,路径(path)是指笔触所经过的轨迹。该轨迹形成笔触的主干,对应于实际手工绘画中画笔笔尖的中心点在纸面上经过的轨迹。笔触(stroke)是指计算机图形学中一种具有几何形状和属性的图形表示,对应于实际手工绘画中的某一笔线条。特征路径(feature path)是指用来描述特征的线条路径,通常用来反映物体的几何特性(例如物体边界)、色彩的边界、光线明暗的边界等。影线路径(hatching path)主要用来表现场景中的光影、色调、颜色、材质等,一般以大量路径组成的群体集合形式出现。特征路径和影线路径生成的笔触分别称为特征笔触(feature stroke)和影线笔触(hatching stroke)。In the description of the present invention, a path (path) refers to a trajectory that a stroke passes through. This trajectory forms the backbone of the stroke and corresponds to the trajectory that the center point of the brush tip travels on the paper in actual manual painting. Stroke (stroke) refers to a graphic representation with geometric shapes and attributes in computer graphics, corresponding to a certain line in actual manual painting. Feature path (feature path) refers to the line path used to describe the feature, usually used to reflect the geometric characteristics of the object (such as the boundary of the object), the boundary of color, the boundary of light and shade, etc. The hatching path is mainly used to express the light and shadow, tone, color, material, etc. in the scene, and generally appears in the form of a group set composed of a large number of paths. The strokes generated by feature paths and hatch paths are called feature strokes and hatching strokes, respectively.

参考图像(reference image)是图形学中用二维数据结构来记录和反映三维信息的一种技术,最早在1999年由Kowalski等人提出。由于早期帧缓存中存储的数据需要读回内存才能进行处理,且通常存储为图像格式,所以称作参考图像。随着可编程图形管线(programmable graphicspipeline)的发展,目前数据可以直接在显存中进行处理,因而也可以称为参考缓存(reference buffer)。Reference image (reference image) is a technique in graphics that uses two-dimensional data structures to record and reflect three-dimensional information. It was first proposed by Kowalski et al. in 1999. Since the data stored in the early frame buffer needs to be read back to the memory for processing, and is usually stored in an image format, it is called a reference image. With the development of programmable graphics pipeline (programmable graphics pipeline), data can be processed directly in video memory at present, so it can also be called reference buffer (reference buffer).

本发明中会使用到三种参考图像,分别为身份参考图像(ID referenceimage),颜色参考图像(color reference image)和光照参考图像(illuminationreference image)。其中身份参考图像使用不同颜色值来区分绘制对象,用于特征片段的消隐线算法;颜色参考图像和光照参考图像用来辅助进行影线的设计。Three kinds of reference images are used in the present invention, which are ID reference image, color reference image and illumination reference image. Among them, the identity reference image uses different color values to distinguish the drawn objects, which is used for the hidden line algorithm of the feature segment; the color reference image and the illumination reference image are used to assist in the design of the shadow line.

下面结合附图1对用户交互模块、特征路径自动生成模块、影线路径自动生成模块、由路径生成笔触模块、绘制输出模块逐一进行说明。The user interaction module, the feature path automatic generation module, the hatch path automatic generation module, the stroke generation module from the path, and the drawing output module will be described one by one in conjunction with Figure 1 below.

1.用户交互模块1. User interaction module

用户交互模块提供以下若干工具供用户进行参数选择和交互式设计:The user interaction module provides the following tools for the user to perform parameter selection and interactive design:

(1)选定所需的三维几何模型向特征路径自动生成模块和影线路径自动生成模块输出,并在此基础上,对模型坐标、摄像机坐标、光源位置和类型、光模型等进行选择和设定。用户还可以根据需要选择自动生成的特征路径类型;(1) Select the desired 3D geometric model and output it to the feature path automatic generation module and hatch path automatic generation module, and on this basis, select and analyze the model coordinates, camera coordinates, light source position and type, light model, etc. set up. Users can also select the automatically generated feature path type according to their needs;

(2)系统根据选定的几何模型和光照模型绘制出颜色参考图像后,用户可以根据需要对颜色参考图像进行编辑;(2) After the system draws the color reference image according to the selected geometric model and illumination model, the user can edit the color reference image as required;

(3)用户可以根据需要,使用路径设计工具在参考图像的基础上进行路径设计,具体参考路径设计的交互式工具中的描述;(3) Users can use the path design tool to design paths based on the reference image according to their needs. For details, refer to the description in the interactive tool of path design;

(4)系统提供不同类型的铅笔类型,分为9B,8B,...2B,B,F,HB,H,2H,...6H等,不同的铅笔类型,其所含石墨、泥土、石蜡的百分比也不同;(4) The system provides different types of pencils, which are divided into 9B, 8B, ... 2B, B, F, HB, H, 2H, ... 6H, etc. Different types of pencils contain graphite, soil, The percentage of paraffin is also different;

(5)系统采用Perlin噪声生成各种纸张的高度场,并可用于铅笔绘制的物理模型;(5) The system uses Perlin noise to generate the height field of various papers, and can be used for the physical model of pencil drawing;

(6)当系统自动生成特征笔触和影线笔触之后,用户还可以使用交互式工具对生成的笔触进行拾取、编辑修改、删除等操作,也可以使用交互式工具添加新的笔触。(6) After the system automatically generates feature strokes and hatch strokes, users can also use interactive tools to pick up, edit, modify, and delete generated strokes, and can also use interactive tools to add new strokes.

2.特征路径自动生成模块2. Feature path automatic generation module

特征路径自动生成模块的功能是从输入的三维几何模型中生成所需的特征路径,主要包括以下四个步骤:The function of the feature path automatic generation module is to generate the required feature path from the input 3D geometric model, which mainly includes the following four steps:

(1)从输入的三维几何模型中存储的三角面片上提取特征片段;(1) Extract feature segments from the triangular faces stored in the input 3D geometric model;

(2)根据输入的三维几何模型和步骤(1)中提取的特征片段构造身份参考图像,用于后续的消隐线算法;(2) Constructing an identity reference image according to the input 3D geometric model and the feature fragments extracted in step (1), for the subsequent hidden line algorithm;

(3)利用身份参考图像,使用消隐线算法对特征片段进行消隐;(3) Utilize the identity reference image, use the hidden line algorithm to hide the feature segment;

(4)将消隐后的特征片段链接成特征路径。(4) Link the hidden feature segments into a feature path.

系统中使用的特征路径有轮廓线(silhouettes or occluding contours)、提示轮廓线(suggestive contours)、折痕线(creases)、边界线(borders orboundary edges)、脊线(ridges)、谷线(valleys)、明显脊线(apparent ridges)、提示高光线(suggestive highlights)、主高光线(principal highlights)等。这些特征路径都可以由现有的方法从三维几何模型实现自动生成。各种特征路径之间没有优劣之分,每种特征路径都有其独特的特征,每种特征路径也都有适用和不适用的场合。某些特征路径之间存在重合和相似的成分,例如脊线和明显脊线、明显脊线和提示轮廓线,因此,在实际使用中,特征路径的种类也不是越多越好,太多容易显得杂乱无序,而特征路径太少又不足反映所需的特征,减少了最终铅笔素描结果的表现内容。因此本发明既提供了自动生成特征路径的模块,也在用户交互模块中提供了工具允许用户自行添加路径。实际使用中,首先由用户根据需要让系统自动生成特征路径和影线路径,然后用户根据自动生成的结果进行选择、编辑、删除操作,或者自行添加新的特征路径和影线路径是比较方便有效的解决方案。The feature paths used in the system include silhouettes or occluding contours, suggestive contours, creases, borders boundary edges, ridges, valleys , apparent ridges, suggestive highlights, principal highlights, etc. These feature paths can be automatically generated from 3D geometric models by existing methods. There is no distinction between various feature paths. Each feature path has its own unique characteristics, and each feature path also has applicable and inapplicable occasions. There are overlapping and similar components between some feature paths, such as ridges and obvious ridges, obvious ridges and hint contours. Therefore, in actual use, the types of feature paths are not the better, too many are easy It appears disorganized, and the feature paths are too few to reflect the required features, reducing the expressive content of the final pencil sketch result. Therefore, the present invention not only provides a module for automatically generating feature paths, but also provides tools in the user interaction module to allow users to add paths by themselves. In actual use, it is more convenient and effective for the user to let the system automatically generate feature paths and hatch paths according to needs, and then select, edit, and delete operations based on the automatically generated results, or add new feature paths and hatch paths by themselves. s solution.

现有的以三维几何模型为输入的特征路径提取方法均从三角面片的计算中获取特征路径。单个三角面片中提取的特征路径称为一个特征片段(feature segment),它由两个端点以及两个端点的连线组成。首尾相连的多个特征线片段链接起来形成特征路径。这里以轮廓线为例进行说明,其它类型的特征路径提取算法可以参考相应的文献。Existing feature path extraction methods that take 3D geometric models as input all obtain feature paths from the calculation of triangular patches. The feature path extracted from a single triangular patch is called a feature segment, which consists of two endpoints and the connecting line between the two endpoints. Multiple feature line segments connected end to end are linked to form a feature path. Here, the contour line is taken as an example for illustration, other types of feature path extraction algorithms can refer to the corresponding literature.

对于平滑曲面,轮廓线从数学上可以定义为:For smooth surfaces, the contour line can be defined mathematically as:

ni·(c-vi)=0,n i ·(cv i )=0,

其中,vi是顶点i的空间坐标,ni是vi的顶点法向量,c是照相机的空间坐标。实际应用中具体算法如下:首先对三角面片中的每个顶点计算规范化点积值:Among them, v i is the space coordinate of vertex i, ni is the vertex normal vector of v i , and c is the space coordinate of the camera. The specific algorithm in practical application is as follows: First, calculate the normalized dot product value for each vertex in the triangular patch:

dd ii == nno ii ·&Center Dot; (( cc -- vv ii )) || nno ii ·&Center Dot; (( cc -- vv ii )) || ,,

然后根据如下公式标记顶点符号:Vertex symbols are then labeled according to the following formula:

sthe s ii == ++ :: dd ii &GreaterEqual;&Greater Equal; 00 -- :: dd ii << 00 ,,

如果三角面片中三个顶点的si值出现异号的情况(2个为+号1个为-号,或者2个为-号1个为+号),则说明该三角面片中存在特征片段,如图2(a)所示。用如下的线性插值公式即可以得到特征片段的两个端点(s1,s2):If the si values of the three vertices in the triangle facet have different signs (2 are + sign and 1 is - sign, or 2 are - sign and 1 is + sign), it means that there is Feature fragments, as shown in Figure 2(a). The two endpoints (s 1 , s 2 ) of the feature segment can be obtained by using the following linear interpolation formula:

sthe s 11 == || dd 22 || || dd 11 || ++ || dd 22 || vv 11 ++ || dd 11 || || dd 11 || ++ || dd 22 || vv 22 ,,

sthe s 22 == || dd 33 || || dd 11 || ++ || dd 33 || vv 11 ++ || dd 11 || || dd 11 || ++ || dd 33 || vv 33 ,,

由于曲面是连续平滑的,因此每个三角面片中提取到的特征片段可以自然首尾相连形成特征路径,如图2(b)所示。Since the surface is continuous and smooth, the feature segments extracted from each triangular patch can be naturally connected end to end to form a feature path, as shown in Figure 2(b).

本发明中,特征片段提取后,目前特征路径的表示是一系列特征片段的集合。由于深度遮挡的原因,其中许多片段是不可见的,但是特征片段提取后原三维几何模型面的信息已经不存在,绘制这些特征片段时,图形处理器中的z-buffer只会在片段像素上进行深度检测,绘制出的特征片段不能反映原三维几何的深度信息,因此需要使用消隐线算法实现特征片段消隐。这里使用的是利用身份参考图像进行消隐的算法。该算法由Northrup等人在2000年提出,是一种几何和图像混合消隐算法。该算法首先构造身份参考图像(ID reference image):将特征片段和三维几何模型以不同颜色标记并绘制到帧缓冲区(frame buffer),然后将绘制结果从帧缓冲区读回内存构造身份参考图像。进行特征片段消隐时,将每个特征片段和身份参考图像中的某些指定像素检测匹配来实现消隐。In the present invention, after the feature segments are extracted, the representation of the current feature path is a collection of a series of feature segments. Due to deep occlusion, many of the fragments are invisible, but the information of the original 3D geometric model surface no longer exists after the feature fragments are extracted. When drawing these feature fragments, the z-buffer in the graphics processor will only be on the fragment pixels For depth detection, the drawn feature segments cannot reflect the depth information of the original 3D geometry, so it is necessary to use the hidden line algorithm to hide the feature segments. The algorithm used here is to use the identity reference image for concealment. This algorithm was proposed by Northrup et al. in 2000, which is a hybrid concealment algorithm of geometry and image. The algorithm first constructs an ID reference image: mark feature fragments and 3D geometric models in different colors and draw them to the frame buffer, and then read the drawing results back from the frame buffer to the memory to construct an ID reference image . When performing feature segment concealment, each feature segment is detected and matched with some specified pixels in the identity reference image to achieve concealment.

对提取的特征片段集合进行消隐后,接下来的工作是将这些消隐后的片段首尾相连形成特征路径,以便于后续生成笔触几何进行绘制。如果某些特征片段长度过短,在屏幕上小于一个像素,可以将这些片段和相邻的片段合并。After concealing the extracted feature fragment set, the next work is to connect these concealed fragments end to end to form a feature path, so as to facilitate the subsequent generation of stroke geometry for drawing. If some feature segments are too short to be smaller than one pixel on the screen, these segments can be merged with adjacent segments.

如果生成的路径过长,不符合实际绘画风格,可以根据最大路径长度将过长的路径分割成若干较短的路径,或者根据路径中相邻片段之间的夹角,在路径弯曲比较大的地方对路径进行分割。If the generated path is too long and does not conform to the actual painting style, the long path can be divided into several shorter paths according to the maximum path length, or according to the included angle between adjacent segments in the path, in the path with a relatively large curvature Where to split the path.

3.影线路径自动生成模块3. Hatch path automatic generation module

影线路径自动生成模块的功能是从输入的三维几何模型中生成所需的影线路径,主要包括以下三个步骤:The function of the hatch path automatic generation module is to generate the required hatch path from the input 3D geometric model, which mainly includes the following three steps:

(1)根据输入的三维几何模型绘制出相应的颜色参考图像和光照参考图像,具体生成哪种参考图像可以由光照和着色模型来决定;(1) Draw the corresponding color reference image and illumination reference image according to the input 3D geometric model, and which reference image to generate can be determined by the illumination and coloring model;

(2)用户可以根据需要使用颜色编辑工具对颜色参考图像进行编辑;(2) Users can use color editing tools to edit the color reference image as needed;

(3)由颜色参考图像和光照参考图像生成影线路径。之后用户也可以利用用户交互模块提供的交互式工具在自动生成的结果上进行编辑和修改。(3) Generate the hatch path from the color reference image and lighting reference image. Afterwards, users can also use the interactive tools provided by the user interaction module to edit and modify the automatically generated results.

铅笔素描中的影线是一系列笔触按某种规律排列的集合。影线笔触可以通过色调(tone)同时表达光照、颜色、材质、形状等信息。笔触具有两个属性:1、每一条笔触可以同时表述色调和纹理,即单条笔触的属性。2、多条笔触的集合也可以反映色调和纹理,即笔触的群体属性。The hatching in pencil sketch is a collection of a series of strokes arranged according to certain rules. Hatch strokes can simultaneously express light, color, material, shape and other information through tone. Strokes have two properties: 1. Each stroke can express tone and texture at the same time, that is, the attributes of a single stroke. 2. The collection of multiple strokes can also reflect the tone and texture, that is, the group attributes of the strokes.

我们的系统中,可以分别根据颜色参考图像和光照参考图像来设计影线。它们分别对应于对象的固有属性(intrinsic property)和外在属性(extrinsic property)。区分开固有属性和外在属性可以使这两个部分能够独立的进行编辑,例如独立使用颜色编辑软件或者光照编辑软件。另一个更为重要的原因是,混合固有属性和外在属性常常会造成视觉上的错差,这一点即使对于专业绘画者都很难把握,因为用户可以很好的估计物体本来的颜色,但是很难正确估计物体上反射出的光照颜色。将颜色系统和光照系统区分对待,分别用颜色参考图像和光照参考图像定位色调,将很好的避免这一视觉错差。用户来指定物体的本来颜色,而图形学中现有的光照绘制系统能够量化光线强度,这样就可以实现用户和计算机的分工合作。实际上,区分固有属性和外在属性的设计方法在专业美术教学技法中也有记述。出于专业背景的不同,计算机工作者和美术工作者在术语和描述上有所差异,但理念和本质是相同的。例如Dodson在其经典的绘画教程《Keys to Drawing》中记述了如何从本色调、光影图案、明度图案的角度来理解绘画创作过程:绘画者将光影图案和本色调结合起来,就可以得到最终依据照片作画的明度图案。系统中区分颜色参考图像和光照参考图像也是基于这一绘画创作理念。In our system, the shadow lines can be designed according to the color reference image and the lighting reference image respectively. They correspond to the intrinsic property (intrinsic property) and extrinsic property (extrinsic property) of the object respectively. Distinguishing intrinsic properties from extrinsic properties enables these two parts to be edited independently, such as using color editing software or lighting editing software independently. Another more important reason is that mixing intrinsic and extrinsic attributes often causes visual errors, which is difficult to grasp even for professional painters, because users can estimate the original color of the object very well, but It is difficult to correctly estimate the color of light reflected off an object. Treating the color system and the lighting system separately, and using the color reference image and the lighting reference image to locate the hue, will avoid this visual error. The user specifies the original color of the object, and the existing lighting rendering system in graphics can quantify the light intensity, so that the division of labor between the user and the computer can be realized. In fact, the design method of distinguishing inherent attributes from external attributes is also described in professional art teaching techniques. Due to different professional backgrounds, computer workers and art workers have different terms and descriptions, but the concept and essence are the same. For example, Dodson described in his classic painting tutorial "Keys to Drawing" how to understand the painting creation process from the perspectives of natural tone, light and shadow pattern, and lightness pattern: the painter combines the light and shadow pattern with the natural tone to get the final basis. Lightness pattern for photo painting. The distinction between color reference images and lighting reference images in the system is also based on this concept of painting creation.

单个影线的主要属性有位置、方向、长度、压力分布等,此外影线集合还具有密度等群体属性。在实际绘画过程中,绘画者在不断观察物体的基础上,将笔触一笔一笔的排列在画纸上,最终用画纸上的所有笔触来逼近绘画对象。这一过程可以抽象为一个采样问题,我们将绘画对象用参考图像表示,则影线的生成和分布问题可以看作一个二维参考图像的采样问题。The main attributes of a single hatch include position, direction, length, pressure distribution, etc. In addition, the set of hatches also has group attributes such as density. In the actual painting process, the painter arranges the brush strokes on the drawing paper one by one on the basis of constantly observing the object, and finally uses all the brush strokes on the drawing paper to approach the painting object. This process can be abstracted as a sampling problem. We represent the drawing object with a reference image, so the generation and distribution of hatching can be regarded as a sampling problem of a two-dimensional reference image.

具体实现时,可以一步一步的确定影线的各种属性,整个影线笔触生成过程参考图3。以下为影线笔触生成步骤,其中步骤(1)-(4)为影线路径生成步骤:During specific implementation, various attributes of the hatching can be determined step by step. Refer to FIG. 3 for the entire hatching stroke generation process. The following are the steps for generating hatch strokes, wherein steps (1)-(4) are steps for generating hatch paths:

(1)首先根据输入的三维几何模型(图3(a))绘制出参考图像(图3(b));(1) First draw a reference image (Fig. 3(b)) according to the input 3D geometric model (Fig. 3(a));

(2)然后根据参考图像运用某种采样方法得到影线的位置和分布(图3(c)),具体的采样方法将在下面叙述;(2) Then according to the reference image, some sampling method is used to obtain the position and distribution of the shadow line (Fig. 3(c)), and the specific sampling method will be described below;

(3)由于笔触具有大小和形状,考虑到采样点的重合对绘制效果会产生影响,还需要对采样点进行修正(图3(d));(3) Due to the size and shape of the stroke, considering that the coincidence of sampling points will affect the drawing effect, the sampling points need to be corrected (Figure 3(d));

(4)采样点修正后,再根据参考图像的梯度信息确定影线路径方向,接着根据参考图像的灰度值确定影线路径长度,然后通过贝塞尔曲线插值确定影线路径形状,最后确定影线压力分布(图3(e)),至此影线路径已经生成;(4) After the sampling point is corrected, the direction of the hatch path is determined according to the gradient information of the reference image, and then the length of the hatch path is determined according to the gray value of the reference image, and then the shape of the hatch path is determined by Bezier curve interpolation, and finally determined The hatched pressure distribution (Fig. 3(e)), so far the hatched path has been generated;

(5)最终生成的影线路径通过由路径生成笔触模块生成影线笔触,并由绘制输出模块绘制出最终结果(图3(f))。(5) The final generated hatch path is generated by the path generating stroke module, and the final result is drawn by the drawing output module (Fig. 3(f)).

假设参考图像的二维概率密度函数为f(x,y),则影线设计相当于从f(x,y)中得到若干采样点来生成笔触,而这些生成的笔触可以用来反映原参考图像的分布特性。这里我们探讨两种采样方式:基于累积概率密度的采样和基于Metropolis-Hastings算法的采样。Assuming that the two-dimensional probability density function of the reference image is f(x, y), the hatching design is equivalent to obtaining a number of sampling points from f(x, y) to generate strokes, and these generated strokes can be used to reflect the original reference The distribution characteristics of the image. Here we discuss two sampling methods: sampling based on cumulative probability density and sampling based on Metropolis-Hastings algorithm.

基于累积概率密度的采样就是利用累积概率密度函数的斜率对均匀分布的随机数进行重新分布,其一维算法如图4所示。该算法首先根据概率密度函数计算累积概率密度函数,然后生成均匀分布的随机向量,并利用累积概率密度函数的反函数对均匀分布的随机向量进行变换,则变换后的随机向量符合最初的概率密度函数分布。对于二维概率密度函数f(x,y),可先对y求取边缘概率密度函数,然后运用上述一维累积概率密度算法,再根据条件概率公式得到x的分布并运用上述一维累积概率密度算法。其做法实际上是通过边缘概率密度和条件概率密度,将二维采样转换为先对y采样,然后再对x采样。Sampling based on cumulative probability density is to redistribute uniformly distributed random numbers using the slope of the cumulative probability density function, and its one-dimensional algorithm is shown in Figure 4. The algorithm first calculates the cumulative probability density function according to the probability density function, then generates a uniformly distributed random vector, and uses the inverse function of the cumulative probability density function to transform the uniformly distributed random vector, then the transformed random vector conforms to the original probability density function distribution. For the two-dimensional probability density function f(x, y), you can first obtain the marginal probability density function for y, then use the above-mentioned one-dimensional cumulative probability density algorithm, and then obtain the distribution of x according to the conditional probability formula and use the above-mentioned one-dimensional cumulative probability density algorithm. The method is actually to convert two-dimensional sampling into sampling y first and then sampling x through marginal probability density and conditional probability density.

Metropolis-Hastings算法是一种可对任意复杂分布进行采样的算法。该算法只需要知道待采样点的概率估计值或者待采样点之间的概率估计比值,在不清楚概率分布函数的情况下就可以进行采样,具有很好的普适性。对于二维数字图像,采用该算法可以直接用图像的灰度值作为估计值进行二维采样,避免了累积概率密度采样算法中对于概率密度函数、边缘概率密度函数、条件概率密度函数的估计。假设我们需要N个采样点,图像上的二维采样点用z=(x,y)表示,概率估计值为

Figure BDA0000096640320000101
当前的采样点为zn,生成候选采样点z*的提议分布为Q(z*|zn),则生成N个采样点的Metropolis-Hastings算法如图5所示。算法开始时将生成的采样点个数n初始化为0。当生成的采样点个数小于N时,算法循环执行,否则算法结束。每个循环内算法根据提议分布生成一个候选采样点,计算其接受概率,并和一个随机数比较,从而决定该生成的候选采样点是否应该被接受。Metropolis-Hastings算法每次根据当前采样点zn生成下一个采样点,其采样点序列(z1,z2,...,zn)形成一条马尔可夫链,且序列路径为二维平面的随机游走。算法确定接受A(zn→z*)≥1的采样点,随机接受A(zn→z*)<1的采样点。随着采样点个数N的增加,采样点序列的分布可以趋近于概率密度函数f(x,y)。The Metropolis-Hastings algorithm is an algorithm that can sample arbitrarily complex distributions. The algorithm only needs to know the estimated probability of the points to be sampled or the ratio of probability estimates between the points to be sampled, and it can sample without knowing the probability distribution function, which has good universality. For two-dimensional digital images, this algorithm can directly use the gray value of the image as the estimated value for two-dimensional sampling, avoiding the estimation of probability density function, marginal probability density function and conditional probability density function in the cumulative probability density sampling algorithm. Assuming that we need N sampling points, the two-dimensional sampling points on the image are represented by z=(x, y), and the estimated probability is
Figure BDA0000096640320000101
The current sampling point is z n , and the proposed distribution for generating candidate sampling point z * is Q(z * |z n ), then the Metropolis-Hastings algorithm for generating N sampling points is shown in Figure 5. At the beginning of the algorithm, the number n of sampling points generated is initialized to 0. When the number of sampling points generated is less than N, the algorithm is executed cyclically, otherwise the algorithm ends. The algorithm in each loop generates a candidate sampling point according to the proposed distribution, calculates its acceptance probability, and compares it with a random number to determine whether the generated candidate sampling point should be accepted. The Metropolis-Hastings algorithm generates the next sampling point each time according to the current sampling point z n , and its sampling point sequence (z 1 , z 2 ,..., z n ) forms a Markov chain, and the sequence path is a two-dimensional plane random walk. The algorithm determines to accept sampling points with A(z n →z * )≥1, and randomly accepts sampling points with A(z n →z * )<1. As the number of sampling points N increases, the distribution of the sampling point sequence can approach the probability density function f(x, y).

本发明的铅笔素描模拟应用中,采样点是用来反映笔触分布的,而笔触是有面积的,由于采样是在有限的参考图像区域内进行的,必然会有某些采样点之间位置接近甚至重叠。从最终绘制的视觉效果上看,位置相近的采样点表现为一系列重叠的笔触,从而减弱绘制的视觉效果。这在笔触透明度比较低、笔触缺乏叠加效果等情况下更为明显。最终生成图片中笔触的平均像素数越多,则采样点位置重叠所造成的影响也会越大。虽然从统计直方图上看,采样点的分布的确逼近了所需的概率分布,但实际绘制效果上并没有达到要求。In the pencil sketch simulation application of the present invention, the sampling points are used to reflect the stroke distribution, and the strokes have an area. Since the sampling is carried out in a limited reference image area, there must be some sampling points that are close to each other. even overlap. From the visual effect of the final drawing, the sampling points with similar positions appear as a series of overlapping strokes, thereby weakening the visual effect of the drawing. This is more noticeable when the stroke transparency is relatively low, the stroke lacks an overlay effect, etc. The more average pixels of strokes in the final generated image, the greater the influence caused by the overlap of sampling point positions. Although the distribution of sampling points does approach the required probability distribution from the statistical histogram, the actual drawing effect does not meet the requirements.

针对上述问题,本发明对得到的采样点进行小范围的修正。具体的采样点重叠修正算法如下:In view of the above problems, the present invention corrects the obtained sampling points in a small range. The specific sampling point overlap correction algorithm is as follows:

(1)对得到的每个采样点zn,查找其邻域内是否存在其它采样点,其中邻域的半径为能够容忍的最小采样点间距,可以设定为平均笔触宽度的一半;(1) For each sampling point z n obtained, find out whether there are other sampling points in its neighborhood, where the radius of the neighborhood is the tolerable minimum sampling point spacing, which can be set to half of the average stroke width;

(2)如果邻域内存在其它采样点,则计算其它采样点的位置中心,然后让被考察的采样点zn沿着与其它采样点位置中心相反的方向移动一小段距离δ,如图6(a)所示。为了不影响得到的采样点的概率分布,我们只让采样点向和其原来位置具有同样灰度值的目标位置移动。(2) If there are other sampling points in the neighborhood, then calculate the position center of other sampling points, and then let the investigated sampling point z n move a small distance δ along the direction opposite to the center of other sampling points, as shown in Figure 6( a) as shown. In order not to affect the probability distribution of the obtained sampling points, we only let the sampling points move to the target position with the same gray value as its original position.

(3)检查目标位置是否满足要求,如果目标位置不满足要求,则让采样点zn沿着离其最近采样点的相反方向移动一小段距离δ,如图6(b)所示;(3) Check whether the target position meets the requirements. If the target position does not meet the requirements, let the sampling point zn move a small distance δ along the opposite direction from its nearest sampling point, as shown in Figure 6(b);

(4)如果目标位置的灰度值仍然不满足要求,则放弃修正采样点zn,由其它采样点的修正来达到避免重叠的效果;(4) If the gray value of the target position still does not meet the requirements, the correction of the sampling point z n is abandoned, and the effect of avoiding overlapping is achieved by the correction of other sampling points;

(5)上述修正过程可以反复迭代进行几次,直到绝大多数采样点均满足要求为止。(5) The above correction process can be repeated several times until most of the sampling points meet the requirements.

使用采样点重叠修正算法可以用尽可能少的采样点来达到更好的绘制效果,最大化的利用每一条采样点生成笔触的绘制效果。Using the sampling point overlap correction algorithm can use as few sampling points as possible to achieve a better drawing effect, and maximize the use of each sampling point to generate a brushstroke drawing effect.

图7(c)和图7(d)分别展示了采样点重叠修正前后的效果图。其对应的输入三维几何模型和参考图像分别如图7(a)和图7(b)所示。可以看出,本发明提出的采样点重叠修正算法可以使采样点尽可能避免重叠,提升了单个采样点生成笔触的视觉效果。Figure 7(c) and Figure 7(d) respectively show the effect diagrams before and after the overlap correction of sampling points. Its corresponding input 3D geometric model and reference image are shown in Fig. 7(a) and Fig. 7(b) respectively. It can be seen that the sampling point overlap correction algorithm proposed by the present invention can avoid overlapping of sampling points as much as possible, and improve the visual effect of strokes generated by a single sampling point.

得到影线位置及分布的信息后,则可以根据参考图像梯度信息来确定影线方向。为了保持生成图片中的特征笔触信息,系统采用与图像梯度相垂直的方向作为影线方向,这样还可以使笔触大小和形状对采样的影响达到最小。如果参考图像的梯度小于某一阈值,则以“左下-右上”方向作为影线的默认方向,这一方向是人类手绘影线最频繁的方向,也最符合人类绘画习惯和人体工程学特点。由于绘画过程中绘画者经常使用“盲画”的绘画技巧(眼睛注视绘制对象的同时手不停止作画),并且笔头经常会发生跳跃,因而这一默认方向在理论和实验方面都具有一定的科学依据。After obtaining the hatching position and distribution information, the hatching direction can be determined according to the gradient information of the reference image. In order to maintain the characteristic stroke information in the generated image, the system uses the direction perpendicular to the image gradient as the hatching direction, which can also minimize the influence of stroke size and shape on sampling. If the gradient of the reference image is less than a certain threshold, the "lower left-upper right" direction is used as the default direction of hatching. This direction is the most frequent direction for human hand-painted hatching, and it is also most in line with human drawing habits and ergonomic characteristics. Since painters often use the "blind painting" painting technique (the eyes keep on drawing the object while the hand does not stop painting) during the painting process, and the brush tip often jumps, this default direction has a certain degree of science in both theory and experiment in accordance with.

确定影线位置、分布以及方向后,影线长度和路径可以由下述算法得到:After determining the position, distribution and direction of the hatch, the length and path of the hatch can be obtained by the following algorithm:

1、生成控制粒子:在每一个生成的采样点上生成一对控制粒子[p+,p-],控制粒子具有速度(vx,vy)和初始颜色c0等属性。其中每对控制粒子的速度方向分别和影线方向以及影线反方向一致;1. Generate control particles: Generate a pair of control particles [p + , p - ] at each generated sampling point. The control particles have attributes such as speed (v x , v y ) and initial color c 0 . The velocity direction of each pair of control particles is consistent with the direction of the shadow line and the opposite direction of the shadow line;

2、移动控制粒子:计算每个控制粒子的目标位置,即控制粒子沿速度(vx,vy)方向移动一个步长的位置,步长可以根据需要设定,一般为1至5个像素值;如果控制粒子目标位置的参考图像灰度值cp满足|c0-cp|<δc,则让控制粒子移动到目标位置;如果不满足或者控制粒子达到最大笔触长度,则让控制粒子停止;其中δc为一阈值,δc越大,则影线笔触的软边缘效果越为明显;δc越小,影线笔触的硬边缘效果越为明显;2. Moving control particles: Calculate the target position of each control particle, that is, the position where the control particle moves a step along the direction of velocity (v x , v y ). The step size can be set according to needs, generally 1 to 5 pixels value; if the reference image gray value c p of the target position of the control particle satisfies |c 0 -c p |<δ c , let the control particle move to the target position; if it is not satisfied or the control particle reaches the maximum stroke length, let the control particle The particles stop; where δ c is a threshold value, the larger the δ c , the more obvious the soft edge effect of the hatched stroke; the smaller the δ c , the more obvious the hard edge effect of the hatched stroke;

3、根据每对控制粒子最终的位置,采用贝塞尔曲线插值方法得到影线路径。影线路径中也会根据参考图像的灰度值记录相应的影线笔触的压力分布,以用于后续的铅笔笔触绘制。3. According to the final position of each pair of control particles, use the Bezier curve interpolation method to obtain the hatch path. The hatching path also records the pressure distribution of the corresponding hatching strokes according to the gray value of the reference image, so as to be used for subsequent drawing of pencil strokes.

从采样点重叠修正算法和影线路径生成算法中可以看出,我们始终让每一条影线覆盖的区域具有近似的灰度,即根据图像中的色块来分布影线,这符合铅笔素描专业教程中按照形状分解来绘画的理念,因而可以使生成的铅笔素描图片具有较好的手绘效果。It can be seen from the sampling point overlap correction algorithm and the shadow path generation algorithm that we always make the area covered by each shadow line have an approximate gray scale, that is, distribute the shadow lines according to the color blocks in the image, which is in line with the pencil sketch professional The concept of drawing according to the shape decomposition in the tutorial can make the generated pencil sketch picture have a better hand-painted effect.

图8(c)展示了茶壶几何的自动铅笔素描生成结果,其中特征笔触和影线笔触均由算法自动生成。图中共有38条特征笔触和8000条影线笔触。图8(a)和图8(b)则分别展示了输入的三维几何模型和绘制生成的光照参考图像。Figure 8(c) shows the automatic pencil sketch generation results of the teapot geometry, in which both feature strokes and hatch strokes are automatically generated by the algorithm. There are 38 characteristic brushstrokes and 8000 hatched strokes in the picture. Figure 8(a) and Figure 8(b) respectively show the input 3D geometric model and the generated lighting reference image.

图9(c)展示了另一幅自动生成的铅笔素描图片,其中包含了自动生成的266条特征笔触和8000条影线笔触,对应的三维几何模型输入和光照参考图像分别如图9(a)和图9(b)所示。Figure 9(c) shows another automatically generated pencil sketch picture, which contains 266 automatically generated feature strokes and 8000 hatch strokes, and the corresponding 3D geometric model input and lighting reference images are shown in Figure 9(a ) and Figure 9(b).

4.由路径生成笔触模块4. Generating stroke modules from paths

该模块的功能是由特征路径或者影线路径生成特征笔触或者影线笔触。参看图10,路径由方形顶点和虚线表示,代表的是笔尖经过的轨迹;笔触由圆形顶点和实线表示,代表的是笔尖在纸面上留下的线条形状和纹理。上一部分的内容中提到过,笔触具有两个属性:1、每一条笔触可以同时表述色调和纹理(单独的属性)。2、多条笔触的集合也可以反映色调和纹理(群体的属性)。这部分内容主要涉及单条笔触的特性,笔触的群体属性已经在影线路径自动生成模块中叙述过了。The function of this module is to generate feature strokes or hatch strokes from feature paths or hatch paths. Referring to Figure 10, the path is represented by square vertices and dotted lines, representing the trajectory of the pen tip; the stroke is represented by round vertices and solid lines, representing the shape and texture of the lines left by the pen tip on the paper. As mentioned in the previous part, strokes have two attributes: 1. Each stroke can express tone and texture (separate attributes) at the same time. 2. A collection of multiple strokes can also reflect tone and texture (attributes of the group). This part mainly involves the characteristics of a single stroke, and the group attribute of strokes has been described in the hatch path automatic generation module.

系统中的特征笔触和影线笔触分别由前述两个模块得到的特征路径和影线路径,以及铅笔笔头形状(tip shape)共同生成,如图10所示。其中方形顶点表示形成路径的顶点,它和路径线段共同形成了路径的几何表示;圆形顶点和实线线段组成了笔触的几何。笔头形状在每个路径顶点处对笔触的几何形状进行定位,从而和路径一起形成了笔触的几何。笔头形状由一系列预先定义的形状组成,例如典型(typical)形状、宽头(broad)形状、凿刀(chisel)形状等,如图11所示。笔头也有一系列的大小可以供用户选择。对于特征路径,我们也可以用输入几何的细节来自动调节笔头的大小,因为用户通常在细节处用较细的笔头来保持细节。绘画中笔头也会受到压力的影响,压力越大,铅笔在纸上形成的笔头大小也会越大。因此最终笔头大小S可以用下面的公式来表示:The characteristic strokes and hatched strokes in the system are jointly generated by the characteristic path and hatched path obtained by the above two modules, and the tip shape of the pencil, as shown in Figure 10. Among them, the square vertex represents the vertex forming the path, and it forms the geometric representation of the path together with the path line segment; the round vertex and the solid line segment form the geometry of the stroke. The nib shape positions the geometry of the stroke at each path vertex, and together with the path, forms the geometry of the stroke. The nib shape is composed of a series of predefined shapes, such as typical shape, broad shape, chisel shape, etc., as shown in FIG. 11 . There are also a range of nib sizes for users to choose from. For feature paths, we can also automatically adjust the size of the pen tip with the details of the input geometry, because users usually use thinner pen tips at the details to maintain the details. The tip of the pen in painting is also affected by pressure. The greater the pressure, the larger the size of the tip formed by the pencil on the paper. Therefore, the final nib size S can be expressed by the following formula:

S=st×fg×fpS=s t ×f g ×f p ,

其中,st是用户选择的全局笔头尺寸,fp是压力因子,fg是几何细节缩放因子,可以用下面的公式定义:Among them, s t is the global tip size selected by the user, f p is the pressure factor, and f g is the geometric detail scaling factor, which can be defined by the following formula:

其中,Av是输入几何模型顶点的环三角形的Voronoi面积(one-ring Voronoiarea),

Figure BDA0000096640320000132
是控制因子。Among them, A v is the Voronoi area (one-ring Voronoiarea) of the ring triangle of the vertex of the input geometric model,
Figure BDA0000096640320000132
is the control factor.

5.绘制输出模块5. Draw the output module

该模块的功能是由笔触绘制成最终的铅笔效果图片。绘制使用的铅笔物理模型采用Sousa铅笔模型,并在图形处理单元(GPU)中实现相应算法。GPU是现代显卡的运算单元,和CPU不同的是,GPU的并行处理能力非常强大,适合处理海量图形数据。The function of this module is to draw the final pencil effect picture from strokes. The pencil physical model used for drawing adopts the Sousa pencil model, and the corresponding algorithm is implemented in the graphics processing unit (GPU). The GPU is the computing unit of modern graphics cards. Unlike the CPU, the GPU has a very powerful parallel processing capability and is suitable for processing massive graphics data.

Sousa铅笔模型涉及到了铅笔与纸张交互时的多个物理变量,并以纸张几何中的粒面(grain)为基本单位进行模拟。每个粒面由纸张高度场中相邻的四个高度围成的椎体构成。系统将纸张的高度和铅笔芯的成分(包括石墨、泥土和石蜡)分别存入纹理的R,G,B,A通道中,并打包成双缓存。绘制时,迭代地交换两张纹理作为绘制目标并根据像素着色程序更新纹理中的各个分量。最后根据纹理像素(每个像素对应一个粒面)中存储的石墨、泥土以及石蜡的含量来生成最终铅笔效果图片。例如,如果石墨的颜色为CG,泥土的颜色为CC,石蜡的颜色为CV,石墨、泥土和石蜡在某个粒面中的含量分别为VG,VC和VV,则最终该粒面显示的颜色值C为:The Sousa pencil model involves multiple physical variables when the pencil interacts with the paper, and uses the grain in the paper geometry as the basic unit for simulation. Each grain is composed of pyramids surrounded by four adjacent heights in the paper height field. The system stores the height of the paper and the composition of the pencil lead (including graphite, earth, and paraffin) into the R, G, B, and A channels of the texture, and packs them into a double buffer. When drawing, iteratively swap two textures as drawing targets and update each component in the texture according to the pixel shader program. Finally, the final pencil effect image is generated according to the graphite, dirt and paraffin content stored in the texels (each pixel corresponds to a grain). For example, if the color of graphite is C G , the color of soil is C C , the color of paraffin is C V , and the contents of graphite, soil and paraffin in a grain are V G , V C and V V respectively, then the final The color value C displayed by this grain is:

C=CG×VG+CC×VC+CV×VVC=C G ×V G +C C ×V C +C V ×V V ,

纸面上所有粒面显示的颜色值共同反映了最终铅笔素描图片的颜色值,形成铅笔素描的绘制效果。用户也可以对最终笔触进行编辑修改,然后重新进行绘制。由于图形处理单元的绘制速度很快,可以基本满足实时交互的要求。The color values displayed by all the grains on the paper reflect the color values of the final pencil sketch image together, forming the drawing effect of the pencil sketch. Users can also edit and modify the final strokes, and then repaint. Since the drawing speed of the graphics processing unit is very fast, it can basically meet the requirements of real-time interaction.

6.影线设计的交互式工具6. Interactive tools for hatch design

系统提供了几种在参考图像上批量设计影线的工具,它们是平行曲线影线工具(parallel curve hatching tool)、波浪影线工具(wave hatching tool)、交叉影线工具(cross hatching tool)和自由影线工具(free hatching tool),如图12所示。其中平行曲线影线工具具有参数可以控制其弯曲程度和对称性。波浪影线工具提供参数来控制其波浪平滑程度。通过参数调节,平行曲线影线可以退化成平行直线影线(parallel line hatching),而波浪影线可以退化成锯齿影线(zigzag hatching)。这些种类的影线都是铅笔素描绘画中的常见影线。系统还提供了自由影线工具供用户设计自己需求样式的影线。由于自由影线工具可以绘制任意样式的笔触,因而不仅可以用来设计影线笔触的路径,也可以用来设计特征笔触的路径。设计的特征笔触和影线笔触通过由路径生成笔触模块,即得到所需的特征笔触和影线笔触。我们使用影线架(hatching carrier)的概念来作为笔触路径设计工具的载体,如图12中的自左向右并且最长的路径所示,所述影线架为用户所绘制的单独的一条路径,影线路径根据影线架的路径进行批量、自动生成。在绘画过程中,用户只需要使用交互式输入设备,例如鼠标、压力笔等在参考图像上绘制出笔触架,影线工具就会自动根据区域形状绘制出一系列能够反映局部色调的影线。人手绘制曲线简单而且灵活,能够根据一条影线架就可以完成一个区域的影线设计,从而能够达到快速设计影线的目的,类似于浏览器中的手势识别。The system provides several tools for designing hatching in batches on reference images, they are parallel curve hatching tool, wave hatching tool, cross hatching tool and Free hatching tool (free hatching tool), as shown in Figure 12. Among them, the Parallel Curve Hatch tool has parameters to control its curvature and symmetry. The Wavy Hatch tool provides parameters to control how smooth its waves are. Through parameter adjustment, parallel curved hatching can degenerate into parallel line hatching, and wavy hatching can degenerate into zigzag hatching. These types of hatching are common hatching in pencil sketch drawings. The system also provides a free hatching tool for users to design their own hatching styles. Since the free hatch tool can draw strokes of any style, it can be used not only to design the path of hatch strokes, but also to design the path of feature strokes. The designed feature strokes and hatch strokes are generated through the path-generated stroke module to obtain the required feature strokes and hatch strokes. We use the concept of a hatching carrier as the carrier of the stroke path design tool, as shown in the longest path from left to right in Figure 12, the hatching carrier is a single line drawn by the user Path, the hatch path is automatically generated in batches according to the path of the hatch frame. During the painting process, users only need to use interactive input devices, such as mouse, pressure pen, etc. to draw a stroke frame on the reference image, and the hatching tool will automatically draw a series of hatching lines that can reflect the local tone according to the shape of the area. Curves drawn by hand are simple and flexible, and the hatching design of an area can be completed according to a hatching frame, so that the purpose of quickly designing hatches can be achieved, similar to gesture recognition in a browser.

用影线架批量生成影线的具体算法如下:The specific algorithm for generating hatches in batches with a hatch frame is as follows:

(1)用户绘制影线架时,记录下输入的坐标点序列和经过的参考图像像素值,并计算出经过的参考图像像素的中值像素值cm(1) When the user draws the shadow frame, record the input coordinate point sequence and the passed reference image pixel value, and calculate the median pixel value c m of the passed reference image pixel;

(2)在影线架上初始化一些控制粒子p1,p2,...pi,pj,...pn,这些控制粒子具有速度(vx,vy)和初始颜色c0等属性,其中初始颜色c0由控制粒子所在位置的参考图像颜色值决定,初始速度根据影线的类型设定。下面在具体说明某个控制粒子的初始颜色值时,用控制粒子序号和0共同表示,例如控制粒子Pi的初始颜色值为ci0,泛指某个控制粒子颜色值时用c0表示。控制粒子pi和pj之间的间距为

Figure BDA0000096640320000151
其中δd为密度控制参数,以像素为单位。这里假设所有颜色值cm,c0,ci0,cj0等均已经规范化到[0,1];(2) Initialize some control particles p 1 , p 2 , ... p i , p j , ... p n on the shadow frame, these control particles have speed (v x , v y ) and initial color c 0 and other attributes, where the initial color c 0 is determined by the color value of the reference image that controls the position of the particle, and the initial speed is set according to the type of hatching. In the following, when specifying the initial color value of a certain control particle, the serial number of the control particle and 0 are used to represent it together. For example, the initial color value of the control particle P i is c i0 , and c 0 is used to represent the color value of a control particle in general. Control the spacing between particles p i and p j as
Figure BDA0000096640320000151
where δ d is the density control parameter in pixels. It is assumed here that all color values c m , c 0 , c i0 , c j0 , etc. have been normalized to [0, 1];

(3)系统让控制粒子根据影线的类型向影线架两侧运动,如图13中的白色箭头所示,图中的白色细线表明了控制粒子的运动路径。这里只让控制粒子在满足|c0-cm|<δc的区域内存活,控制粒子离开该区域就会死亡(这里死亡的含义与粒子系统中论述的含义一致,即粒子功能的终结和存储空间的释放)。其中δc是区域内的颜色差异控制参数,可以由用户调节。δc越大,则绘制出的软边缘效果越明显;δc越小,则绘制出的硬边缘效果越明显:(3) The system allows the control particles to move to both sides of the shadow frame according to the type of the shadow line, as shown by the white arrows in Figure 13, and the thin white lines in the figure indicate the movement path of the control particles. Here, only the control particle is allowed to survive in the region satisfying |c 0 -c m |<δ c , and the control particle will die if it leaves this region (the meaning of death here is consistent with the meaning discussed in the particle system, that is, the end of particle function and release of storage space). where δc is the color difference control parameter within the region, which can be adjusted by the user. The larger the δ c is, the more obvious the soft edge effect is; the smaller the δ c is, the more obvious the hard edge effect is:

(4)根据控制粒子死亡的位置,以贝塞尔曲线插值或者Catmull-Rom插值来得到影线路径。(4) According to the death position of the control particle, the shadow path is obtained by Bezier curve interpolation or Catmull-Rom interpolation.

可以看出该影线设计工具的具有如下几个特点:影线类型由用户指定,影线方向由影线架间接指定(用户控制)。色调和影线密度由颜色参考图像和光照参考图像自动确定(计算机控制)。影线设计工具可以感知参考图像中的形状,并可以自动区分软边缘和硬边缘(计算机控制)。图14展示了使用影线设计交互式工具、在参考图像的基础上设计影线的界面图。It can be seen that the hatching design tool has the following characteristics: the hatching type is specified by the user, and the hatching direction is indirectly specified by the hatching frame (controlled by the user). Tint and hatch density are automatically determined (computer controlled) from the color reference image and lighting reference image. The hatch design tool is aware of shapes in reference images and can automatically distinguish between soft and hard edges (computer controlled). Figure 14 shows the interface diagram of using the hatch design interactive tool to design hatches based on reference images.

图15(b)展示了一副简单的铅笔速写,其输入的三维几何模型如图15(a)所示。该结果主要展示了自动生成的特征笔触和交互式工具绘制的各种影线笔触(包括平行曲线影线、波浪影线和交叉影线)。图中共包含了291条特征笔触和777条影线笔触。从图中可以看出,系统绘制的铅笔线条还是比较真实的。线条的粗细、压力均富于变化,类似于人的手绘效果。Figure 15(b) shows a simple pencil sketch, and its input 3D geometric model is shown in Figure 15(a). The results mainly showcase the automatically generated feature strokes and various hatch strokes (including parallel curved hatch, wavy hatch, and crosshatch) drawn by interactive tools. The picture contains 291 characteristic strokes and 777 hatched strokes. It can be seen from the figure that the pencil lines drawn by the system are relatively real. The thickness and pressure of the lines are varied, similar to the effect of human hand-painting.

图1和图16(a)-(d)中均展示了母牛铅笔素描的绘制过程。其中图16(a)展示的是自动生成的特征笔触;图16(b)展示了根据编辑的颜色参考图像交互生成的影线笔触(固有属性,表示本色调);图16(c)展示了根据光照参考图像交互生成的影线笔触(外在属性,代表光影图案)。图16(a)、图16(b)和图16(c)中所有笔触绘制在一起则形成了最终的绘制效果,如图16(d)所示。其中共包含了211条特征笔触和2747条影线笔触。如前所述,这种绘制方式是符合人类绘画的认知和习惯的。Both Figure 1 and Figure 16(a)-(d) show the drawing process of the pencil sketch of the cow. Among them, Figure 16(a) shows the automatically generated feature strokes; Figure 16(b) shows the hatched strokes (inherent attributes, representing the original tone) interactively generated according to the edited color reference image; Figure 16(c) shows Hatch strokes (extrinsic properties, representing light and shadow patterns) generated interactively from a lighting reference image. All strokes in Figure 16(a), Figure 16(b) and Figure 16(c) are drawn together to form the final drawing effect, as shown in Figure 16(d). It contains a total of 211 characteristic strokes and 2747 hatched strokes. As mentioned earlier, this drawing method is in line with the cognition and habit of human drawing.

图17(c)展示了一副使用系统提供的交互式工具生成的植物铅笔素描,对应的输入三维几何模型和参考图像与图9(a)和图9(b)中展示的相同,分别如图17(a)和图17(b)所示。图17(c)中共包含了266条特征笔触和7231条影线笔触。从图17(c)和图9(c)的比较可以看出,自动生成方法和交互式设计方法均可以生成真实的铅笔素描,但是使用交互式工具绘制的结果与自动生成的结果相比,细节部分处理的更好,也更具有手绘效果。Figure 17(c) shows a plant pencil sketch generated using the interactive tools provided by the system, and the corresponding input 3D geometric model and reference image are the same as those shown in Figure 9(a) and Figure 9(b), respectively as Figure 17(a) and Figure 17(b). Figure 17(c) contains a total of 266 feature strokes and 7231 hatch strokes. From the comparison of Figure 17(c) and Figure 9(c), it can be seen that both the automatic generation method and the interactive design method can generate real pencil sketches, but the results drawn using interactive tools are compared with the automatically generated results. The details are handled better and have a more hand-painted effect.

图18展示了一幅使用交互式工具生成的彩色铅笔素描,共包含了766条特征笔触和2631条影线笔触。其中特征笔触由系统自动生成,影线笔触由交互式工具生成。图18中的颜色来自颜色参考图像。从结果可以看出,系统生成的铅笔素描图片较为真实且具有手工绘制的效果。Figure 18 shows a colored pencil sketch generated using the interactive tool, which contains a total of 766 feature strokes and 2631 hatch strokes. Among them, the feature strokes are automatically generated by the system, and the hatch strokes are generated by interactive tools. The colors in Figure 18 are from the color reference image. It can be seen from the results that the pencil sketch pictures generated by the system are more realistic and have the effect of hand-drawing.

由于本发明中的系统可以自动生成特征笔触和影线笔触,并且允许用户对生成的笔触进行编辑和修改,也可以使用交互式工具自行添加笔触,系统提供的交互式工具也可以根据参考图像中的色调自动排列影线,因而降低了用户的专业绘画技能要求。另外据统计,无绘画基础的用户使用交互式工具绘制的影线速度为5-11笔触/秒,这大大快于传统的人工绘制影线速度。使用交互式工具设计影线的优势在大面积绘制影线时更为突出,因而本系统更加适合于大幅作品的绘制。另外,系统目前使用普通鼠标作为输入,如果使用专业的输入笔和压力手写板等工具,估计效率还有进一步的提升。Since the system in the present invention can automatically generate characteristic strokes and hatched strokes, and allows users to edit and modify the generated strokes, and can also use interactive tools to add strokes by themselves, the interactive tools provided by the system can also be based on reference images. The hatching is automatically arranged according to the color tone, thus reducing the professional painting skills required by the user. In addition, according to statistics, users without drawing foundation use interactive tools to draw hatching at a speed of 5-11 strokes/second, which is much faster than traditional manual hatching. The advantages of using interactive tools to design hatches are more prominent when drawing hatches in large areas, so this system is more suitable for drawing large-scale works. In addition, the system currently uses a normal mouse as input. If you use tools such as a professional stylus and pressure tablet, it is estimated that the efficiency will be further improved.

从上面的分析可以看出,本发明的系统可以模拟出逼真的铅笔素描作品。即使无绘画基础的用户也可以在系统的辅助下,快速生成具有手绘效果的铅笔素描作品。由于系统是基于笔触的,相对于其它图像、体绘制、纹理映射等铅笔素描生成方法,具有符合实际绘画创作过程、易于编辑修改等优点,因而具有更高的实用价值。As can be seen from the above analysis, the system of the present invention can simulate realistic pencil sketch works. Even users without drawing foundation can quickly generate pencil sketches with hand-painted effects with the assistance of the system. Because the system is based on strokes, compared with other pencil sketch generation methods such as image, volume rendering, and texture mapping, it has the advantages of conforming to the actual painting creation process and being easy to edit and modify, so it has higher practical value.

上述实验结果和基于笔触的铅笔素描模拟和绘制方法,可以用于计算机图形学、计算机辅助设计、电影动漫特效、艺术设计等领域,具有操作简单、生成速度快、效果逼真、易于修改和编辑、应用前景广的特点。The above experimental results and the brush stroke-based pencil sketch simulation and drawing method can be used in fields such as computer graphics, computer-aided design, movie animation special effects, art design, etc. It has the advantages of simple operation, fast generation speed, realistic effect, easy modification and editing, The characteristics of wide application prospects.

以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (11)

1. the pencil sketch based on style of writing is simulated and drawing system, it is characterized in that this system comprises:
User interactive module, being used to the user provides the interface to carry out that 3-D geometric model is selected and export the 3-D geometric model of selecting to characteristic path automatically-generating module and hachure path automatically-generating module;
Characteristic path automatically-generating module is used for the automatic generating feature of the 3-D geometric model path according to input;
Hachure path automatically-generating module is used for generating the hachure path automatically according to the 3-D geometric model of input;
Generate the style of writing module by the path, be used for according to the characteristic path of characteristic path automatically-generating module generation and the hachure path of hachure path automatically-generating module generation, the geometry and the attribute thereof of generating feature style of writing and hachure style of writing;
Draw output module, be used for geometry and attribute, adopt the pencil physical model to draw out the pencil style of writing according to style of writing.
2. the system of claim 1; It is characterized in that said user interactive module also provides interactive tools to supply the user to carry out following operation: color reference picture editting, hachure path design, pencil attribute are chosen, the sketch paper selection of parameter, add the deletion style of writing and edit-modify has generated style of writing.
3. system as claimed in claim 2; It is characterized in that; Said hachure path design is meant that system's common hachure type in to the pencil sketch concludes on the basis of summary; It is divided into four types; And use parallel curves hachure instrument, wave hachure instrument, cross hatch instrument and free hachure instrument respectively, with hachure frame (hatching carrier) as carrier carry out interactive mode, the hachure path generates in batches, wherein free hachure instrument also can be used for the path of design feature style of writing.
4. system as claimed in claim 3 is characterized in that, said hachure frame is the independent paths that the user drew, and the hachure path is carried out in batches, generated automatically according to the path of hachure frame.
5. system as claimed in claim 3 is characterized in that, said with the hachure frame as carrier carry out interactive mode, in batches the step that generates of hachure comprises:
Step 1: when the user drew hachure frame path, system log (SYSLOG) descended the coordinate point sequence of input and the reference picture pixel value of process, and calculated the median pixel value c of the reference picture pixel of process m
Step 2: system is some control particle p of initialization on the hachure frame 1, p 2... p i, p j... p n, these control particles have speed v x, v yWith priming color c 0, and control particle p iAnd p jBetween spacing do
Figure FDA0000096640310000021
δ wherein dBeing the density controlled variable, is unit with the pixel, c I0Be control particle p iThe priming color value, c J0Be control particle p jThe priming color value;
Step 3: system let the control particle according to the type of hachure to two lateral movements of hachure frame, and only let the control particle satisfy | c 0-c m|<δ cRegion memory live δ wherein cIt is the color distortion controlled variable in the zone;
Step 4: according to the dead position of control particle, with Bezier (B é zier curve) interpolation or Ka Temaer-obtain the hachure path like (Catmull-Rom) interpolation not.
6. the system of claim 1 is characterized in that, the step in said automatic generating feature path comprises:
(1) tri patch of from the 3-D geometric model of input, storing extracts characteristic fragment;
(2) construct the identity reference picture according to the 3-D geometric model and the middle characteristic fragment that extracts of step (1) of input;
(3) utilize the identity reference picture, use the blanking line algorithm that characteristic fragment is carried out blanking;
(4) characteristic fragment after the blanking is linked into the characteristic path.
7. the system of claim 1 is characterized in that, the step in said automatic generation hachure path comprises:
(1) draws out corresponding color reference image and illumination reference picture according to the 3-D geometric model of input;
The position and the distribution of (2) color reference image and illumination reference picture being sampled and obtaining hachure;
(3) sampled point is revised, to weaken the overlapping influence of style of writing to final drafting effect;
(4) sampled point is revised after, confirm the hachure path direction according to the gradient information of reference picture, confirm the hachure path according to gray-scale value, confirm the pressure distribution on the hachure path then, thereby generate the hachure path.
8. system as claimed in claim 7; It is characterized in that; Said color reference image and illumination reference picture correspond respectively to build-in attribute and the external attribute of drawing object, and its implication corresponds respectively to this color harmony shadow pattern of drawing object in the study course of specialty drawing.
9. system as claimed in claim 7 is characterized in that, the employed algorithm of said sampling have based on the sampling of cumulative probability density and based on the ultra Pohle of rice this-sampling of Haas spit of fland (Metropolis-Hastings) algorithm.
10. system as claimed in claim 7 is characterized in that, the said step that sampled point is revised comprises:
(1) each sampled point z to obtaining n, search whether there is other sampled point in its neighborhood, wherein the minimum sampled point spacing of the radius of neighborhood for tolerating can be set at the half the of average style of writing width;
(2) if having other sampled point in the neighborhood, then calculate the place-centric of other sampled point, let the sampled point z that is investigated then nMove a bit of along the direction opposite apart from δ with other sampling point position center;
(3) whether the inspection target location meets the demands, if the target location does not meet the demands, then lets sampled point z nMove a bit of apart from δ along reverse direction from its nearest sampled point;
(4) if the gray-scale value of target location does not still meet the demands, then abandon revising sampled point z n, avoid overlapping by the correction of other sampled point;
Iterate above-mentioned makeover process for several times, till most sampled points all meet the demands.
11. system as claimed in claim 10 is characterized in that, said target location can use following two kinds of methods to differentiate:
In order not influence the probability distribution of the sampled point that obtains, the requirement of target location is: the sampled point target location has same gray-scale value with its origin-location;
Perhaps in order to reduce the influence of correction algorithm to the sampled point probability distribution as far as possible, the requirement of target location is: the gray-scale value of sampled point target location differs certain threshold value with the gray-scale value of its origin-location.
CN201110300028.3A 2011-09-28 2011-09-28 Stroke-based Pencil Sketch Simulation and Drawing System Expired - Fee Related CN102509357B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110300028.3A CN102509357B (en) 2011-09-28 2011-09-28 Stroke-based Pencil Sketch Simulation and Drawing System

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110300028.3A CN102509357B (en) 2011-09-28 2011-09-28 Stroke-based Pencil Sketch Simulation and Drawing System

Publications (2)

Publication Number Publication Date
CN102509357A true CN102509357A (en) 2012-06-20
CN102509357B CN102509357B (en) 2014-04-23

Family

ID=46221434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110300028.3A Expired - Fee Related CN102509357B (en) 2011-09-28 2011-09-28 Stroke-based Pencil Sketch Simulation and Drawing System

Country Status (1)

Country Link
CN (1) CN102509357B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914862A (en) * 2014-03-10 2014-07-09 上海大学 Pencil sketch simulating method based on edge tangent stream
CN104766355A (en) * 2015-04-22 2015-07-08 哈尔滨工业大学 Splash-color painting interactive system based on handwriting analysis and method for generating digital splash-color painting in real time through system
CN104777944A (en) * 2014-01-13 2015-07-15 范钦雄 Method for simulating hand-drawing board based on pen shadow detection
CN105631916A (en) * 2014-11-25 2016-06-01 奥多比公司 Paintbrush and liquid simulation
CN104036547B (en) * 2014-06-30 2017-05-24 清华大学 Method and device for three-dimensional brush to generate network module in real time based on Leap Motion control
CN109191539A (en) * 2018-07-20 2019-01-11 广东数相智能科技有限公司 Oil painting generation method, device and computer readable storage medium based on image
CN109300178A (en) * 2018-09-11 2019-02-01 广东智媒云图科技股份有限公司 A kind of souvenir figure generation system based on automatic sketch
CN109325986A (en) * 2018-09-11 2019-02-12 广东智媒云图科技股份有限公司 A kind of method for drafting and device of sketch
US10235778B2 (en) 2016-03-25 2019-03-19 Microsoft Technology Licensing, Llc GPU-accelerated pencil ink effect rendering
TWI671711B (en) * 2018-05-29 2019-09-11 崑山科技大學 Apparatus and method for simulating light distribution in environmental space
CN110453395A (en) * 2019-07-19 2019-11-15 广东智媒云图科技股份有限公司 A kind of intelligent robot embroidering method, electronic equipment, storage medium
CN111223184A (en) * 2019-11-19 2020-06-02 中煤航测遥感集团有限公司 Target curve drawing method and device
CN113168723A (en) * 2018-12-05 2021-07-23 索尼集团公司 Repairing tool

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1797472A (en) * 2004-12-20 2006-07-05 甲尚股份有限公司 System and method for manipulating comic characters
US20100073409A1 (en) * 2008-09-25 2010-03-25 Jennifer Greenwood Zawacki Techniques for Adjusting a Drying Time of Digital Ink

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1797472A (en) * 2004-12-20 2006-07-05 甲尚股份有限公司 System and method for manipulating comic characters
US20100073409A1 (en) * 2008-09-25 2010-03-25 Jennifer Greenwood Zawacki Techniques for Adjusting a Drying Time of Digital Ink

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王宁等: "IdiotPencil:An Interactive System for Generating Pencil Drawings from 3D Polygonal Models", 《2011 12TH INTERNATIONAL CONFERENCE ON COMPUTER-AIDED DESIGN AND COMPUTER GRAPHICS》 *
王宁等: "一种基于笔触的铅笔素描自动生成方法", 《中国体视学与图像分析》 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104777944A (en) * 2014-01-13 2015-07-15 范钦雄 Method for simulating hand-drawing board based on pen shadow detection
CN104777944B (en) * 2014-01-13 2018-06-22 范钦雄 Method for simulating hand-drawing board based on pen shadow detection
CN103914862A (en) * 2014-03-10 2014-07-09 上海大学 Pencil sketch simulating method based on edge tangent stream
CN104036547B (en) * 2014-06-30 2017-05-24 清华大学 Method and device for three-dimensional brush to generate network module in real time based on Leap Motion control
CN105631916A (en) * 2014-11-25 2016-06-01 奥多比公司 Paintbrush and liquid simulation
CN105631916B (en) * 2014-11-25 2020-12-04 奥多比公司 Brush and liquid simulation
CN104766355A (en) * 2015-04-22 2015-07-08 哈尔滨工业大学 Splash-color painting interactive system based on handwriting analysis and method for generating digital splash-color painting in real time through system
CN104766355B (en) * 2015-04-22 2018-04-10 哈尔滨工业大学 Bold and vigorous colour painting interactive system based on graphology analysis and generate the method that colour painting is sprinkled in digitlization in real time using the system
US10235778B2 (en) 2016-03-25 2019-03-19 Microsoft Technology Licensing, Llc GPU-accelerated pencil ink effect rendering
US10269143B2 (en) 2016-03-25 2019-04-23 Microsoft Technology Licensing, Llc Multiple texture variable opacity stroke rendering and blending
US10282867B2 (en) 2016-03-25 2019-05-07 Microsoft Technology Licensing, Llc Shading for variable opacity stroke rendering
TWI671711B (en) * 2018-05-29 2019-09-11 崑山科技大學 Apparatus and method for simulating light distribution in environmental space
CN109191539A (en) * 2018-07-20 2019-01-11 广东数相智能科技有限公司 Oil painting generation method, device and computer readable storage medium based on image
CN109191539B (en) * 2018-07-20 2023-01-06 广东数相智能科技有限公司 Oil painting generation method and device based on image and computer readable storage medium
CN109325986A (en) * 2018-09-11 2019-02-12 广东智媒云图科技股份有限公司 A kind of method for drafting and device of sketch
CN109300178A (en) * 2018-09-11 2019-02-01 广东智媒云图科技股份有限公司 A kind of souvenir figure generation system based on automatic sketch
CN113168723A (en) * 2018-12-05 2021-07-23 索尼集团公司 Repairing tool
CN113168723B (en) * 2018-12-05 2024-05-28 索尼集团公司 Repair tool
CN110453395A (en) * 2019-07-19 2019-11-15 广东智媒云图科技股份有限公司 A kind of intelligent robot embroidering method, electronic equipment, storage medium
CN110453395B (en) * 2019-07-19 2021-04-09 广东智媒云图科技股份有限公司 Intelligent robot embroidery method, electronic equipment and storage medium
CN111223184A (en) * 2019-11-19 2020-06-02 中煤航测遥感集团有限公司 Target curve drawing method and device

Also Published As

Publication number Publication date
CN102509357B (en) 2014-04-23

Similar Documents

Publication Publication Date Title
CN102509357B (en) Stroke-based Pencil Sketch Simulation and Drawing System
US9367944B2 (en) Tree model and forest model generating method and apparatus
CN109712223B (en) Three-dimensional model automatic coloring method based on texture synthesis
CN106373187A (en) Two-dimensional image to three-dimensional scene realization method based on AR
CN104299263B (en) A kind of method that cloud scene is modeled based on single image
CN101853517A (en) An automatic generation method of realistic image oil painting based on stroke limitation and texture
Zeng et al. Region-based bas-relief generation from a single image
Way et al. The synthesis of trees in Chinese landscape painting using silhoutte and texture strokes
Bhattacharjee et al. A survey on sketch based content creation: from the desktop to virtual and augmented reality
Zhang et al. Real-time bas-relief generation from a 3D mesh
Wong et al. Model-based analysis of Chinese calligraphy images
Tasse et al. Feature-based terrain editing from complex sketches
CN104091318B (en) A kind of synthetic method of Chinese Sign Language video transition frame
CN115311393A (en) An 8K three-dimensional ink animation production method
Feng et al. An interactive 2d-to-3d cartoon modeling system
Wang et al. IdiotPencil: an interactive system for generating pencil drawings from 3D polygonal models
Zhao et al. A pencil drawing algorithm based on wavelet transform multiscale
KR101635992B1 (en) Pencil Rendering Framework based on Noise Generalization
Kwon et al. Pencil rendering on 3D meshes using convolution
Zhu et al. Bas-reliefs modelling based on learning deformable 3D models
CN117058301B (en) Knitted fabric real-time rendering method based on delayed coloring
Zeng et al. 3D plants reconstruction based on point cloud
dos Passos et al. Sample-based synthesis of illustrative patterns
Paiva et al. Sketch-based adaptive mesh augmentation using stellar operators
Bolduc Sketch-based interactive shape deformation using shading isophotes

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140423