CN109598773A - A kind of method and apparatus handling static figure layer - Google Patents

A kind of method and apparatus handling static figure layer Download PDF

Info

Publication number
CN109598773A
CN109598773A CN201811478217.8A CN201811478217A CN109598773A CN 109598773 A CN109598773 A CN 109598773A CN 201811478217 A CN201811478217 A CN 201811478217A CN 109598773 A CN109598773 A CN 109598773A
Authority
CN
China
Prior art keywords
tilt angle
terminal device
layer
static
offset
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.)
Withdrawn
Application number
CN201811478217.8A
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.)
Kylin Seing Network Technology Ltd By Share Ltd
Original Assignee
Kylin Seing Network Technology Ltd By Share 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 Kylin Seing Network Technology Ltd By Share Ltd filed Critical Kylin Seing Network Technology Ltd By Share Ltd
Priority to CN201811478217.8A priority Critical patent/CN109598773A/en
Publication of CN109598773A publication Critical patent/CN109598773A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Abstract

The embodiment of the present application provides a kind of method and apparatus for handling static figure layer, this method comprises: obtaining the three-dimensional of the terminal device by the direction sensor of terminal device, component of the acceleration of gravity on the three-dimensional is obtained by the acceleration transducer of the terminal device;The tilt angle of the terminal device is calculated based on the component, the tilt angle includes the angle of the three-dimensional Yu acceleration of gravity direction;The tilt angle is smoothed;The offset for determining static figure layer respectively based on the tilt angle after smoothing processing moves the static figure layer according to the offset in real time.A kind of method and apparatus handling static figure layer provided by the embodiments of the present application, can make static figure layer be subjected to displacement the effect for realizing dynamic image under the premise of not increasing product cost during terminal device is inclined.

Description

