CN110163935A - Animation rendering method, device, equipment and readable storage medium storing program for executing - Google Patents

Animation rendering method, device, equipment and readable storage medium storing program for executing Download PDF

Info

Publication number
CN110163935A
CN110163935A CN201910273018.1A CN201910273018A CN110163935A CN 110163935 A CN110163935 A CN 110163935A CN 201910273018 A CN201910273018 A CN 201910273018A CN 110163935 A CN110163935 A CN 110163935A
Authority
CN
China
Prior art keywords
original
original component
component
pixel value
motion
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.)
Pending
Application number
CN201910273018.1A
Other languages
Chinese (zh)
Inventor
钱鸿强
张莹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Koubei Network Technology Co Ltd
Original Assignee
Zhejiang Koubei Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Koubei Network Technology Co Ltd filed Critical Zhejiang Koubei Network Technology Co Ltd
Priority to CN201910273018.1A priority Critical patent/CN110163935A/en
Publication of CN110163935A publication Critical patent/CN110163935A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a kind of animation rendering method, device, equipment and readable storage medium storing program for executing, it is related to technical field of image processing, movement velocity can be obtained according to the true motion process of original component and original pixel value establishes shadow layer, rendering is carried out come the motion process to original component using the shadow layer and generates motion animation, motion animation is set to observe the process of object of which movement in its natural state close to human eye as far as possible, authenticity is preferable, and user's viscosity is higher.The described method includes: carrying out data acquisition in the motion process of original component, the movement velocity and original pixel value of original component are obtained;Calculation processing is carried out to movement velocity and original pixel value, generates the movement pixel value of original component during the motion;Based on movement pixel value, the shadow layer of original component is established;When receiving the enabled instruction to original component, is rendered using motion process of the shadow layer to original component, generate the motion animation of original component.

Description

