Image processing method, device, equipment and computer readable storage medium
By identifying the object of the video shooting interface and obtaining its state amount, determining the animation effect based on the time length, and adding transition animation effect to the second object, solving the problem of monotonous image transformation effect in the prior art, and realizing dynamic changes and rich image transformation methods.
Patent Information
- Application Number
- CN202210527655.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-05-16
AI Technical Summary
In the prior art, the image transformation effect is too monotonous to be used for guidance and description, and cannot be dynamically changed according to the user's wishes.
By identifying the first object and the second object in the video shooting interface, the current state amount of the first object is obtained, and the target animation effect is determined based on the current state amount and the time length, and the transition animation effect of the target animation effect is added to the second object in the video shooting interface.
It realizes the generation of animation effects for the second object according to the state changes of the first object, thereby increasing storytelling and interestingness, enriching the image transformation method, and being able to be used for guidance and explanation.
Smart Images

Figure CN114972586B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device, equipment and computer-readable storage medium. Background Art
[0002] In the application field of face or human figure transformation, the existing related technologies mainly import the source image or video into the editing software according to the user's existing wishes, and then generate the target image or video through the editing software output. For example, the beauty effect, after importing the image into the video editing software, the various organs of the face are beautified and modified, and finally a new image with a better look and feel than the source image is generated.
[0003] The image transformation effect achieved by existing artificial intelligence (AI) and AI detection technology is too monotonous, similar to generating a rendering by performing image processing with one click, and cannot be used for guiding instructions. Summary of the invention
[0004] Embodiments of the present invention provide an image processing method, apparatus, device and computer-readable storage medium to solve the problem that the existing image transformation effect is too monotonous, similar to generating an effect diagram by performing image processing with one key, and cannot be used for guiding instructions.
[0005] In a first aspect, an embodiment of the present invention provides an image processing method, including:
[0006] Identify a first object and a second object in a video shooting interface;
[0007] Obtaining the current state of the first object;
[0008] Determine the target animation effect according to the current state quantity and the timing duration;
[0009] In the video shooting interface, a transition animation effect changing toward the target animation effect is added to the second object.
[0010] Optionally, determining a target animation effect according to the current state quantity and the timing duration includes:
[0011] Determine, according to the current state quantity and the timing duration, a first time length required for a maximum state change quantity to occur;
[0012] The target animation effect is determined according to the first time length and the time length threshold.
[0013] Optionally, determining the target animation effect according to the first time length and the time length threshold includes:
[0014] If the first time length is less than or equal to a first time length threshold, taking the first animation effect as the target animation effect;
[0015] If the first time length is greater than or equal to a second time length threshold, taking the second animation effect as the target animation effect;
[0016] The second duration threshold is greater than the first duration threshold.
[0017] Optionally, in the video shooting interface, adding a transition animation effect to the second object that changes to the target animation effect includes:
[0018] When the first time length is less than or equal to a first time length threshold, determining a first transition animation according to the current state quantity;
[0019] In the video shooting interface, adding the first transition animation to the second object;
[0020] Among them, the first animation effect includes a total of N feature images, the first transition animation includes at least one of the N feature images, and the number of feature images included in the first transition animation and / or the display size of the feature images are positively correlated with the current state change; the current state change is the difference between the current state quantity and the initial state quantity of the first object at the beginning of the timing; N is a positive integer.
[0021] Optionally, after adding the first transition animation to the second object in the video shooting interface, the method further includes:
[0022] When the timing duration is greater than the first duration threshold and less than the second duration threshold, determining a second transition animation according to the timing duration;
[0023] In the video shooting interface, updating the first transition animation to the second transition animation;
[0024] Among them, the first animation effect includes a total of N feature images, the second transition animation includes at least one of the N feature images, and the number of feature images included in the second transition animation and / or the display size of the feature images are negatively correlated with the timing duration; N is a positive integer.
[0025] Optionally, in the video shooting interface, adding a transition animation effect to the second object that changes to the target animation effect includes:
[0026] When the first time length is greater than or equal to the second time length threshold, determining a third transition animation according to the timing time length;
[0027] In the video shooting interface, adding the third transition animation to the second object;
[0028] Among them, the second animation effect includes M feature images, the third transition animation includes at least one of the M feature images, and the number of feature images included in the third transition animation and / or the display size of the feature images are positively correlated with the timing duration; M is a positive integer.
[0029] Optionally, determining, according to the current state quantity and the timing duration, a first time length required for a maximum state change to occur includes:
[0030] Determine the current state change amount according to the current state amount and the initial state amount of the first object at the beginning of timing;
[0031] A first time length required for a maximum state change to occur is determined according to the current state change amount and the timing duration.
[0032] In a second aspect, an embodiment of the present invention further provides an image processing device, including:
[0033] An identification module, used to identify a first object and a second object in a video shooting interface;
[0034] An acquisition module, used to acquire the current state quantity of the first object;
[0035] A determination module, used to determine a target animation effect according to the current state quantity and the timing duration;
[0036] A generation module is used to add a transition animation effect to the second object in the video shooting interface, which changes to the target animation effect.
[0037] In a third aspect, an embodiment of the present invention further provides an image processing device, comprising: a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps in the image processing method described above.
[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the image processing method as described above are implemented.
[0039] In an embodiment of the present invention, by identifying the first object and the second object in the video shooting interface; and obtaining the current state quantity of the first object; further determining the target animation effect according to the current state quantity and the timing duration; and adding a transition animation effect to the target animation effect for the second object in the video shooting interface. Therefore, using the solution of the embodiment of the present invention, the target animation effect can be generated for the second object based on the current state of the first object, so that the state change of the first object can be guided by the animated image of the second object, while increasing the story and interest, and enriching the image transformation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0041] Figure 1 is a flow chart of an image processing method provided by an embodiment of the present invention;
[0042] Figure 2 is one of the schematic diagrams of the video shooting interface provided by the embodiment of the present invention;
[0043] Figure 3 This is a second schematic diagram of a video shooting interface provided by an embodiment of the present invention;
[0044] Figure 4 This is a third schematic diagram of a video shooting interface provided by an embodiment of the present invention;
[0045] Figure 5 This is a fourth schematic diagram of a video shooting interface provided by an embodiment of the present invention;
[0046] Figure 6 This is a fifth schematic diagram of a video shooting interface provided by an embodiment of the present invention;
[0047] Figure 7 This is a sixth schematic diagram of a video shooting interface provided by an embodiment of the present invention;
[0048] Figure 8 FIG. 7 is a seventh schematic diagram of a video shooting interface provided by an embodiment of the present invention;
[0049] Fig. 9 is a structural diagram of an image processing device provided by an embodiment of the present invention;
[0050] Fig.10 It is a schematic diagram of the hardware structure of the image processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] See also Figure 1 , Figure 1 is a flow chart of an image processing method provided by an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0053] Step 101: Identify a first object and a second object in a video shooting interface.
[0054] In this step, an image captured by a camera is displayed on a video shooting interface of the electronic device. The first object in the image may be a person or an object, and the second object may be a person or an object.
[0055] As an implementation manner, a user presents the first object and the second object in front of a camera, so that the camera can recognize and acquire the first object and the second object.
[0056] For example, when a user shows a bowl and a child in front of the camera, the camera recognizes the bowl and the child and takes the bowl as the first object and the child as the second object. When showing the bowl, the user can be guided to perform the display behavior, such as changing different angles and distances from the camera.
[0057] As another implementation method, the image captured by the camera includes a child, a bowl, a spoon, etc., wherein a guide icon is displayed on the video shooting interface to prompt the user to select a first object and a second object; further, based on the user's input, the first object and the second object are determined.
[0058] For example, when the guide sign displayed on the video shooting interface indicates that there are multiple objects, the user indicates to use voice input, text description input, or touch input to select the rice bowl as the first object and the child as the second object.
[0059] Step 102: Obtain the current state of the first object.
[0060] In this step, the current state quantity may be determined based on the image feature of the first object currently displayed on the video shooting interface. The current state quantity may include at least one of the following: the size of the image feature of the first object, the number of the image features of the first object, the position of the image feature of the first object, the color of the image feature of the first object, the shape of the image feature of the first object, etc.
[0061] Exemplarily, when the first object is a rice bowl, the amount of rice in the rice bowl is used as the current state quantity of the first object.
[0062] Exemplarily, when the first object is a writing book, the amount of text on the writing book is used as the current state amount of the first object.
[0063] Exemplarily, when the first object is a toy storage box, the number of toys in the toy storage box is used as the current state quantity of the first object.
[0064] Step 103, determining a target animation effect according to the current state quantity and the timing duration.
[0065] In this step, the state change rate of the first object can be estimated according to the current state quantity and the timing duration; thus, based on the state change rate, the actual duration required to complete the set goal can be obtained; further, the target animation effect can be determined according to the corresponding relationship between the duration and the animation effect.
[0066] The actual time required to complete the set goal can be understood as the time required for the user's initial image features to change to the user's expected image features.
[0067] For example, based on the current amount of rice in the bowl, estimate the child's eating speed; and further estimate the meal time; based on the correspondence between the meal time and the animation effect, add a target animation effect corresponding to the meal time for the child.
[0068] Step 104: In the video shooting interface, a transition animation effect is added to the second object to change to the target animation effect.
[0069] In this step, as an implementation method, the image of the second object and the transition animation effect can be synthesized to obtain an animated image of the second object and displayed in the video shooting interface.
[0070] In the above embodiment, two people can be selected as the first object and the second object respectively, two objects can be selected as the first object and the second object respectively, or one object and a person can be selected as the first object and the second object respectively. Based on the current state quantity of the reference object and the logical change relationship between the two objects, a target animation effect is generated for the other object, so that the state change of the first object can be guided by the animated image of the second object. The plot of the story can be described through coherent and causal image changes, forming a technical display with a storyline, while also enhancing interest and enriching the image transformation method.
[0071] In one embodiment, before step 102, the method further includes:
[0072] Get the user's first input;
[0073] The first animation effect and the second animation effect are determined according to the first input.
[0074] The first input may be voice input, text input or touch selection input.
[0075] Exemplarily, the first input is voice input or text input, and the input content may include: a good effect for the child is a beautiful angel with angel wings, a halo on the head, and an omnipotent magic wand; a bad effect is turning into a Zhu Bajie with big ears and a big nose.
[0076] Exemplarily, when an animation effect selection control is displayed, the first input is a touch input to controls corresponding to the first animation effect and the second animation effect.
[0077] Optionally, in one embodiment, the first animation effect is a positive animation effect expected by the second object, and the second animation effect is a negative animation effect not expected by the second object. In one embodiment, the first animation effect is a positive animation effect that serves as an incentive or positive guidance, and the second animation effect is a negative animation effect that serves as a punishment or urging.
[0078] Optionally, the output effect customized by artificial rules can be changed to a blind box method. For example, instead of turning a person into a beautiful or ugly person, they can turn into an unpredictable product. For example, instead of a fixed pig, they can turn into a tree or a mouse.
[0079] In one embodiment, the above step 103 includes:
[0080] Determine, according to the current state quantity and the timing duration, a first time length required for a maximum state change quantity to occur;
[0081] The target animation effect is determined according to the first time length and the time length threshold.
[0082] In this embodiment, the first time length is an estimated time length. When the maximum state change amount is constant, the first time length can reflect the change rate of the first object, and different change rates correspond to different target animation effects. In this way, the state change of the first object can be guided by the change of the target animation effect.
[0083] In a specific embodiment, determining the first time length required for the maximum state change amount to occur according to the current state amount and the timing duration includes:
[0084] Determine the current state change amount according to the current state amount and the initial state amount of the first object at the beginning of timing;
[0085] A first time length required for a maximum state change to occur is determined according to the current state change amount and the timing duration.
[0086] For example, the first object is a rice bowl, the first object has a maximum capacity attribute MaxBenchmarkAProp, a minimum value MinBenchmarkAProp=0, a current state quantity is mBenchmarkAProp, and initially mBenchmarkAProp=MaxBenchmarkAProp. The first time length is the time consumed when the amount of rice in the rice bowl changes from MaxBenchmarkAProp to 0.
[0087] Then, the first time length is: Among them, △EventProTime is the first time length, and T is the current timing duration.
[0088] In a specific embodiment, determining the target animation effect according to the first time length and the time length threshold includes:
[0089] If the first time length is less than or equal to a first time length threshold, taking the first animation effect as the target animation effect;
[0090] If the first time length is greater than or equal to a second time length threshold, taking the second animation effect as the target animation effect;
[0091] The second duration threshold is greater than the first duration threshold.
[0092] For example, the first animation effect is a beautiful angel, and the second animation effect is Zhu Bajie. The specific animation effect can be selected based on user needs, such as based on the preferences of the second object.
[0093] In this embodiment, the target animation effect can be determined based on the first time length.
[0094] Furthermore, in one embodiment, the step 104 includes:
[0095] When the first time length is less than or equal to a first time length threshold, determining a first transition animation according to the current state quantity; and adding the first transition animation to the second object in the video shooting interface;
[0096] Among them, the first animation effect includes a total of N feature images, the first transition animation includes at least one of the N feature images, and the number of feature images included in the first transition animation and / or the display size of the feature images are positively correlated with the current state change; the current state change is the difference between the current state quantity and the initial state quantity of the first object at the beginning of the timing; N is a positive integer.
[0097] In this embodiment, the number of image features in the first transition animation is at least part of the N image features of the first animation effect, and the size of the image features is less than or equal to the size of the image features in the first animation effect. In this way, it is possible to reflect the intermediate change process from the current effect to the first animation effect, or the current change degree of the first animation effect. Ultimately, with the change of the current state quantity, all image features of the first animation effect are gradually grown with a step length of n1 image features; or part of the image features of the first animation effect are gradually grown with a step length of n2 image features.
[0098] As an implementation method, when the first time length is less than or equal to the third time length threshold, and the third time length threshold is less than the first time length threshold, all image features of the first animation effect are gradually grown with a step size of n1 image features; when the first time length is greater than the third time length threshold and less than or equal to the first time length threshold, some image features of the first animation effect are gradually grown with a step size of n2 image features.
[0099] In one embodiment, in the video shooting interface, after adding the first transition animation to the second object, the method further includes:
[0100] When the timing duration is greater than the first duration threshold and less than the second duration threshold, determining a second transition animation according to the timing duration; and updating the first transition animation to the second transition animation in the video shooting interface;
[0101] Among them, the first animation effect includes a total of N feature images, the second transition animation includes at least one of the N feature images, and the number of feature images included in the second transition animation and / or the display size of the feature images are negatively correlated with the timing duration; N is a positive integer.
[0102] In this embodiment, the second transition animation is used to reflect the intermediate change process from the first transition animation to no animation effect. When the timing duration exceeds the third duration threshold but does not exceed the first duration threshold, the number of image features that have grown is controlled to gradually decrease, and / or the size of the image features is controlled to gradually decrease. In this way, the animation effect of gradually degenerating the grown image features is achieved.
[0103] Furthermore, in one embodiment, the step 104 includes:
[0104] When the first time length is greater than or equal to the second time length threshold, determining a third transition animation according to the timing time length;
[0105] In the video shooting interface, adding the third transition animation to the second object;
[0106] Among them, the second animation effect includes M feature images, the third transition animation includes at least one of the M feature images, and the number of feature images included in the third transition animation and / or the display size of the feature images are positively correlated with the timing duration; M is a positive integer.
[0107] In this embodiment, the number of image features in the third transition animation is at least part of the M image features of the second animation effect, and the size of the image features is less than or equal to the size of the image features in the second animation effect. In this way, it is possible to reflect the intermediate change process from the current effect to the second animation effect, or the current change degree of the second animation effect. Ultimately, as the timing duration increases, all image features of the second animation effect are gradually grown with a step length of m1 image features; or some image features of the second animation effect are gradually grown with a step length of m2 image features.
[0108] The following is combined with Figures 2 to 8 The above step 104 is explained by taking the first animation effect of an angel and the second animation effect of Zhu Bajie as an example.
[0109] Among them, the angel includes the following three feature images: wings k11, crown k12, magic wand k13. Zhu Bajie includes the following two feature images: big ears k21 and big nose k22. For wings, halo, magic wand, Zhu Bajie's nose and mouth, they all have the maximum value attribute MaxBenchmarkBKmn, the current actual effect value is mBenchmarkBProp, and the initial value is 0. It can be understood that the maximum effect value of the angel is: MaxBenchmarkBProp = MaxBk11 + MaxBk12 + MaxBk13; the maximum effect value of Zhu Bajie is: MaxBenchmarkBProp = MaxBk21 + MaxBk22.
[0110] like Figures 2 to 4 As shown, the positive angel animation effect changes in that when you eat a mouthful of rice, it becomes longer, and if you don't eat, it doesn't grow. That is, the number of feature images included in the angel animation effect and / or the display size of the feature images are positively correlated with the current amount of food eaten.
[0111] Specifically, the current remaining meal value x and the current actual usage time timer △EventProTime in the first object are monitored in real time, then (1-x / MaxBenchmarkAProp) is the proportion of the amount of food consumed, and when the first time length is less than or equal to the first time length threshold, as the amount of food consumed increases, the number of angel image features and / or the display size of the image features are gradually displayed.
[0112] In one specific implementation, the initial state of the first object is as follows Figure 2 As shown, when the first time length is less than the third time threshold, and the third time threshold is less than the first time threshold, all image features of the first animation effect (i.e., the first transition animation, such as Figure 4 As shown, it has grown angel wings and a halo, Figure 3 As shown, angel wings, a halo and a magic wand have grown out); if the third time threshold is exceeded but within the first time threshold, part of the image features of the first animation effect are gradually displayed with a step length of n2 image features (i.e., the first transition animation, such as Figure 5 As shown, only the wings gradually grow). When the timing duration exceeds the first time threshold but does not exceed the second time threshold, all the image features that have grown gradually degenerate as the timing duration increases (second transition animation).
[0113] It should be noted that, when the first animation effect has only one image feature, the lengths of n1 and n2 are 1. If there are multiple image features, the lengths of n1 and n2 may be greater than 1.
[0114] For example, the time (first time length) consumed when the amount of rice in the bowl changes from MaxBenchmarkAProp to 0, that is, the actual time when the user finishes eating: △EventProTime<=△T1×D1[0], an angel with wings, wearing a crown and holding a magic wand (such as Figure 4 ). And the properties of wings, halo and magic wand are: mBenchmarkBProp=(MaxBk11+MaxBk12+MaxBk13)×lim x→0 (1-x / MaxBenchmarkAProp); where MaxBk11, MaxBk12, and MaxBk13 are the maximum attribute values (i.e., the maximum display size) of wings, halo, and magic wand, respectively; △T1×D1[0] is the third duration threshold; △T1 is the set total duration; D1[0] is the first weight index; and △EventProTime is the first time length.
[0115] For example, the time (first time length) consumed when the amount of rice in the rice bowl changes from MaxBenchmarkAProp to 0, that is, the actual time the user finishes eating: △EventProTime<=△T1×D1[1], exceeds the critical value of the third time length threshold, the magic wand and the crown have disappeared, and only the angel wings attribute (such as Figure 5 ), and gradually change according to the original attribute change properties. And the wing attribute is: mBenchmarkBProp=(MaxBk11)×lim x→0 (1-x / MaxBenchmarkAProp); where MaxBk11 is the maximum attribute value of the wing (i.e., the maximum display size); △T1×D1[1] is the first duration threshold, △T1 is the set total duration; D1[1] is the second weight index; △EventProTime is the first time length.
[0116] Exemplarily, the time (first time length) consumed when the amount of rice in the bowl changes from MaxBenchmarkAProp to 0, that is, the actual time the user finishes the meal: △EventProTime<=△T1 / 2, and when it exceeds the first time length threshold, the wings disappear, that is, mBenchmarkBProp=0 at this time; among them, △T1 / 2 is the second time length threshold, △T1 is the set total time length, and △EventProTime is the first time length.
[0117] like Figure 7 and 8 As shown, the negative change of Zhu Bajie's animation effect is that whether you eat or not, the longer the time, the worse the effect, that is, the number of feature images included in the Zhu Bajie animation effect and / or the display size of the feature images are positively correlated with the duration.
[0118] In a specific example, the initial state of the first object is as follows: Figure 2 As shown in FIG. 1 , when the first time length is greater than the second time length threshold but not greater than the fourth time length threshold, and the fourth time length threshold is greater than the second time length threshold, as time increases, the partial image features of the second animation effect (such as Figure 7 In the example, no matter whether you eat or not, you will start to grow a pig nose, but not pig ears); when the first time length exceeds the fourth time length threshold and the fourth time length threshold is greater than the second time length threshold, all image features of the second animation effect are gradually displayed with a step length of m2 image features (such as Figure 8 When the fifth duration threshold is exceeded, Zhu Bajie's nose and big ears are always fully displayed.
[0119] It should be noted that, when the second animation effect has only one image feature, the lengths of m1 and m2 are 1; if the second animation effect has multiple image features, the lengths of m1 and m2 may be greater than 1.
[0120] For example, the time (first time length) consumed when the amount of rice in the bowl changes from MaxBenchmarkAProp to 0, that is, the actual time the user finishes the meal: when △EventProTime>△T1×D2[0] and △EventProTime<=△T1×D2[1], Zhu Bajie's nose appears, and the attribute of the second object is: mBenchmarkBProp=(MaxBk21+MaxBk22×0)×(△EventProTime-△T1 / 2) / (△T1×D2[0]-△T1 / 2)).
[0121] For example, the time (first time length) consumed when the amount of rice in the bowl mBenchmarkAProp changes from MaxBenchmarkAProp to 0, that is, the actual time when the user finishes eating: △EventProTime>△T1×D2[0], Zhu Bajie's nose and ears appear, and Zhu Bajie's attributes are:
[0122] mBenchmarkBProp=(MaxBk22)×(△EventProTime-△T1 / 2) / (△T1×D2[0]-△T1 / 2))+MaxBk21. When △EventProTime>=△T1×D2[1], Zhu Bajie's complete nose and ears appear directly.
[0123] Among them, the above △T1×D2[0] is, △T1×D2[1] is, MaxBk21 is the maximum attribute of the nose (maximum display size), MaxBk22 is the maximum attribute of the ear (maximum display size), △T1 is the set total duration, △EventProTime is the first time length; △T1 / 2 is the second duration threshold, △T1×D2[0] is the fourth duration threshold, △T1×D2[1] is the fifth duration threshold, D2[0] is the third weight value, and D2[1] is the fourth weight value.
[0124] It should be noted that the above-mentioned first to fourth weight values can be system preset values. Alternatively, they can be obtained according to voice input. For example, the user sets the total duration to 60 minutes through voice. After eating for the first 10 minutes, the person becomes a complete angel, after eating for 20 minutes, only has angel wings, after eating for 40 minutes, he grows a pig nose, and after eating for 50 minutes, he grows a pig nose and pig ears. Then D1[0]=0.17 (i.e. 10 / 60), D1[1]=0.33 (i.e. 20 / 60), D2[0]=0.67(40 / 60), D2[1]=0.83(50 / 60).
[0125] In one embodiment, before determining the target animation effect according to the first time length and the time length threshold, the method further includes:
[0126] Get the second input entered by the user;
[0127] The first duration threshold and the second duration threshold are determined according to the second input, wherein the second input may be voice input, text input or touch selection input.
[0128] For example, taking the first object as a rice bowl, the input content of the second input may include: the total time of eating, and the transformation critical value of the first animation effect (first time threshold), and the transformation critical value of the second animation effect (second time threshold). For example, if the total time is 60 minutes, eating within 30 minutes will turn you into an angel, and eating more than 50 minutes will turn you into Zhu Bajie.
[0129] Exemplarily, the second input may be an input operation on the touch input interface to set the first duration threshold and the second duration threshold.
[0130] In the above example, the image processing method provided by the present application is illustrated by taking the scene of children eating as an example. In this example, the dynamic changes of interesting AI images are used to detect children eating, and the children's portraits are automatically changed according to the amount and speed of eating. This changing process is not only vivid and interesting, and brings happiness to children, but also guides and solves the problem of children not eating through this process.
[0131] The following is an introduction based on the application scenarios:
[0132] Step a: Install an application with an interesting AI image change detection mechanism on your phone or computer, and input bowls of rice with different capacities that children often use, including empty bowls, into the phone for machine learning. Similarly, input a collection of pictures of children sitting at a reference dining table into the phone for deep learning. After that, the system can determine whether the child is sitting at the dining table and whether he is about to eat by collecting pictures.
[0133] Step b: Fix the phone or computer on the dining table, and capture the composition in the field of view to include the child's bowl and the range of the child's activities. After setting up and fixing the phone or application, turn on the startup system, and you can observe the status of the child and the bowl through the video preview. The AI detection system begins to automatically judge by collecting pictures and analyzing the status of the pictures. It determines that the bowl of rice is full and the child is sitting in front of the bowl. At this time, a picture is automatically collected for deep learning.
[0134] Step c: When the AI detects that the child has raised the spoon or chopsticks to put food into his mouth, the system automatically starts timing and initializes.
[0135] Step d, after completing initialization and automatic startup, the AI detection system continues to monitor the screen. When the rice in the bowl is monitored to be gradually reduced, and the bowl does not move or reverse significantly, the child on the screen begins to grow angel wings, and a crown and a magic wand gradually appear. When the child finishes the rice within 10 minutes, the picture of the child in the mobile phone or computer gradually changes to a beautiful girl with white angel wings, a crown, and a magic wand, just like an angel. When the child finishes the rice within 20 minutes, the picture of the child in the mobile phone or computer gradually changes to a white wing, but the crown and magic wand disappear after more than 10 minutes. When the child finishes the rice within 30 minutes, the picture is judged to be normal, and the original wings disappear after 20 minutes. When the child eats for more than 30 minutes, a pig nose begins to appear on the face of the child in the mobile phone or computer screen. When the child eats for more than 40 minutes, the child in the mobile phone gradually grows Zhu Bajie ears and gradually becomes Zhu Bajie.
[0136] In the above scheme, by using the first object and the second object as the source and target respectively, using AI to detect the quantitative change of one of the objects as the event source of AI change, a mapping change is generated for the other object; using AI to detect changes and combining certain rules to guide the first object to produce the effect of the second object. It can achieve dynamic and continuous changes, which is more vivid and interesting, and provides a better experience. Moreover, through the vivid and interesting positive and negative effects, it can be used as an efficient means of knowledge dissemination and popularization to solve some practical problems in life.
[0137] For example, through vivid and interesting displays, users (such as children) are greatly interested in actively participating in activities, and interesting interactions immerse users (such as children) in them, allowing them to recognize the relationship between two objects through dynamic changes, and even solve some problems that cannot be solved by technology and people. For example, if a child does not like to eat, no matter how the parents coax them or what high-tech products they use, the problem cannot be solved. However, the fun generated by the case changes in the present invention arouses great interest in the child, who thinks eating is a happy thing and then eats actively. Moreover, the generated video is more ornamental and vivid, giving people a better sense of pleasure and experience.
[0138] The embodiment of the present invention also provides an image processing device. Fig. 9 , Fig. 9 1 is a structural diagram of an image processing device provided by an embodiment of the present invention. Since the principle of solving the problem by the image processing device is similar to that of the image processing method in the embodiment of the present invention, the implementation of the video processing device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0139] like Fig. 9 As shown, the image processing device 900 includes:
[0140] Identification module 901, used to identify a first object and a second object in a video shooting interface;
[0141] A first acquisition module 902, used to acquire the current state quantity of the first object;
[0142] A first determination module 903 is used to determine a target animation effect according to the current state quantity and the timing duration;
[0143] The generating module 904 is used to add a transition animation effect to the second object in the video shooting interface, which changes to the target animation effect.
[0144] Optionally, the apparatus 900 further includes:
[0145] A second acquisition module, used to acquire a first input from a user;
[0146] The second determining module is used to determine the first animation effect and the second animation effect according to the first input.
[0147] Optionally, the first determining module 903 includes:
[0148] A first determining submodule, used to determine a first time length required for a maximum state change amount to occur according to the current state amount and the timing duration;
[0149] The second determining submodule is used to determine the target animation effect according to the first time length and the time length threshold.
[0150] Optionally, the second determining submodule includes:
[0151] a first determining unit, configured to use the first animation effect as the target animation effect if the first time length is less than or equal to a first time length threshold;
[0152] a second determining unit, configured to use the second animation effect as the target animation effect if the first time length is greater than or equal to a second time length threshold;
[0153] The second duration threshold is greater than the first duration threshold.
[0154] Optionally, the generating module 904 includes:
[0155] A first generating submodule, configured to determine a first transition animation according to the current state quantity when the first time length is less than or equal to a first time length threshold;
[0156] A second generating submodule, configured to add the first transition animation to the second object in the video shooting interface;
[0157] Among them, the first animation effect includes a total of N feature images, the first transition animation includes at least one of the N feature images, and the number of feature images included in the first transition animation and / or the display size of the feature images are positively correlated with the current state change; the current state change is the difference between the current state quantity and the initial state quantity of the first object at the beginning of the timing; N is a positive integer.
[0158] Optionally, the generating module 904 further includes:
[0159] A third generating submodule, configured to determine a second transition animation according to the timing duration when the timing duration is greater than the first duration threshold and less than the second duration threshold;
[0160] A fourth generating submodule, used for updating the first transition animation to the second transition animation in the video shooting interface;
[0161] Among them, the first animation effect includes a total of N feature images, the second transition animation includes at least one of the N feature images, and the number of feature images included in the second transition animation and / or the display size of the feature images are negatively correlated with the timing duration; N is a positive integer.
[0162] Optionally, the generating module 904 includes:
[0163] A fifth generating submodule, configured to determine a third transition animation according to the timing duration when the first time duration is greater than or equal to a second time duration threshold;
[0164] A sixth generation submodule, configured to add the third transition animation to the second object in the video shooting interface;
[0165] Among them, the second animation effect includes M feature images, the third transition animation includes at least one of the M feature images, and the number of feature images included in the third transition animation and / or the display size of the feature images are positively correlated with the timing duration; M is a positive integer.
[0166] Optionally, the first determining submodule includes:
[0167] A third determining unit, configured to determine a current state change amount according to the current state amount and an initial state amount of the first object at the beginning of timing;
[0168] The fourth determining unit is used to determine a first time length required for a maximum state change to occur according to the current state change amount and the timing duration.
[0169] Optionally, the apparatus 900 further includes:
[0170] A third acquisition module, used to acquire a second input input by a user;
[0171] The third determination module is used to determine the first duration threshold and the second duration threshold according to the second input.
[0172] The device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0173] like Fig.10 As shown, the image processing device of the embodiment of the present invention includes: a transceiver 1030, a memory 1020, a processor 1000, and a computer program stored in the memory 1020 and executable on the processor 1000; wherein the processor 1000 is configured to read the program in the memory 1020 and execute the following process:
[0174] Identify a first object and a second object in a video shooting interface;
[0175] Obtaining the current state of the first object;
[0176] Determine the target animation effect according to the current state quantity and the timing duration;
[0177] In the video shooting interface, a transition animation effect changing toward the target animation effect is added to the second object.
[0178] The transceiver 1010 is configured to receive and send data under the control of the processor 1000 .
[0179] Among them, Fig.10 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 1000 and memory represented by memory 1020. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 1010 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. The processor 1000 is responsible for managing the bus architecture and general processing, and the memory 1020 may store data used by the processor 1000 when performing operations.
[0180] The processor 1000 is responsible for managing the bus architecture and general processing, and the memory 1020 can store data used by the processor 1000 when performing operations.
[0181] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0182] Get the user's first input;
[0183] The first animation effect and the second animation effect are determined according to the first input.
[0184] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0185] Determine, according to the current state quantity and the timing duration, a first time length required for a maximum state change quantity to occur;
[0186] The target animation effect is determined according to the first time length and the time length threshold.
[0187] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0188] If the first time length is less than or equal to a first time length threshold, taking the first animation effect as the target animation effect;
[0189] If the first time length is greater than or equal to a second time length threshold, taking the second animation effect as the target animation effect;
[0190] The second duration threshold is greater than the first duration threshold.
[0191] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0192] When the first time length is less than or equal to a first time length threshold, determining a first transition animation according to the current state quantity;
[0193] In the video shooting interface, adding the first transition animation to the second object;
[0194] Among them, the first animation effect includes a total of N feature images, the first transition animation includes at least one of the N feature images, and the number of feature images included in the first transition animation and / or the display size of the feature images are positively correlated with the current state change; the current state change is the difference between the current state quantity and the initial state quantity of the first object at the beginning of the timing; N is a positive integer.
[0195] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0196] When the timing duration is greater than the first duration threshold and less than the second duration threshold, determining a second transition animation according to the timing duration;
[0197] In the video shooting interface, updating the first transition animation to the second transition animation;
[0198] Among them, the first animation effect includes a total of N feature images, the second transition animation includes at least one of the N feature images, and the number of feature images included in the second transition animation and / or the display size of the feature images are negatively correlated with the timing duration; N is a positive integer.
[0199] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0200] When the first time length is greater than or equal to the second time length threshold, determining a third transition animation according to the timing time length;
[0201] In the video shooting interface, adding the third transition animation to the second object;
[0202] Among them, the second animation effect includes M feature images, the third transition animation includes at least one of the M feature images, and the number of feature images included in the third transition animation and / or the display size of the feature images are positively correlated with the timing duration; M is a positive integer.
[0203] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0204] Determine the current state change amount according to the current state amount and the initial state amount of the first object at the beginning of timing;
[0205] A first time length required for a maximum state change to occur is determined according to the current state change amount and the timing duration.
[0206] Optionally, the processor 1000 is further configured to read the computer program and execute the following steps:
[0207] Get the second input entered by the user;
[0208] The first duration threshold and the second duration threshold are determined according to the second input.
[0209] The device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated in this embodiment.
[0210] In addition, the computer-readable storage medium of the embodiment of the present invention is used to store a computer program, and the computer program can be executed by a processor to implement the steps of the image processing method as described above.
[0211] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0212] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0213] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0214] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An image processing method, characterized in that: include: Identify a first object and a second object in a video shooting interface; Acquire a current state quantity of the first object; wherein the current state quantity includes at least one of the following: the size of the image feature of the first object, the number of the image features of the first object, the position of the image feature of the first object, the color of the image feature of the first object, and the shape of the image feature of the first object; Determine the target animation effect according to the current state quantity and the timing duration; wherein the timing duration is the duration taken by the first object to change from the initial state to the current state quantity; In the video shooting interface, a transition animation effect changing toward the target animation effect is added to the second object.
2. The image processing method according to claim 1, characterized in that: The step of determining a target animation effect according to the current state quantity and the timing duration includes: Determine, according to the current state quantity and the timing duration, a first time length required for a maximum state change quantity to occur; The target animation effect is determined according to the first time length and the time length threshold.
3. The image processing method according to claim 2, characterized in that: The step of determining the target animation effect according to the first time length and the time length threshold comprises: If the first time length is less than or equal to a first time length threshold, taking the first animation effect as the target animation effect; If the first time length is greater than or equal to a second time length threshold, taking the second animation effect as the target animation effect; The second duration threshold is greater than the first duration threshold.
4. The image processing method according to claim 3, characterized in that: In the video shooting interface, adding a transition animation effect to the second object that changes to the target animation effect includes: When the first time length is less than or equal to a first time length threshold, determining a first transition animation according to the current state quantity; In the video shooting interface, adding the first transition animation to the second object; Among them, the first animation effect includes a total of N feature images, the first transition animation includes at least one of the N feature images, and the number of feature images included in the first transition animation and / or the display size of the feature images are positively correlated with the current state change; the current state change is the difference between the current state quantity and the initial state quantity of the first object at the beginning of the timing; N is a positive integer.
5. The image processing method according to claim 4, characterized in that: After adding the first transition animation to the second object in the video shooting interface, the method further includes: When the timing duration is greater than the first duration threshold and less than the second duration threshold, determining a second transition animation according to the timing duration; In the video shooting interface, updating the first transition animation to the second transition animation; Among them, the first animation effect includes a total of N feature images, the second transition animation includes at least one of the N feature images, and the number of feature images included in the second transition animation and / or the display size of the feature images are negatively correlated with the timing duration; N is a positive integer.
6. The image processing method according to claim 3, characterized in that: In the video shooting interface, adding a transition animation effect to the second object that changes to the target animation effect includes: When the first time length is greater than or equal to the second time length threshold, determining a third transition animation according to the timing time length; In the video shooting interface, adding the third transition animation to the second object; Among them, the second animation effect includes M feature images, the third transition animation includes at least one of the M feature images, and the number of feature images included in the third transition animation and / or the display size of the feature images are positively correlated with the timing duration; M is a positive integer.
7. The image processing method according to claim 2, characterized in that: The determining, according to the current state quantity and the timing duration, a first time length required for a maximum state change to occur includes: Determine the current state change amount according to the current state amount and the initial state amount of the first object at the beginning of timing; A first time length required for a maximum state change to occur is determined according to the current state change amount and the timing duration.
8. An image processing device, characterized in that: include: An identification module, used to identify a first object and a second object in a video shooting interface; an acquisition module, configured to acquire a current state quantity of the first object; wherein the current state quantity includes at least one of the following: a size of an image feature of the first object, a number of image features of the first object, a position of an image feature of the first object, a color of an image feature of the first object, and a shape of an image feature of the first object; A determination module, used to determine a target animation effect according to the current state quantity and the timing duration; wherein the timing duration is the duration taken by the first object to change from an initial state to the current state quantity; A generation module is used to add a transition animation effect to the second object in the video shooting interface, which changes to the target animation effect.
9. An image processing device, comprising: A transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the image processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the steps in the image processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Display method and device, electronic equipment and storage medium
CN109885231A
Video processing method and device, electronic equipment and storage medium
CN113207025A