CN113610951A - Automatic tracing method and device - Google Patents

Automatic tracing method and device Download PDF

Info

Publication number
CN113610951A
CN113610951A CN202110927883.0A CN202110927883A CN113610951A CN 113610951 A CN113610951 A CN 113610951A CN 202110927883 A CN202110927883 A CN 202110927883A CN 113610951 A CN113610951 A CN 113610951A
Authority
CN
China
Prior art keywords
line
image
central point
format
user
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
CN202110927883.0A
Other languages
Chinese (zh)
Other versions
CN113610951B (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.)
Shenzhen Fangzhi Technology Co ltd
Original Assignee
Shenzhen Fangzhi Technology Co ltd
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 Shenzhen Fangzhi Technology Co ltd filed Critical Shenzhen Fangzhi Technology Co ltd
Priority to CN202110927883.0A priority Critical patent/CN113610951B/en
Publication of CN113610951A publication Critical patent/CN113610951A/en
Application granted granted Critical
Publication of CN113610951B publication Critical patent/CN113610951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Abstract

The invention provides an automatic tracing method and a device, and the method comprises the steps of scanning a paper freehand line draft into an image file in an electronic format through scanning equipment; analyzing the gray level of each pixel of the image file, and filtering out the pixels with the gray level lower than a preset value to obtain a binary image with bright lines; calculating the coordinates of the central point of each line in the binary image through a subdivision algorithm; collecting coordinates of the central point of each line to form a coordinate set of the central point of each line; popping up a parameter setting panel to the user side so as to enable the user to set image line parameters; and after the user sets the line parameters of the image, redrawing the lines according to the coordinate set of the central point of each line to obtain a vector line draft. The invention has the beneficial effects that: the method has the advantages that the effect that the hand-drawing line draft is automatically converted into the vector line draft in the animation software is realized, both hands of an animator are liberated, and the development efficiency of the outline tracing of the two-dimensional animation product is greatly improved.

Description

Automatic tracing method and device
Technical Field
The present invention relates to the field of image rendering technologies, and in particular, to an automatic image rendering method and apparatus.
Background
Two-dimensional animation is formed by continuously playing a plurality of still pictures, the common frame rate is 12 frames/second and 24 frames/second, taking 12 frames/second as an example, that is, 12 pictures are required to be made per second, and characters and scenes in each picture are composed of a large number of lines and color filling. In the process of making these lines, the animator needs to refer to the hand drawing manuscript of the original animator, and the drawing is manually performed in the animation software by using a drawing tool. For example, for a ten-minute animation, the frame rate is 12 frames, the required number of pictures is 7200, the manual production of lines in each picture takes a long time, and the quality of the drawn lines is affected by human factors and is uneven.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: provides an automatic tracing method, aiming at improving the production efficiency of animation works.
In order to solve the technical problems, the invention adopts the technical scheme that: an automatic tracing method comprises the following steps,
s10, scanning the paper hand-drawing line draft into an image file in an electronic format through scanning equipment;
s20, analyzing the gray level of each pixel of the image file, filtering out pixels with gray levels lower than a preset value, and obtaining a binary image with bright lines;
s30, calculating the coordinates of the center point of each line in the binary image through a subdivision algorithm;
s40, collecting coordinates of the central point of each line to form a coordinate set of the central point of each line;
s50, popping up a parameter setting panel to the user side for the user to set the image line parameters;
and S60, after the user sets the line parameters of the image, redrawing the lines according to the coordinate set of the central point of each line to obtain a vector line draft.
Further, step S60 specifically includes,
s61, after the user sets the line parameters of the image, taking the image file in the original electronic format as a bottom image layer, and creating a new line drawing layer on the bottom image layer;
and S62, redrawing the lines on the line drawing layer according to the coordinate set of the central point of each line and the line parameters set by the user to obtain a vector line draft.
Further, step S30 specifically includes calculating coordinates of a center point of each line in the binary image by a subdivision algorithm, and eliminating black pixels of each line except the center point.
Further, in step S10, the format of the image file includes, but is not limited to, jpg format, png format, and bmp format.
Further, in step S50, the line parameters include the color of the line, the thickness of the line, and the smoothing factor of the line.
The invention also provides an automatic tracing device, which comprises,
the picture pixel analysis module is used for scanning the paper hand-drawing line draft into an image file in an electronic format through scanning equipment;
the pixel filtering module is used for analyzing the gray level of each pixel of the image file, filtering out the pixels with the gray level lower than a preset value, and obtaining a binary image with bright lines;
the pixel coordinate analysis module is used for calculating the coordinates of the central point of each line in the binary image through a subdivision algorithm;
the key coordinate collection module is used for collecting the coordinates of the central point of each line to form a coordinate set of the central point of each line;
the parameter setting module is used for popping up a parameter setting panel to the user side so as to enable the user to set the image line parameters;
and the line drawing module is used for redrawing the lines according to the coordinate set of the central point of each line after the line parameters of the image are set by the user, so as to obtain the vector line draft.
Furthermore, the line drawing module specifically comprises,
the image layer establishing unit is used for taking an image file in an original electronic format as a bottom image layer after a user finishes setting line parameters of an image, and newly building a line drawing image layer on the bottom image layer;
and the redrawing unit is used for redrawing the lines on the line drawing layer according to the coordinate set of the central point of each line and the line parameters set by the user to obtain the vector line draft.
Further, the pixel coordinate analysis module is specifically configured to calculate coordinates of a center point of each line in the binary image through a subdivision algorithm, and eliminate black pixels of each line except the center point.
Further, in the picture pixel analysis module, the format of the image file includes, but is not limited to, jpg format, png format, and bmp format.
Further, in the parameter setting module, the line parameters include a color of the line, a thickness of the line, and a smoothing coefficient of the line.
The invention has the beneficial effects that: according to the method, the coordinates of the central point of each line in the binary image are calculated through a subdivision algorithm, the coordinates of the central point of each line are collected to form the coordinate set of the central point of each line, the lines are redrawn according to the coordinate set of the central point of each line to obtain the vector line draft, the effect that the hand-drawn line draft is automatically converted into the vector line draft in the animation software is achieved, the hands of an animator are liberated, and the development efficiency of the two-dimensional animation product outline tracing is greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the mechanisms shown in the drawings without creative efforts.
FIG. 1 is a flow chart of an automated tracing method of an embodiment of the present invention;
fig. 2 is a block diagram of an automatic tracing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description of the invention relating to "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying any relative importance or implicit indication of the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Referring to fig. 1, a first embodiment of the present invention is: an automatic tracing method includes the following steps that S10, paper hand-drawing line manuscripts are scanned into image files in an electronic format through scanning equipment;
in step S10, the image file format includes, but is not limited to, jpg format, png format, and bmp format.
S20, analyzing the gray level of each pixel of the image file, filtering out pixels with gray levels lower than a preset value, and obtaining a binary image with bright lines;
in this step, the shadow gray scale generated in some scanning or hand-drawing modification processes in the image is low, and the mottle is removed by filtering the pixels with low gray scale, so as to obtain a binary image with clear lines, i.e. an image only retaining two colors of black and white.
S30, calculating the coordinates of the center point of each line in the binary image through a subdivision algorithm;
step S30 specifically includes calculating coordinates of a center point of each line in the binary image by a subdivision algorithm, and eliminating black pixels of each line except the center point.
S40, collecting coordinates of the central point of each line to form a coordinate set of the central point of each line;
although the coordinates of each black pixel can be obtained in steps S30-S40, since the hand-drawn lines are fine and inconsistent, a subdivision algorithm is required to obtain the coordinates of the center point of each line, the subdivision algorithm continuously eliminates the black pixels at the outermost periphery of the line by cycling, only the black pixels at the center of the bottom line are finally retained, and then the coordinates of all the black pixels in the picture are collected, so that the coordinate set of the center point of each line can be obtained.
S50, popping up a parameter setting panel to the user side for the user to set the image line parameters;
in step S50, the line parameters include the color of the line, the thickness of the line, and the smoothing coefficient of the line.
And S60, after the user sets the line parameters of the image, redrawing the lines according to the coordinate set of the central point of each line to obtain a vector line draft.
Wherein, the step S60 specifically includes,
s61, after the user sets the line parameters of the image, taking the image file in the original electronic format as a bottom image layer, and creating a new line drawing layer on the bottom image layer;
and S62, redrawing the lines on the line drawing layer according to the coordinate set of the central point of each line and the line parameters set by the user to obtain a vector line draft.
In step S60, after the user confirms the line parameters, automatically placing the electronic format image file of the line drawing draft on the bottom layer of the animation software, then creating a new line drawing layer, and driving the animation software to complete the drawing of the lines by combining the coordinate set of the center point of each line obtained before, so as to replace manual line-by-line drawing, and simultaneously, the finished product also maintains the format and standard of the hand drawing, so that the next element creating and coloring operation can be performed seamlessly.
In the embodiment, the work of processing the hand-drawn manuscript into the vector line manuscript in the animation software frequently occurs in the two-dimensional animation production process, the coordinate of the central point of each line in the binary image is calculated through a subdivision algorithm, the coordinate of the central point of each line is collected to form the coordinate set of the central point of each line, the lines are redrawn according to the coordinate set of the central point of each line to obtain the vector line manuscript, the hand-drawn line manuscript is automatically converted into the vector line manuscript in the animation production software, the hands of an animator are liberated, and the development efficiency of the two-dimensional animation product outline sketch is greatly improved.
Another embodiment of the present invention, as shown in fig. 2, is an automatic tracing apparatus, comprising,
the picture pixel analysis module 10 is used for scanning the paper hand-drawing line draft into an image file in an electronic format through scanning equipment;
in the picture pixel analysis module 10, the format of the image file includes, but is not limited to, jpg format, png format, and bmp format.
The pixel filtering module 20 is configured to analyze the gray level of each pixel of the image file, and filter out pixels with gray values lower than a preset value to obtain a binary image with bright lines;
the pixel coordinate analysis module 30 is used for calculating the coordinates of the central point of each line in the binary image through a subdivision algorithm;
the pixel coordinate analysis module 30 is specifically configured to calculate coordinates of a central point of each line in the binary image through a subdivision algorithm, and eliminate black pixels of each line except the central point.
The key coordinate collection module 40 is used for collecting the coordinates of the central point of each line to form a coordinate set of the central point of each line;
the parameter setting module 50 is used for popping up a parameter setting panel to the user side so as to enable the user to set the image line parameters;
in the parameter setting module 50, the line parameters include the color of the line, the thickness of the line, and the smoothing coefficient of the line.
And the line drawing module 60 is configured to redraw the lines according to the coordinate set of the central point of each line after the user sets the line parameters of the image, so as to obtain a vector line draft.
Wherein, the line drawing module 60 specifically includes,
the image layer establishing unit is used for taking an image file in an original electronic format as a bottom image layer after a user finishes setting line parameters of an image, and newly building a line drawing image layer on the bottom image layer;
and the redrawing unit is used for redrawing the lines on the line drawing layer according to the coordinate set of the central point of each line and the line parameters set by the user to obtain the vector line draft.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the automatic drawing apparatus may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An automatic tracing method is characterized in that: comprises the following steps of (a) carrying out,
s10, scanning the paper hand-drawing line draft into an image file in an electronic format through scanning equipment;
s20, analyzing the gray level of each pixel of the image file, filtering out pixels with gray levels lower than a preset value, and obtaining a binary image with bright lines;
s30, calculating the coordinates of the center point of each line in the binary image through a subdivision algorithm;
s40, collecting coordinates of the central point of each line to form a coordinate set of the central point of each line;
s50, popping up a parameter setting panel to the user side for the user to set the image line parameters;
and S60, after the user sets the line parameters of the image, redrawing the lines according to the coordinate set of the central point of each line to obtain a vector line draft.
2. The automatic tracing method of claim 1, wherein: the step S60 specifically includes the steps of,
s61, after the user sets the line parameters of the image, taking the image file in the original electronic format as a bottom image layer, and creating a new line drawing layer on the bottom image layer;
and S62, redrawing the lines on the line drawing layer according to the coordinate set of the central point of each line and the line parameters set by the user to obtain a vector line draft.
3. The automatic tracing method of claim 1, wherein: step S30 specifically includes calculating coordinates of a center point of each line in the binary image by a subdivision algorithm, and eliminating black pixels of each line except the center point.
4. The automatic tracing method of claim 1, wherein: in step S10, the format of the image file includes, but is not limited to, jpg format, png format, and bmp format.
5. The automatic tracing method of claim 1, wherein: in step S50, the line parameters include the color of the line, the thickness of the line, and the smoothing coefficient of the line.
6. An automatic tracing device, characterized in that: comprises the steps of (a) preparing a mixture of a plurality of raw materials,
the picture pixel analysis module is used for scanning the paper hand-drawing line draft into an image file in an electronic format through scanning equipment;
the pixel filtering module is used for analyzing the gray level of each pixel of the image file, filtering out the pixels with the gray level lower than a preset value, and obtaining a binary image with bright lines;
the pixel coordinate analysis module is used for calculating the coordinates of the central point of each line in the binary image through a subdivision algorithm;
the key coordinate collection module is used for collecting the coordinates of the central point of each line to form a coordinate set of the central point of each line;
the parameter setting module is used for popping up a parameter setting panel to the user side so as to enable the user to set the image line parameters;
and the line drawing module is used for redrawing the lines according to the coordinate set of the central point of each line after the line parameters of the image are set by the user, so as to obtain the vector line draft.
7. The automatic tracing apparatus of claim 6, wherein: the line drawing module specifically comprises a line drawing module,
the image layer establishing unit is used for taking an image file in an original electronic format as a bottom image layer after a user finishes setting line parameters of an image, and newly building a line drawing image layer on the bottom image layer;
and the redrawing unit is used for redrawing the lines on the line drawing layer according to the coordinate set of the central point of each line and the line parameters set by the user to obtain the vector line draft.
8. The automatic tracing apparatus of claim 6, wherein: the pixel coordinate analysis module is specifically used for calculating the coordinates of the central point of each line in the binary image through a subdivision algorithm and eliminating black pixels of each line except the central point.
9. The automatic tracing apparatus of claim 6, wherein: in the picture pixel analysis module, the format of the image file includes, but is not limited to, jpg format, png format, and bmp format.
10. The automatic tracing apparatus of claim 6, wherein: in the parameter setting module, the line parameters comprise the color of the line, the thickness of the line and the smooth coefficient of the line.
CN202110927883.0A 2021-08-12 2021-08-12 Automatic tracing method and device Active CN113610951B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110927883.0A CN113610951B (en) 2021-08-12 2021-08-12 Automatic tracing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110927883.0A CN113610951B (en) 2021-08-12 2021-08-12 Automatic tracing method and device

