CN108537858B - Drawing time sequence-based stroke line dynamic merging method - Google Patents
Drawing time sequence-based stroke line dynamic merging method Download PDFInfo
- Publication number
- CN108537858B CN108537858B CN201810243095.8A CN201810243095A CN108537858B CN 108537858 B CN108537858 B CN 108537858B CN 201810243095 A CN201810243095 A CN 201810243095A CN 108537858 B CN108537858 B CN 108537858B
- Authority
- CN
- China
- Prior art keywords
- line
- new
- lines
- line segment
- merged
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
- G06T11/203—Drawing of straight lines or curves
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
A stroke line dynamic merging method based on drawing time sequence can quickly and accurately merge a plurality of strokes into a small number of stroke lines by utilizing the sequence of the strokes and keep the main drawing content of an original drawing, the method provides a dynamic merging method, and mainly comprises the following steps for any newly drawn line: firstly, calculating the space distance between a new line and a previous input line; secondly, if the space distance is larger than a given threshold value, taking the new line as a new combined line, otherwise, calculating the space distance between the new line and the previous combined line; and then, if the space distance between the new line and the previous merged line is larger than a given threshold value, taking the new line as the new merged line, and otherwise, merging the new line into the previous merged line.
Description
Technical Field
The invention relates to a stroke line dynamic merging method based on drawing time sequence by utilizing computer technology, which can keep the creation intention of a painter and automatically and accurately finish the simplification work of complex line drawing.
Background
The line drawing is a simple and easy guided expression form, is widely applied to the fields of industrial design and artistic creation, and is popular with vast art creators and designers. Compared with the line drawing drawn by a paper pen, the line drawing is recorded and transmitted to the computer by the drawer by means of the digitizer, the intention expressed by the drawer can be more completely reserved, and the drawer can modify and reuse the line drawing conveniently.
In the process of drawing a line drawing, a painter often draws a part which is difficult to draw for multiple times, so that a large number of overlapped lines exist in the line drawing. The lines of such line drawings are very complex and it is difficult for the painter to make fine modifications and re-use of such line drawings. In order to simplify a complex line drawing and simplify lines as much as possible on the premise of keeping the intention of a drawer, the conventional method clusters and merges the lines in the line drawing by analyzing spatial distance constraints of attributes such as proximity, parallelism and drawing direction between areas and lines in the line drawing to obtain a simple line drawing. However, the existing method only considers the spatial attributes between the regions and the lines, ignores the time sequence information of line drawing, and has the clustering and merging results that are difficult to completely retain the drawing intention of the drawer and cannot process complex line drawing graphs.
The painters have a certain sequence in the process of drawing the line and the picture. Electronic pens and digital tablets are common drawing tools used by many new generations of designers and painters, and they can record all lines in sequence. The invention combines the drawing time sequence of the lines with the spatial positions of the lines, and provides a stroke line dynamic combination method based on the drawing time sequence. Compared with the existing method, the method can better keep the drawing intention of the drawer when simplifying the complicated stroke lines.
Disclosure of Invention
In order to overcome the defects of the existing stroke line merging method, the invention provides a stroke line dynamic merging method based on drawing time sequence by utilizing computer technology, which can efficiently and accurately finish the simplification work of complex line drawing.
The invention analyzes the space distance information and the time sequence information of the lines drawn by the drawer and dynamically clusters and combines the stroke lines, thereby realizing the purpose of simplifying complex line drawings on the premise of ensuring the intention of the drawer.
The following symbol definitions are provided herein: for the input n lines, S ═ S is defined1,S2,...,Sn}; define m lines after merging L ═ { L ═ L1,L2,...,Lm}。Ds(Si,Sj) Representation line SiAnd SjThe spatial distance therebetween; hausdorff (S)i,Sj) Calculating line SiAll points up to SjThe maximum value of the shortest distance, T, is the spatial distance threshold.
Step 2, if Ds(Sn,Sn+1) < T by Ds(Lj,Sn+1) Calculating LjAnd Sn+1Otherwise S isn+1As a new merge line Lm+1。
Further, in step 3, line Sn+1And LjThe combination of (A) and (B) mainly comprises the following steps: first, for LjAnd Sn+1Searching two points which are positioned on the other line and are nearest to the two end points of the line, determining the part of the two lines which are overlapped in a short distance, and converting L into LjAnd Sn+1Are respectively marked as strip section K1And K2(ii) a Then, for K1And K2By linear interpolation, i.e. K ═ λ K1+(1-λ)K2Where K is the new line segment obtained by interpolationλ is an interpolation weight, and λ is not a global weight, but a local weight that may be different at each position of the line in the overlapping portion. Sn+1And LjThere is a possibility that the lines of the non-overlapping portions may be present at both ends of the K line segment, and since the overlapping portions are obtained by end point calculation, the lines of the non-overlapping portions do not simultaneously appear on one side of the K line segment. Let us assume that on one side of the K line segment, LjOr Sn+1There is a line of the misaligned portion, λ on this side is set to 1 or 0 to ensure that the new line segment K can be continued with the line of the misaligned portion. When λ is 1, K is K1(ii) a When λ is 0, K is K2. If one side of the K line segment is not connected with LjOr Sn+1The line of the misaligned part of (2) sets λ at the side to 0.5, and also sets λ at the middle position of the K line segment to 0.5. To ensure that the new line segment K is continuous at any position, λ at the non-end point and midpoint positions is calculated using a linear transition from the end point to the midpoint.
The technical conception of the invention is as follows: the dynamic combination of the lines is carried out by taking the time sequence of the strokes in the line drawing as the main basis, thereby realizing the dynamic combination of the complex line drawing. In the merging process, the spatial distance between lines is used for detecting the coincidence relation, and further efficient and continuous merging is realized.
The invention has the advantages that: the time sequence of the lines is sequentially taken into consideration in the line combination of the line drawing, and only the previous line and the combined line are taken into consideration in the combination process, so that the dynamic update is supported, and the combination efficiency is improved; the combination of the lines considers the distance relationship of the space, and the final combination line is ensured to be continuous everywhere through the design of the combination weight.
Drawings
FIG. 1 is a flow chart of the present invention.
FIG. 2 is a schematic diagram of the input of the present invention, and the numbers represent the time sequence of each stroke.
FIG. 3 is a diagram of the clustering results of the present invention, with strokes of different gray levels representing different classifications.
The lines of fig. 4 merge the exemplary diagrams.
FIG. 5 is a simplified result diagram of a line drawing.
Detailed Description
Referring to the drawings, S ═ S is defined for n lines that have been input1,S2,...,Sn}; define m lines after merging L ═ { L ═ L1,L2,...,Lm}。Ds(Si,Sj) Representation line SiAnd SjThe spatial distance therebetween; hausdorff (S)i,Sj) Calculating line SiAll points up to SjThe maximum value of the shortest distance, T, is the spatial distance threshold, further illustrating the invention:
Step 2, if Ds(Sn,Sn+1) < T by Ds(Lj,Sn+1) Calculating LjAnd Sn+1Otherwise S isn+1As a new merge line Lm+1。
Further, in step 3, line Sn+1And LjThe combination mainly comprises the following steps: first, for LjAnd Sn+1Searching two points which are positioned on the other line and are nearest to the two end points of the line, determining the part of the two lines which are overlapped in a short distance, and converting L into LjAnd Sn+1Are respectively marked as strip section K1And K2(ii) a Then, for K1And K2By linear interpolation, i.e. K ═ λ K1+(1-λ)K2Where K is the new line segment obtained by interpolation, λ is the interpolation weight, and λ is not the global weight, but the local weight that may be different at each position of the line in the overlapped part. Sn+1And LjMay have lines which do not overlap at both ends, due to overlappingThe part is calculated by the end point, so the lines of the non-overlapping part do not appear on one side of the K line segment at the same time. Let us assume that on one side of the K line segment, LjOr Sn+1There is a line of the misaligned portion, λ on this side is set to 1 or 0 to ensure that the new line segment K can be continued with the line of the misaligned portion. When λ is 1, K is K1(ii) a When λ is 0, K is K2. If one side of the K line segment is not connected with LjOr Sn+1The line of the misaligned part of (2) sets λ at the side to 0.5, and also sets λ at the middle position of the K line segment to 0.5. To ensure that the new line segment K is continuous at any position, λ at the non-end point and midpoint positions is calculated using a linear transition from the end point to the midpoint.
The combination of the stroke lines is an effective means for improving the efficiency of drawing a draft by an artist, and the existing stroke line simplification method only considers the space distance between the lines, but has the problems of low algorithm stability, low calculation efficiency, inaccurate combination result and the like. The invention provides a stroke line dynamic merging method based on drawing time sequence, which can automatically and accurately merge line drawing sketches formed by a plurality of stroke lines into line drawing pictures with less quantity and retained original picture content.
The embodiments described in this specification are merely illustrative of implementations of the inventive concept and the scope of the present invention should not be considered limited to the specific forms set forth in the embodiments but rather by the equivalents thereof as may occur to those skilled in the art upon consideration of the present inventive concept.
Claims (3)
1. A stroke line dynamic merging method based on drawing time sequence is used for defining input n lines as S ═ S { (S)1,S2,...,Sn}; define m lines after merging L ═ { L ═ L1,L2,...,Lm};Ds(Si,Sj) Representation line SiAnd SjThe spatial distance therebetween; hausdorff (S)i,Sj) Calculating line SiAll points up to SjMaximum value of the shortest distance, T being the space distanceThe method specifically comprises the following steps:
step 1, for any newly input line Sn+1Calculating it from the previous input line SnSpatial distance D ofs(Sn,Sn+1)=Hausdorff(Sn,Sn+1);
Step 2, if Ds(Sn,Sn+1) < T by Ds(Lj,Sn+1) Calculating LjAnd Sn+1Otherwise S isn+1As a new merge line Lm+1;
Step 3, if Ds(Lj,Sn+1) < T, merge Sn+1And LjAnd update Lj(ii) a Otherwise will Sn+1As a new merge line Lm+1。
2. The method as claimed in claim 1, wherein the merging is a dynamic merging process, and any newly added line is spatially separated from the previous input line and the previous merged line to determine whether the new line is to be a new merged line or to be merged again with the existing merged line.
3. The stroke line dynamic merging method based on drawing time sequence as claimed in claim 1, characterized in that: in the step 3, a line Sn+1And LjThe combination of (A) and (B) mainly comprises the following steps: first, for LjAnd Sn+1Searching two points which are positioned on the other line and are nearest to the two end points of the line, determining the part of the two lines which are overlapped in a short distance, and converting L into LjAnd Sn+1Are respectively marked as strip section K1And K2(ii) a Then, for K1And K2By linear interpolation, i.e. K ═ λ K1+(1-λ)K2Wherein K is a new line segment obtained by interpolation, λ is an interpolation weight, λ is not a global weight, but a local weight which can be different at each position of a line of the overlapped part; sn+1And LjThere may be non-overlapping lines at both ends of the K line segment, and since the overlapping portion is obtained by end point calculation, the non-overlapping lines do not appear on one side of the K line segment at the same time; let us assume that on one side of the K line segment, LjOr Sn+1If the line of the non-coincident part exists, setting the lambda of the side to be 1 or 0 so as to ensure that the new line segment K can be continuous with the line of the non-coincident part; when λ is 1, K is K1(ii) a When λ is 0, K is K2(ii) a If one side of the K line segment is not connected with LjOr Sn+1The line of the misaligned part of (1), λ at the one side is set to 0.5, and λ at the middle position of the K line segment is also set to 0.5; to ensure that the new line segment K is continuous at any position, λ at the non-end point and midpoint positions is calculated using a linear transition from the end point to the midpoint.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810243095.8A CN108537858B (en) | 2018-03-23 | 2018-03-23 | Drawing time sequence-based stroke line dynamic merging method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810243095.8A CN108537858B (en) | 2018-03-23 | 2018-03-23 | Drawing time sequence-based stroke line dynamic merging method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108537858A CN108537858A (en) | 2018-09-14 |
CN108537858B true CN108537858B (en) | 2022-06-21 |
Family
ID=63484344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810243095.8A Active CN108537858B (en) | 2018-03-23 | 2018-03-23 | Drawing time sequence-based stroke line dynamic merging method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108537858B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110931129A (en) * | 2019-12-10 | 2020-03-27 | 上海市精神卫生中心(上海市心理咨询培训中心) | Painting and drawing computer analysis method for evaluating schizophrenia mental state |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103106309A (en) * | 2013-02-06 | 2013-05-15 | 浙江大学 | Sketch behavior identification method and sketch behavior identification system during computer aided design process |
CN103400109A (en) * | 2013-07-10 | 2013-11-20 | 西安交通大学 | Free-hand sketch offline identification and reshaping method |
CN103927056A (en) * | 2014-04-28 | 2014-07-16 | 西北工业大学 | Stroke segmentation method based on mixing feature for intelligent free-hand input |
CN104143209A (en) * | 2014-06-20 | 2014-11-12 | 浙江工业大学 | Method for engraving three-dimensional model based on line pattern |
CN104424658A (en) * | 2014-10-22 | 2015-03-18 | 浙江工商大学 | Structure-preserving interpolation method of two-dimensional shapes |
CN107735758A (en) * | 2015-06-29 | 2018-02-23 | 微软技术许可有限责任公司 | Synchronous digital ink strokes are presented |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102999282B (en) * | 2011-09-08 | 2015-11-25 | 北京林业大学 | Based on data object logic control system and the method thereof of real-time stroke input |
US9183467B2 (en) * | 2013-05-03 | 2015-11-10 | Microsoft Technology Licensing, Llc | Sketch segmentation |
CN103902689B (en) * | 2014-03-26 | 2016-07-20 | 小米科技有限责任公司 | Clustering method, increment clustering method and relevant apparatus |
-
2018
- 2018-03-23 CN CN201810243095.8A patent/CN108537858B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103106309A (en) * | 2013-02-06 | 2013-05-15 | 浙江大学 | Sketch behavior identification method and sketch behavior identification system during computer aided design process |
CN103400109A (en) * | 2013-07-10 | 2013-11-20 | 西安交通大学 | Free-hand sketch offline identification and reshaping method |
CN103927056A (en) * | 2014-04-28 | 2014-07-16 | 西北工业大学 | Stroke segmentation method based on mixing feature for intelligent free-hand input |
CN104143209A (en) * | 2014-06-20 | 2014-11-12 | 浙江工业大学 | Method for engraving three-dimensional model based on line pattern |
CN104424658A (en) * | 2014-10-22 | 2015-03-18 | 浙江工商大学 | Structure-preserving interpolation method of two-dimensional shapes |
CN107735758A (en) * | 2015-06-29 | 2018-02-23 | 微软技术许可有限责任公司 | Synchronous digital ink strokes are presented |
Non-Patent Citations (6)
Title |
---|
"Line Drawing Simplification by Stroke Translation and Combination";Yun Chien .etc;《Fifth International Conference on Graphic and Image Processing》;20140110;第9069卷;第1-6页 * |
"nterpretation of Overtracing Freehand Sketching for Geometric Shapes";Day Chyi Ku .etc;《Proceedings of WSCG’2006, the 14th International Conference in Central Europe on Computer Graphics, Visualization and Computer Vision》;20060203;第263-270页 * |
"一种参数曲线间Hausdorff距离的计算方法 ";林意等;《图学学报》;20141031;第35卷(第5期);第704-708页 * |
"基于时空关系的在线多笔划手绘直线段识别";王淑侠等;《计算机工程与应用》;20110929;第48卷(第14期);第198-202页 * |
"基于线画图案的三维模型雕刻";缪永伟等;《计算机辅助设计与图形学学报》;20160131;第28卷(第1期);第50-57页 * |
"手绘图风格的三维模型线条渲染";许嘉翰等;《计算机系统应用》;20150331;第24卷(第31期);第214-219页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108537858A (en) | 2018-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Pupyrev et al. | Improving layered graph layouts with edge bundling | |
CN105225260B (en) | Method for realizing original handwriting | |
CN104063723B (en) | The stroke restoring method and device of the Off-line Handwritten Chinese | |
KR20120095852A (en) | Method and apparatus for drawing and erasing calligraphic ink objects on a display surface | |
CN104424473A (en) | Method and device for identifying and editing freehand sketch | |
WO2014086264A1 (en) | Method and electronic device for beautifying handwriting in real time | |
CN104200240A (en) | Sketch retrieval method based on content adaptive Hash encoding | |
CN109886877A (en) | A kind of method of destination fitting and the splicing of segmentation course line | |
WO2019233089A1 (en) | Method and device for large-ratio scale reduction of internet testbed topology | |
CN104079926B (en) | A kind of video performance method of testing of remote desktop software | |
CN108537858B (en) | Drawing time sequence-based stroke line dynamic merging method | |
GB2366108A (en) | Vectorization of raster images | |
CN111047671B (en) | Method for optimizing drawing path of hand-drawn picture and storage medium | |
CN110264311B (en) | Business promotion information accurate recommendation method and system based on deep learning | |
CN106920269A (en) | Graphic processing method and device | |
JP2014038518A (en) | Handwritten document processing device, method, and program | |
CN111164645A (en) | Image segmentation method and device | |
Morrison et al. | Inexact graph matching using a hierarchy of matching processes | |
Tran et al. | Guided instance segmentation framework for semi-supervised video instance segmentation | |
Moura | 3D density histograms for criteria-driven edge bundling | |
Li et al. | Deep reinforcement learning for automatic thumbnail generation | |
US20190287279A1 (en) | Dynamic Path Modification and Extension | |
Huang et al. | Iteratively parsing contour fragments for object detection | |
Bremer et al. | A practical approach to two-dimensional scalar topology | |
JP6072148B2 (en) | Handwritten document processing apparatus, method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |