CN105447901B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN105447901B
CN105447901B CN201410505493.4A CN201410505493A CN105447901B CN 105447901 B CN105447901 B CN 105447901B CN 201410505493 A CN201410505493 A CN 201410505493A CN 105447901 B CN105447901 B CN 105447901B
Authority
CN
China
Prior art keywords
stroke
trunk
line segment
edge line
indicate
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
Application number
CN201410505493.4A
Other languages
Chinese (zh)
Other versions
CN105447901A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410505493.4A priority Critical patent/CN105447901B/en
Publication of CN105447901A publication Critical patent/CN105447901A/en
Application granted granted Critical
Publication of CN105447901B publication Critical patent/CN105447901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a kind of image processing method and devices, belong to field of image processing.It include multiple strokes of ink and wash in image this method comprises: obtaining image;Multiple trunk strokes are obtained from multiple stroke;For each trunk stroke, multiple angle points of the trunk stroke are obtained;According to the relative positional relationship between multiple angle point, the endpoint of the trunk stroke is determined;According to the endpoint of each trunk stroke, the topological structure of the ink and wash is constructed, includes the corresponding edge line segment of each trunk stroke in the topological structure;According to the position of each edge line segment, the weight of each edge line segment is calculated;According to the position of edge each in topological structure line segment and weight, the drawing order of each trunk stroke in the images is determined.The present invention provides a kind of methods of stroke drawing order for obtaining ink and wash, can be automatically derived the drawing order of stroke according to the ink and wash completed.

Description