A kind of method and apparatus handling static figure layer
Technical field
This application involves technical field of image processing more particularly to a kind of method and apparatus for handling static figure layer.
Background technique
Currently, the high end product matched can configure rotating vector sensor, produced using rotating vector sensor in terminal Changing value is generated during product are inclined, after getting these changing values, can be calculated the inclined angle of mobile phone, be recycled hand The inclined goniometer of machine calculates the offset of static images movement, finally by the position of the present static images of offset-lists, i.e., The effect of dynamic image can be achieved.
However, configuration rotating vector sensor will greatly increase end product manufacturing cost, it is low with end product without Method configures rotating vector sensor, and low direction sensor and acceleration transducer with common configuration on end product is because to end It holds the shaking of product very sensitive and usually is not used to form dynamic image.
Summary of the invention
The purpose of the embodiment of the present application is to provide a kind of method and apparatus for handling static figure layer, can not increase product The effect of dynamic image is realized under the premise of cost.
In order to solve the above technical problems, the embodiment of the present application is achieved in that
In a first aspect, the embodiment of the present application provides a kind of method for handling static figure layer, comprising:
The three-dimensional that the terminal device is obtained by the direction sensor of terminal device passes through the terminal device Acceleration transducer obtains component of the acceleration of gravity on the three-dimensional;
Calculate the tilt angle of the terminal device based on the component, the tilt angle include the three-dimensional with The angle in acceleration of gravity direction;
The tilt angle is smoothed;
Determine the offset of static figure layer respectively based on the tilt angle after smoothing processing, it is real according to the offset Static state figure layer described in Shi Yidong.
Second aspect, the embodiment of the present application provide a kind of device for handling static figure layer, comprising:
Module is obtained, the three-dimensional of the terminal device is obtained for the direction sensor by terminal device, is passed through The acceleration transducer of the terminal device obtains component of the acceleration of gravity on the three-dimensional;
Computing module, for calculating the tilt angle of the terminal device based on the component, the tilt angle includes The angle of the three-dimensional and acceleration of gravity direction;
Processing module, for being smoothed to the tilt angle;
Displacement module, for determining the offset of static figure layer, root respectively based on the tilt angle after smoothing processing The static figure layer is moved in real time according to the offset.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: memory, processor and are stored in institute The computer executable instructions that can be run on memory and on the processor are stated, the computer executable instructions are described The step of a kind of method of processing static state figure layer as described in above-mentioned first aspect is realized when processor executes.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer-readable storage Medium realizes such as above-mentioned first for storing computer executable instructions when the computer executable instructions are executed by processor A kind of the step of method of processing static state figure layer described in aspect.
In the embodiment of the present application, the three-dimensional of the terminal device is obtained by the direction sensor of terminal device, Component of the acceleration of gravity on the three-dimensional is obtained by the acceleration transducer of the terminal device;Based on described point Amount calculates the tilt angle of the terminal device, and the tilt angle includes the folder of the three-dimensional Yu acceleration of gravity direction Angle;The tilt angle is smoothed;Determine static figure layer respectively based on the tilt angle after smoothing processing Offset moves the static figure layer according to the offset in real time, can not increase without configuring rotating vector sensor Under the premise of product cost, using the sensor of terminal device standard configuration, send out static figure layer during terminal device is inclined The effect of dynamic image is realized in raw displacement.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in application, for those of ordinary skill in the art, in the premise of not making the creative labor property Under, it is also possible to obtain other drawings based on these drawings.
Fig. 1 shows a kind of the first flow diagram of method for handling static figure layer provided by the embodiments of the present application;
Fig. 2 shows a kind of second of flow diagrams of the method for handling static figure layer provided by the embodiments of the present application;
Fig. 3 shows the schematic diagram of terminal device run-off the straight;
Fig. 4 shows a kind of the third flow diagram of method for handling static figure layer provided by the embodiments of the present application;
Fig. 5, which is shown, is mapped to each figure to same tilt angle using the near big and far smaller natural law of the human eye to space object The schematic diagram that offset on layer is adjusted;
Fig. 6 shows a kind of the 4th kind of flow diagram of method for handling static figure layer provided by the embodiments of the present application;
Fig. 7 shows a kind of the first module diagram of device for handling static figure layer provided by the embodiments of the present application;
Fig. 8 shows a kind of second of module diagram of device for handling static figure layer provided by the embodiments of the present application;
Fig. 9 shows the hardware knot for executing a kind of electronic equipment of method for handling static figure layer provided by the embodiments of the present application Structure schematic diagram.
Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality The attached drawing in example is applied, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described implementation Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common The application protection all should belong in technical staff's every other embodiment obtained without creative efforts Range.
Fig. 1 shows a kind of the first flow diagram of method for handling static figure layer provided by the embodiments of the present application, should Method can be executed by electronic equipment, such as terminal device etc..In other words, the method can be by being mounted on mobile phone etc. Software or hardware on terminal device execute.As shown, this method may comprise steps of.
S10: obtaining the three-dimensional of the terminal device by the direction sensor of terminal device, is set by the terminal Standby acceleration transducer obtains component of the acceleration of gravity on the three-dimensional.
The three-dimensional of terminal device includes: that the parallel axis in two sides intersecting on terminal device is respectively three-dimensional side To X-axis and Y-axis, X-axis and Y-axis determine a plane, and the axis vertical with the plane is Z axis.
The direction of acceleration of gravity is obtained on the three-dimensional by the acceleration transducer of the terminal device Component includes component of the vertically downward direction respectively in X-axis, Y-axis and Z-direction.
S20: calculating the tilt angle of the terminal device based on the component, and the tilt angle includes the three-dimensional side To the angle with acceleration of gravity direction.
In one possible implementation, using SIN function, the tilt angle of terminal device can be calculated.One In kind possible implementation, can also be calculated using cosine function the three-dimensional of equipment respectively with the folder of acceleration of gravity The tilt angle of angle, this angle and equipment complementary angle each other.
S30: the tilt angle is smoothed.
Direction sensor and acceleration transducer are very sensitive to the shaking of terminal device, lead to meeting in image moving process There is the defect acutely shaken, it is therefore desirable to carry out eliminating the smoothing processing of shake in this step.
For example, data relationship (mathematical model) can be established based on discrete tilt angle, find out a series of small straight Interpolation point is connected into curve again by line segment, it is possible thereby to form more smooth curve.
S40: the offset of static figure layer is determined respectively based on the tilt angle after smoothing processing, according to the offset Amount moves the static figure layer in real time.
The effect for generating dynamic image is subjected to displacement by static figure layer.
A kind of method handling static figure layer provided by the embodiments of the present application as a result, can be without configuring rotating vector biography Sensor, under the premise of not increasing product cost, using the sensor of terminal device standard configuration, during terminal device is inclined Static figure layer is set to be subjected to displacement the effect for realizing dynamic image.
Fig. 2 shows a kind of second of flow diagrams of the method for handling static figure layer provided by the embodiments of the present application, should Method can be executed by electronic equipment, such as terminal device.In other words, the method can be by being mounted on end of mobile phone etc. The software or hardware of end equipment executes.As shown, this method may comprise steps of.
S10: obtaining the three-dimensional of the terminal device by the direction sensor of terminal device, is set by the terminal Standby acceleration transducer obtains component of the acceleration of gravity on the three-dimensional.
The acceleration transducer of terminal device is usually the acceleration for detecting detection mobile phone using acceleration of gravity and rocking , such as function of passometer in " shaking " function and mobile phone in " wechat " etc..Direction sensor can be by acceleration The software class sensor realized after sensor and geomagnetic sensor superposition, commonly used to realize the functions such as the compass on mobile phone.
Terminal device can register acceleration transducer, if succeeded in registration, can normally get sensor detection To acceleration of gravity and the component fastened in terminal device three-dimensional coordinate.I.e. when terminal device screen level is placed upward, Component value of the terminal device on Z axis is 9.8006, and the component value in X-axis and Y-axis is 0.
Fig. 3 shows the schematic diagram of terminal device run-off the straight.As shown in connection with fig. 3, the three-dimensional of terminal device include: with The two parallel axis in side intersected on terminal device are respectively the X-axis and Y-axis of three-dimensional, and X-axis and Y-axis determine that one is put down Face, the axis vertical with the plane are Z axis.
When device inclined, the three-dimensional of terminal device is changed correspondingly, and the direction of acceleration of gravity is vertical always It holds down constant.The direction of acceleration of gravity is obtained on three-dimensional by the acceleration transducer of the terminal device Component includes the direction g in figure straight down, respectively the component in X-axis, Y-axis and Z-direction, i.e. g1, g2 and g3 in figure.
S20: calculating the tilt angle of the terminal device based on the component, and the tilt angle includes the three-dimensional side To the angle with acceleration of gravity direction.
In one possible implementation, using SIN function, the tilt angle of terminal device can be calculated.One In kind possible implementation, can also be calculated using cosine function the three-dimensional of equipment respectively with the folder of acceleration of gravity The tilt angle of angle, this angle and equipment complementary angle each other.
S30: the tilt angle is smoothed.
Direction sensor and acceleration transducer are very sensitive to the shaking of terminal device, lead to meeting in image moving process There is the defect acutely shaken, it is therefore desirable to carry out eliminating the smoothing processing of shake in this step.
In one possible implementation, this step can specifically include step S31-S32.
Step S31: being filtered the tilt angle of terminal device, obtains the discrete inclination numerical value.
Numerous, the intensive data detected are filtered, one group of discrete data are obtained.
Step S32: the discrete inclination numerical value is separately converted to continuous tilt angle by utilization index function Numerical value.
In one possible implementation, it can be calculated based on preceding primary calculated previous tilt angle with this Current tilt angle, utilization index function enables the previous tilt angle be infinitely close to the current tilt angle.
Pass through exponential function infinite tendency as a result, but not equal principle, the value infinite tendency once detected before allowing In currently detected value, discrete value is allowed to become successive value.
Specifically, exponential function may include: y=startValue*a^x+finalValue, wherein startValue For the previous tilt angle, finalValue is the current tilt angle, and a is the truth of a matter of exponential function, and 0 < a < 1, x are certainly Variable.When sensor adjusts back a tilt angle, the tilt angle that the last time detects is assigned to first Tilt angle this time is assigned to finalValue by startValue, and a, which takes, meets defined arbitrary value, representative be from The pace of change of startValue to finalValue, the x as independent variable start from scratch in another thread from increasing.
Pass through exponential function infinite tendency as a result, but not equal principle, the value infinite tendency once detected before allowing In currently detected value, discrete value is allowed to become successive value.It is not at once when sensor detects current tilt angle Current tilt angle is obtained, but obtains the process for being gradually varied to current tilt angle from previous tilt angle, to prevent figure As shake, realizes the smooth movement of image, improve the visual effect of dynamic image.User is in screen locking, load dynamic wallpaper, figure Piece will be moved uniformly, be unlikely to transition jitter.
S40: the offset of static figure layer is determined respectively based on the tilt angle after smoothing processing, according to the offset Amount moves the static figure layer in real time.
It is subjected to displacement the effect for generating dynamic image by static figure layer, the dynamic wall of terminal device can be applied particularly to The application scenarios such as paper.
A kind of method handling static figure layer provided by the embodiments of the present application as a result, can be without configuring rotating vector biography Sensor, under the premise of not increasing product cost, using the sensor of terminal device standard configuration, during terminal device is inclined Static figure layer is set to be subjected to displacement the effect for realizing dynamic image.
Further, a kind of method handling static figure layer provided by the embodiments of the present application, can realize dynamic image During prevent flating, realize the smooth movement of image, improve the visual effect of dynamic image.
Fig. 4 shows a kind of the third flow diagram of method for handling static figure layer provided by the embodiments of the present application, should Method can be executed by electronic equipment, such as terminal device.In other words, the method can be by being mounted on end of mobile phone etc. The software or hardware of end equipment executes.As shown, this method may comprise steps of.
S10: obtaining the three-dimensional of the terminal device by the direction sensor of terminal device, is set by the terminal Standby acceleration transducer obtains component of the acceleration of gravity on the three-dimensional.
Terminal device can register acceleration transducer, if succeeded in registration, can normally get sensor detection To acceleration of gravity and the component fastened in terminal device three-dimensional coordinate.I.e. when terminal device screen level is placed upward, Component value of the terminal device on Z axis is 9.8006, and the component value in X-axis and Y-axis is 0.
Fig. 3 shows the schematic diagram of terminal device run-off the straight.As shown in connection with fig. 3, the three-dimensional of terminal device include: with The two parallel axis in side intersected on terminal device are respectively the X-axis and Y-axis of three-dimensional, and X-axis and Y-axis determine that one is put down Face, the axis vertical with the plane are Z axis.
The direction of acceleration of gravity is obtained on the three-dimensional by the acceleration transducer of the terminal device Component includes vertically downward direction, i.e., the direction of g in figure, respectively the component in X-axis, Y-axis and Z-direction, i.e., g1 in figure, G2 and g3.
S20: calculating the tilt angle of the terminal device based on the component, and the tilt angle includes the three-dimensional side To the angle with acceleration of gravity direction.
In one possible implementation, using SIN function, the tilt angle of terminal device can be calculated.One In kind possible implementation, can also be calculated using cosine function the three-dimensional of equipment respectively with the folder of acceleration of gravity The tilt angle of angle, this angle and equipment complementary angle each other.
S30: the tilt angle is smoothed.
Direction sensor and acceleration transducer are very sensitive to the shaking of terminal device, lead to meeting in image moving process There is the defect acutely shaken, it is therefore desirable to carry out eliminating the smoothing processing of shake in this step.
In one possible implementation, this step can specifically include step S31-S32.
Step S31: being filtered the tilt angle of terminal device, obtains the discrete inclination numerical value.
Numerous, the intensive data detected are filtered, one group of discrete data are obtained.
Step S32: the discrete inclination numerical value is separately converted to continuous tilt angle by utilization index function Numerical value.
In one possible implementation, it can be calculated based on preceding primary calculated previous tilt angle with this Current tilt angle, utilization index function enables the previous tilt angle be infinitely close to the current tilt angle.
Pass through exponential function infinite tendency as a result, but not equal principle, the value infinite tendency once detected before allowing In currently detected value, discrete value is allowed to become successive value.
Specifically, exponential function may include: y=startValue*a^x+finalValue, wherein startValue For the previous tilt angle, finalValue is the current tilt angle, and a is the truth of a matter of exponential function, and 0 < a < 1, x are certainly Variable.When sensor adjusts back a tilt angle, the tilt angle that the last time detects is assigned to first Tilt angle this time is assigned to finalValue by startValue, and a, which takes, meets defined arbitrary value, representative be from The pace of change of startValue to finalValue, the x as independent variable start from scratch in another thread from increasing.
Pass through exponential function infinite tendency as a result, but not equal principle, the value infinite tendency once detected before allowing In currently detected value, discrete value is allowed to become successive value.It is not at once when sensor detects current tilt angle Current tilt angle is obtained, but obtains the process for being gradually varied to current tilt angle from previous tilt angle, to prevent figure As shake, realizes the smooth movement of image, improve the visual effect of dynamic image.
S40: the offset of static figure layer is determined respectively based on the tilt angle after smoothing processing, according to the offset Amount moves the static figure layer in real time.
It is subjected to displacement the effect for generating dynamic image by static figure layer, the dynamic wall of terminal device can be applied particularly to The application scenarios such as paper.
In one possible implementation, this step can specifically include step S41.
Step S41: using human eye to the near big and far smaller natural law of space object, the same tilt angle is mapped Offset on to each figure layer is adjusted, according to offset adjusted static figure layer mobile in real time.
The dynamic wallpaper realized on the terminal device can be divided into multiple figure layers, and each dynamic layer is each parallel to x, y-axis Determining plane draws the one or more elements for forming entire wallpaper in each figure layer respectively, and dynamic effect can be according to specific Element is different and different, and each figure layer element can move in y-axis plane in screen ranges in x, by each dynamic layer edge Z-axis sequence arranges, and outwardly user, the successively fusion of each dynamic layer obtain final move to z-axis direction normal to screen State effect.
If human eye to the near big and far smaller natural law of space object include: by two objectively the identical material object of size put When in the position with eyes equidistance, eye recognition is identical to the two natural scales.If one of material object is put In another in kind and eyes middle line, the size of eye recognition to the two objects is 2 to 1 relationship.
Fig. 5, which is shown, is mapped to each figure to same tilt angle using the near big and far smaller natural law of the human eye to space object The schematic diagram that offset on layer is adjusted.Elements A and B in Fig. 5 in two figure layers is identical in objectively size, and is in Away from human eye distance be 1 to 2 figure layer when, relationship that elements A and B size are 2 to 1, wherein element size it is smaller the One figure layer is located at apart from the closer position of background, and the second bigger figure layer of element size is located at apart from background remote position, And the offset of the first figure layer can be 2 times of the second figure layer offset.Thereby, it is possible to realize visual three-dimensional sense.
A kind of method handling static figure layer provided by the embodiments of the present application as a result, can be without configuring rotating vector biography Sensor, under the premise of not increasing product cost, using the sensor of terminal device standard configuration, during terminal device is inclined Make multiple static figure layers that the effect that dynamic image is realized in relative displacement occur.
Further, a kind of method handling static figure layer provided by the embodiments of the present application, can realize dynamic image During prevent flating, realize the smooth movement of image, improve the visual effect of dynamic image.
Further, a kind of method handling static figure layer provided by the embodiments of the present application, can be using human eye to space The near big and far smaller natural law of object makes multiple static figure layers that different relative displacements occur, and realizing has space multistory sense Dynamic image.
Fig. 6 shows a kind of the 4th kind of flow diagram of method for handling static figure layer provided by the embodiments of the present application, should Method can be executed by electronic equipment, such as terminal device.In other words, the method can be by being mounted on end of mobile phone etc. The software or hardware of end equipment executes.As shown, this method may comprise steps of.
S10: obtaining the three-dimensional of the terminal device by the direction sensor of terminal device, is set by the terminal Standby acceleration transducer obtains component of the acceleration of gravity on the three-dimensional.
Terminal device can register acceleration transducer, if succeeded in registration, can normally get sensor detection To acceleration of gravity and the component fastened in terminal device three-dimensional coordinate.I.e. when terminal device screen level is placed upward, Component value of the terminal device on Z axis is 9.8006, and the component value in X-axis and Y-axis is 0.
Fig. 3 shows the schematic diagram of terminal device run-off the straight.As shown in connection with fig. 3, the three-dimensional of terminal device include: with The two parallel axis in side intersected on terminal device are respectively the X-axis and Y-axis of three-dimensional, and X-axis and Y-axis determine that one is put down Face, the axis vertical with the plane are Z axis.
The direction of acceleration of gravity is obtained on the three-dimensional by the acceleration transducer of the terminal device Component includes vertically downward direction, i.e., the direction of g in figure, respectively the component in X-axis, Y-axis and Z-direction, i.e., g1 in figure, G2 and g3.
S20: calculating the tilt angle of the terminal device based on the component, and the tilt angle includes the three-dimensional side To the angle with acceleration of gravity direction.
In one possible implementation, using SIN function, the tilt angle of terminal device can be calculated.One In kind possible implementation, can also be calculated using cosine function the three-dimensional of equipment respectively with the folder of acceleration of gravity The tilt angle of angle, this angle and equipment complementary angle each other.
S30: the tilt angle is smoothed.
Direction sensor and acceleration transducer are very sensitive to the shaking of terminal device, lead to meeting in image moving process There is the defect acutely shaken, it is therefore desirable to carry out eliminating the smoothing processing of shake in this step.
In one possible implementation, this step can specifically include step S31-S32.
Step S31: being filtered the tilt angle of terminal device, obtains the discrete inclination numerical value.
Numerous, the intensive data detected are filtered, one group of discrete data are obtained.
Step S32: the discrete inclination numerical value is separately converted to continuous tilt angle by utilization index function Numerical value.
In one possible implementation, it can be calculated based on preceding primary calculated previous tilt angle with this Current tilt angle, utilization index function enables the previous tilt angle be infinitely close to the current tilt angle.
Pass through exponential function infinite tendency as a result, but not equal principle, the value infinite tendency once detected before allowing In currently detected value, discrete value is allowed to become successive value.
Specifically, exponential function may include: y=startValue*a^x+finalValue, wherein startValue For the previous tilt angle, finalValue is the current tilt angle, and a is the truth of a matter of exponential function, and 0 < a < 1, x are certainly Variable.When sensor adjusts back a tilt angle, the tilt angle that the last time detects is assigned to first Tilt angle this time is assigned to finalValue by startValue, and a, which takes, meets defined arbitrary value, representative be from The pace of change of startValue to finalValue, the x as independent variable start from scratch in another thread from increasing.
Pass through exponential function infinite tendency as a result, but not equal principle, the value infinite tendency once detected before allowing In currently detected value, discrete value is allowed to become successive value.It is not at once when sensor detects current tilt angle Current tilt angle is obtained, but obtains the process for being gradually varied to current tilt angle from previous tilt angle, to prevent figure As shake, realizes the smooth movement of image, improve the visual effect of dynamic image.
S40: the offset of static figure layer is determined respectively based on the tilt angle after smoothing processing, according to the offset Amount moves the static figure layer in real time.
It is subjected to displacement the effect for generating dynamic image by static figure layer, the dynamic wall of terminal device can be applied particularly to The application scenarios such as paper.
In one possible implementation, this step can specifically include step S42.
Step S42: using human eye to the near big and far smaller natural law of space object, according to the element in each figure layer In size objectively, it is based on arc length formula, the offset being mapped in each figure layer to the same tilt angle is adjusted, According to offset adjusted static figure layer mobile in real time.
The dynamic wallpaper realized on the terminal device can be divided into multiple static figure layers, each dynamic layer each parallel to x, The plane that y-axis determines draws the one or more elements for forming entire wallpaper in each figure layer respectively, and dynamic effect can be according to tool Element of volume is different and different, and each figure layer element can move in y-axis plane in screen ranges in x, by each dynamic layer It is arranged along z-axis sequence, outwardly user, the successively fusion of each dynamic layer obtain final z-axis direction normal to screen Dynamic effect.
If human eye to the near big and far smaller natural law of space object include: by two objectively the identical material object of size put When in the position with eyes equidistance, eye recognition is identical to the two natural scales.If one of material object is put In another in kind and eyes middle line, the size of eye recognition to the two objects is 2 to 1 relationship.
Fig. 5, which is shown, is mapped to each figure to same tilt angle using the near big and far smaller natural law of the human eye to space object The schematic diagram that offset on layer is adjusted.As shown in figure 5, the near big and far smaller natural law of the human eye to space object is answered For multiple static figure layers of dynamic wallpaper, the elements A and B in Fig. 5 in two figure layers are identical in objectively size, and locate respectively When the figure layer for being 1 to 2 away from human eye distance, relationship that elements A and B size are 2 to 1, wherein element size is smaller First figure layer is located at apart from the closer position of background, and the second bigger figure layer of element size is located at apart from the farther away position of background It sets.
On this basis, each figure can be further considered on the basis of the near big and far smaller natural law of space object Element on layer is in size objectively.It is based on arc length formula again, the same tilt angle is mapped to inclined in each figure layer Shifting amount is adjusted.Wherein, L=α × r, wherein L is arc length, and α is radian, and r is radius.As shown in connection with fig. 5, L1 inclines to be same Rake angle α is mapped to the offset in the first figure layer, and L2 is that same inclination angle alpha is mapped to the offset in the second figure layer.By This, each figure layer is deviated according to respectively different offsets, then merges each figure layer to obtain final entire wallpaper Dynamic effect.The dynamic image with space multistory sense being achieved in has true to nature because being consistent with element actual size ratio Visual effect.Also, in screen locking, load dynamic wallpaper, each layer picture will be moved uniformly user, be unlikely to transition jitter.
A kind of method handling static figure layer provided by the embodiments of the present application as a result, can be without configuring rotating vector biography Sensor realizes the effect of dynamic image using the sensor of terminal device standard configuration under the premise of not increasing product cost.
Further, a kind of method handling static figure layer provided by the embodiments of the present application, can realize dynamic image During prevent flating, realize the smooth movement of image, improve the visual effect of dynamic image.
Further, a kind of method handling static figure layer provided by the embodiments of the present application, can be using human eye to space The near big and far smaller natural law of object, and the objective size based on element make multiple static figure layers that different opposite positions occur It moves, realizes dynamic image that there is space multistory sense and that effect is true to nature.
Fig. 7 shows a kind of the first module diagram of device for handling static figure layer provided by the embodiments of the present application.Such as Shown in figure, a kind of device 1 handling static figure layer provided by the embodiments of the present application includes: to obtain module 10, computing module 20, place Manage module 30 and displacement module 40.
Module 10 is obtained, the three-dimensional of the terminal device is obtained for the direction sensor by terminal device, is led to The acceleration transducer for crossing the terminal device obtains component of the acceleration of gravity on the three-dimensional.
Computing module 20 is connect, for being calculated the inclination angle of the terminal device based on the component with module 10 is obtained Degree, the tilt angle includes the angle of the three-dimensional Yu acceleration of gravity direction.
Processing module 30 is connect with computing module 20, for being smoothed to the tilt angle.
Displacement module 40 is connect with processing module 30, for being determined respectively based on the tilt angle after smoothing processing The offset of static figure layer moves the static figure layer according to the offset in real time.
It is above to obtain module 10, computing module 20, the working method and method above of processing module 30 and displacement module 40 Step in embodiment is same or similar, and details are not described herein.
A kind of device handling static figure layer provided by the embodiments of the present application can be not necessarily to configure rotating vector sensor, Under the premise of not increasing product cost, using the sensor of terminal device standard configuration, static state is made during terminal device is inclined Figure layer is subjected to displacement the effect for realizing dynamic image.
Fig. 8 shows a kind of second of module diagram of device for handling static figure layer provided by the embodiments of the present application.Such as Shown in figure, a kind of device 1 handling static figure layer provided by the embodiments of the present application includes: to obtain module 10, computing module 20, place Manage module 30, displacement module 40 and filtering module 50.
Module 10 is obtained, the three-dimensional of the terminal device is obtained for the direction sensor by terminal device, is led to The acceleration transducer for crossing the terminal device obtains component of the acceleration of gravity on the three-dimensional.
Computing module 20 is connect, for being calculated the inclination angle of the terminal device based on the component with module 10 is obtained Degree, the tilt angle includes the angle of the three-dimensional Yu acceleration of gravity direction.
Processing module 30 is connect with computing module 20, for being smoothed to the tilt angle.
Displacement module 40 is connect with processing module 30, for being determined respectively based on the tilt angle after smoothing processing The offset of static figure layer moves the static figure layer according to the offset in real time.
The discrete inclination numerical value is separately converted to continuously by the processing module 30 for utilization index function Inclination numerical value.In one possible implementation, processing module 30 can be used for based on it is preceding it is primary it is calculated before One tilt angle and this calculated current tilt angle, utilization index function enable the previous tilt angle infinite approach In the current tilt angle.
In one possible implementation, the exponential function includes: y=startValue*a^x+finalValue, Wherein, startValue is the previous tilt angle, and finalValue is the current tilt angle, and 0 < a < 1, x are from change Amount.
In one possible implementation, described device 1 further include: filtering module 50 is connect with processing module 30, is used It is filtered in the tilt angle to the terminal device, obtains the discrete inclination numerical value.
In one possible implementation, displacement module 40 be used for using human eye to space object it is near big and far smaller from So rule, the offset being mapped in each figure layer to the same tilt angle are adjusted.
In one possible implementation, displacement module 40 is used for according to element in each figure layer objectively Size, is based on arc length formula, and the offset being mapped in each figure layer to the same tilt angle is adjusted.
It is above to obtain module 10, computing module 20, processing module 30, the working method of displacement module 40 and filtering module 50 Same or similar with the step in embodiment of the method above, details are not described herein.
A kind of device handling static figure layer provided by the embodiments of the present application as a result, can be without configuring rotating vector biography Sensor realizes the effect of dynamic image using the sensor of terminal device standard configuration under the premise of not increasing product cost.
Further, a kind of device handling static figure layer provided by the embodiments of the present application, can realize dynamic image During prevent flating, realize the smooth movement of image, improve the visual effect of dynamic image.
Further, a kind of device handling static figure layer provided by the embodiments of the present application, can be using human eye to space The near big and far smaller natural law of object, and the objective size based on element make multiple static figure layers that different opposite positions occur It moves, realizes dynamic image that there is space multistory sense and that effect is true to nature.
Fig. 9 shows the hardware knot for executing a kind of electronic equipment of method for handling static figure layer provided by the embodiments of the present application Structure schematic diagram, as shown, the electronic equipment can generate bigger difference because configuration or performance are different, it may include one Or more than one processor 701 and memory 702, it can store one or more storage applications in memory 702 Program or data.Wherein, memory 702 can be of short duration storage or persistent storage.The application program for being stored in memory 702 can To include one or more modules (diagram is not shown), each module may include to a series of meters in the electronic equipment Calculation machine executable instruction.Further, processor 701 can be set to communicate with memory 702, hold on the electronic equipment Series of computation machine executable instruction in line storage 702.The electronic equipment can also include one or more power supplys 703, one or more wired or wireless network interfaces 704, one or more input/output interfaces 705, one or More than one keyboard 706 etc..
In a specific embodiment, which includes memory, processor and is stored on the memory And the computer executable instructions that can be run on the processor, the computer executable instructions are executed by the processor Shi Shixian following below scheme:
The three-dimensional that the terminal device is obtained by the direction sensor of terminal device passes through the terminal device Acceleration transducer obtains component of the acceleration of gravity on the three-dimensional;
Calculate the tilt angle of the terminal device based on the component, the tilt angle include the three-dimensional with The angle in acceleration of gravity direction;
The tilt angle is smoothed;
Determine the offset of static figure layer respectively based on the tilt angle after smoothing processing, it is real according to the offset Static state figure layer described in Shi Yidong.
In one possible implementation, the tilt angle is smoothed and includes:
The discrete inclination numerical value is separately converted to continuous inclination numerical value by utilization index function.
In one possible implementation, the utilization index function turns the discrete inclination numerical value respectively Turning to continuous inclination numerical value includes:
Based on preceding primary calculated previous tilt angle and this calculated current tilt angle, utilization index letter Number, enables the previous tilt angle be infinitely close to the current tilt angle.
In one possible implementation, the exponential function includes:
Y=startValue*a^x+finalValue,
Wherein, startValue be the previous tilt angle, finalValue be the current tilt angle, 0 < a < 1, X is independent variable.
In one possible implementation, the discrete inclination numerical value is distinguished in the utilization index function It is converted into before continuous inclination numerical value, further includes:
The tilt angle of the terminal device is filtered, the discrete inclination numerical value is obtained.
In one possible implementation, the offset packet of image is determined based on the tilt angle after smoothing processing It includes:
Using human eye to the near big and far smaller natural law of space object, each figure layer is mapped to the same tilt angle On offset be adjusted.
In one possible implementation, it is described to the same tilt angle be mapped to the offset in each figure layer into Row adjusts
According to the element in each figure layer in size objectively, it is based on arc length formula, to the same tilt angle The offset being mapped in each figure layer is adjusted.
The electronic equipment for executing a kind of method for handling static figure layer provided by the embodiments of the present application as a result, can be without matching Rotating vector sensor is set, under the premise of not increasing product cost, realizes Dynamic Graph using the sensor of terminal device standard configuration The effect of picture.
Further, the electronic equipment for executing a kind of method for handling static figure layer provided by the embodiments of the present application, can Flating is prevented during realizing dynamic image, the smooth movement of image is realized, improves the visual effect of dynamic image.
Further, the electronic equipment for executing a kind of method for handling static figure layer provided by the embodiments of the present application, can Objective size using human eye to the near big and far smaller natural law of space object, and based on element sends out multiple static figure layers Dynamic image having space multistory sense and that effect is true to nature is realized in raw different relative displacement.
The electronic equipment for executing the embodiment of the present application exists in a variety of forms, including but not limited to following equipment.
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio, Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic devices with data interaction function.
Further, described computer-readable to deposit the embodiment of the present application also provides a kind of computer readable storage medium Storage media is realized for storing computer executable instructions, when the computer executable instructions are executed by processor to flow down Journey:
The three-dimensional that the terminal device is obtained by the direction sensor of terminal device passes through the terminal device Acceleration transducer obtains component of the acceleration of gravity on the three-dimensional;
Calculate the tilt angle of the terminal device based on the component, the tilt angle include the three-dimensional with The angle in acceleration of gravity direction;
The tilt angle is smoothed;
Determine the offset of static figure layer respectively based on the tilt angle after smoothing processing, it is real according to the offset Static state figure layer described in Shi Yidong.
In one possible implementation, the tilt angle is smoothed and includes:
The discrete inclination numerical value is separately converted to continuous inclination numerical value by utilization index function.
In one possible implementation, the utilization index function turns the discrete inclination numerical value respectively Turning to continuous inclination numerical value includes:
Based on preceding primary calculated previous tilt angle and this calculated current tilt angle, utilization index letter Number, enables the previous tilt angle be infinitely close to the current tilt angle.
In one possible implementation, the exponential function includes:
Y=startValue*a^x+finalValue,
Wherein, startValue be the previous tilt angle, finalValue be the current tilt angle, 0 < a < 1, X is independent variable.
In one possible implementation, the discrete inclination numerical value is distinguished in the utilization index function It is converted into before continuous inclination numerical value, further includes:
The tilt angle of the terminal device is filtered, the discrete inclination numerical value is obtained.
In one possible implementation, the offset packet of image is determined based on the tilt angle after smoothing processing It includes:
Using human eye to the near big and far smaller natural law of space object, each figure layer is mapped to the same tilt angle On offset be adjusted.
In one possible implementation, it is described to the same tilt angle be mapped to the offset in each figure layer into Row adjusts
According to the element in each figure layer in size objectively, it is based on arc length formula, to the same tilt angle The offset being mapped in each figure layer is adjusted.
Executing the instruction stored on the computer readable storage medium as a result, can be not necessarily to configure rotating vector sensor, Under the premise of not increasing product cost, the effect of dynamic image is realized using the sensor of terminal device standard configuration.
Further, executing the instruction stored on the computer readable storage medium can be in the process for realizing dynamic image In prevent flating, realize the smooth movement of image, improve the visual effect of dynamic image.
Further, executing the instruction stored on the computer readable storage medium can be using human eye to space object The near big and far smaller natural law, and the objective size based on element make multiple static figure layers that different relative displacements occur, realize Dynamic image with space multistory sense and that effect is true to nature.
Wherein, the computer readable storage medium includes read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), magnetic or disk etc..
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal Replacement, improvement etc., should be included within the scope of the claims of this application.

