Method and device for displaying wallpaper image on screen

A method for displaying an image on a terminal, includes: acquiring current posture information of the terminal; selecting, according to the current posture information, a target area in a preset image as a wallpaper image of the terminal; and displaying the wallpaper image on a screen of the terminal.

TECHNICAL FIELD

The present disclosure relates to the field of terminal technology and, more particularly, to a method and a device for displaying a wallpaper image on a terminal.

BACKGROUND

With the development of terminal technology, the function of displaying wallpaper images on a terminal may significantly affect users' experience. The development of the function of displaying wallpaper images has attracted more attention.

Conventional functions of displaying wallpaper images generally introduce a variable of time into static wallpaper images. By setting a relationship between time periods and corresponding wallpaper images to be displayed in advance, the terminal can display a corresponding wallpaper image in a specific time period, so that the displayed wallpaper images change with time.

SUMMARY

According to a first aspect of the present disclosure, there is provided a method for displaying an image on a terminal, comprising: acquiring current posture information of the terminal; selecting, according to the current posture information, a target area in a preset image as a wallpaper image of the terminal; and displaying the wallpaper image on a screen of the terminal.

According to a second aspect of the present disclosure, there is provided a terminal, comprising: a processor; a screen coupled to the processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: acquire current posture information of the terminal; select, according to the current posture information, a target area in a preset image as a wallpaper image of the terminal; and display the wallpaper image on the screen of the terminal.

According to a third aspect of the present disclosure, there is provided a non-transitory readable storage medium having stored therein instructions that, when executed by a processor of a terminal, cause the terminal to perform a method for displaying an image, the method comprising: acquiring current posture information of the terminal; selecting, according to the current posture information, a target area in a preset image as a wallpaper image of the terminal; and displaying the wallpaper image on a screen of the terminal.

DETAILED DESCRIPTION

FIG. 1is a flowchart of a method100for displaying an image on a terminal, according to an exemplary embodiment. Referring toFIG. 1, the method100includes the following steps.

In step101, the terminal acquires current posture information of the terminal.

In step102, the terminal selects a target area of a preset image as a wallpaper image of the terminal according to the posture information.

In step103, the terminal displays the wallpaper image on a screen of the terminal

In exemplary embodiments, a curl processing is performed on the preset image based on a curl algorithm, such as one known in the art, so as to obtain a processed image.

In exemplary embodiments, a resolution of the preset image is greater than or equal to a preset resolution. The preset image may be a built-in system image of the terminal, a picture taken by a user, or an image obtained by the user from a third party such as a network. The curl processing is performed on the preset image that meets the preset resolution requirement based on the curl algorithm, so as to obtain the processed image, e.g., a spherical image corresponding to the preset image. A target area in the spherical image, selected according to the user's posture information, is consecutive in any direction.

In exemplary embodiments, if the resolution of the preset image does not meet the preset resolution requirement for obtaining the spherical image in the curl algorithm, a complete spherical image may not be obtained after the curl processing. Therefore, before the curl processing, it is determined whether the resolution of the preset image meets the preset resolution requirement for obtaining the spherical image in the curl algorithm. If the preset resolution requirement is met, the curl algorithm is performed, otherwise, parameters in the curl algorithm can be changed, and then the curl algorithm is performed so as to obtain, e.g., a cylindrical image as the processed image. In one exemplary embodiment, a target area in the cylindrical image selected according to the user's posture information can move only in a horizontal direction but not in a vertical direction.

In exemplary embodiments, when the curl processing is performed on the preset image by the curl algorithm, the preset image is curled onto a sphere in accordance with a specific curvature. A center point of the sphere can be denoted by an origin in a three-dimensional coordinate system, denoted by O, a radius of the sphere can be denoted by R, and the sphere can be denoted by φ(O). In the embodiments, the three-dimensional coordinate system aligns with a coordinate system of a sensor in the terminal.

In exemplary embodiments, a length of a distance between a center point of a virtual screen area of the terminal and the origin of the three-dimensional coordinate system is set according to a value of the radius R, wherein the center point of the virtual screen area of the terminal is denoted by E. The origin O is set as a center point of a sphere where the point E locates, denoted by ψ(O), and a radius of the sphere is denoted by r. In the embodiments, the value of R may be set according to a relationship between the resolution of the preset image and the radius, and the value of r is set manually or by default by the system for meeting an optimal display effect of the wallpaper image. The ratio of R/r may have a proportional relationship, and R>r, which may be understood as that the virtual screen area of the terminal is within the spherical image corresponding to the preset image, i.e., the processed image. In one exemplary embodiment, R/r=1.618, which is the golden ratio.

Because the preset image is a plane image before the curl processing, a coordinate of each pixel in the preset image is a two-dimensional orthogonal coordinate within a two-dimensional coordinate system. The spherical or cylindrical image obtained after the curl processing, i.e., the processed image, is a three-dimensional image. Thus, the coordinate of each pixel in the spherical or cylindrical image is a three-dimensional orthogonal coordinate within a three-dimensional coordinate system. In the curl processing, a corresponding relationship between the two-dimensional orthogonal coordinate of each pixel in the preset image before the curl processing and the three-dimensional orthogonal coordinate of each pixel in the processed image after the curl processing can be recorded.

In exemplary embodiments, the terminal renders the spherical image and presents the rendered image to the user. The terminal can adjust a render effect of the spherical image by, e.g., prettification and blurring, so as to reduce a stiff effect caused by connecting original boundaries of the preset image.

The method100increases interactivity between the user and the terminal when the user uses the wallpaper function.

FIG. 2is a flowchart of a method200for displaying an image on a terminal, according to an exemplary embodiment. Referring toFIG. 2, the method200includes the following steps.

In step201, the terminal acquires current posture information of the terminal.

In exemplary embodiments, a trigger condition of step201may be that, when a screen of the terminal is lighted, step201is performed periodically at a preset time interval.

For example, after the screen of the terminal is lighted, e.g., when the terminal enters a normal use state from an unlock state, step201is performed periodically. Therefore, the terminal can update the selected target area in the preset image continuously according to the posture information acquired by a sensor in the terminal.

In exemplary embodiments, the current posture information of the terminal is acquired by the sensor built in the terminal, and the sensor may include, but is not limited to, a gravity sensor, a gyroscope sensor, etc.

In exemplary embodiments, the posture information includes Euler angle information of the terminal in the three-dimensional coordinate system corresponding to the terminal. Euler angles are three types of angles of the terminal in the three-dimensional coordinate system, including, e.g., a left and right tilt angle, a back and forth tilt angle, and a left and right swing angle, denoted by (α, β, γ), respectively.

In exemplary embodiments, the terminal selects a target area in a preset image as a current wallpaper image of the terminal according to the posture information. The selecting of the target area may be implemented by the following steps.

In step2021, according to the posture information and a radius of a sphere where a center point of a virtual screen area of the terminal locates, the terminal determines the virtual screen area in the three-dimensional coordinate system corresponding to the terminal.

In exemplary embodiments, the terminal first determines a coordinate of the center point of the virtual screen area of the terminal according to the posture information, so as to determine a location of the virtual screen area in the three-dimensional coordinate system according to the coordinate.

For example, according to (α, β, γ) in the posture information and r, the radius of the sphere where the virtual screen area of the terminal locates, a spherical coordinate of the point E. the center point of the virtual screen area, in the three-dimensional coordinate system may be obtained. Because the point E is located on the sphere ψ (O), and a line between the origin O the sphere ψ (O) and the point E is perpendicular to the virtual screen area of the terminal, and also because in the posture information of the terminal, the point E is not affected by the right and left swing angle γ, a location coordinate of the point E is denoted by (α′, β′, r), wherein α′=α+π/2, β′=β−π/2. Thus, the location coordinate of the point E is (α+π/2, β−π/2, r). A posture of the virtual screen area of the terminal can be represented by the location of the point E and the right and left swing angle γ of the terminal, that is (α′, β′, r, γ).