Image processing method and device
Technical field
The present invention relates to field of image processing, in particular to a kind of image processing method and device.
Background technique
Ink and wash is a kind of unique art form, and the drawing order for studying stroke in ink and wash has the development of ink and wash Important directive function.
In order to know the drawing order of ink and wash, can be shot down during artist draws ink and wash using camera Drawing process determines the drawing order of each stroke according to the photo or video of shooting.
In the implementation of the present invention, inventor has found that the prior art at least has the following deficiencies:
It must be shot during drawing ink and wash, can just obtain the drawing order of stroke, and for having drawn It makes for the ink and wash completed, which is static, and according only to static ink and wash, it can not know that the drafting of stroke is suitable Sequence.
Summary of the invention
In order to solve problems in the prior art, the embodiment of the invention provides a kind of image processing method and devices.It is described Technical solution is as follows:
In a first aspect, providing a kind of image processing method, which comprises
Image to be analyzed is obtained, includes multiple strokes of picture in described image;
From the multiple stroke, multiple trunk strokes are obtained;
For each trunk stroke, multiple angle points of the trunk stroke are obtained;
According to the relative positional relationship between the multiple angle point, the endpoint of the trunk stroke is determined;
According to the endpoint of each trunk stroke, the topological structure of the picture is constructed, includes each in the topological structure The corresponding edge line segment of trunk stroke;
According to position of each edge line segment in described image, the weight of each edge line segment is calculated;
According to the position of edge each in topological structure line segment and weight, determine each trunk stroke in described image In drawing order.
Second aspect, provides a kind of image processing apparatus, and described device includes:
Image collection module includes multiple strokes of picture for obtaining image to be analyzed, in described image;
Stroke classification module, for obtaining multiple trunk strokes from the multiple stroke;
Angle point obtains module, for obtaining multiple angle points of the trunk stroke for each trunk stroke;
Endpoint determining module, for determining the trunk stroke according to the relative positional relationship between the multiple angle point Endpoint;
Topological structure constructs module and constructs the topological structure of the picture, institute for the endpoint according to each trunk stroke Stating includes the corresponding edge line segment of each trunk stroke in topological structure;
Weight calculation module calculates each edge line segment for the position according to each edge line segment in described image Weight;
Drawing order determining module, for according to edge each in topological structure line segment position and weight, determine Drawing order of each trunk stroke in described image.
Technical solution provided in an embodiment of the present invention has the benefit that
Method and apparatus provided in an embodiment of the present invention, it is every in image by obtaining in multiple strokes of known picture The endpoint of a trunk stroke, constructs the topological structure of the picture, according to each edge line segment in the topological structure, determines each The drawing order of trunk stroke in the images provides a kind of method of stroke drawing order for obtaining picture, being capable of basis The picture completed is automatically derived the drawing order of stroke.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of flow chart of image processing method provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of image processing method provided in an embodiment of the present invention;
Fig. 3 is the schematic diagram of the selection endpoint of trunk stroke provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of building topological structure provided in an embodiment of the present invention;
Fig. 5 is a kind of image processing apparatus structural schematic diagram provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Fig. 1 is a kind of flow chart of image processing method provided in an embodiment of the present invention, referring to Fig. 1, this method comprises:
101, image to be analyzed is obtained, includes multiple strokes of picture in the image.
102, from multiple stroke, multiple trunk strokes are obtained.
103, for each trunk stroke, multiple angle points of the trunk stroke are obtained.
104, according to the relative positional relationship between multiple angle point, the endpoint of the trunk stroke is determined.
105, according to the endpoint of each trunk stroke, the topological structure of the picture is constructed, includes each in the topological structure The corresponding edge line segment of trunk stroke.
106, the position according to each edge line segment in the images calculates the weight of each edge line segment.
107, according to the position of edge each in topological structure line segment and weight, determine each trunk stroke in the image In drawing order.
Method provided in an embodiment of the present invention, in multiple strokes of known picture, by obtaining each trunk in image The endpoint of stroke constructs the topological structure of picture, according to each edge line segment in the topological structure, determines each trunk stroke Drawing order in the images provides a kind of method of stroke drawing order for obtaining picture, can be according to rendered The picture of completion is automatically derived the drawing order of stroke.
Optionally, should be from multiple stroke, obtaining multiple trunk strokes includes:
According to the stroke area of stroke each in multiple stroke, multiple stroke is clustered, obtains multiple trunks Stroke.
Optionally, should be for each trunk stroke, the multiple angle points for obtaining the trunk stroke include:
Using morphological gradient, operation is carried out to the trunk stroke, obtains multiple angle points of the trunk stroke.
Optionally, this determines that the endpoint of the trunk stroke includes: according to the relative positional relationship between multiple angle point
According to the relative positional relationship between multiple angle point, calculate in multiple angle point between every two angle point away from From;
Using maximum two angle points of distance in multiple angle point as the endpoint of the trunk stroke.
Optionally, the endpoint according to each trunk stroke, the topological structure for constructing the picture include:
For each trunk stroke, two endpoints of the trunk stroke are connected, edge line segment is obtained;
According to the corresponding edge line segment of each trunk stroke, the topological structure of the picture is obtained.
Optionally, the position according to each edge line segment in the images, the weight for calculating each edge line segment include:
For each edge line segment, stroke length, stroke area and the pen of trunk stroke corresponding to the edge line segment are obtained Draw concentration;
According to the position of edge line segment in the images, the position significance of the edge line segment is calculated;
According to the stroke length, the stroke area, the position significance and the stroke, the power of the edge line segment is calculated Weight.
Optionally, this calculates the position significance packet of the edge line segment according to the position of edge line segment in the images It includes:
According to the position of edge line segment in the images, using following formula, the position for calculating the edge line segment is significant Degree:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, DiIndicate that the position of the edge line segment is significant Degree, Pi(xi,yi) indicate the midpoint coordinates of the edge line segment, O (x0,y0) indicate the centre coordinate of the image.
Optionally, this calculates the side according to the stroke length, the stroke area, the position significance and the stroke The weight of edge line segment includes:
Obtain the stroke length maximum value of multiple trunk stroke, stroke area maximum value, position significance maximum value and Stroke maximum value;
According to the stroke length of the trunk stroke, stroke area, position significance and stroke, and the pen got Length maximum value, stroke area maximum value, position significance maximum value and stroke maximum value are drawn, using following formula, meter Calculate the weight of the edge line segment:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, WiIndicate the weight of the edge line segment, LiIt indicates The stroke length of the trunk stroke, LmaxIndicate the stroke length maximum value, SiIndicate the stroke area of the trunk stroke, SmaxTable Show the stroke area maximum value, DiIndicate the position significance of the trunk stroke, DmaxIndicate the position significance maximum value, TiTable Show the stroke of the trunk stroke, TmaxIndicate the stroke maximum value, α1Indicate the characteristic parameter of stroke length, α2It indicates The characteristic parameter of stroke area, α3Indicate the characteristic parameter of position significance, α4Indicate the characteristic parameter of stroke.
Optionally, the position and weight according to edge each in topological structure line segment, determines that each trunk stroke exists Drawing order in the image includes:
Using the maximum edge line segment of weight in the topological structure as first edge line segment;
According to the position of edge each in topological structure line segment, obtain using first edge line segment as the multiple of starting point Edge line segment;
The maximum edge line segment of weight is as second edge line segment in the multiple edge line segments that will acquire;
Based on second edge line segment, continuation obtains next edge line segment from the topological structure, until determining every The sequence of a edge line segment;
According to the sequence of each edge line segment, the drawing order of each trunk stroke in the images is determined.
Optionally, this method further include:
According to the stroke area of stroke each in multiple stroke, multiple stroke is clustered, obtains multiple details Stroke.
Optionally, the stroke area according to stroke each in multiple stroke, clusters multiple stroke, obtains After multiple details strokes, this method further include:
For each trunk stroke, multiple details strokes in the preset range of the trunk stroke are obtained;
In accordance with the order from top to bottom, multiple details stroke is ranked up, obtains the drafting of multiple details stroke Sequentially.
Optionally, which is ink and wash.
All the above alternatives can form alternative embodiment of the invention using any combination, herein no longer It repeats one by one.
Fig. 2 is a kind of flow chart of image processing method provided in an embodiment of the present invention, the execution master of the embodiment of the present invention Body is image processing apparatus, referring to fig. 2, this method comprises:
201, the image processing apparatus obtains image to be analyzed, includes multiple strokes of ink and wash in the image, from this In multiple strokes, multiple trunk strokes are obtained.
The embodiment of the present invention by executing subject be the image processing apparatus for, the image processing apparatus can for terminal, Server or the functional module etc. that can be realized image processing function, it is not limited in the embodiment of the present invention.At the image Reason device can analyze the image for including picture, to determine the drawing order of multiple strokes in the picture.The picture can Think ink and wash, watercolor or simple picture etc., the embodiment of the present invention is only illustrated by taking ink and wash as an example, actually not right The picture is defined.
In embodiments of the present invention, the ink and wash completed in the image including a width, which can By obtaining the image, the image of terminal upload can also be received in a manner of shooting the ink and wash or scan the ink and wash etc. Or the image is downloaded from server, the embodiment of the present invention obtains the mode of the image without limitation to the image processing apparatus.
Include multiple strokes of the ink and wash in the image, may include trunk stroke and details pen in multiple stroke It draws, wherein trunk stroke refers to that, to the biggish stroke of the influence degree of the ink and wash, details stroke refers to the shadow to the ink and wash Ring the lesser stroke of degree.Since each stroke is related to the influence degree of the ink and wash and the stroke area of the stroke, then may be used To think: when stroke area is bigger, which more may be trunk stroke, and stroke area gets over hour, which more may be thin Save stroke.
Based on above-mentioned characteristic, which can set area threshold, for each stroke, when the pen of the stroke When picture product is greater than the area threshold, which can determine that the stroke is main dry brush, when the stroke of the stroke When area is less than the area threshold, which can determine that the stroke is details stroke.Further, at the image Reason device can also cluster multiple stroke, obtain multiple according to the stroke area of stroke each in multiple stroke Trunk stroke and multiple details strokes.Optionally, the image processing apparatus is characterized by the stroke area of each stroke, using nothing Supervision clustering algorithm clusters multiple stroke, obtains multiple trunk strokes and multiple details strokes.
202, for each trunk stroke, which obtains multiple angle points of the trunk stroke, more according to this Relative positional relationship between a angle point determines the endpoint of the trunk stroke.
It, can when the image processing apparatus is from multiple stroke, gets multiple trunk strokes and multiple details strokes First to determine the drawing order of multiple trunk stroke.
For each trunk stroke, which first obtains multiple angle points of the trunk stroke, which refers to Extreme point in the trunk stroke.Specifically, which uses morphological gradient, carries out to the trunk stroke Operation obtains the edge of the trunk stroke, from the edge of the trunk stroke, extracts multiple angle points.Further, at the image Reason device can also first use edge detection operator, such as Canny operator, carry out operation to the trunk stroke, obtain the trunk The first edge of stroke, then morphological gradient is used, operation is carried out to the first edge of the trunk stroke, obtains the trunk The second edge of stroke extracts multiple angle points from the second edge of the trunk stroke.
For the image processing apparatus when extracting the angle point of the trunk stroke, the angle point extracted is more, subsequent obtained end Point will get over precision, but computation complexity also can be higher.The number for extracting angle point can be according to the size and accuracy of the image Demand determines that it is not limited in the embodiment of the present invention.
Referring to Fig. 3, pass through emulation experiment, it is determined that the edge of a trunk stroke, as shown in Figure 3a, shadow region indicate The inking region of the trunk stroke, other white spaces indicate the canvas area of ink and wash.When the image processing apparatus is according to this When the edge extracting of trunk stroke is to 10 angle points, two ends of dotted line in two endpoints such as Fig. 3 b of the trunk stroke are determined Point, when the image processing apparatus according to the edge extracting of the trunk stroke to 20 angle points when, determine two of the trunk stroke Two endpoints of dotted line in endpoint such as Fig. 3 c, when the image processing apparatus is according to the edge extracting of the trunk stroke to 50 angle points When, determine two endpoints of dotted line in two endpoints such as Fig. 3 d of the trunk stroke.Then as can be seen that working as the image processing apparatus When the angle point extracted is more, determining endpoint is more accurate.
It include multiple angle points in the trunk stroke, it is believed that two farthest angle points of distance are the masters in the trunk stroke The endpoint of dry brush calculates every in multiple angle point then according to the relative positional relationship in the trunk stroke between multiple angle points The distance between two angle points, using maximum two angle points of distance in multiple angle point as the endpoint of the trunk stroke.
203, the image processing apparatus constructs the topological structure of the ink and wash according to the endpoint of each trunk stroke, this is opened up Flutterring includes the corresponding edge line segment of each trunk stroke in structure.
For each trunk stroke, when the image processing apparatus gets two endpoints of the trunk stroke, by this two A endpoint is connected, using obtained line segment as the corresponding edge line segment of the trunk stroke.When the image processing apparatus obtain it is each When the edge line segment of trunk stroke, obtained all edge line segments are formed into the topological structure.Optionally, the image processing apparatus Each edge line segment is connected with designated identification, obtains the topological structure, which can identify for circular indicia, triangle Deng it is not limited in the embodiment of the present invention.
Referring to fig. 4,5 trunk strokes in the image as shown in fig. 4 a, when the image processing apparatus obtains each trunk When the edge line segment of stroke, obtain 5 edge line segments are connected with circular indicia, netted topological structure are obtained, such as Fig. 4 b It is shown.
204, position of the image processing apparatus according to each edge line segment in the images calculates each edge line segment Weight.
For each edge line segment, it is believed that the stroke length of trunk stroke corresponding to the edge line segment is bigger, pen When picture product is bigger, stroke is bigger, the position significance of the edge line segment is bigger, the drawing order of the trunk stroke is more leaned on Before.
Based on above-mentioned characteristic, which can be detected the image, obtain the pen of each trunk stroke Length, stroke area and stroke are drawn, and for each edge line segment, obtain the pen of trunk stroke corresponding to the edge line segment It draws length, stroke area and stroke and the position of the edge line segment is calculated according to the position of edge line segment in the images Significance calculates the power of the edge line segment according to the stroke length, the stroke area, the position significance and the stroke Weight.Wherein, the stroke length, the stroke area, the position significance and the stroke are positively correlated with the weight respectively.
For the position significance of the edge line segment, which can indicate the position pair of the edge line segment The influence degree of the image, it may be considered that the edge line segment is closer from the center of the image, the position of the edge line segment is significant It spends higher.Then optionally, the image processing apparatus is according to the position of edge line segment in the images, using following formula, meter Calculate the position significance of the edge line segment:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, DiIndicate that the position of the edge line segment is significant Degree, Pi(xi,yi) indicate the midpoint coordinates of the edge line segment, O (x0,y0) indicate the centre coordinate of the image.
Further, the image processing apparatus can according to the stroke length, the stroke area, the position significance and should Stroke calculates the weight of the edge line segment using following formula:
Wi1Li2Si3Di4Ti
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, WiIndicate the weight of the edge line segment, LiIt indicates The stroke length of the trunk stroke, SiIndicate the stroke area of the trunk stroke, DiIndicate the position significance of the trunk stroke, TiIndicate the stroke of the trunk stroke, α1Indicate the characteristic parameter of stroke length, α2Indicate the characteristic parameter of stroke area, α3Indicate the characteristic parameter of position significance, α4Indicate the characteristic parameter of stroke.Features described above parameter alpha1、α2、α3And α4It can To be determined respectively according to the accuracy requirements to stroke length, stroke area, position significance and stroke, the present invention is implemented Example does not limit this.Optionally, α1234=0.25.
Further, in order to avoid in the stroke length, the stroke area, the position significance and the stroke Any one numerical value is excessive and causes weight calculation inaccurate, which can also obtain the pen of multiple trunk stroke Length maximum value, stroke area maximum value, position significance maximum value and stroke maximum value are drawn, according to the trunk stroke Stroke length, stroke area, position significance and stroke, and get stroke length maximum value, stroke area most Big value, position significance maximum value and stroke maximum value calculate the weight of the edge line segment using following formula:
Wherein, LmaxIndicate the stroke length maximum value, SmaxIndicate the stroke area maximum value, DmaxIndicate that the position is aobvious Work degree maximum value, TmaxIndicate the stroke maximum value.
205, position and weight of the image processing apparatus according to edge each in topological structure line segment, determines each master The drawing order of dry brush in the images.
It is when the image processing apparatus has calculated that the weight of each edge line segment, weight in the topological structure is maximum Edge line segment is obtained as first edge line segment according to the position of edge each in topological structure line segment with this first Edge line segment is multiple edge line segments of starting point, and the maximum edge line segment of weight is as the in the multiple edge line segments that will acquire Two edge line segments are based on second edge line segment, and continuation obtains next edge line segment from the topological structure, until really The sequence of fixed each edge line segment determines the drafting of each trunk stroke in the images according to the sequence of each edge line segment Sequentially.
Wherein, edge line segment adjacent in the topological structure is with designated identification connection, when determining first edge line segment When, the available edge line segment that the same designated identification is connect with first edge line segment, as with first edge Line segment is multiple edge line segments of starting point, then selects the maximum edge line segment of weight as second from multiple edge line segment Edge line segment.When having determined that first edge line segment and second edge line segment, determine that second edge line segment connects The designated identification connect, determine it is in addition to first edge line segment and second edge line segment, connect the designated identification Multiple edge line segments, from the maximum edge line segment of multiple edge line segment right to choose weight as third edge line segment, with such It pushes away, so that it is determined that the sequence of each edge line segment.
Optionally, when the image processing apparatus determines first edge line segment, it is with first edge line segment Point carries out breadth first traversal to the weight of other edge line segments in the topological structure, determines the drafting of each edge line segment Sequentially.
It should be noted that the image processing apparatus can't area when getting the endpoint of trunk stroke in step 202 Divide the starting endpoint and termination end points of the trunk stroke, but when the image processing apparatus determines next trunk of the trunk stroke When stroke, the starting endpoint of the trunk stroke can be determined according to the position of the trunk stroke and next trunk stroke And end caps, that is, the drafting direction of the trunk stroke is determined, so as to know what how the trunk stroke was specifically drawn.
206, for each trunk stroke, which obtains multiple thin in the preset range of the trunk stroke Section stroke is in accordance with the order from top to bottom ranked up multiple details stroke, and the drafting for obtaining multiple details stroke is suitable Sequence.
Wherein, the region which determines can be centered on one of endpoint of the edge line segment, and can also should Centered on the midpoint of edge line segment, or centered on other shops on the edge line segment, the region which determines can Think the shapes such as round or ellipse, the size of the preset range can the size according to the image and the essence to details stroke Exactness demand determine, the embodiment of the present invention to this without limitation.
The embodiment of the present invention is executed after step 205 with the step 206, and in actual application, whenever the figure When determining the drawing order of a trunk stroke as processing unit, the step 206 can be directly executed, determines that the trunk stroke is pre- If the drawing order of multiple details strokes in range, then determine the drawing order of next trunk stroke.
When the drawing order of all trunk stroke and details stroke is determined, which can be determined The drawing order of each stroke in the ink and wash.The image processing apparatus can determine multiple details strokes all in multiple master It is drawn after dry brush.In addition, since artist is when drawing ink and wash, as soon as get used to having drawn a trunk stroke, draw Details stroke near the trunk stroke, therefore, for each trunk stroke, which can also determine the trunk The drawing order of multiple details strokes of stroke is after the trunk stroke, before next trunk stroke.
In the embodiment of the present invention, under the premise of multiple strokes in known ink and wash, multiple strokes are divided into trunk pen It draws and the endpoint of each trunk stroke is found out, to get the figure by analyzing the shape and structure of trunk stroke with details stroke The topological structure of picture, the relative positional relationship between the multiple trunk strokes of comprehensive analysis, determines the drafting of multiple trunk stroke Sequentially, details stroke is filled on each trunk stroke later, the drawing order of whole picture ink and wash is obtained, can be automatically generated Reasonable stroke drawing order.
The embodiment of the present invention can also be applied to the drawing process of simulation ink and wash, which determines the ink It, can be according to the shape of each stroke in picture when the drawing order of the drawing order of each trunk stroke and each details stroke The visual informations such as shape, color, and according to identified drawing order, animation effect displaying successively is carried out to each stroke, with Simulate the drawing process of the ink and wash.The drawing process of simulation can also be recorded as video by the image processing apparatus, other use Family can carry out a variety of applications such as research or teaching of ink and wash by watching the video.
Method provided in an embodiment of the present invention, in multiple strokes of known ink and wash, by obtaining each master in image The endpoint of dry brush constructs the topological structure of ink and wash, according to each edge line segment in the topological structure, determines each trunk The drawing order of stroke in the images provides a kind of method of stroke drawing order for obtaining ink and wash, can be according to The ink and wash of rendered completion is automatically derived the drawing order of stroke.
Fig. 5 is a kind of image processing apparatus structural schematic diagram provided in an embodiment of the present invention, and referring to Fig. 5, which includes:
Image collection module 501 includes multiple strokes of picture for obtaining image to be analyzed, in the image;
Stroke classification module 502, for obtaining multiple trunk strokes from multiple stroke;
Angle point obtains module 503, for obtaining multiple angle points of the trunk stroke for each trunk stroke;
Endpoint determining module 504, for determining the trunk stroke according to the relative positional relationship between multiple angle point Endpoint;
Topological structure constructs module 505 and constructs the topological structure of the picture for the endpoint according to each trunk stroke, It include the corresponding edge line segment of each trunk stroke in the topological structure;
Weight calculation module 506 calculates each edge line segment for the position according to each edge line segment in the images Weight;
Drawing order determining module 507, for according to edge each in topological structure line segment position and weight, determine The drawing order of each trunk stroke in the images.
Device provided in an embodiment of the present invention, in multiple strokes of known picture, by obtaining each trunk in image The endpoint of stroke constructs the topological structure of picture, according to each edge line segment in the topological structure, determines each trunk stroke Drawing order in the images provides a kind of method of stroke drawing order for obtaining picture, can be according to rendered The picture of completion is automatically derived the drawing order of stroke.
Optionally, which is also used to the stroke area according to stroke each in multiple stroke, to this Multiple strokes are clustered, and multiple trunk strokes are obtained.
Optionally, which obtains module 503 and is used to use morphological gradient, carries out operation to the trunk stroke, Obtain multiple angle points of the trunk stroke.
Optionally, which includes:
Metrics calculation unit, it is every in multiple angle point for calculating according to the relative positional relationship between multiple angle point The distance between two angle points;
Endpoint selection unit, for using maximum two angle points of distance in multiple angle point as the end of the trunk stroke Point.
Optionally, topological structure building module 505 includes:
Endpoint connection unit, for two endpoints of the trunk stroke being connected, edge is obtained for each trunk stroke Line segment;
Topological structure construction unit, for obtaining the topology of the picture according to the corresponding edge line segment of each trunk stroke Structure.
Optionally, which includes:
Stroke information acquiring unit, for obtaining trunk stroke corresponding to the edge line segment for each edge line segment Stroke length, stroke area and stroke;
Position significance computing unit, for calculating the edge line segment according to the position of edge line segment in the images Position significance;
Weight calculation unit is used for according to the stroke length, the stroke area, the position significance and the stroke, Calculate the weight of the edge line segment.
Optionally, which is used for according to the position of edge line segment in the images, using with Lower formula calculates the position significance of the edge line segment:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, DiIndicate that the position of the edge line segment is significant Degree, Pi(xi,yi) indicate the midpoint coordinates of the edge line segment, O (x0,y0) indicate the centre coordinate of the image.
Optionally, which is used to obtain stroke length maximum value, the stroke area of multiple trunk stroke Maximum value, position significance maximum value and stroke maximum value;According to the stroke length of the trunk stroke, stroke area, position Significance and stroke are set, and the stroke length maximum value, stroke area maximum value, the position significance maximum value that get The weight of the edge line segment is calculated using following formula with stroke maximum value:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, WiIndicate the weight of the edge line segment, LiIt indicates The stroke length of the trunk stroke, LmaxIndicate the stroke length maximum value, SiIndicate the stroke area of the trunk stroke, SmaxTable Show the stroke area maximum value, DiIndicate the position significance of the trunk stroke, DmaxIndicate the position significance maximum value, TiTable Show the stroke of the trunk stroke, TmaxIndicate the stroke maximum value, α1Indicate the characteristic parameter of stroke length, α2It indicates The characteristic parameter of stroke area, α3Indicate the characteristic parameter of position significance, α4Indicate the characteristic parameter of stroke.
Optionally, the drawing order determining module 507 be used for using the maximum edge line segment of weight in the topological structure as First edge line segment;According to the position of edge each in topological structure line segment, acquisition is with first edge line segment Multiple edge line segments of point;The maximum edge line segment of weight is as second edge line in the multiple edge line segments that will acquire Section;Based on second edge line segment, continuation obtains next edge line segment from the topological structure, until determining each edge The sequence of line segment;According to the sequence of each edge line segment, the drawing order of each trunk stroke in the images is determined.
Optionally, which is also used to the stroke area according to stroke each in multiple stroke, to this Multiple strokes are clustered, and multiple details strokes are obtained.
Optionally, the device further include:
Details stroke obtains module, for obtaining more in the preset range of the trunk stroke for each trunk stroke A details stroke;
Details stroke sorting module, in accordance with the order from top to bottom, being ranked up, obtaining to multiple details stroke The drawing order of multiple details stroke.
Optionally, which is ink and wash.
All the above alternatives can form alternative embodiment of the invention using any combination, herein no longer It repeats one by one.
It should be understood that image processing apparatus provided by the above embodiment is when handling image, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of equipment is divided into different functional modules, to complete all or part of function described above Energy.In addition, image processing apparatus provided by the above embodiment and image processing method embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (20)