Publications (2)

Publication Number Publication Date
CN113610951A true CN113610951A (en) 2021-11-05
CN113610951B CN113610951B (en) 2022-05-17

Family

ID=78308426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110927883.0A Active CN113610951B (en) 2021-08-12 2021-08-12 Automatic tracing method and device

Country Status (1)

Country Link
CN (1) CN113610951B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080032856A (en) * 2006-10-11 2008-04-16 삼성중공업 주식회사 Recognition method of welding line position in shipbuilding subassembly stage
CN102592302A (en) * 2011-12-28 2012-07-18 江苏如意通动漫产业有限公司 Digital cartoon intelligent dynamic detection system and dynamic detection method
CN107301649A (en) * 2017-06-15 2017-10-27 大连海事大学 A kind of region merging technique SAR image coastline Detection Method algorithm based on super-pixel
US20200186672A1 (en) * 2016-04-28 2020-06-11 Dalian Czur Tech Co., Ltd. Method for Flattening Laser-based Image of Curved Book Page

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080032856A (en) * 2006-10-11 2008-04-16 삼성중공업 주식회사 Recognition method of welding line position in shipbuilding subassembly stage
CN102592302A (en) * 2011-12-28 2012-07-18 江苏如意通动漫产业有限公司 Digital cartoon intelligent dynamic detection system and dynamic detection method
US20200186672A1 (en) * 2016-04-28 2020-06-11 Dalian Czur Tech Co., Ltd. Method for Flattening Laser-based Image of Curved Book Page
CN107301649A (en) * 2017-06-15 2017-10-27 大连海事大学 A kind of region merging technique SAR image coastline Detection Method algorithm based on super-pixel