Claims (14)

1. a kind of method for handling static figure layer characterized by comprising
The three-dimensional that the terminal device is obtained by the direction sensor of terminal device passes through the acceleration of the terminal device It spends sensor and obtains component of the acceleration of gravity on the three-dimensional;
The tilt angle of the terminal device is calculated based on the component, the tilt angle includes the three-dimensional and gravity The angle in acceleration direction;
The tilt angle is smoothed;
The offset for being determined static figure layer respectively based on the tilt angle after smoothing processing, is moved in real time according to the offset Move the static figure layer.
2. the method according to claim 1, wherein being smoothed to the tilt angle and including:
The discrete inclination numerical value is separately converted to continuous inclination numerical value by utilization index function.
3. according to the method described in claim 2, it is characterized in that, the utilization index function is by the discrete tilt angle Numerical value is separately converted to continuous inclination numerical value
Based on preceding primary calculated previous tilt angle and this calculated current tilt angle, utilization index function is enabled The previous tilt angle is infinitely close to the current tilt angle.
4. according to the method described in claim 3, it is characterized in that, the exponential function includes:
Y=startValue*a^x+finalValue,
Wherein, startValue is the previous tilt angle, and finalValue is the current tilt angle, and 0 < a < 1, x are Independent variable.
5. according to the method described in claim 2, it is characterized in that, in the utilization index function by the discrete inclination angle Degree value is separately converted to before continuous inclination numerical value, further includes:
The tilt angle of the terminal device is filtered, the discrete inclination numerical value is obtained.
6. the method according to claim 1, wherein determining image based on the tilt angle after smoothing processing Offset include:
Using human eye to the near big and far smaller natural law of space object, the same tilt angle is mapped in each figure layer Offset is adjusted.
7. according to the method described in claim 6, it is characterized in that, described be mapped in each figure layer the same tilt angle Offset be adjusted and include:
According to the element in each figure layer in size objectively, it is based on arc length formula, the same tilt angle is mapped Offset on to each figure layer is adjusted.
8. a kind of device for handling static figure layer characterized by comprising
Module is obtained, the three-dimensional of the terminal device is obtained for the direction sensor by terminal device, by described The acceleration transducer of terminal device obtains component of the acceleration of gravity on the three-dimensional;
Computing module, for calculating the tilt angle of the terminal device based on the component, the tilt angle includes described The angle of three-dimensional and acceleration of gravity direction;
Processing module, for being smoothed to the tilt angle;
Displacement module, for determining the offset of static figure layer respectively based on the tilt angle after smoothing processing, according to institute It states offset and moves the static figure layer in real time.
9. device according to claim 8, which is characterized in that the processing module will be discrete for utilization index function The inclination numerical value is separately converted to continuous inclination numerical value.
10. device according to claim 9, which is characterized in that the processing module is used for based on preceding primary calculated Previous tilt angle and this calculated current tilt angle, utilization index function enable the previous tilt angle infinitely connect It is bordering on the current tilt angle.
11. device according to claim 10, which is characterized in that the exponential function includes:
Y=startValue*a^x+finalValue,
Wherein, startValue is the previous tilt angle, and finalValue is the current tilt angle, and 0 < a < 1, x are Independent variable.
12. device according to claim 9, which is characterized in that described device further include:
Filtering module is filtered for the tilt angle to the terminal device, obtains the discrete tilt angle Numerical value.
13. device according to claim 8, which is characterized in that the displacement module is used for using human eye to space object The near big and far smaller natural law, the offset being mapped in each figure layer to the same tilt angle is adjusted.
14. device according to claim 13, which is characterized in that the displacement module is used for according in each figure layer Element is based on arc length formula in size objectively, is mapped to the offset in each figure layer to the same tilt angle and carries out Adjustment.
CN201811478217.8A 2018-12-05 2018-12-05 A kind of method and apparatus handling static figure layer Withdrawn CN109598773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811478217.8A CN109598773A (en) 2018-12-05 2018-12-05 A kind of method and apparatus handling static figure layer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811478217.8A CN109598773A (en) 2018-12-05 2018-12-05 A kind of method and apparatus handling static figure layer