1. a kind of image processing method, which is characterized in that the described method includes:
Obtain image to be analyzed, include multiple strokes of picture in described image, in the multiple stroke there are stroke length, Stroke area or the different stroke of stroke;
From the multiple stroke, multiple trunk strokes are obtained;
For each trunk stroke, multiple angle points of the trunk stroke are obtained;
According to the relative positional relationship between the multiple angle point, the endpoint of the trunk stroke is determined;
According to the endpoint of each trunk stroke, the topological structure of the picture is constructed, includes each trunk in the topological structure The corresponding edge line segment of stroke;
According to position of each edge line segment in described image, the weight of each edge line segment is calculated;
According to the position of edge each in topological structure line segment and weight, determine each trunk stroke in described image Drawing order.
2. obtaining multiple trunk pens the method according to claim 1, wherein described from the multiple stroke Picture includes:
According to the stroke area of stroke each in the multiple stroke, the multiple stroke is clustered, obtains multiple trunks Stroke.
3. obtaining the trunk pen the method according to claim 1, wherein described for each trunk stroke Draw multiple angle points include:
Using morphological gradient, operation is carried out to the trunk stroke, obtains multiple angle points of the trunk stroke.
4. the method according to claim 1, wherein the relative position according between the multiple angle point is closed System, determines that the endpoint of the trunk stroke includes:
According to the relative positional relationship between the multiple angle point, calculate in the multiple angle point between every two angle point away from From;
Using maximum two angle points of distance in the multiple angle point as the endpoint of the trunk stroke.
5. the method according to claim 1, wherein the endpoint according to each trunk stroke, described in building The topological structure of picture includes:
For each trunk stroke, two endpoints of the trunk stroke are connected, edge line segment is obtained;
According to the corresponding edge line segment of each trunk stroke, the topological structure of the picture is obtained.
6. the method according to claim 1, wherein the position according to each edge line segment in described image It sets, the weight for calculating each edge line segment includes:
For each edge line segment, stroke length, stroke area and the stroke of trunk stroke corresponding to the edge line segment are obtained Concentration;
According to position of the edge line segment in described image, the position significance of the edge line segment is calculated;
According to the stroke length, the stroke area, the position significance and the stroke, the edge line is calculated The weight of section.
7. according to the method described in claim 6, it is characterized in that, the position according to the edge line segment in described image It sets, the position significance for calculating the edge line segment includes:
According to position of the edge line segment in described image, using following formula, the position for calculating the edge line segment is aobvious Work degree:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, DiIndicate the position significance of the edge line segment, Pi(xi,yi) indicate the midpoint coordinates of the edge line segment, O (x0,y0) indicate described image centre coordinate.
8. according to the method described in claim 6, it is characterized in that, described according to the stroke length, the stroke area, institute Rheme sets significance and the stroke, and the weight for calculating the edge line segment includes:
Obtain stroke length maximum value, stroke area maximum value, position significance maximum value and the pen of the multiple trunk stroke Draw concentration maxima;
According to the stroke length of the trunk stroke, stroke area, position significance and stroke, and the stroke got Length maximum value, stroke area maximum value, position significance maximum value and stroke maximum value are calculated using following formula The weight of the edge line segment:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, WiIndicate the weight of the edge line segment, LiIt indicates The stroke length of the trunk stroke, LmaxIndicate the stroke length maximum value, SiIndicate the stroke face of the trunk stroke Product, SmaxIndicate the stroke area maximum value, DiIndicate the position significance of the trunk stroke, DmaxIndicate that the position is aobvious Work degree maximum value,Indicate the stroke of the trunk stroke,Indicate the stroke maximum value, α1Indicate stroke The characteristic parameter of length, α2Indicate the characteristic parameter of stroke area, α3Indicate the characteristic parameter of position significance, α4Indicate stroke The characteristic parameter of concentration.
9. the method according to claim 1, wherein described according to edge each in topological structure line segment Position and weight determine that drawing order of each trunk stroke in described image includes:
Using the maximum edge line segment of weight in the topological structure as first edge line segment;
According to the position of edge each in topological structure line segment, obtain using first edge line segment as the multiple of starting point Edge line segment;
The maximum edge line segment of weight is as second edge line segment in the multiple edge line segments that will acquire;
Based on second edge line segment, continuation obtains next edge line segment from the topological structure, until determining every The sequence of a edge line segment;
According to the sequence of each edge line segment, drawing order of each trunk stroke in described image is determined.
10. the method according to claim 1, wherein the method also includes:
According to the stroke area of stroke each in the multiple stroke, the multiple stroke is clustered, obtains multiple details Stroke.
11. according to the method described in claim 10, it is characterized in that, the pen according to stroke each in the multiple stroke Picture product, clusters the multiple stroke, after obtaining multiple details strokes, the method also includes:
For each trunk stroke, multiple details strokes in the preset range of the trunk stroke are obtained;
In accordance with the order from top to bottom, the multiple details stroke is ranked up, obtains the drafting of the multiple details stroke Sequentially.
12. -11 described in any item methods according to claim 1, which is characterized in that the picture is ink and wash.
13. a kind of image processing apparatus, which is characterized in that described device includes:
Image collection module includes multiple strokes of picture, the multiple pen for obtaining image to be analyzed, in described image There are stroke length, stroke area or the different strokes of stroke in picture;
Stroke classification module, for obtaining multiple trunk strokes from the multiple stroke;
Angle point obtains module, for obtaining multiple angle points of the trunk stroke for each trunk stroke;
Endpoint determining module, for determining the end of the trunk stroke according to the relative positional relationship between the multiple angle point Point;
Topological structure constructs module and constructs the topological structure of the picture for the endpoint according to each trunk stroke, described to open up Flutterring includes the corresponding edge line segment of each trunk stroke in structure;
Weight calculation module calculates the power of each edge line segment for the position according to each edge line segment in described image Weight;
Drawing order determining module, for according to edge each in topological structure line segment position and weight, determine each Drawing order of the trunk stroke in described image.
14. device according to claim 13, which is characterized in that the stroke classification module is also used to according to the multiple The stroke area of each stroke in stroke, clusters the multiple stroke, obtains multiple trunk strokes.
15. device according to claim 13, which is characterized in that the endpoint determining module includes:
Metrics calculation unit, it is every in the multiple angle point for calculating according to the relative positional relationship between the multiple angle point The distance between two angle points;
Endpoint selection unit, for using maximum two angle points of distance in the multiple angle point as the end of the trunk stroke Point.
16. device according to claim 13, which is characterized in that the topological structure constructs module and includes:
Endpoint connection unit, for two endpoints of the trunk stroke being connected, edge line is obtained for each trunk stroke Section;
Topological structure construction unit, for obtaining the topology knot of the picture according to the corresponding edge line segment of each trunk stroke Structure.
17. device according to claim 13, which is characterized in that the weight calculation module includes:
Stroke information acquiring unit, for obtaining the pen of trunk stroke corresponding to the edge line segment for each edge line segment Draw length, stroke area and stroke;
Position significance computing unit calculates the edge line for the position according to the edge line segment in described image The position significance of section;
Weight calculation unit, for dense according to the stroke length, the stroke area, the position significance and the stroke Degree, calculates the weight of the edge line segment.
18. device according to claim 17, which is characterized in that the position significance computing unit is used for according to Position of the edge line segment in described image calculates the position significance of the edge line segment using following formula:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, DiIndicate the position significance of the edge line segment, Pi(xi,yi) indicate the midpoint coordinates of the edge line segment, O (x0,y0) indicate described image centre coordinate.
19. device according to claim 17, which is characterized in that the weight calculation unit is for obtaining the multiple master Stroke length maximum value, stroke area maximum value, position significance maximum value and the stroke maximum value of dry brush;According to institute Stroke length, stroke area, position significance and the stroke of trunk stroke are stated, and the stroke length got is maximum Value, stroke area maximum value, position significance maximum value and stroke maximum value calculate the edge using following formula The weight of line segment:
Wherein, i indicates the serial number of the corresponding trunk stroke of the edge line segment, WiIndicate the weight of the edge line segment, LiIt indicates The stroke length of the trunk stroke, LmaxIndicate the stroke length maximum value, SiIndicate the stroke face of the trunk stroke Product, SmaxIndicate the stroke area maximum value, DiIndicate the position significance of the trunk stroke, DmaxIndicate that the position is aobvious Work degree maximum value,Indicate the stroke of the trunk stroke,Indicate the stroke maximum value, α1Indicate stroke The characteristic parameter of length, α2Indicate the characteristic parameter of stroke area, α3Indicate the characteristic parameter of position significance, α4Indicate stroke The characteristic parameter of concentration.
20. device according to claim 13, which is characterized in that the drawing order determining module is used for the topology The maximum edge line segment of weight is as first edge line segment in structure;According to the position of edge each in topological structure line segment It sets, obtains using first edge line segment as multiple edge line segments of starting point;Weight in the multiple edge line segments that will acquire Maximum edge line segment is as second edge line segment;Based on second edge line segment, continue from the topological structure Next edge line segment is obtained, until determining the sequence of each edge line segment;According to the sequence of each edge line segment, determine each Drawing order of the trunk stroke in described image.
CN201410505493.4A 2014-09-26 2014-09-26 Image processing method and device Active CN105447901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410505493.4A CN105447901B (en) 2014-09-26 2014-09-26 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410505493.4A CN105447901B (en) 2014-09-26 2014-09-26 Image processing method and device