Assuming that a length and a width of the virtual screen area of the terminal are a and b, respectively, a spherical coordinate of the virtual screen area of the terminal may be determined according to the spherical coordinate of the point E, denoted by (α′, β′, r, γ, a, b).FIG. 3is a schematic diagram of selecting a target area in a processed image, i.e., the preset image after the curl processing, in the three-dimensional coordinate system of the terminal, according to an exemplary embodiment. InFIG. 3, a plane area ABCD represents the virtual screen area of the terminal.

Referring toFIGS. 2 and 3, in step2022, the terminal projects the virtual screen area of the terminal to the processed image, based on the origin of the three-dimensional coordinate system corresponding to the terminal. The target area projected from the virtual screen area of the terminal in the processed image is determined.

In the embodiments, since R>r, the target area projected from the virtual screen area of the terminal has an area larger than that of the virtual screen area of the terminal. As shown inFIG. 3, an area A′B′C′D′ represents the projected target area, E′ is the center point of the area A′B′C′D′, and OE′=R.

In exemplary embodiments, based on the principle of similarity, the spherical coordinate of the target area A′B′C′D′ may be obtained by the following equation:
(α′, β′,r, γ, a, b)*R/r=(α′, β′,R, γ, a*R/r, b*R/r)  equation (1),
wherein the spherical coordinate of the point E′ is denoted by (α′, β′, R).

In other words, in step2022, the target area in the processed image is determined according to a ratio between the radius of the sphere where the center point of the virtual screen area locates and the radius of the sphere where the processed image locates, and a spherical coordinate of the virtual screen area of the terminal.

In step2023, according to the target area in the processed image, the terminal determines a target area in the original preset image before the curl processing, and the target area in the original preset image is selected as the wallpaper image of the terminal. In one exemplary embodiment, step2023can be implemented by the following steps.

In a first step, according to a spherical coordinate of the target area in the processed image, the terminal calculates a three-dimensional orthogonal coordinate of each vertex of the target area in the processed image.

For example, a transform relationship between the spherical coordinate and the three-dimensional orthogonal coordinate can be expressed as follows:
x=r*cos α*cos β  equation (2);
y=r*sin α*cos β  equation (3);
and
z=r*sin β  equation (4).

The spherical coordinate of the point E′ is transformed into the three-dimensional orthogonal coordinate: (R*cos α′*cos β′, R*sin α′*cos β′, R*sin β′), which can be denoted by (x, y, z).

Assuming that the three-dimensional orthogonal coordinate of the point A′ is (x′, y′, z′), the values of x′, y′, z′ can be determined according to the following equations:
(x′−x)*x+(y′−y)*y+(z′−z)*z=0  equation (5);
and
y′2+z′2=x2+y2+z2+(a2+b2)  equation (6).

Similarly, three-dimensional orthogonal coordinates of B′, C′, and D′ may he obtained based on equations (5) and (6).

In a second step, according to a corresponding relationship between two-dimensional orthogonal coordinates of pixels in the original preset image amid three-dimensional orthogonal coordinates of pixels in the processed image, the terminal determines the two-dimensional orthogonal coordinate of each vertex of the target area in the original preset image based on the three-dimensional orthogonal coordinate of a corresponding vertex of the target area in the processed image.

In a third step, according to the two-dimensional orthogonal coordinate of each vertex of the target area in the original preset image, the terminal determines the target area in the original preset image, and selects the determined target area as the wallpaper image of the terminal.

In step203, the terminal displays the wallpaper image on a screen of the terminal. For example, the wallpaper image is displayed on the screen of the terminal by using a wallpaper displaying function.

The method200improves interactivity between the user and the terminal when the user uses the wallpaper displaying function.

FIG. 4is a block diagram of a device400for displaying an image, according to an exemplary embodiment. Referring toFIG. 4, the device400includes an acquiring module401configured to acquire current posture information of a terminal; a selecting module402configured to select, according to the current posture information, a target area in a preset image as a wallpaper image of the terminal; and a displaying module403configured to display the wallpaper image on a screen of the terminal.