Publications (1)

Publication Number Publication Date
CN109598773A true CN109598773A (en) 2019-04-09

Family

ID=65961045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811478217.8A Withdrawn CN109598773A (en) 2018-12-05 2018-12-05 A kind of method and apparatus handling static figure layer

Country Status (1)

Country Link
CN (1) CN109598773A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110196032A (en) * 2019-07-11 2019-09-03 南京普泰德电气科技有限公司 A kind of railway contact line ratchet compensating device a (b) value measurement method and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1799122A (en) * 2003-05-29 2006-07-05 松下电器产业株式会社 Method of measuring focus deviation in pattern exposure and pattern exposure method
CN102236436A (en) * 2010-04-30 2011-11-09 索尼公司 Information processing apparatus and display screen operating method
CN104238907A (en) * 2013-06-20 2014-12-24 华为技术有限公司 Interface display method and device and terminal equipment
CN104932687A (en) * 2009-09-30 2015-09-23 联想(北京)有限公司 Mobile terminal and method for displaying information on mobile terminal
CN105468370A (en) * 2015-11-23 2016-04-06 惠州Tcl移动通信有限公司 Method and system for quickly removing message in notification bar of mobile terminal and mobile terminal
CN106055335A (en) * 2016-06-07 2016-10-26 惠州Tcl移动通信有限公司 Method and system for realizing live wallpaper of mobile terminal
CN106325649A (en) * 2015-06-19 2017-01-11 深圳创锐思科技有限公司 3d dynamic display method and mobile terminal
CN106582016A (en) * 2016-12-05 2017-04-26 湖南简成信息技术有限公司 Augmented reality-based motion game control method and control apparatus
CN107025002A (en) * 2017-01-22 2017-08-08 广东欧珀移动通信有限公司 Terminal applies control method, device and terminal

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1799122A (en) * 2003-05-29 2006-07-05 松下电器产业株式会社 Method of measuring focus deviation in pattern exposure and pattern exposure method
CN104932687A (en) * 2009-09-30 2015-09-23 联想(北京)有限公司 Mobile terminal and method for displaying information on mobile terminal
CN102236436A (en) * 2010-04-30 2011-11-09 索尼公司 Information processing apparatus and display screen operating method
CN104238907A (en) * 2013-06-20 2014-12-24 华为技术有限公司 Interface display method and device and terminal equipment
CN106325649A (en) * 2015-06-19 2017-01-11 深圳创锐思科技有限公司 3d dynamic display method and mobile terminal
CN105468370A (en) * 2015-11-23 2016-04-06 惠州Tcl移动通信有限公司 Method and system for quickly removing message in notification bar of mobile terminal and mobile terminal
CN106055335A (en) * 2016-06-07 2016-10-26 惠州Tcl移动通信有限公司 Method and system for realizing live wallpaper of mobile terminal
CN106582016A (en) * 2016-12-05 2017-04-26 湖南简成信息技术有限公司 Augmented reality-based motion game control method and control apparatus
CN107025002A (en) * 2017-01-22 2017-08-08 广东欧珀移动通信有限公司 Terminal applies control method, device and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
芮杰等: "一种稳健的自适应图像平滑算法", 《中国图象图形学报》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110196032A (en) * 2019-07-11 2019-09-03 南京普泰德电气科技有限公司 A kind of railway contact line ratchet compensating device a (b) value measurement method and system