Also Published As

Publication number Publication date
CN113610951B (en) 2022-05-17

Similar Documents

Publication Publication Date Title
US5475507A (en) Color image processing method and apparatus for same, which automatically detects a contour of an object in an image
DE102017009276A1 (en) TO PRODUCE A THREE-DIMENSIONAL MODEL FROM A SCANNED OBJECT
US8768001B2 (en) Apparatus and methods for generating and processing manga-style images
JP2007507802A (en) Text-like edge enhancement in digital images
CN109242858B (en) Fabric printing cyclic pattern element segmentation method based on self-adaptive template matching
CN111062331A (en) Mosaic detection method and device for image, electronic equipment and storage medium
CN110415223B (en) No-reference spliced image quality evaluation method and system
CN113610951B (en) Automatic tracing method and device
CN114862706B (en) Tone mapping method for keeping gradient direction of image
JP2009134410A (en) Coloring device, coloring method and program
CN112700485B (en) Image depth information extraction method
CN116030114A (en) Manufacturing method, device, equipment and medium of bioelectrical homologous electronic impression
CN106204463A (en) A kind of processing method of Core Scanning Image
JPH09147102A (en) Image processor
JP2000357226A (en) Method for binarizing light and shade image and recording medium where binarizing program is recorded
CN110009082B (en) Three-dimensional code optimization method, medium, computer device and apparatus
CN110390339A (en) A kind of method for correcting image, device and storage medium
JPS62170287A (en) Apparatus for forming stitch data of embroidering machine
CN1855993A (en) Method and apparatus for forming image using edge information of image
JP4684074B2 (en) Image processing device
CN116228573A (en) Image edge sharpness method
CN113963005A (en) Multi-fingerprint image segmentation display method and device and computer readable storage medium
CN117079294A (en) Method, device, equipment and medium for generating standard template of broken code screen of ammeter
CN114913527A (en) Calibration method and system for camera calibration of scanning translation pen
CN114022498A (en) Blank area detection method, device, equipment and storage medium

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