Publications (2)

Publication Number Publication Date
CN105447901A CN105447901A (en) 2016-03-30
CN105447901B true CN105447901B (en) 2019-08-27

Family

ID=55558032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410505493.4A Active CN105447901B (en) 2014-09-26 2014-09-26 Image processing method and device

Country Status (1)

Country Link
CN (1) CN105447901B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107705346A (en) * 2017-11-07 2018-02-16 中国石油大学(华东) A kind of hand-drawing image sequential adding method based on stroke length and spatial information
CN108038890A (en) * 2017-12-06 2018-05-15 广州视源电子科技股份有限公司 Polar plot demenstration method, device, equipment and computer-readable storage medium
CN109118505B (en) * 2018-08-08 2021-03-30 福建天泉教育科技有限公司 Font track calculation method and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7340689B2 (en) * 1999-12-08 2008-03-04 International Business Machines Corporation Method, system and program product for automatically modifying a display view during presentation of a web page
CN102496177A (en) * 2011-12-05 2012-06-13 中国科学院自动化研究所 Method for producing three-dimensional water-and-ink animation
CN103136515A (en) * 2013-02-06 2013-06-05 浙江大学 Creative inflection point identification method based on draft action sequence and system using the same
CN103455816A (en) * 2012-05-28 2013-12-18 阿里巴巴集团控股有限公司 Stroke width extraction method and device and character recognition method and system
US9715356B2 (en) * 2012-11-30 2017-07-25 Canon Kabushiki Kaisha Method, apparatus and system for determining a merged intermediate representation of a page

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7340689B2 (en) * 1999-12-08 2008-03-04 International Business Machines Corporation Method, system and program product for automatically modifying a display view during presentation of a web page
CN102496177A (en) * 2011-12-05 2012-06-13 中国科学院自动化研究所 Method for producing three-dimensional water-and-ink animation
CN103455816A (en) * 2012-05-28 2013-12-18 阿里巴巴集团控股有限公司 Stroke width extraction method and device and character recognition method and system
US9715356B2 (en) * 2012-11-30 2017-07-25 Canon Kabushiki Kaisha Method, apparatus and system for determining a merged intermediate representation of a page
CN103136515A (en) * 2013-02-06 2013-06-05 浙江大学 Creative inflection point identification method based on draft action sequence and system using the same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Animated Construction of Line Drawings》;Hongbo Fu等;《ACM Transactions on Graphics》;20111231;第1-10页 *
《细节增强的水墨扩散模拟》;马燕;《计算机辅助设计与图形学学报》;20140331;第429-435页 *