Similar Documents

Publication Publication Date Title
CN108520552A (en) Image processing method, device, storage medium and electronic equipment
CN110458805A (en) Plane detection method, computing device and circuit system
US20120054690A1 (en) Apparatus and method for displaying three-dimensional (3d) object
CN108021242B (en) Gyroscope data processing method, mobile terminal and computer readable storage medium
CN106161930A (en) Camera control method and device
US10007348B2 (en) Method and system for controlling virtual camera in virtual 3D space and computer-readable recording medium
CN105005441B (en) A kind of display methods and electronic equipment of instant video
CN111489378A (en) Video frame feature extraction method and device, computer equipment and storage medium
CN109191547A (en) element adsorption method, device, equipment and storage medium
CN105718232A (en) Display method and display device of arbitrary angle plane rotation
CN110276774A (en) Drawing practice, device, terminal and the computer readable storage medium of object
CN110413011A (en) A kind of binocular cloud platform control method, device and storage medium
CN110069125B (en) Virtual object control method and device
US20230082928A1 (en) Virtual aiming control
CN106791818B (en) Test the method for camera resolving power and the equipment for the test of camera resolving power
CN116366750B (en) Method for determining included angle of folding screen and related equipment thereof
CN109598773A (en) A kind of method and apparatus handling static figure layer
CN108829595A (en) Test method, device, storage medium and electronic equipment
CN103000161A (en) Image displaying method and device and intelligent handheld terminal
CN104346797A (en) Key pixel point matching method and device, and image matching method and device
CN105786333B (en) The operating method and device of mobile terminal
CN103577051A (en) Method and device for controlling menu
CN104994307B (en) A kind of method for correcting image and device
CN115409928A (en) Water body effect rendering method and device, electronic equipment and storage medium
CN107800863A (en) For carrying out the control method of real-time scene detection by Wireless Telecom Equipment

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20190409

WW01 Invention patent application withdrawn after publication