CN108257079A - Graphic change method and device - Google Patents
Graphic change method and device Download PDFInfo
- Publication number
- CN108257079A CN108257079A CN201611250163.0A CN201611250163A CN108257079A CN 108257079 A CN108257079 A CN 108257079A CN 201611250163 A CN201611250163 A CN 201611250163A CN 108257079 A CN108257079 A CN 108257079A
- Authority
- CN
- China
- Prior art keywords
- path node
- graph
- location information
- path
- compensating parameter
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 230000008859 change Effects 0.000 title claims abstract description 23
- 230000009466 transformation Effects 0.000 claims abstract description 45
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 31
- 238000004364 calculation method Methods 0.000 claims abstract description 22
- 230000008569 process Effects 0.000 abstract description 17
- 238000010586 diagram Methods 0.000 description 14
- 238000004590 computer program Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 238000003860 storage Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 241000208340 Araliaceae Species 0.000 description 4
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 4
- 235000003140 Panax quinquefolius Nutrition 0.000 description 4
- 235000008434 ginseng Nutrition 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 241001465754 Metazoa Species 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000010422 painting Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/18—Image warping, e.g. rearranging pixels individually
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The present invention provides a kind of graphic change method and devices, realize the graph transformation between any two figure, especially by the path node quantity obtained in the first figure and second graph, and the location information of each path node, and path node compensation calculation is carried out to the figure with less path node quantity, obtain corresponding compensating parameter, so as to utilize the location information and the compensating parameter of the first figure and each path node in second graph, according to default animation algorithms, realize the graph transformation between the first figure and second graph, need not rely on specific graphical authoring tools, process is simple and applied widely.
Description
Technical field
The present invention relates to computer graphics field, more particularly to a kind of graphic change method and device.
Background technology
Vector graphics is made of the straight line and curve of a rule, is using the drawing form based on mathematical way, is used
The figure that vector method is drawn out.Wherein, each object in vector graphics have respective color, profile, size with
And the attributes such as shape.In practical applications, in order to improve graphic plotting efficiency, it will usually using vector plotting software, such as Adobe
Illustrator, i.e. AI tools carry out vector graphics drafting, to meet actual needs.Based on this, when needing, acquisition one is new
Figure when, the prior art be typically new figure is repainted using vector plotting software, existing figure can not be utilized
Transformation obtains required new figure, affects experience when user carries out graphic plotting using vector plotting software.
Invention content
In view of the above problems, overcome the above problem the present invention provides a kind of or at least partly solve the above problems
Graphic change method and device.
The present invention provides a kind of graphic change method, the method includes:
Determine pending the first figure and second graph;
Obtain path node quantity in first figure and the second graph and each path node
Location information;
To having the figure of less path node quantity to carry out path node in first figure and the second graph
Compensation calculation, determines compensating parameter, and the compensating parameter includes the path node quantity that need to be compensated and each institute that need to be compensated
State the location information of path node;
Based on each path node in the compensating parameter and first figure and the second graph
Location information according to default animation algorithms, realizes the graph transformation between first figure and the second graph.
Preferably, after determining pending first figure and second graph, and described first is obtained described
Before the location information of path node quantity in figure and the second graph and each path node, the side
Method further includes:
Judge whether first figure and the second graph are vector graphics, the vector graphics is saved based on path
The figure of point-rendering;
To not be that the figure of vector graphics is converted to arrow in first figure and the second graph based on judging result
Spirogram shape.
Preferably, it is described in first figure and the second graph have less path node quantity figure into
Row path node compensation calculation, determines compensating parameter, including:
Judge whether first figure and the path node quantity in the second graph are equal;
If unequal, the path node quantity in first figure and the path node number in the second graph are obtained
Difference between amount;
Position based on each path node in the difference and first figure and the second graph
Information determines compensating parameter.
Preferably, each road based in the difference and first figure and the second graph
The location information of diameter node, determines compensating parameter, including:
The difference is determined as to the figure in first figure and the second graph with less path node quantity
The quantity of the path node of compensation is needed in shape;
Based on the location information of each path node in first figure and the second graph, determine described
The position relationship between each path node in first figure and the second graph;
Based on each institute having in first figure and the second graph in the figure of more path node quantity
The position relationship between path node is stated, determines that there is less path node quantity in first figure and the second graph
Figure in need compensation each path node location information;
The quantity for the path node that need to be compensated and the location information of each path node that need to be compensated is true
It is set to compensating parameter.
Preferably, it is described based on the figure in first figure and the second graph with more path node quantity
In each path node between position relationship, determine in first figure and the second graph have less road
The location information of each path node of compensation is needed in the figure of diameter number of nodes, including:
When in first figure and the second graph, path node quantity in the figure being transformed is than being transformed into
When the path node quantity of figure is more, by the corresponding location information in any position on the path in the figure being transformed into,
It is determined as the location information of each path node that need to be compensated;
When in first figure and the second graph, path node quantity in the figure being transformed is than being transformed into
When the path node quantity of figure is few, based on having more path node quantity in first figure and the second graph
The position relationship between each path node in figure selectes two paths in the figure being transformed
Node, and determine that the position of a path node that need to be compensated is believed on the extended line of two selected path nodes
Breath, until having determined the location information of each path node that need to be compensated.
Preferably, it is described based on each described in the compensating parameter and first figure and the second graph
The location information of path node according to default animation algorithms, realizes the figure between first figure and the second graph
Transformation, including:
Based on the compensating parameter, there is less path node quantity in first figure and the second graph
In figure, the corresponding position of location information of each path node with that need to compensate is determined, and each described opposite
The corresponding path node that need to be compensated is inserted at the position answered;
Acquisition is currently inserted between the figure path node corresponding with the figure for being not inserted into path node of path node
Change in location information;
Based on the change in location information, according to default animation algorithms, first figure and the second graph are realized
Between graph transformation.
A kind of pattern converter, described device include:
Figure determining module, for determining pending the first figure and second graph;
Path node acquisition module, for obtaining the path node quantity in first figure and the second graph,
And the location information of each path node;
Compensation calculation module, for having less path node quantity in first figure and the second graph
Figure carries out path node compensation calculation, determines compensating parameter, the compensating parameter include the path node quantity that need to be compensated with
And the location information of each path node that need to be compensated;
Graph transformation module, for based on every in the compensating parameter and first figure and the second graph
The location information of a path node according to default animation algorithms, is realized between first figure and the second graph
Graph transformation.
Preferably, described device further includes:
Judgment module, for judging whether first figure and the second graph are vector graphics, the polar plot
Shape is the figure drawn based on path node;
Figure modular converter will not be vector in first figure and the second graph for being based on judging result
The figure of figure is converted to vector graphics.
Preferably, the compensation calculation module includes:
Judging unit, for judging whether first figure and the path node quantity in the second graph are equal;
Difference acquiring unit, for when the judging result of the judging unit is unequal, obtaining first figure
In path node quantity and the second graph in path node quantity between difference;
Compensating parameter determination unit, for being based in the difference and first figure and the second graph
The location information of each path node, determines compensating parameter.
Preferably, the compensating parameter determination unit includes:
Quantity determination subelement is compensated, for the difference to be determined as having in first figure and the second graph
The quantity of the path node of compensation is needed in the figure for having less path node quantity;
Position relationship determination subelement, for based on each path in first figure and the second graph
The location information of node determines that the position between each path node in first figure and the second graph is closed
System;
Location information determination subelement is compensated, for being based on having compared with multichannel in first figure and the second graph
The position relationship between each path node in the figure of diameter number of nodes, determines first figure and described second
The location information of each path node of compensation is needed in figure in figure with less path node quantity;
Compensating parameter determination subelement, for each institute that will be needed the quantity of the path node of compensation and need to compensate
The location information for stating path node is determined as compensating parameter.
Preferably, the graph transformation module includes:
Path node is inserted into unit, for being based on the compensating parameter, in first figure and the second graph
With in less path node quantity figure, the corresponding position of location information of each path node with that need to compensate is determined
It puts, and the corresponding path node that need to be compensated is inserted at each corresponding position;
Change in location information obtainment unit, for obtaining the figure for being currently inserted into path node with being not inserted into path node
Change in location information in figure between corresponding path node;
Graph transformation unit for being based on the change in location information, according to default animation algorithms, realizes first figure
Graph transformation between shape and the second graph.
By above-mentioned technical proposal, the present invention provides a kind of graphic change method and devices, realize any two figure
Graph transformation between shape, specifically, by obtaining path node quantity and each road in the first figure and second graph
The location information of diameter node, and path node compensation calculation is carried out to the figure with less path node quantity, it obtains corresponding
Compensating parameter, path node quantity and the location information of each path node that need to compensate if you need to compensation, so as to utilize
The location information and the compensating parameter of each path node in first figure and second graph, according to default animation algorithms,
Realize the graph transformation between the first figure and second graph, need not rely on specific graphical authoring tools, process it is simple and
It is applied widely.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, below the special specific embodiment for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this field
Technical staff will become clear.Attached drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of flow chart of graphic change method embodiment provided by the invention;
Fig. 2 shows the flow charts of another graphic change method embodiment provided by the invention;
Fig. 3 (a)~Fig. 3 (d) shows a kind of graph transformation process schematic provided by the invention;
Fig. 4 shows a kind of structure diagram of pattern converter embodiment provided by the invention;
Fig. 5 shows the structure diagram of another pattern converter embodiment provided by the invention;
Fig. 6 shows the part-structure block diagram of another pattern converter embodiment provided by the invention;
Fig. 7 shows the part-structure block diagram of another pattern converter embodiment provided by the invention;
Fig. 8 shows the part-structure block diagram of another pattern converter embodiment provided by the invention;
Fig. 9 shows a kind of hardware architecture diagram of pattern converter provided by the invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
As shown in Figure 1, for a kind of flow chart of graphic change method embodiment provided by the invention, this method can wrap
It includes:
Step S11 determines pending the first figure and second graph;
The application can realize the transformation between any two figure, and thus, above-mentioned first figure and second graph can
To be random regular pattern or irregular figure, such as simple rectangular, round, triangle or as various animals, personage,
The complex figures such as landscape or building.The application is not construed as limiting the particular content of the first figure and second graph.
It should be noted that the first figure and second graph are two different figures.
Step S12 obtains the first figure and the path node quantity in second graph and the position of each path node
Information;
It should be noted that the concrete mode that the application uses the quantity for calculating the path node of figure is not construed as limiting,
The calculating of SVG (Scalable Vector Graphics, scalable vector graphics) animation algorithms may be used, naturally it is also possible to be
Other animation algorithms calculate, and the application will not enumerate herein.
Wherein, path node can be the path orientation point of vector graphics, in practical applications, the path of each figure
It is usually made of multiple path nodes, according to different needs, determining that the unit of a path node can be different.
In addition, in this application, after determining position reference point (such as coordinate origin), it may be determined that each path section in image
The location information relative to the position reference point is put, that is, determines the position of each path node in the first figure and second graph
Information, such as determine the position coordinates of each path node.
In practical applications, the location information of each path node in above-mentioned figure can be input by user, this Shen
Please the mode of the location information to determining path node is not construed as limiting, and is closed by the position between the location information of each path node
System can represent the concrete shape of the first figure and second graph.
Step S13, to having the figure of less path node quantity to carry out path node in the first figure and second graph
Compensation calculation determines compensating parameter;
Since the path node that the present invention carries out two figures of graph transformation must be identical, so, by the first figure
Path node quantity and the path node quantity of second graph are compared, and determine the path node quantity and second of the first figure
After the path node quantity difference of figure, path node can be carried out to the figure with less path node using backoff algorithm
Compensation, so as to make the path node of the uncompensated figure of the figure after compensation and another identical.
It is not construed as limiting it should be noted that the application carries out figure the backoff algorithm that path node compensation uses.It is optional
, the application can realize the path node compensation calculation to the figure with less path node by using interpolation algorithm,
Following article embodiment description content, but it is not limited to a kind of this realization method.Based on above-mentioned analysis, present invention gained compensation ginseng
Number can include the path node quantity that need to be compensated and the location information of each path node that need to be compensated.Specifically, pass through
Aforesaid way can determine to need to be inserted into the quantity of path node into the figure with less path node and in the figure
Where each path node of insertion, so as to subsequently according to the insertion operation of these information realization path nodes.
It can be seen that above-mentioned determining compensation is with reference to transformation when can be converted as the first figure and second graph
Parameter.Content listed above is not limited to, especially in the graph transformation between carrying out complex figure, can also be included
The variation tendency information in path, such as path radian information, this can be determined according to actual needs, and the application is herein no longer one by one
It enumerates.
Step S14, based on the location information of each path node in compensating parameter and the first figure and second graph,
According to default animation algorithms, the graph transformation between the first figure and second graph is realized.
In the present embodiment practical application, since each electronic equipment usually all has the function of animation process, that is, it is built-in with phase
The animation algorithms answered, so, the present invention can realize graph transformation scheme of the present invention by arbitrary interface on an electronic device;Certainly,
Graph transformation scheme provided by the invention can also be applied on various graphical authoring tools, have very strong applicability.
Wherein, above-mentioned default animation algorithms can be SVG animation algorithms or other animation algorithms, and the application is to its specific calculation
Method content is not construed as limiting.
Optionally, the present embodiment can be by the result of calculation of the first figure and the path node of second graph, and write-in is in advance
If in the path paths of animation algorithms, and animate labels and corresponding attribute are added, meanwhile, compensating parameter can be based on
And first figure and each path node in second graph location information, determine the first graph transformation for second graph
Animation moving parameter, such as path node change in location information later, can pass through the animation mark of the default animation algorithms of update
Label, animation attributes and animation moving parameter, and perform updated default animation algorithms, so as to by the first graph transformation into the
Two figures.
Wherein, animate is the animated element in SVG animation algorithms, represents that the attribute and category of standard can be changed in real time
The value of property value;Path paths can represent that SVG allows the path attribute of SVG to come for an animateMotion element assignment
One path attribute, animateMotion are also animated element in SVG animation algorithms, represent to move along an animation path
Dynamic element.
It can be seen that during by the first graph transformation for second graph, the path of second graph can will be utilized
The information such as label, attribute that nodal information determines, target animation element, objective attribute target attribute as animation transformation are pre- so as to perform
If the animation technique of painting, the transformation between two figures is realized, the present invention is to being provided between two figures of same paths node
Conversion process is not described further.
As shown in Fig. 2, the flow chart for another graphic change method embodiment provided by the invention, this method can wrap
It includes:
Step S21 determines pending the first figure and second graph;
Step S22 judges whether the first figure and second graph are vector graphics;
It should be noted that the vector graphics of the application refers to the vector graphics drawn based on path node.
Step S23 will not be that the figure of vector graphics is converted to arrow in the first figure and second graph based on judging result
Spirogram shape;
Can will not be that the figure in path paths is converted in the first figure and second graph specifically, in the present embodiment
For path paths, the specific implementation process that the present invention is converted to image in path paths is not construed as limiting.
Step S24 obtains the first figure and the path node quantity in second graph and the position of each path node
Information;
Step S25, judges whether the path node quantity of the first figure is more than the path node quantity of second graph, if
It is no, enter step S26;If so, perform step S27;
Step S26 compensates calculating to the path node of the first figure, determines the first compensation ginseng for the first figure
Number;
With reference to above-described embodiment as described in compensating parameter description it is found that first compensating parameter can include the first figure need
The path node quantity of compensation and the location information of each path node that need to compensate etc..
Step S27 compensates calculating to the path node of second graph, determines the second compensation ginseng for second graph
Number;
Similarly, which can include the second graph path node quantity that need to be compensated and need to compensate
Location information of each path node etc..
It should be noted that close the compensation calculation process of the path node of figure is referred in this present embodiment it is above-mentioned
The description of embodiment corresponding part, details are not described herein for the present embodiment.
For example, when the first figure is rectangular, second graph is triangle, it is clear that rectangular path node is more than three
Angular path node, if at this point, rectangular each vertex is once named as a1, a2, a3 and a4, corresponding triangle only has
A1, a2 and a3, triangle, can determine a little as a4 on the free routing of triangle, that is to say, that rectangular in order to obtain
A1, a2 and a3 between line on determine any point as a4, in this way, by it is rectangular be transformed to triangle during,
It can be converted using the connected a4 between determining a1, a2, a3 and its any two node as reference, to obtain three
It is angular.It should be noted that three path nodes that triangle is selected from four rectangular path nodes are not construed as limiting, Ke Yishi
A1, a2 and a3;A1, a2 and a4;A2, a3 and a4 etc..
As it can be seen that in this embodiment, identified compensation reference can include the number of path node that triangle need to be inserted into
Amount and its location information etc..
Certainly, still by it is above-mentioned it is rectangular be transformed to triangle for illustrate, in addition to using aforesaid way determine compensation ginseng
Number is outer, and the application, according to the concrete shape of figure, can determine to need to mend after the coordinate position of each path node of figure is determined
Which two path node coordinate the path node repaid should be inserted between, and re-establishes each path node after triangle is inserted into
With it is rectangular in path node between correspondence.
It is in contrast with the previous embodiment, i.e., when needing triangularity turning to rectangular, reference Fig. 3 (d), according to the above analysis
Mode, can based on rectangular graphics shape (it can be determined based on the position relationship between each path node in rectangular)
To select two path nodes in the triangles, and in the extended line (void in such as Fig. 3 (d) of the two selected path nodes
Line) on, the location information of a path node that need to be compensated is determined, such as the point a4 in Fig. 3 (d).
Wherein, during determining compensating parameter in the manner described above, when the specific figure shape of the first figure and second graph
Shape and comprising path node number differences difference when, determine need to compensate path node the mode of location information be adapted to
Property adjustment, especially need on the extended line of two path nodes determine need to compensate the location information of path node when, it is each
It usually only can determine whether the location information of the path node of a need compensation on a path node extended line, so, in this case,
Can determine multiple path node extended lines, so that it is determined that corresponding multiple location informations that need to compensate path node, process with
Determination process shown in above-mentioned Fig. 3 (d) is similar, and this will not be detailed here for the present embodiment.
Step S28, location information and the first compensation based on each path node in the first figure and second graph
First graph transformation is second graph according to default animation algorithms by parameter or the second compensating parameter.
It is still illustrated so that above-mentioned first figure is rectangular and second graph is triangle as an example, with reference to Fig. 3 (a)~Fig. 3
(c) the graph transformation process shown in shows the rectangular conversion process to triangle.Wherein, it is from left to right marked successively in the figure
Know the first figure, second graph and graph transformation process.
By Fig. 3 (a)~Fig. 3 (c) Suo Shi, by it is rectangular be transformed to triangle during, can be by rectangular integral-rotation, with it
In three path nodes for vertex of a triangle, gradually by the 4th rectangular path node and its two, place side into line position
Movement is put, finally obtains required triangle.
By Fig. 3 (d) Suo Shi, by triangularity be changed to it is rectangular during, determine the path that need to be compensated in the manner described above
It, can be in this, as reference, according to rectangular graphics shape, by the path between a2 and a3 on path after the location information of node
Node is moved to the path node of compensation, such as the graph transformation process in Fig. 3 (d) from left to right, finally obtains the rectangular of needs.
To sum up, when acquisition is needed to be different from another figure of existing figure, the above-mentioned graph transformation of the application may be used
Method, by existing graph transformation be required figure, do not need to remake new figure again, saved memory space, and
The graph transformation process needs not rely on special pattern edit tool, and it is convenient and flexible to facilitate.
It is a kind of structure diagram of pattern converter embodiment provided by the invention with reference to Fig. 4, which can wrap
It includes:
Figure determining module 41, for determining pending the first figure and second graph;
Optionally, as shown in figure 5, the device can also include:
Judgment module 45, for judging whether first figure and the second graph are vector graphics;
Figure modular converter 46 will not be arrow in first figure and the second graph for being based on judging result
The figure of spirogram shape is converted to vector graphics.
In practical applications, it after the first figure and second graph that determine to need to convert all are vector graphics, can just touch
Hair subsequent path node computing module 42 calculates the path node quantity of each figure.
Path node acquisition module 42, for obtaining the path node number in first figure and the second graph
The location information of amount and each path node;
Such as the description of above-mentioned embodiment of the method corresponding part, the present invention is to calculating the path node quantity of figure and obtaining
The detailed process for obtaining the location information of each path node is not construed as limiting.
Compensation calculation module 43, for having less path node quantity in first figure and the second graph
Figure carry out path node compensation calculation, determine compensating parameter;
In the present embodiment, identified compensating parameter can include the path node quantity that need to be compensated and need to compensate every
Location information of a path node etc., the application do not limit the particular content that compensating parameter includes.
In the present embodiment, as shown in fig. 6, compensation calculation device 43 can include:
Judging unit 431, for judge first figure and the path node quantity in the second graph whether phase
Deng;
Difference acquiring unit 432, for when the judging result of judging unit is unequal, obtaining in first figure
Path node quantity and the second graph in path node quantity between difference;
Compensating parameter determination unit 433, for based on each described in the difference and the first figure and second graph
The location information of path node, determines compensating parameter.
Graph transformation module 44, for based in the compensating parameter and first figure and the second graph
The location information of each path node, according to default animation algorithms, realize first figure and the second graph it
Between graph transformation.
Optionally, as shown in fig. 7, compensating parameter determination unit 433 can include in above-described embodiment:
Quantity determination subelement 4331 is compensated, for the difference to be determined as first figure and the second graph
In have less path node quantity figure in need compensation path node quantity;
Position relationship determination subelement 4332, for based on each described in first figure and the second graph
The location information of path node determines the position between each path node in first figure and the second graph
Put relationship;
Compensate location information determination subelement 4333, for be based on having in first figure and the second graph compared with
The position relationship between each path node in the figure of multipath number of nodes determines first figure and described
The location information of each path node of compensation is needed in second graph in figure with less path node quantity;
In the present embodiment practical application, when in first figure and the second graph, in the figure being transformed
Path node quantity than the figure being transformed into path node quantity more than when, by the path in the figure being transformed into appoint
The corresponding location information in meaning position, is determined as the location information of each path node that need to be compensated;When first figure
In the second graph, the path node quantity of figure of the path node quantity than being transformed into the figure being transformed is few
When, based on each path having in first figure and the second graph in the figure of more path node quantity
Position relationship between node selectes two path nodes, and at selected two in the figure being transformed
The location information of a path node that need to be compensated is determined on the extended line of the path node, until having determined to need to compensate
Each path node location information.Subelement 4334, for will need compensation the path node quantity and
The location information of each path node that need to be compensated is determined as compensating parameter
Optionally, on the basis of above-described embodiment, as shown in figure 8, above-mentioned graph transformation module 44 can include:
Path node is inserted into unit 441, for being based on the compensating parameter, in first figure and the second graph
In have in less path node quantity figure, determine corresponding with the location information of each path node that need to compensate
Position, and the corresponding path node that need to be compensated is inserted at each corresponding position;
Change in location information obtainment unit 442 saves for obtaining to be currently inserted into the figure of path node and be not inserted into path
Change in location information in the figure of point between corresponding path node;
Graph transformation unit 443 for being based on the change in location information, according to default animation algorithms, realizes described the
Graph transformation between one figure and the second graph.
With reference to Fig. 9, the present invention also provides the hardware architecture diagram for realizing above-mentioned pattern converter, which can be with
Including:Processor 91 and memory 92, above-mentioned each function module from the device embodiment of function structure description can be made
It is stored in memory 92 for program unit, each program unit being stored in the memory 92 is performed by processor 91, so as to
Realize corresponding function.
It should be noted that the hardware configuration for the pattern converter, it is not limited to above-mentioned processor 91 and deposit
Reservoir 92 can also include realizing communication interface, communication bus of above-mentioned function etc..
Wherein, above-mentioned processor 91 can include kernel, be gone in memory 92 to transfer corresponding program unit by kernel.It is interior
Core can set one or more, realize that the animation between any two figure converts by adjusting kernel parameter, specific real
Existing process is referred to the description of above method embodiment corresponding part, and details are not described herein for the present embodiment.
Memory 92 can include the volatile memory in computer-readable medium, random access memory (RAM)
And/or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one
Storage chip.
In conclusion in this embodiment, by the path node quantity in the first figure of acquisition and second graph and often
The location information of a path node, and path node compensation calculation is carried out to the figure with less path node quantity, it obtains
Corresponding compensating parameter, so as to utilize location information and the compensation of the first figure and each path node in second graph
Parameter according to default animation algorithms, realizes the figure between the first figure and second graph (i.e. any two different figure)
Transformation, needs not rely on specific graphical authoring tools, process is simple and applied widely.
The present invention also provides a kind of computer program products, when carrying out graph transformation, can perform following method step
Rapid program code:
Determine pending the first figure and second graph;
Obtain the position of the path node quantity and each path node in first figure and the second graph
Information;
To having the figure of less path node quantity to carry out path node in first figure and the second graph
Compensation calculation determines compensating parameter, which can include the path node data that need to be compensated and need to compensate each
The location information of path node;
Based on the location information of each path node in the compensating parameter and the first figure and second graph, according to
Default animation algorithms, realize the graph transformation between first figure and the second graph.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the application
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the application
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is with reference to the flow according to the method for the embodiment of the present application, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, CD-ROM read-only memory (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, available for storing the information that can be accessed by a computing device.It defines, calculates according to herein
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It these are only embodiments herein, be not limited to the application.To those skilled in the art,
The application can have various modifications and variations.All any modifications made within spirit herein and principle, equivalent replacement,
Improve etc., it should be included within the scope of claims hereof.
Claims (10)
1. a kind of graphic change method, which is characterized in that the method includes:
Determine pending the first figure and second graph;
Obtain the position of the path node quantity and each path node in first figure and the second graph
Information;
To having the figure of less path node quantity to carry out path node compensation in first figure and the second graph
It calculates, determines compensating parameter, the compensating parameter includes the path node quantity that need to be compensated and each road that need to be compensated
The location information of diameter node;
Position based on each path node in the compensating parameter and first figure and the second graph
Information according to default animation algorithms, realizes the graph transformation between first figure and the second graph.
2. according to the method described in claim 1, it is characterized in that, determine pending the first figure and second graph described
Later, and the path node quantity in the acquisition first figure and the second graph and each path
Before the location information of node, the method further includes:
Judge whether first figure and the second graph are vector graphics, and the vector graphics is painted based on path node
The figure of system;
To not be that the figure of vector graphics is converted to polar plot in first figure and the second graph based on judging result
Shape.
It is 3. according to the method described in claim 1, it is characterized in that, described to having in first figure and the second graph
The figure for having less path node quantity carries out path node compensation calculation, determines compensating parameter, including:
Judge whether first figure and the path node quantity in the second graph are equal;
If unequal, between the path node quantity in path node quantity and the second graph in acquisition first figure
Difference;
Position letter based on each path node in the difference and first figure and the second graph
Breath, determines compensating parameter.
4. according to the method described in claim 3, it is characterized in that, it is described based on the difference and first figure and
The location information of each path node in the second graph, determines compensating parameter, including:
The difference is determined as in first figure and the second graph in the figure with less path node quantity
The quantity for the path node that need to be compensated;
Based on the location information of each path node in first figure and the second graph, described first is determined
The position relationship between each path node in figure and the second graph;
Based on each road having in first figure and the second graph in the figure of more path node quantity
Position relationship between diameter node determines there is the figure of less path node quantity in first figure and the second graph
The location information of each path node of compensation is needed in shape;
The quantity for the path node that need to be compensated and the location information of each path node that need to be compensated are determined as
Compensating parameter.
It is 5. according to the method described in claim 4, it is characterized in that, described based in first figure and the second graph
The position relationship between each path node in figure with more path node quantity, determines first figure
With the position letter of each path node that compensation is needed in the figure with less path node quantity in the second graph
Breath, including:
When in first figure and the second graph, path node quantity in the figure being transformed is than the figure that is transformed into
Path node quantity it is more when, the corresponding location information in any position on the path in the figure being transformed into determines
For the location information of each path node that need to be compensated;
When in first figure and the second graph, path node quantity in the figure being transformed is than the figure that is transformed into
Path node quantity it is few when, based on the figure in first figure and the second graph with more path node quantity
In each path node between position relationship, in the figure being transformed select two path nodes,
And the location information of a path node that need to be compensated is determined on the extended line of two selected path nodes, directly
Extremely the location information of each path node that need to be compensated is determined.
6. according to claim 1-5 any one of them methods, which is characterized in that described based on the compensating parameter and described
The location information of each path node in first figure and the second graph according to default animation algorithms, realizes institute
The graph transformation between the first figure and the second graph is stated, including:
Based on the compensating parameter, there is the figure of less path node quantity in first figure and the second graph
In, determine the corresponding position of location information of each path node with that need to compensate, and each described corresponding
The corresponding path node that need to be compensated is inserted at position;
Obtain the position being currently inserted between the figure path node corresponding with the figure for being not inserted into path node of path node
Change information;
Based on the change in location information, according to default animation algorithms, realize between first figure and the second graph
Graph transformation.
7. a kind of pattern converter, which is characterized in that described device includes:
Figure determining module, for determining pending the first figure and second graph;
Path node acquisition module, for obtain path node quantity in first figure and the second graph and
The location information of each path node;
Compensation calculation module, for having the figure of less path node quantity in first figure and the second graph
Path node compensation calculation is carried out, determines compensating parameter, the compensating parameter includes the path node quantity that need to be compensated and needs
The location information of each path node of compensation;
Graph transformation module, for based on each institute in the compensating parameter and first figure and the second graph
The location information of path node is stated, according to default animation algorithms, realizes the figure between first figure and the second graph
Fractal transform.
8. device according to claim 7, which is characterized in that described device further includes:
Judgment module, for judging whether first figure and the second graph are vector graphics, and the vector graphics is
The figure drawn based on path node;
Figure modular converter will not be vector graphics in first figure and the second graph for being based on judging result
Figure be converted to vector graphics.
9. device according to claim 7, which is characterized in that the compensation calculation module includes:
Judging unit, for judging whether first figure and the path node quantity in the second graph are equal;
Difference acquiring unit, for when the judging result of the judging unit is unequal, obtaining in first figure
The difference between path node quantity in path node quantity and the second graph;
Compensating parameter determination unit, it is each in the difference and first figure and the second graph for being based on
The location information of the path node, determines compensating parameter.
10. device according to claim 9, which is characterized in that the compensating parameter determination unit includes:
Compensate quantity determination subelement, for by the difference be determined as in first figure and the second graph have compared with
The quantity of the path node of compensation is needed in the figure of few path node quantity;
Position relationship determination subelement, for based on each path node in first figure and the second graph
Location information, determine the position relationship between each path node in first figure and the second graph;
Location information determination subelement is compensated, for being based on having compared with multipath section in first figure and the second graph
The position relationship between each path node in the figure of point quantity, determines first figure and the second graph
In have less path node quantity figure in need compensation each path node location information;
Compensating parameter determination subelement, for each road that will be needed the quantity of the path node of compensation and need to compensate
The location information of diameter node is determined as compensating parameter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611250163.0A CN108257079B (en) | 2016-12-29 | 2016-12-29 | Method and device for graphics conversion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611250163.0A CN108257079B (en) | 2016-12-29 | 2016-12-29 | Method and device for graphics conversion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108257079A true CN108257079A (en) | 2018-07-06 |
CN108257079B CN108257079B (en) | 2021-07-27 |
Family
ID=62722007
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611250163.0A Active CN108257079B (en) | 2016-12-29 | 2016-12-29 | Method and device for graphics conversion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108257079B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11605190B1 (en) | 2021-09-01 | 2023-03-14 | Toyota Research Institute, Inc. | System and method for de-biasing graphical information |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1330836A (en) * | 1998-12-15 | 2002-01-09 | 松下电器产业株式会社 | Method and apparatus for image processing |
CN101785684A (en) * | 2010-01-27 | 2010-07-28 | 天津大学 | Ultrasonic endoscopic synthetic aperture imaging system and synthetic method of larger aperture |
JP2011223340A (en) * | 2010-04-09 | 2011-11-04 | Ntt Docomo Inc | Moving image encoding device, moving image decoding device, moving image encoding method, moving image decoding method, moving image encoding program, and moving image decoding program |
US8064688B2 (en) * | 2004-10-22 | 2011-11-22 | Carnegie Mellon University | Object recognizer and detector for two-dimensional images using Bayesian network based classifier |
CN102411786A (en) * | 2010-09-29 | 2012-04-11 | 微软公司 | Low complexity method for motion compensation of dwt based systems |
KR20120111477A (en) * | 2011-03-31 | 2012-10-10 | 이엔유 주식회사 | Translating method from xml dcs drawing data to object oriented simulation data |
CN102736557A (en) * | 2011-04-07 | 2012-10-17 | 杨建国 | Numerical control machine tool error real-time compensation system based on virtual instrument |
CN104484803A (en) * | 2014-11-24 | 2015-04-01 | 苏州福丰科技有限公司 | Mobile phone payment method employing three-dimensional human face recognition based on neural network |
CN104811637A (en) * | 2014-01-24 | 2015-07-29 | 株式会社理光 | Projection system, image processing apparatus, and correction method |
CN104917931A (en) * | 2015-05-28 | 2015-09-16 | 京东方科技集团股份有限公司 | Moving image compensation method and device and display device |
CN105119250A (en) * | 2015-07-22 | 2015-12-02 | 国电南瑞科技股份有限公司 | Relay protection remote dynamic display method based on data integration |
CN106251304A (en) * | 2015-09-11 | 2016-12-21 | 深圳市理邦精密仪器股份有限公司 | Dynamic image segmented system and method |
CN107850777A (en) * | 2015-04-22 | 2018-03-27 | 易赛特股份有限公司 | The method and apparatus of optical aberrations correction |
-
2016
- 2016-12-29 CN CN201611250163.0A patent/CN108257079B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1330836A (en) * | 1998-12-15 | 2002-01-09 | 松下电器产业株式会社 | Method and apparatus for image processing |
US8064688B2 (en) * | 2004-10-22 | 2011-11-22 | Carnegie Mellon University | Object recognizer and detector for two-dimensional images using Bayesian network based classifier |
CN101785684A (en) * | 2010-01-27 | 2010-07-28 | 天津大学 | Ultrasonic endoscopic synthetic aperture imaging system and synthetic method of larger aperture |
JP2011223340A (en) * | 2010-04-09 | 2011-11-04 | Ntt Docomo Inc | Moving image encoding device, moving image decoding device, moving image encoding method, moving image decoding method, moving image encoding program, and moving image decoding program |
CN102411786A (en) * | 2010-09-29 | 2012-04-11 | 微软公司 | Low complexity method for motion compensation of dwt based systems |
KR20120111477A (en) * | 2011-03-31 | 2012-10-10 | 이엔유 주식회사 | Translating method from xml dcs drawing data to object oriented simulation data |
CN102736557A (en) * | 2011-04-07 | 2012-10-17 | 杨建国 | Numerical control machine tool error real-time compensation system based on virtual instrument |
CN104811637A (en) * | 2014-01-24 | 2015-07-29 | 株式会社理光 | Projection system, image processing apparatus, and correction method |
CN104484803A (en) * | 2014-11-24 | 2015-04-01 | 苏州福丰科技有限公司 | Mobile phone payment method employing three-dimensional human face recognition based on neural network |
CN107850777A (en) * | 2015-04-22 | 2018-03-27 | 易赛特股份有限公司 | The method and apparatus of optical aberrations correction |
CN104917931A (en) * | 2015-05-28 | 2015-09-16 | 京东方科技集团股份有限公司 | Moving image compensation method and device and display device |
CN105119250A (en) * | 2015-07-22 | 2015-12-02 | 国电南瑞科技股份有限公司 | Relay protection remote dynamic display method based on data integration |
CN106251304A (en) * | 2015-09-11 | 2016-12-21 | 深圳市理邦精密仪器股份有限公司 | Dynamic image segmented system and method |
Non-Patent Citations (1)
Title |
---|
丁健生: "基于GDI+的矢量图形几何变换原理研究", 《科技天地》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11605190B1 (en) | 2021-09-01 | 2023-03-14 | Toyota Research Institute, Inc. | System and method for de-biasing graphical information |
Also Published As
Publication number | Publication date |
---|---|
CN108257079B (en) | 2021-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR20200031163A (en) | Neural network structure creation method and device, electronic device, storage medium | |
JP5108019B2 (en) | Projection apparatus and projection method for projecting a two-dimensional motif onto a complex surface of a three-dimensional object | |
CN101986344A (en) | Graphics processing systems | |
CN104391991B (en) | A kind of conversion method from AutoCAD data to GIS spatial data | |
CN109711486A (en) | Based on the relevant high degree of overlapping remote sensing image full scale tie point matching process of phase | |
US20170235870A1 (en) | Method for generating and using a two-dimensional drawing having three-dimensional orientation information | |
CN109118593A (en) | A kind of system and method creating threedimensional model editable configuration | |
CN113610968A (en) | Target detection model updating method and device | |
CN108257079A (en) | Graphic change method and device | |
US10893252B2 (en) | Image processing apparatus and 2D image generation program | |
JP6623681B2 (en) | Magnetic material simulation apparatus, micromagnetization calculation method and program | |
Mesgarani et al. | Application of SPD-RBF method of lines for solving nonlinear advection–diffusion–reaction equation with variable coefficients | |
Biermann et al. | Direct free-form deformation of NC programs for surface reconstruction and form-error compensation | |
CN109242877A (en) | Image partition method and device | |
Iglesias et al. | Hybridizing mesh adaptive search algorithm and artificial immune systems for discrete rational Bézier curve approximation | |
CN104134207B (en) | Automatic detection method for complete enveloping of surface model in geometric modeling | |
US20130063425A1 (en) | Visualization apparatus and method | |
EP3924792A1 (en) | Method and apparatus for managing robot program | |
CN109582776A (en) | Model generation method and device, electronic device and storage medium | |
Sacharow et al. | Iterative, simulation-based shape modification by free-form deformation of the NC programs | |
Monsegny et al. | Fast marching method in seismic ray tracing on parallel GPU devices | |
CN111144064B (en) | Character deformation method, medium, equipment and device | |
CN110309561A (en) | Goods space volume measuring method and device | |
US11132836B2 (en) | Method for determining real world measurements from an apparel 3D model | |
Yousif et al. | Video Frames Selection Method for 3D Reconstruction Depending on ROS-Based Monocular SLAM |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 100080 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |