Disclosure of Invention
A first aspect of an embodiment of the present invention provides an animation generation method, where the method includes:
s10: loading picture materials;
s20: identifying the picture material;
s30: matching the animation materials based on the recognition result of the picture materials;
s40: and generating the animation according to the recognition result of the picture material and the matched animation material.
Preferably, the method for identifying the picture material comprises the following steps:
s201: extracting image characteristic elements in the picture material;
s202: and extracting attribute parameters of the image feature elements.
Preferably, the method of matching animation material based on the recognition result of the picture material includes:
s301: classifying the picture materials based on the matching of the recognition results of the picture materials;
s302: matching the corresponding animation material labels based on the types of the picture materials;
s303: the animation material is matched based on the type of the picture material and the corresponding animation material label.
Preferably, the method of generating an animation according to the recognition result of the picture material and the matched animation material includes:
s401: converting the picture material into a moving picture according to the moving picture material matched with the picture material;
s402: and restoring the attribute of the picture material.
A second aspect of an embodiment of the present invention provides an animation generation apparatus, including:
the loading module is used for loading the picture material;
the identification module is used for identifying the picture material;
the matching module is used for matching the animation materials based on the recognition result of the picture materials;
and the generating module is used for generating the animation according to the identification result of the picture material and the matched animation material.
Preferably, the identification module comprises:
the first extraction unit is used for extracting image characteristic elements in the picture material;
and a second extraction unit which extracts the attribute parameters of the image feature elements.
Preferably, the matching module comprises:
the classification unit is used for classifying the picture materials based on the matching of the recognition results of the picture materials;
the first matching unit is used for matching the corresponding animation material label based on the type of the picture material;
and the second matching unit is used for matching the animation materials based on the types of the picture materials and the corresponding animation material labels.
Preferably, the generating module comprises:
a conversion unit for converting the picture material into the moving picture according to the matching moving picture material
And the restoring unit is used for restoring the attribute of the picture material.
A third aspect of embodiments of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the computer program is executed in the processor and can implement any one of the above methods.
A third aspect of embodiments of the present invention provides a storage medium storing a computer program, the computer program being executable in a processor to implement any one of the methods described above.
The invention has the advantages and positive effects that: the invention provides an animation generation method, which converts a picture into an animation scene page. The method and the device are based on an image recognition technology, the recognized elements are extracted, the image characteristics and parameters of the elements are obtained, the material types are managed through understanding of recognition results, and intelligently matched animation materials are recommended; and combining characteristic parameters (point location, size, rotation angle, hierarchy and the like) in each element of the original picture, intelligently restoring and forming default animation effects recommended by different material types, and finally achieving the effect of rotating the picture scene. The animation production efficiency is improved, and the vividness and the interestingness of the product are enhanced through the endowed dynamic effect.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that in the description of the present invention, unless otherwise explicitly specified or limited, the term "storage medium" may be various media that can store a computer program, such as ROM, RAM, a magnetic or optical disk, or the like. The term "processor" may be a chip or a circuit having a data Processing function, such as a CPLD (Complex Programmable Logic Device), an FPGA (Field-Programmable Gate Array), an MCU (micro Controller Unit), a PLC (Programmable Logic Controller), and a CPU (Central Processing Unit). The term "electronic device" may be any device having data processing and storage functions and may generally include fixed and mobile terminals. Fixed terminals such as desktop computers and the like. Mobile terminals such as mobile phones, PADs, and mobile robots, etc. Furthermore, the technical features mentioned in the different embodiments of the invention described later can be combined with each other as long as they do not conflict with each other.
Fig. 1 shows a flowchart of an animation generation method according to an embodiment of the present invention, and as shown in fig. 1, the animation generation method includes the following steps.
S10: and loading the picture material.
In this step, the picture material is uploaded by the user in a customized manner, for example.
S20: and identifying the picture material.
Fig. 2 shows a flowchart of a method for identifying picture material according to an embodiment of the present invention, and as shown in fig. 2, the step includes:
s201: and extracting image characteristic elements in the picture materials.
In this step, for example, a picture material is identified based on an image identification technology, and image feature elements in the picture material are, for example, a background, a person, a prop, characters, and the like.
S202: and extracting attribute parameters of the image feature elements.
In this step, for example, based on an image recognition technique, the image feature elements recognized in step S201 are further recognized, and attribute parameters thereof are acquired. The attribute parameters include, for example, point location, size, rotation angle, layer level, material type, and the like of the image feature elements, where the material type includes, for example, distinguishing background, people, props, characters, and the like.
S30: and matching the animation materials based on the recognition result of the picture materials.
Fig. 3 shows a flowchart of a method for matching animation material based on the recognition result of picture material according to an embodiment of the present invention, as shown in fig. 3, the method includes:
s301: and classifying the picture materials based on the matching of the recognition results of the picture materials.
In this step, the picture materials are summarized into different material types based on the recognition result of the picture materials, wherein the material types include, for example, background materials, character materials, prop materials and character materials. The picture material with the characteristic element in the picture as the background is, for example, a background material, the picture material with the characteristic element in the picture as a character is, for example, a human material, the picture material with the characteristic element in the picture as a prop is, for example, a prop material, and the picture material with the characteristic element in the picture as a character is, for example, a character material.
In a specific embodiment, for example, the image feature elements extracted in step S20 and the attribute parameters of the image feature elements are as follows: the identified picture material has an element A, and the attribute parameters of the element A comprise point positions: x, v; size: 10 px; rotation angle: vertical horizontal line 90 degrees; layer level: the picture is placed on the topmost layer; material types are as follows: a character. The type of the picture material is character material.
S302: and matching the corresponding animation material labels based on the types of the picture materials.
In the embodiment of the invention, the animation material library is preset, and a large number of animation materials are contained in the animation material library.
In the embodiment of the invention, a large number of animation materials in an animation material library are classified in advance, wherein the large number of animation materials are classified into background animation materials, character animation materials, prop animation materials, character animation materials and the like, for example, each type of animation materials comprises a plurality of labels, for example, the character animation materials comprise different label classifications of business characters, animal characters, professional characters, famous characters and the like, and the background materials comprise different label classifications of festivals, 3D, hand-drawing, real shooting and the like. Each label includes a plurality of animation material thereunder.
In this step, corresponding animation material tags are matched in a large number of animation resources through an AI map recognition technique. In one specific embodiment, for example, the a element in the picture material described above matches to a tag under the character animation material: a business figure.
S303: the animation material is matched based on the type of the picture material and the corresponding animation material label.
In this step, for example, for a picture material of the type "character material", it is recommended to match the corresponding lottiee animated character by recognizing the body movement, facial expression, skin color, and clothing of its character element. For picture materials of the type "prop materials", specific animation materials are matched by identifying prop elements (e.g., objects) thereof.
In a specific embodiment, the a elements in the above-mentioned picture materials, such as the final matching animation materials, are lottiee animation character materials of "foreign speaker _ walk" under the commercial character label.
S40: and generating the animation according to the recognition result of the picture material and the matched animation material.
Fig. 4 shows a flowchart of a method for generating an animation according to the recognition result of picture material and matched animation material, as shown in fig. 4, the method includes:
s401: and converting the picture material into the animation according to the matching animation material.
In the step, for example, for the character materials matched with the corresponding lottie animation character, the dynamisation of the character is realized by the effect of skeleton animation; for picture materials with the type of prop materials, recommending and matching svg materials according to object identification so as to highlight the high-definition characteristics of vectors and the effect of hand-drawn animation; and converting the picture materials with the types of the character materials into text materials to realize text styles and text animations.
S402: and restoring the attribute of the picture material.
Based on the attribute parameters in step S20, such as point location, size, rotation angle, level, and the like, the default animation of recommended character actions, characters, and property materials is combined, restored, and an animation scene page is generated intelligently, so that the capability of converting pictures into animation is realized.
In a specific embodiment, the original picture material has an element a, and the attribute parameters of the element a are: point location: x, v; size: 10 px; rotation angle: vertical horizontal line 90 degrees; layer level: and when the matched animation material B is closest to the element of the original image material A, the attribute parameters of the element A are given to the animation material B by default.
Fig. 5 is a schematic structural diagram of an animation generation apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes:
the loading module is used for loading the picture material;
the identification module is used for identifying the picture material;
the matching module is used for matching the animation materials based on the recognition result of the picture materials;
and the generating module is used for generating the animation according to the identification result of the picture material and the matched animation material.
Further, the identification module includes:
the first extraction unit is used for extracting image characteristic elements in the picture material;
and a second extraction unit which extracts the attribute parameters of the image feature elements.
Further, the matching module comprises:
the classification unit is used for classifying the picture materials based on the matching of the recognition results of the picture materials;
the first matching unit is used for matching the corresponding animation material label based on the type of the picture material;
and the second matching unit is used for matching the animation materials based on the types of the picture materials and the corresponding animation material labels.
Further, the generating module includes:
a conversion unit for converting the picture material into the moving picture according to the matching moving picture material
And the restoring unit is used for restoring the attribute of the picture material.
An embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the computer program is executed in the processor, where the method may be implemented by any one of the methods.
An embodiment of the present invention further provides a storage medium storing a computer program, where the computer program is executed in a processor, and can implement any one of the methods described above.
It should be noted that any of the methods provided in the above embodiments are within the scope of the present invention, and any use or storage of these methods is prohibited without permission.
The embodiments of the present invention have been described in detail, but the description is only for the preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. All equivalent changes and modifications made within the scope of the present invention should be covered by the present patent.