Animation rendering method, device, equipment and readable storage medium storing program for executing
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of animation rendering method, device, equipment and readable Storage medium.
Background technique
With the rapid development of Internet technology, people's lives are become into more convenient and colourful intelligent terminal It comes into being.Multiple applications can be carried in intelligent terminal, user can realize in the application to do shopping, orders, calling a taxi Daily behavior.Currently, when using running in an intelligent terminal, it, can be in intelligent terminal if detecting certain operation of user The page in show the situation of change for operating the component being related to herein, the change procedure of component is more lively, image in order to make, and fills Full interest, many applications can carry out animation rendering to the motion process of component, to be shown by the way of animation as a result, For example, being fade-in animation, floaing into animation, rotation animation etc..
In the related technology, when the motion process to component carries out animation rendering, animation be all using simple linear or Filling of the non-linear difference of person as intermediate frame, to cash out by the motion process of component using animation.
In the implementation of the present invention, inventor find the relevant technologies the prior art has at least the following problems:
When indicating the motion process of component by the way of intermediate frame filling, due to being all to go to fill in itself using component Such that regardless of component movement have how soon, be all of component itself seen in human eye, observe in its natural state with human eye quick The process of object of which movement is not consistent, and causes the authenticity of animation poor, and user's viscosity is lower.
Summary of the invention
In view of this, the present invention provides a kind of animation rendering method, device, equipment and readable storage medium storing program for executing, main mesh Be to solve to observe the process of quick object of which movement in its natural state with human eye at present be not consistent, lead to the authenticity of animation It is poor, the lower problem of user's viscosity.
According to the present invention in a first aspect, providing a kind of animation rendering method, this method comprises:
Data acquisition is carried out in the motion process of original component, obtains the movement velocity of the original component and original Pixel value, the original pixel value are the pixel value of the original component under static state;
Calculation processing is carried out to the movement velocity and the original pixel value, the original component is generated and is being moved through Movement pixel value in journey;
Based on the movement pixel value, establish the shadow layer of the original component, the shape of the shadow layer with described group The shape of part is consistent;
Movement when receiving the enabled instruction to the original component, using the shadow layer to the original component Process is rendered, and the motion animation of the original component is generated.
In another embodiment, described that data acquisition is carried out in the motion process of original component, it obtains described original The movement velocity and original pixel value of component, comprising:
Under the stationary state of the original component, the pixel of the original component is extracted, is obtained described original The original pixel value of component;
Setting sampling duration and sampling interval, start the original component and are moved according to the sampling duration;
According to move distance of the original component in multiple sampling intervals, the original component is calculated multiple Multiple sample speed in the sampling interval;
The average speed for calculating the multiple sample speed, using the average speed as the movement of original component speed Degree.
In another embodiment, the move distance according to the original component in multiple sampling intervals, Calculate multiple First Speed of the original component in multiple sampling intervals, comprising:
For any sampling interval in multiple sampling intervals, the original component is counted in the sampling interval Move distance;
The first ratio for calculating the move distance Yu the sampling interval, using first ratio as the sample region Between sample speed;
The process of above-mentioned calculating sample speed is repeated, the multiple sample speed of multiple sampling intervals is generated Degree.
In another embodiment, described that calculation processing is carried out to the movement velocity and the original pixel value, it is raw At the movement pixel value of the original component during the motion, comprising:
The second ratio for calculating the sampling duration and the sampling interval, using second ratio as sampling number;
The movement velocity is decomposed according to horizontal direction and vertical direction, obtains the first speed of the horizontal direction The second speed of degree and the vertical direction;
The first product of the sampling number Yu the sampling interval is calculated, first product and first speed are calculated Second product of degree, and the third product of first product Yu the second speed is calculated, it will be described in second sum of products Third product is as the first pixel value;
The value for calculating separately the sampling number is changed to multiple first pixel values of second ratio from 0, and counts Calculate the pixel and value of the multiple first pixel value;
The third ratio for calculating the pixel and value and second ratio, using the third ratio as described original group The original pixel values of part during the motion;
It is sampled based on adjustment frequency, obtains the instantaneous velocity of the original component during the motion;
The original pixel values are adjusted using the instantaneous velocity, generate the original component during the motion Movement pixel value.
In another embodiment, described to be sampled based on adjustment frequency, the original component is obtained in motion process In instantaneous velocity, comprising:
The adjustment frequency is obtained, sets adjustment section according to the adjustment frequency;
Move distance of the original component in adjustment section is acquired, calculates the original component in the adjustment section In second speed, using the second speed as the original component it is described adjustment section instruction position instantaneous speed Degree.
In another embodiment, described that the original pixel values are adjusted using the instantaneous velocity, generate institute State the movement pixel value of original component during the motion, comprising:
Calculate the 4th ratio of the instantaneous velocity Yu the movement velocity;
Predetermined coefficient is obtained, calculates the product of the predetermined coefficient and the 5th ratio as regulation coefficient;
The products of the regulation coefficient and the original pixel values is calculated as the original component during the motion Move pixel value.
Second aspect according to the present invention, provides a kind of animation rendering device, which includes:
Acquisition module obtains the fortune of the original component for carrying out data acquisition in the motion process of original component Dynamic speed and original pixel value, the original pixel value are the pixel value of the original component under static state;
Processing module generates the original for carrying out calculation processing to the movement velocity and the original pixel value The movement pixel value of beginning component during the motion;
Module is established, for establishing the shadow layer of the original component based on the movement pixel value, the shadow layer Shape is consistent with the shape of the component;
Rendering module, for when receiving the enabled instruction to the original component, using the shadow layer to described The motion process of original component is rendered, and the motion animation of the original component is generated.
In another embodiment, the acquisition module, comprising:
Extraction unit, for being extracted to the pixel of the original component under the stationary state of the original component, Obtain the original pixel value of the original component;
Start unit starts the original component according to the sampling duration for setting sampling duration and sampling interval It is moved;
First computing unit is calculated for the move distance according to the original component in multiple sampling intervals Multiple sample speed of the original component in multiple sampling intervals;
Second computing unit, for calculating the average speed of the multiple sample speed, using the average speed as institute State the movement velocity of original component.
In another embodiment, first computing unit, for being adopted for any in multiple sampling intervals Sample section counts move distance of the original component in the sampling interval;Calculate the move distance and the sampling First ratio in section, using first ratio as the sample speed of the sampling interval;Repeat above-mentioned calculating sample The process of speed generates the multiple sample speed of multiple sampling intervals.
In another embodiment, the processing module, comprising:
First computing unit, for calculating the second ratio of the sampling duration and the sampling interval, by described second Ratio is as sampling number;
Decomposition unit obtains the water for decomposing according to horizontal direction and vertical direction to the movement velocity Square to First Speed and the vertical direction second speed;
Second computing unit calculates described for calculating the first product of the sampling number Yu the sampling interval Second product of one product and the First Speed, and the third product of first product Yu the second speed is calculated, it will Third product described in second sum of products is as the first pixel value;
Third computing unit, the value for calculating separately the sampling number are changed to the more of second ratio from 0 A first pixel value, and calculate the pixel and value of the multiple first pixel value;
4th computing unit, for calculating the third ratio of the pixel and value and second ratio, by the third Original pixel values of the ratio as the original component during the motion;
Sampling unit obtains the original component during the motion instantaneous for being sampled based on adjustment frequency Speed;
Adjustment unit generates described original group for being adjusted using the instantaneous velocity to the original pixel values The movement pixel value of part during the motion.
In another embodiment, the sampling unit is set for obtaining the adjustment frequency according to the adjustment frequency It sets the tone between main plot;Move distance of the original component in adjustment section is acquired, calculates the original component in the adjustment Second speed in section, using the second speed as the original component in the instantaneous of the position of adjustment section instruction Speed.
In another embodiment, the adjustment unit, for calculating the of the instantaneous velocity and the movement velocity Four ratios;Predetermined coefficient is obtained, calculates the product of the predetermined coefficient and the 5th ratio as regulation coefficient;Described in calculating Movement pixel value of the product of regulation coefficient and the original pixel values as the original component during the motion.
The third aspect according to the present invention, provides a kind of equipment, including memory and processor, and the memory is stored with The step of computer program, the processor realizes above-mentioned first aspect the method when executing the computer program.
Fourth aspect according to the present invention provides a kind of readable storage medium storing program for executing, is stored thereon with computer program, the meter The step of calculation machine program realizes method described in above-mentioned first aspect when being executed by processor.
By above-mentioned technical proposal, a kind of animation rendering method, device, equipment and readable storage medium provided by the invention Matter, with it is current using simply linear or non-linear difference as the filling of intermediate frame by the way of compared with, the present invention is according to original The true motion process of beginning component obtains the movement velocity and original pixel value of original component, and generation meets original component reality The movement pixel value of motion conditions is that original component establishes shadow layer based on movement pixel value, so that original when receiving request When the enabled instruction of component movement, the motion process of original component can be rendered using the shadow layer, to generate The motion animation of original component guarantees that the motion animation rendered for original component is raw according to the actual motion situation of original component At, so that motion animation is observed the process of quick object of which movement in its natural state close to human eye as far as possible, the authenticity of animation compared with Good, user's viscosity is higher.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical 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, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a 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 animation rendering method flow diagram provided in an embodiment of the present invention;
Fig. 2A shows a kind of animation rendering method flow diagram provided in an embodiment of the present invention;
Fig. 2 B shows a kind of schematic diagram of animation rendering method provided in an embodiment of the present invention;
Fig. 2 C shows a kind of schematic diagram of animation rendering method provided in an embodiment of the present invention;
Fig. 2 D shows a kind of schematic diagram of animation rendering method provided in an embodiment of the present invention;
Fig. 3 A shows a kind of structural schematic diagram of animation rendering device provided in an embodiment of the present invention;
Fig. 3 B shows a kind of structural schematic diagram of animation rendering device provided in an embodiment of the present invention;
Fig. 3 C shows a kind of structural schematic diagram of animation rendering device provided in an embodiment of the present invention;
Fig. 4 shows a kind of apparatus structure schematic diagram of equipment provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure 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 It is fully disclosed to those skilled in the art.
The embodiment of the invention provides a kind of animation rendering methods, can be obtained according to the true motion process of original component The movement velocity and original pixel value of original component, and original component is met to generate using movement velocity and original pixel value The movement pixel value of actual motion situation is that original component establishes shadow layer based on movement pixel value, so that when receiving request When the enabled instruction of original component movement, the motion process of original component can be rendered using the shadow layer, thus The motion animation for generating original component guarantees that the motion animation rendered for original component is the actual motion feelings according to original component What condition generated, so that motion animation is observed the process of quick object of which movement in its natural state close to human eye as far as possible, reaches animation Authenticity it is preferable, the higher purpose of user's viscosity, as shown in Figure 1, this method comprises:
101, data acquisition is carried out in the motion process of original component, obtains the movement velocity of original component and original Pixel value, original pixel value are the pixel value of original component under static state.
102, calculation processing is carried out to movement velocity and original pixel value, generates the fortune of original component during the motion Dynamic pixel value.
103, based on movement pixel value, the shadow layer of original component is established, the shape of shadow layer and the shape of component are consistent.
104, it when receiving the enabled instruction to original component, is carried out using motion process of the shadow layer to original component Rendering, generates the motion animation of original component.
Method provided by the invention, according to the true motion process of original component obtain original component movement velocity and Original pixel value generates the movement pixel value for meeting original component actual motion situation, is original component based on movement pixel value Shadow layer is established, so that when receiving the enabled instruction of request original component movement, it can be using the shadow layer come to original The motion process of component is rendered, to generate the motion animation of original component, guarantees that the movement rendered for original component is dynamic Picture is generated according to the actual motion situation of original component, observes motion animation in its natural state close to human eye as far as possible fastly The authenticity of the process of fast object of which movement, animation is preferable, and user's viscosity is higher.
The embodiment of the invention provides a kind of animation rendering methods, can be obtained according to the true motion process of original component The movement velocity and original pixel value of original component, and original component is met to generate using movement velocity and original pixel value The movement pixel value of actual motion situation is that original component establishes shadow layer based on movement pixel value, so that when receiving request When the enabled instruction of original component movement, the motion process of original component can be rendered using the shadow layer, thus The motion animation for generating original component guarantees that the motion animation rendered for original component is the actual motion feelings according to original component What condition generated, so that motion animation is observed the process of quick object of which movement in its natural state close to human eye as far as possible, reaches animation Authenticity it is preferable, the higher purpose of user's viscosity, as shown in Figure 2 A, this method comprises:
201, under the stationary state of original component, the pixel of original component is extracted, obtains the original of original component Beginning pixel value.
It was recognized by the inventor that the method for current render component motion process generallys use component itself and is used as intermediate frame to fill out It fills, namely the motion process of component is rendered using component itself, but under actual conditions, component is in the process of movement It can be obscured since speed factor generates, be to have differences between the pixel for the intermediate frame that user sees and the pixel of component itself , it therefore, in embodiments of the present invention, in advance can for original component generation by being sampled to original component motion process With the shadow layer for rendering original component motion process, these shadow layers are generated according to the actual motion process of original component, The pixel value of shadow layer is also to be calculated according to the motion process of original component, can be not only directly based upon subsequent Shadow layer carries out the rendering of motion animation, is not necessarily to real-time rendering, and the motion animation of rendering can also be made more close to eye-observation Actual conditions, increase the authenticity of animation.
Wherein, since shadow layer is to need to establish based on original component itself, therefore, it is necessary to obtain original component Original pixel value is rendered so as to subsequent based on the original pixel value.When obtaining original pixel value, it is contemplated that original component It is made of many a pixels, in this way, the pixel value of each pixel can be obtained respectively, and by whole pixels Original pixel value of the pixel value as the original component.Specifically, original component can be placed in plane right-angle coordinate, to sit Target mode records the pixel value of each pixel, and then obtains the original pixel value of original component.For example, g can be used (x, y) indicates the pixel value for being located at the pixel at (x, y) in original component.Original of the embodiment of the present invention to record original component The mode of beginning pixel value is without specifically limiting.
202, setting sampling duration and sampling interval, starting original component is moved according to sampling duration, according to original Move distance of the component in multiple sampling intervals calculates multiple sample speed of the original component in multiple sampling intervals, meter The average speed for calculating multiple sample speed, using average speed as the movement velocity of original component.
In embodiments of the present invention, it is contemplated that the movement velocity of original component will affect the fog-level of shadow layer, therefore, It needs to determine the movement velocity of original component during the motion by sampling, and then is built according to movement velocity for original component Vertical shadow layer.
Due to the motion process of original component be all it is shorter, speed quickly, calculate original component movement velocity when It is likely to generate error because measuring device is inaccurate, in order to which error to be preferably minimized, when can set sampling Long and sampling interval, and multiple speed are acquired according to sampling interval in sampling duration, by the average speed for calculating multiple speed Degree achievees the purpose that reduce error to determine the actual motion speed of original component.Specifically, for every in sampling duration One sampling interval, firstly, move distance of the statistics original component in the sampling interval;Then, it calculates move distance and adopts First ratio in sample section, using the first ratio as the sample speed of sampling interval.By repeating above-mentioned calculating sample speed The process of degree can generate multiple sample speed of multiple sampling intervals.In this way, calculating the average speed of multiple sample speed Degree, using average speed as the movement velocity of original component.
It should be noted that since the movement velocity of original component is fixed, and the data volume that samples the big more can be with The error of movement velocity is reduced, therefore, adjustable sampling duration and sampling interval acquire original component in different sampling durations And the speed in different sampling intervals, and then average speed can be calculated based on the sample speed acquired in different scenes, Guarantee the comprehensive different motion scene for having original component of the average speed being calculated.Wherein, for ease of description, it can use T indicates sampling duration, indicates sampling interval using Δ t, indicates movement velocity using v (x, y).The embodiment of the present invention adopts expression The mode of sample duration, sampling interval and movement velocity is without specifically limiting.
203, calculation processing is carried out to movement velocity and original pixel value, generates the fortune of original component during the motion Dynamic pixel value.
In embodiments of the present invention, when the original pixel value and original component for getting original component during the motion Movement velocity after, calculation processing can be carried out to movement velocity and original pixel value, and then generate original component and transporting Movement pixel value during dynamic.
Wherein, when carrying out calculation processing to movement velocity and original pixel value, it should be noted that due to some originals The motion profile of beginning component be not it is fully horizontal or substantially vertical, can exist with vertical direction in the horizontal direction certain Speed therefore before carrying out calculation processing to movement velocity and original pixel value, need to be divided movement velocity Movement velocity, is decomposed into the First Speed of horizontal direction and the second speed of vertical direction by solution, thus comprehensive different directions Speed carries out the calculating of pixel value.Specifically, it can be handled according to following formula 1.
Formula 1:
Wherein, f (x, y) is used to indicate the original pixel values of original component;N is used to indicate sampling number, and the value of n is positive Integer, value interval are 0 to the ratio for sampling duration and sampling interval;Vx is used to indicate First Speed;Vy is used to indicate second Speed.
That is, above-mentioned formula can be expressed as, firstly, calculate the second ratio of sampling duration and sampling interval, by the Two ratios are as sampling number (namely t/ Δ t);Then, sampling number and first product in sampling interval (namely n* Δ are calculated T), the second product (namely vx* (n* Δ t)), and calculate the first product and second speed of the first product and First Speed is calculated Third product (namely vy* (n* Δ t)), using the second sum of products third product as the first pixel value;It is adopted finally, calculating separately Multiple first pixel values that the value of sample number is changed to the second ratio from 0 also compare the value from 0 to the second of sampling number Value is changed, and obtains multiple first pixel values, and the pixel and value for multiple first pixel values being calculated, calculate pixel and The third ratio of value and the second ratio, the original pixel values using third ratio as original component during the motion.
It should be noted that after having obtained original pixel values, can by original pixel values directly as movement pixel value, and It is directly based upon the foundation that movement pixel value carries out shadow layer.But the movement due to participating in movement calculated for pixel values in the above process Speed is the average speed of original component during the motion, is relatively specific for the relatively uniform field of the movement velocity of original component Jing Zhong leads to original if original component is not that at the uniform velocity, there are biggish acceleration or deceleration in the process of movement There are larger fluctuations for the instantaneous velocity of beginning component during the motion, and it will cause the depths of the different position shadow layer of speed Degree is also different.For example, if original component move when initial velocity it is larger, soon at the end of speed very little, then can make At it is initial when shade it is shallower, soon at the end of shade it is deeper, therefore, it is necessary to the instantaneous speed based on original component during the motion Degree is adjusted obtained original pixel values, and then generates movement pixel value.
Wherein, when being adjusted based on the instantaneous velocity in original component motion process, it is necessary first to calculate original group The instantaneous velocity of part during the motion is adjusted to be then based on the instantaneous velocity.Due to the calculating of instantaneous velocity Journey needs more above-mentioned average speed more accurate, and also needs to be calculated by the process of sampling, therefore, Ke Yishe It sets one and more accurately adjusts frequency, set the adjustment section suitable for calculating instantaneous velocity according to adjustment frequency to carry out Sampling, and then instantaneous velocity is calculated.Specifically, firstly, obtaining adjustment frequency, according to adjustment frequency setting adjustment section; Then, move distance of the acquisition original component in adjustment section calculates second speed of the original component in adjustment section, will Instantaneous velocity of the second speed as original component in the position of adjustment section instruction.Usually, adjustment frequency can be 60 hertz Hereby, instantaneous velocity can be indicated with v Δ t.
The instantaneous velocity of original component during the motion can be calculated by the above process.It is being based on instantaneous velocity When being adjusted to original pixel values, need to generate regulation coefficient, regulation coefficient can be generated using following formula 2.
Formula 2:
Wherein, α is used to indicate regulation coefficient;K is used to indicate predetermined coefficient;V Δ t is used to indicate instantaneous velocity;V is for referring to Show the average speed being calculated in average speed namely above-mentioned steps 202.It above-mentioned formula 2 namely can be described as: firstly, Calculate the 4th ratio of instantaneous velocity and movement velocity;Then, predetermined coefficient is obtained, calculating predetermined coefficient multiplies with the 5th ratio Product is used as regulation coefficient.Above-mentioned formula 2 shows that the value of α and the ratio of instantaneous velocity and average speed are positively correlated, the reality of k Use is to adjust the depth of shadow layer entirety, and the value of usual k is 0.5 to 2.
After generating regulation coefficient, it can be adjusted based on original pixel values of the regulation coefficient to generation, specifically Adjustment process in ground is to calculate the product of regulation coefficient and original pixel values, using obtained product as original component in motion process In movement pixel value.
204, based on movement pixel value, the shadow layer of original component is established, the shape of shadow layer and the shape of component are consistent.
It in embodiments of the present invention, can base after generating the movement pixel value of original component during the motion The shadow layer of original component is established in the movement pixel value.Wherein, since shadow layer is to be moved to generate by original component, shape Be it is completely the same with original component, therefore, the shadow layer of foundation needs to establish according to the shape of original component.Completing original After the shadow layer of beginning component is established, the shadow layer of original component can be saved, to be moved in subsequent original component of working as When, motion process is rendered using the shadow layer.
It should be noted that above-mentioned steps 201 to the process for generating shadow layer shown in step 204 for original component can Directly to be generated after original component complete design for original component, can also be relied on during original component starts for the first time The calculating of GPU (Graphics Processing Unit, graphics processor) generates, to avoid to CPU (Central Processing Unit, central processing unit) operation impact, CPU will not be blocked, the Caton of the page will not be caused.This Inventive embodiments are to the opportunity of generation shadow layer without specifically limiting.
205, it when receiving the enabled instruction to original component, is carried out using motion process of the shadow layer to original component Rendering, generates the motion animation of original component.
In embodiments of the present invention, when receiving the enabled instruction to original component, due to being that original component is raw At shadow layer, therefore, shadow layer can be directly used, the motion process of original component is rendered, is generated for original component Motion animation.Wherein, when rendering based on shadow layer to motion process, shadow layer can be superimposed upon to the fortune of original component During dynamic, and then generate the motion animation of original component.
It should be noted that if being temporarily not received by the enabled instruction of original component step 204 can be completed Terminate process later, and just executes step 205 to the motion process of original component when receiving the enabled instruction of original component It is rendered.
201 to process shown in step 204 through the above steps, just establishes and its shape, content for original component The difference of completely the same shadow layer, shadow layer and original component is only that the difference of pixel value, therefore, using shadow layer to original Beginning component, which carries out rendering, can be generated the effect such as Fig. 2 B to Fig. 2 D.Wherein, Fig. 2 B is shown when original component not yet starts Original interface, when original component starting, original component just starts to occur and move in original interface, during which due to original group Part occurs gradually downward, therefore, when being rendered based on shadow layer to original component, multiple names that original component includes Claim the shade that all there is variation on motion profile, referring specifically to Fig. 2 C, in this way, just realizing original component in original interface Pull down the rendering of motion process.After original component drop-down, original component is just shown generally in original interface, specific to join See Fig. 2 D.It should be noted that shadow layer can not only render the process of original component drop-down, original component can also be rendered and returned The process of bullet, the mode for rendering the process and rendering downdraw process of rebound are consistent, are no longer repeated herein.
Method provided by the invention, according to the true motion process of original component obtain original component movement velocity and Original pixel value generates the movement pixel value for meeting original component actual motion situation, is original component based on movement pixel value Shadow layer is established, so that when receiving the enabled instruction of request original component movement, it can be using the shadow layer come to original The motion process of component is rendered, to generate the motion animation of original component, guarantees that the movement rendered for original component is dynamic Picture is generated according to the actual motion situation of original component, observes motion animation in its natural state close to human eye as far as possible fastly The authenticity of the process of fast object of which movement, animation is preferable, and user's viscosity is higher.
Further, the specific implementation as Fig. 1 the method, the embodiment of the invention provides a kind of renderings of animation to fill It sets, as shown in Figure 3A, described device includes: acquisition module 301, and processing module 302 establishes module 303 and rendering module 304.
The acquisition module 301 obtains the original component for carrying out data acquisition in the motion process of original component Movement velocity and original pixel value, the original pixel value be the pixel value of the original component under static state;
The processing module 302 generates institute for carrying out calculation processing to the movement velocity and the original pixel value State the movement pixel value of original component during the motion;
This establishes module 303, for being based on the movement pixel value, establishes the shadow layer of the original component, the yin The shape of shadow layer is consistent with the shape of the component;
The rendering module 304, for when receiving the enabled instruction to the original component, using the shadow layer pair The motion process of the original component is rendered, and the motion animation of the original component is generated.
In specific application scenarios, as shown in Figure 3B, the acquisition module 301, comprising: extraction unit 3011, starting Unit 3012, the first computing unit 3013 and the second computing unit 3014.
The extraction unit 3011, under the stationary state of the original component, to the pixel of the original component into Row extracts, and obtains the original pixel value of the original component;
The start unit 3012 starts the original component and adopts according to described for setting sampling duration and sampling interval Sample duration is moved;
First computing unit 3013, for according to movement of the original component in multiple sampling intervals away from From calculating multiple sample speed of the original component in multiple sampling intervals;
Second computing unit 3014, for calculating the average speed of the multiple sample speed, by the average speed Movement velocity as the original component.
In specific application scenarios, first computing unit 3013, for for appointing in multiple sampling intervals One sampling interval counts move distance of the original component in the sampling interval;Calculate the move distance with it is described First ratio of sampling interval, using first ratio as the sample speed of the sampling interval;Repeat above-mentioned calculating The process of sample speed generates the multiple sample speed of multiple sampling intervals.
In specific application scenarios, as shown in Figure 3 C, the processing module 302, comprising: the first computing unit 3021, point Solve unit 3022, the second computing unit 3023, third computing unit 3024, the 4th computing unit 3025,3026 He of sampling unit Adjustment unit 3027.
First computing unit 3021, for calculating the second ratio of the sampling duration and the sampling interval, by institute The second ratio is stated as sampling number;
The decomposition unit 3022 is obtained for decomposing according to horizontal direction and vertical direction to the movement velocity The second speed of the First Speed of the horizontal direction and the vertical direction;
Second computing unit 3023 is calculated for calculating the first product of the sampling number Yu the sampling interval Second product of first product and the First Speed, and the third for calculating first product and the second speed multiplies Product, using third product described in second sum of products as the first pixel value;
The third computing unit 3024, the value for calculating separately the sampling number are changed to second ratio from 0 Multiple first pixel values of value, and calculate the pixel and value of the multiple first pixel value;
4th computing unit 3025, for calculating the third ratio of the pixel and value and second ratio, by institute State the original pixel values of third ratio during the motion as the original component;
The sampling unit 3026 obtains the original component during the motion for being sampled based on adjustment frequency Instantaneous velocity;
The adjustment unit 3027, for being adjusted using the instantaneous velocity to the original pixel values, described in generation The movement pixel value of original component during the motion.
In specific application scenarios, the sampling unit 3026, for obtaining the adjustment frequency, according to the adjustment frequency Rate setting adjustment section;Move distance of the original component in adjustment section is acquired, calculates the original component described The second speed in section is adjusted, using the second speed as the original component in the position of adjustment section instruction Instantaneous velocity.
In specific application scenarios, the adjustment unit 3027, for calculating the instantaneous velocity and the movement velocity The 4th ratio;Predetermined coefficient is obtained, calculates the product of the predetermined coefficient and the 5th ratio as regulation coefficient;It calculates Movement pixel value of the product of the regulation coefficient and the original pixel values as the original component during the motion.
Device provided in an embodiment of the present invention obtains the movement speed of original component according to the true motion process of original component Degree and original pixel value generate the movement pixel value for meeting original component actual motion situation, are original based on movement pixel value Beginning component establishes shadow layer so that when receive request original component movement enabled instruction when, can using the shadow layer come The motion process of original component is rendered, to generate the motion animation of original component, is guaranteed as original component rendering Motion animation is generated according to the actual motion situation of original component, make motion animation as far as possible close to human eye in its natural state The process of quick object of which movement is observed, the authenticity of animation is preferable, and user's viscosity is higher.
It should be noted that other of each functional unit involved by a kind of animation rendering device provided in an embodiment of the present invention Corresponding description, can be with reference to the corresponding description in Fig. 1 and Fig. 2A to Fig. 2 D, and details are not described herein.
In the exemplary embodiment, referring to fig. 4, a kind of equipment is additionally provided, which includes communication bus, processing Device, memory and communication interface, can also include, input/output interface and display equipment, wherein can between each functional unit To complete mutual communication by bus.The memory is stored with computer program, processor, for executing institute on memory The program of storage executes the animation rendering method in above-described embodiment.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor The step of animation rendering method is realized when row.
Through the above description of the embodiments, those skilled in the art can be understood that the application can lead to Hardware realization is crossed, the mode of necessary general hardware platform can also be added to realize by software.Based on this understanding, this Shen Technical solution please can be embodied in the form of software products, which can store in a non-volatile memories In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions are used so that a computer equipment (can be Personal computer, server or network equipment etc.) execute method described in each implement scene of the application.
It will be appreciated by those skilled in the art that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, module in attached drawing or Process is not necessarily implemented necessary to the application.
It will be appreciated by those skilled in the art that the module in device in implement scene can be described according to implement scene into Row is distributed in the device of implement scene, can also be carried out corresponding change and is located at the one or more dresses for being different from this implement scene In setting.The module of above-mentioned implement scene can be merged into a module, can also be further split into multiple submodule.
Above-mentioned the application serial number is for illustration only, does not represent the superiority and inferiority of implement scene.
Disclosed above is only several specific implementation scenes of the application, and still, the application is not limited to this, Ren Heben What the technical staff in field can think variation should all fall into the protection scope of the application.

Claims (10)

1. a kind of animation rendering method characterized by comprising
Data acquisition is carried out in the motion process of original component, obtains the movement velocity and original pixels of the original component Value, the original pixel value are the pixel value of the original component under static state;
Calculation processing is carried out to the movement velocity and the original pixel value, generates the original component during the motion Movement pixel value;
Based on the movement pixel value, the shadow layer of the original component, the shape of the shadow layer and the component are established Shape is consistent;
When receiving the enabled instruction to the original component, using the shadow layer to the motion process of the original component It is rendered, generates the motion animation of the original component.
2. the method according to claim 1, wherein the data that carry out in the motion process of original component are adopted Collection, obtains the movement velocity and original pixel value of the original component, comprising:
Under the stationary state of the original component, the pixel of the original component is extracted, obtains the original component Original pixel value;
Setting sampling duration and sampling interval, start the original component and are moved according to the sampling duration;
According to move distance of the original component in multiple sampling intervals, the original component is calculated multiple described Multiple sample speed in sampling interval;
The average speed for calculating the multiple sample speed, using the average speed as the movement velocity of the original component.
3. according to the method described in claim 2, it is characterized in that, it is described according to the original component in multiple sample regions Between in move distance, calculate multiple First Speed of the original component in multiple sampling intervals, comprising:
For any sampling interval in multiple sampling intervals, fortune of the original component in the sampling interval is counted Dynamic distance;
The first ratio for calculating the move distance Yu the sampling interval, using first ratio as the sampling interval Sample speed;
The process of above-mentioned calculating sample speed is repeated, the multiple sample speed of multiple sampling intervals is generated.
4. according to the method described in claim 2, it is characterized in that, described to the movement velocity and the original pixel value Calculation processing is carried out, the movement pixel value of the original component during the motion is generated, comprising:
The second ratio for calculating the sampling duration and the sampling interval, using second ratio as sampling number;
The movement velocity is decomposed according to horizontal direction and vertical direction, obtain the horizontal direction First Speed and The second speed of the vertical direction;
The first product of the sampling number Yu the sampling interval is calculated, first product and the First Speed are calculated Second product, and the third product of first product Yu the second speed is calculated, by third described in second sum of products Product is as the first pixel value;
The value for calculating separately the sampling number is changed to multiple first pixel values of second ratio from 0, and calculates institute State the pixel and value of multiple first pixel values;
The third ratio for calculating the pixel and value and second ratio exists using the third ratio as the original component Original pixel values in motion process;
It is sampled based on adjustment frequency, obtains the instantaneous velocity of the original component during the motion;
The original pixel values are adjusted using the instantaneous velocity, generate the fortune of the original component during the motion Dynamic pixel value.
5. according to the method described in claim 4, it is characterized in that, it is described based on adjustment frequency sampled, obtain the original The instantaneous velocity of beginning component during the motion, comprising:
The adjustment frequency is obtained, sets adjustment section according to the adjustment frequency;
Move distance of the original component in adjustment section is acquired, calculates the original component in the adjustment section Second speed, the instantaneous velocity using the second speed as the original component in the position of adjustment section instruction.
6. according to the method described in claim 4, it is characterized in that, described use the instantaneous velocity to the original pixel values It is adjusted, generates the movement pixel value of the original component during the motion, comprising:
Calculate the 4th ratio of the instantaneous velocity Yu the movement velocity;
Predetermined coefficient is obtained, calculates the product of the predetermined coefficient and the 5th ratio as regulation coefficient;
Calculate movement of the product of the regulation coefficient and the original pixel values as the original component during the motion Pixel value.
7. a kind of animation rendering device characterized by comprising
Acquisition module obtains the movement speed of the original component for carrying out data acquisition in the motion process of original component Degree and original pixel value, the original pixel value are the pixel value of the original component under static state;
Processing module generates described original group for carrying out calculation processing to the movement velocity and the original pixel value The movement pixel value of part during the motion;
Module is established, for being based on the movement pixel value, establishes the shadow layer of the original component, the shape of the shadow layer It is consistent with the shape of the component;
Rendering module, for when receiving the enabled instruction to the original component, using the shadow layer to described original The motion process of component is rendered, and the motion animation of the original component is generated.
8. device according to claim 7, which is characterized in that the acquisition module, comprising:
Extraction unit is obtained for being extracted under the stationary state of the original component to the pixel of the original component The original pixel value of the original component;
Start unit starts the original component and carries out according to the sampling duration for setting sampling duration and sampling interval Movement;
First computing unit, for the move distance according to the original component in multiple sampling intervals, described in calculating Multiple sample speed of the original component in multiple sampling intervals;
Second computing unit, for calculating the average speed of the multiple sample speed, using the average speed as the original The movement velocity of beginning component.
9. a kind of equipment, including memory and processor, the memory are stored with computer program, which is characterized in that described The step of processor realizes any one of claims 1 to 6 the method when executing the computer program.
10. a kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that the computer program is processed The step of device realizes method described in any one of claims 1 to 6 when executing.
CN201910273018.1A 2019-04-04 2019-04-04 Animation rendering method, device, equipment and readable storage medium storing program for executing Pending CN110163935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910273018.1A CN110163935A (en) 2019-04-04 2019-04-04 Animation rendering method, device, equipment and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910273018.1A CN110163935A (en) 2019-04-04 2019-04-04 Animation rendering method, device, equipment and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN110163935A true CN110163935A (en) 2019-08-23

Family

ID=67639116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910273018.1A Pending CN110163935A (en) 2019-04-04 2019-04-04 Animation rendering method, device, equipment and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN110163935A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110766718A (en) * 2019-09-09 2020-02-07 北京美院帮网络科技有限公司 Method, device and system for acquiring picture
CN110930484A (en) * 2019-11-21 2020-03-27 腾讯科技(深圳)有限公司 Animation configuration method and device, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1139473A (en) * 1997-05-22 1999-02-12 Sega Enterp Ltd Image processor, image processing method and game device using it
US20070076978A1 (en) * 2005-09-30 2007-04-05 Fuji Photo Film Co., Ltd. Moving image generating apparatus, moving image generating method and program therefor
CN103477630A (en) * 2011-04-15 2013-12-25 夏普株式会社 Menu screen display control method and display control device
CN104766361A (en) * 2015-04-29 2015-07-08 腾讯科技(深圳)有限公司 Ghosting effect realization method and device
CN109564495A (en) * 2016-06-28 2019-04-02 株式会社尼康 Display device, program, display methods and control device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1139473A (en) * 1997-05-22 1999-02-12 Sega Enterp Ltd Image processor, image processing method and game device using it
US20070076978A1 (en) * 2005-09-30 2007-04-05 Fuji Photo Film Co., Ltd. Moving image generating apparatus, moving image generating method and program therefor
CN103477630A (en) * 2011-04-15 2013-12-25 夏普株式会社 Menu screen display control method and display control device
CN104766361A (en) * 2015-04-29 2015-07-08 腾讯科技(深圳)有限公司 Ghosting effect realization method and device
CN109564495A (en) * 2016-06-28 2019-04-02 株式会社尼康 Display device, program, display methods and control device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110766718A (en) * 2019-09-09 2020-02-07 北京美院帮网络科技有限公司 Method, device and system for acquiring picture
CN110766718B (en) * 2019-09-09 2024-04-16 北京美院帮网络科技有限公司 Picture acquisition method, device and system
CN110930484A (en) * 2019-11-21 2020-03-27 腾讯科技(深圳)有限公司 Animation configuration method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
US10154246B2 (en) Systems and methods for 3D capturing of objects and motion sequences using multiple range and RGB cameras
US20210287379A1 (en) Video data processing method and related apparatus
US10347023B2 (en) Data drawing method and apparatus, terminal, and storage medium
CN110704768B (en) Webpage rendering method and device based on graphics processor
CN106021421B (en) method and device for accelerating webpage rendering
CN112102437B (en) Canvas-based radar map generation method and device, storage medium and terminal
US20200349391A1 (en) Method for training image generation network, electronic device, and storage medium
CN109712131A (en) Quantization method, device, electronic equipment and the storage medium of Lung neoplasm feature
CN104574495A (en) Method and device for rendering image
US10475229B2 (en) Information processing apparatus and information processing method
CN110163935A (en) Animation rendering method, device, equipment and readable storage medium storing program for executing
CN110740309B (en) Image display method and device, electronic equipment and storage medium
CN109272044A (en) A kind of image similarity determines method, apparatus, equipment and storage medium
WO2014036857A1 (en) Animation playing method, device and apparatus
CN110930492B (en) Model rendering method, device, computer readable medium and electronic equipment
CN104142807A (en) Android-control-based method and system for drawing image through OpenGL
CN114531553A (en) Method and device for generating special effect video, electronic equipment and storage medium
CN111292234B (en) Panoramic image generation method and device
CN114786067B (en) Bullet screen-based interaction method, bullet screen-based interaction device, bullet screen-based interaction equipment and storage medium
CN107395692A (en) Terminal screen methods of exhibiting and device
CN108256451B (en) Method and device for detecting human face
CN113810755B (en) Panoramic video preview method and device, electronic equipment and storage medium
CN114913277A (en) Method, device, equipment and medium for three-dimensional interactive display of object
CN114022601A (en) Volume element rendering method, device and equipment
CN110662099B (en) Method and device for displaying bullet screen

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190823

RJ01 Rejection of invention patent application after publication