Also Published As

Publication number Publication date
CN105447901A (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN105512627B (en) A kind of localization method and terminal of key point
WO2022213612A1 (en) Non-contact three-dimensional human body size measurement method
JP7266106B2 (en) Image coordinate system transformation method and its device, equipment and computer program
CN106384126B (en) Clothes fashion recognition methods based on contour curvature characteristic point and support vector machines
CN104484643B (en) The intelligent identification Method and system of a kind of handwriting table
CN106127108B (en) A kind of manpower image region detection method based on convolutional neural networks
CN104200240B (en) A kind of Sketch Searching method based on content-adaptive Hash coding
CN110188835A (en) Data based on production confrontation network model enhance pedestrian's recognition methods again
CN105069751B (en) A kind of interpolation method of depth image missing data
CN109213884A (en) A kind of cross-module state search method based on Sketch Searching threedimensional model
CN110032954A (en) A kind of reinforcing bar intelligent recognition and method of counting and system
CN107766861A (en) The recognition methods of character image clothing color, device and electronic equipment
CN110110650A (en) Face identification method in pedestrian
CN105893925A (en) Human hand detection method based on complexion and device
CN103413145B (en) Intra-articular irrigation method based on depth image
CN110232379A (en) A kind of vehicle attitude detection method and system
CN108921203A (en) A kind of detection and recognition methods of pointer-type water meter
CN110544233B (en) Depth image quality evaluation method based on face recognition application
CN111598175B (en) Detector training optimization method based on online difficult case mining mode
CN108961330A (en) The long measuring method of pig body and system based on image
CN104376334B (en) A kind of pedestrian comparison method of multi-scale feature fusion
CN105447901B (en) Image processing method and device
CN109766873A (en) A kind of pedestrian mixing deformable convolution recognition methods again
CN109670517A (en) Object detection method, device, electronic equipment and target detection model
CN107016697A (en) A kind of height measurement method and device

Legal Events

Date Code Title Description
C06 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