In exemplary embodiments, the selecting module402includes a first determining unit4021, a second determining unit4022, and a selecting unit4023. The first determining unit4021is configured to determine a virtual screen area of the terminal in a three-dimensional coordinate system corresponding to the terminal, according to the posture information and a radius of a sphere where a center point of the virtual screen area of the terminal locates. The second determining unit4022is configured to project the virtual screen area of the terminal to a processed image, i.e., the preset image after the curl processing, based on an origin of the three-dimensional coordinate system, and determine a target area in the processed image. The selecting unit4023is configured to determine a target area in the original preset image according to the target area in the processed image, and select the target area in the original preset image as the wallpaper image of the terminal.

In exemplary embodiments, the second determining unit4022is configured to determine the target area in the processed image, according to a ratio between the radius of the sphere where the center point of the virtual screen area of the terminal locates and a radius of a sphere where the processed image locates, and a spherical coordinate of the virtual screen area of the terminal.

In exemplary embodiments, the selecting unit4023includes a calculating sub-unit configured to calculate a three-dimensional orthogonal coordinate of each vertex of the target area in the processed image, according to a spherical coordinate of the target area in the processed image, a determining sub-unit configured to determine a two-dimensional orthogonal coordinate of each vertex of the target area in the original preset image based on the three-dimensional orthogonal coordinate of a corresponding vertex of the target area in the processed image, in accordance with a relationship between two-dimensional orthogonal coordinates in the original preset image and three-dimensional orthogonal coordinates of pixels in the processed image, and a selecting sub-unit configured to determine the target area in the original preset image according to the two-dimensional orthogonal coordinate of each vertex of the target area in the original preset image, and select the target area in the original preset image as the wallpaper image of the terminal.

In exemplary embodiments, the acquiring module401is configured to, when the screen of the terminal is lighted, acquire the current posture information of the terminal periodically at a preset time interval.

The device400can improve interactivity between the user and the terminal when the user uses a wallpaper displaying function of the terminal.

FIG. 5is a block diagram of a terminal500, according to an exemplary embodiment. For example, the terminal500may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, medical equipment, fitness equipment, a personal digital assistant, etc.

Referring toFIG. 5, the terminal500may include one or more of the following components: a processing component502, a memory504, a power component506, a multimedia component508, an audio component510, an input/output (I/O)) interface512, a sensor component514, and a communication component516.

The processing component502typically controls overall operations of the terminal500, such as operations associated with display, telephone calls, data communications, camera operations and recording operations. The processing component502may include one or more processors520to execute instructions to perform all or part of the steps in the above described methods. Moreover, the processing component502may include one or more modules which facilitate the interaction between the processing component502and other components. For instance, the processing component502may include a multimedia module to facilitate the interaction between the multimedia component508and the processing component502.

The power component506provides power to various components of the terminal500. The power component506may include a power management system, one or more power sources, and any other components associated with the generation, management, and distribution of power for the terminal500.

The audio component510is configured to output and/or input audio signals. For example, the audio component510includes a microphone (“MIC”) configured to receive an external audio signal when the terminal500is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may be further stored in the memory504or transmitted via the communication component516. In some embodiments, the audio component510further includes a speaker to output audio signals.

The sensor component514includes one or more sensors to provide status assessments of various aspects of the terminal500. For instance, the sensor component514may detect an open/closed status of the terminal500, relative positioning of components (e.g., the display and the keypad of the terminal500), a change in position of the terminal500or a component of the terminal500, a presence or absence of user contact with the terminal500, an orientation or an acceleration/deceleration of the terminal500, and a change in temperature of the terminal500. The sensor component514may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component514may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component514may also include an accelerometer sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

One of ordinary skill in the art will understand that the above described modules/units can each be implemented by hardware, or software, a combination of hardware and software. One of ordinary skill in the art will also understand that multiple ones of the above described modules/units may be combined as one module/unit, and each of the above described modules/units may be further divided into a plurality of sub-modules/sub-units.