Wallpaper setting method and electronic equipment

By enlarging and cropping the pictures selected by the user, and using the cropped image objects to block part of the control, the display of depth of field wallpaper is realized, solving the problem that the existing technology cannot set depth of field wallpaper and meeting the personalized needs of users.

CN119440680APending Publication Date: 2025-02-14HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310963433.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art is difficult to set photos taken or downloaded by users as depth of field wallpapers, which cannot meet users' personalized needs.

Method used

By receiving user operations, enlarge and cropping the images selected by the user, and use the cropped image objects to block part of the control to achieve the display of depth of field effect.

Benefits of technology

It realizes setting the photos taken or downloaded by users as depth of field wallpaper, meeting users' personalized needs, and achieving better display effects through pre-cropped areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440680A_ABST
    Figure CN119440680A_ABST
Patent Text Reader

Abstract

The invention provides a wallpaper setting method and electronic equipment, and relates to the technical field of terminals. The method comprises the following steps: in response to a first operation of setting a first picture as wallpaper by a user, amplifying the first picture to obtain at least one second picture, determining at least one first clipping region according to the at least one second picture, then determining a second clipping region from the at least one first clipping region, the second picture corresponding to the second clipping area is clipped according to the second clipping area to obtain a third picture, the first interface is displayed, and an object of the third picture on the first interface shields part of the area of the first control. Therefore, the device can amplify the first picture selected by the user to obtain the second picture, cut the second picture to obtain the third picture, and utilize the object of the third picture to shield the partial area of the first control to create the depth-of-field effect, so that the personalized demand of the user on the depth-of-field wallpaper is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method for setting wallpaper and an electronic device. Background Art

[0002] The lock screen image is an image displayed in the lock screen interface. For example, when the electronic device is set with a lock screen password, the lock screen image is displayed in the lock screen interface when the electronic device turns off the screen and then turns on the screen again. With the rapid development of terminal technology, the display methods of the lock screen images of electronic devices are becoming more and more diverse, for example, including but not limited to static lock screen images, dynamic lock screen images, magazine lock screen images, etc. Summary of the invention

[0003] The embodiments of the present application provide a method for setting wallpaper and an electronic device, which can set a photo taken or downloaded by a user as a depth of field wallpaper to meet the user's personalized needs.

[0004] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, the present application provides a method for setting wallpaper, which is applied to an electronic device including a display screen, and the method includes: receiving a first operation of a user to set a first picture as wallpaper, wherein the foreground of the first picture includes one or more objects; in response to the first operation, enlarging the first picture according to at least one adjustment coefficient to obtain at least one second picture, wherein the at least one second picture corresponds to the at least one adjustment coefficient one-to-one; determining at least one first cropping area according to the at least one second picture; wherein the at least one second picture corresponds to the at least one first cropping area one-to-one; determining a second cropping area from at least one first cropping area; cropping the second picture corresponding to the second cropping area according to the second cropping area to obtain a third picture; displaying a first interface; wherein the first interface includes a third picture and a first control, and the object of the third picture blocks a part of the first control. Through the above steps, the device can enlarge the first picture selected by the user to obtain the second picture, and crop the third picture from the second picture to obtain the third picture, and use the object of the third picture to block a part of the first control to create a depth of field effect. Thus, the present application can set the photos taken or downloaded by the user as depth of field wallpaper to meet the personalized needs of the user. At the same time, since the pre-cropped area (ie, the first cropped area) is screened to obtain the second cropped area, a better display effect can be achieved.

[0006] In one implementation of the first aspect, determining at least one first cropping area based on at least one second image includes: determining first parameter information of at least one second image; wherein the first parameter information of each second image includes the size of the second image, the position information of the highest point of an object in the second image, and the position information of the center of the object in the second image, the highest point of the object is the highest point among the candidate highest points in the first image, the candidate highest point is the highest point of the target object among one or more objects, and the object center is used to reflect the center of the one or more objects in the horizontal direction; determining at least one first cropping area based on the at least one first parameter information and the second parameter information; wherein the at least one first parameter information corresponds one-to-one to the at least one first cropping area, and the second parameter information includes the cropping size, and the position information of the first control.

[0007] In one implementation of the first aspect, the size of the first cropping area is the same as the cropping size, the ratio of the cropping size is the same as the ratio of the display screen, the highest point of the object and the first control are located within the first cropping area, and the distance from the highest point of the object to the first side of the first cropping area satisfies the first condition, and the distance from the highest point of the object to the second side of the first cropping area satisfies the second condition, so that when the second picture cropped according to the first cropping area is displayed, the object included in the second picture obstructs part of the first control. That is, when the highest point of the object satisfies the first condition and the second condition, the object included in the second picture can obstruct part of the first control when the electronic device displays the second picture, so as to create a depth of field effect.

[0008] In an implementation of the first aspect, the first side is the upper boundary of the first cropping area, and the first condition includes: the distance from the highest point of the object to the first side of the first cropping area is less than the distance from the lower boundary of the first control to the first side of the first cropping area; or, the first side is the lower boundary of the first cropping area, and the first condition includes: the distance from the highest point of the object to the first side of the first cropping area is greater than the distance from the lower boundary of the first control to the first side of the first cropping area. In this way, it can be ensured that the highest point of the object is located above the lower boundary of the first control.

[0009] The second side is the left boundary of the first cropping area or the right boundary of the first cropping area, and the second condition includes: the distance from the highest point of the object to the second side of the first cropping area is the same as the distance from the center line of the first control to the second side of the first cropping area. In this way, the center line of the first cropping area can coincide with the center line of the first control.

[0010] It should be noted that the two situations of the first side and the two situations of the second side mentioned above can be arbitrarily combined, for example, the first side is the upper boundary of the first cropping area, and the second side is the left boundary of the first cropping area; or, the first side is the upper boundary of the first cropping area, and the second side is the right boundary of the first cropping area; or, the first side is the lower boundary of the first cropping area, and the second side is the left boundary of the first cropping area; or, the first side is the lower boundary of the first cropping area, and the second side is the right boundary of the first cropping area.

[0011] In an implementation of the first aspect, the first side is the upper boundary of the first cropping area, and the first condition further includes: the distance from the highest point of the object to the first side of the first cropping area is greater than the distance from the upper boundary of the first control to the first side of the first cropping area; or, the first side is the lower boundary of the first cropping area, and the first condition further includes: the distance from the highest point of the object to the first side of the first cropping area is less than the distance from the upper boundary of the first control to the first side of the first cropping area. In this way, it can be ensured that the highest point of the object is within the range where the first control is located, that is, the highest point of the object is located between the upper boundary and the lower boundary of the first control.

[0012] In an implementation of the first aspect, the first cropping area satisfies a first preset condition, and the first preset condition includes: the first cropping area does not exceed the area where the first image is located, and the area ratio of the object in the first cropping area is within a first preset range. Wherein, when the first cropping area satisfies the first preset condition, a better display effect can be achieved when displayed with a depth of field effect.

[0013] In one implementation of the first aspect, the distance from the highest point of the object to the lower border of the first control accounts for 50% of the distance from the lower border of the first control to the upper border of the first control.

[0014] In an implementation of the first aspect, determining the second cropping area from at least one first cropping area includes: determining the first cropping area that satisfies the largest number of conditions in the second preset condition among the at least one first cropping area as the second cropping area. That is, the more first cropping areas that satisfy the largest number of conditions in the second preset condition, the better the display effect of the picture obtained by cropping the first cropping areas.

[0015] In one implementation of the first aspect, determining the second cropping area from at least one first cropping area also includes: if there are multiple first cropping areas that satisfy the largest number of conditions in the second preset condition in the at least one first cropping area, the first cropping area with the largest adjustment coefficient corresponding to the multiple first cropping areas that satisfy the largest number of conditions in the second preset condition is determined as the second cropping area.

[0016] In an implementation of the first aspect, the second preset condition includes: Condition 1: all objects included in the first picture are within the second cropping area; Condition 2: when the first picture includes an object, the object is not truncated.

[0017] In an implementation of the first aspect, the method further includes: determining third parameter information of the first image; wherein the third parameter information includes the size of the first image, the position information of the highest point of the object in the first image, and the position information of the center of the object in the first image; determining a third cropping area according to the third parameter information and the second parameter information; performing an enlargement operation on the first image according to at least one adjustment coefficient to obtain at least one second image, including: if the object area ratio of the third cropping area is less than a threshold, performing an enlargement operation on the first image according to at least one adjustment coefficient to obtain at least one second image. In this way, unnecessary calculations can be reduced and CPU resources of the device can be saved.

[0018] In an implementation of the first aspect, the target objects are all objects included in the first picture.

[0019] In one implementation of the first aspect, the target objects are all objects within a first range of the first image, the first range includes a first boundary and a second boundary, the first boundary is a boundary obtained by moving the center of the object in a first horizontal direction by a first distance, and the second boundary is a boundary obtained by moving the center of the object in a second horizontal direction by a second distance.

[0020] In an implementation of the first aspect, the first image includes an object, and the first distance and the second distance are half of the width of the object; or, the first image includes multiple objects, and the first distance and the second distance are half of the width of the first control.

[0021] In one implementation of the first aspect, obtaining the position information of the highest point of an object in the second image includes: cutting out the first image to obtain a fourth image; wherein the fourth image includes first-category pixels, and the first-category pixels are pixels belonging to the foreground in the first image; determining the position information of a target pixel in the fourth image; wherein the target pixel is the highest point among all first-category pixels in the fourth image, or the target pixel is the highest point among all first-category pixels within a first range of the fourth image; and using the position information of the target pixel as the position information of the highest point of the object.

[0022] In one implementation of the first aspect, the object center is the axis of symmetry between the third boundary perpendicular to the first direction and the fourth boundary perpendicular to the first direction, the position information of the object center is the coordinate of the axis of symmetry in the first direction, and the third boundary and the fourth boundary are two boundaries of one or more objects in the first direction.

[0023] In an embodiment of the first aspect, the first control is a time indicator.

[0024] In a second aspect, the present application provides an electronic device, the electronic device comprising: a memory, a processor and a display screen;

[0025] The processor is coupled to a memory and a display screen; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes a method as in any one of the embodiments of the first aspect.

[0026] In a third aspect, the present application provides a computer-readable storage medium, comprising computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes a method as in any one of the embodiments of the first aspect.

[0027] In a fourth aspect, the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device executes a method as described in any one of the embodiments of the first aspect.

[0028] Among them, the technical effects brought about by any implementation method in the second to fourth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1A This is a schematic diagram of the lock screen interface using a depth of field wallpaper;

[0030] Figure 1B This is a schematic diagram of the lock screen interface using a non-depth of field wallpaper;

[0031] Figure 2 A schematic diagram showing a notification bar on the lock screen interface;

[0032] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of software levels of an electronic device provided in an embodiment of the present application;

[0034] Figure 5 A set of interface schematic diagrams provided for embodiments of the present application;

[0035] Figure 6 A schematic diagram of an interface provided in an embodiment of the present application;

[0036] Figure 7A-7B A set of interface schematic diagrams provided for embodiments of the present application;

[0037] Figure 8A-BA set of interface schematic diagrams provided for embodiments of the present application;

[0038] Fig.9A A schematic diagram of a folding screen mobile phone provided in an embodiment of the present application;

[0039] Fig. 9B A schematic diagram of an interface provided in an embodiment of the present application;

[0040] Fig. 9C A schematic diagram of an interface provided in an embodiment of the present application;

[0041] Fig.10 A flowchart of a method for setting wallpaper provided in an embodiment of the present application;

[0042] Fig.11 A schematic diagram of the location information of a human face provided in an embodiment of the present application;

[0043] Fig.12 A schematic diagram of character distribution provided in an embodiment of the present application;

[0044] Fig.13 A distribution diagram of a first range provided in an embodiment of the present application;

[0045] Fig.14 A diagram of parameter information provided in an embodiment of the present application;

[0046] Fig.15 A schematic diagram of a first cropping area provided in an embodiment of the present application;

[0047] Fig.16 A schematic diagram of a method for setting wallpaper provided in an embodiment of the present application;

[0048] Fig.17 A flowchart of another method for setting wallpaper provided in an embodiment of the present application;

[0049] Fig.18 A schematic diagram of a process for determining a second cropping area provided in an embodiment of the present application;

[0050] Fig.19 A comparison diagram of the cropping area provided in the embodiment of the present application;

[0051] Fig. 20 A flowchart of another method for setting wallpaper provided in an embodiment of the present application;

[0052] Fig.21 A schematic diagram of a cutout process provided in an embodiment of the present application;

[0053] Fig. 22 A flowchart of another method for setting wallpaper provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in a "or" relationship.

[0055] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0056] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0057] To facilitate understanding of the present solution, the following is a brief description of the relevant concepts involved in the embodiments of the present application.

[0058] The lock screen interface refers to the interface displayed when the device is in lock screen state.

[0059] Lock screen wallpaper refers to the picture used as the background on the lock screen interface. Lock screen wallpaper can be static or dynamic.

[0060] The depth of field effect is a 3D visual layering effect that can highlight the main subject of the wallpaper. The main subject can be called the foreground of the wallpaper, such as people, mountains, flowers, animals, etc. In the embodiment of the present application, when the lock screen wallpaper is displayed with the depth of field effect, part of the control (such as the clock control) on the lock screen interface is blocked by the foreground.

[0061] Depth of field wallpaper refers to wallpaper that displays with depth of field effect. Depth of field wallpaper can include foreground and background, and the background includes the foreground content.

[0062] Non-depth of field wallpaper refers to wallpaper that is not displayed with depth of field effect.

[0063] For example, see Figure 1A , is a schematic diagram of the lock screen interface using a depth of field wallpaper. Figure 1A As shown in (a) of FIG. 1 , the lock screen interface 101 includes a lock screen wallpaper 102 and a clock widget 103. The lock screen wallpaper 102 includes a background 102a and a foreground 102b. Figure 1A As shown in (b) of FIG. 1 , the lock screen interface 101 includes at least three layers, namely, the layer where the background 102a is located, the layer where the clock control 103 is located, and the layer where the foreground 102b is located. Among them, the layer where the clock control 103 is located is located above the layer where the background 102a is located, and the layer where the foreground 102b is located is located above the layer where the clock control 103 is located. When the above three layers overlap, as shown in FIG. Figure 1A As shown in (a) in FIG. 1 , part of the clock widget 103 is blocked by the foreground 102b. Figure 1A As shown in (b) in FIG. 1 , the background 102 a includes all the contents on the lock screen wallpaper 102 , and the foreground 102 b only includes the main objects on the lock screen wallpaper 102 , namely, the characters on the lock screen wallpaper 102 .

[0064] It should be noted that Figure 1A The dotted lines in the figure are only used to mark the area and do not really exist. For example, the clock control 103 is a view control and does not include the dotted lines around it. In addition, the clock control can also be called a time indicator or other names.

[0065] See also Figure 1B , is a schematic diagram of the lock screen interface using a non-depth of field wallpaper. Figure 1B As shown in (a) of FIG. 1 , the lock screen interface 104 includes a lock screen wallpaper 105 and a clock control 106. Figure 1BAs shown in (b) of FIG. 1 , the lock screen interface 104 includes at least two layers, namely, a layer where the lock screen wallpaper 105 is located, and a layer where the clock control 106 is located. Among them, the layer where the clock control 106 is located is located above the layer where the lock screen wallpaper 105 is located. When the above two layers overlap, the lock screen wallpaper 105 is partially blocked by the clock control 106, and the clock control 106 can be fully displayed.

[0066] Optionally, in other implementations, the lock screen interface 104 may also be as follows Figure 1A The lock screen interface 101 shown in (b) is similar and also includes at least three layers. The difference is that in Figure 1B In the embodiment, the layer where the clock control 106 is located is located above the layer where the foreground of the lock screen wallpaper 105 is located and the layer where the background is located.

[0067] contrast Figure 1A , Figure 1B It can be seen that the depth of field wallpaper sets the foreground and background, and embeds the controls on the lock screen interface (such as the clock control 106) between the background (such as the background 102a) and the foreground (such as the foreground 102b) of the lock screen wallpaper, so that the foreground can be presented to the user in the form of a 3D effect, making the visual effect of the foreground more three-dimensional, which can bring a good visual experience to the user.

[0068] If the device receives a notification while in the locked screen state, the notification can be displayed on the lock screen interface. Figure 2 , is a schematic diagram of the lock screen interface when the device receives a notification. Figure 2 As shown in (a) of FIG. 1 , the lock screen interface 101 also includes a notification bar 201. Figure 2 As shown in (b) in FIG. 1 , the layer where the notification bar 201 is located is above the layer where the foreground 102b is located.

[0069] It should be noted that Figure 2 The notification shown is for illustration only, and the lock screen interface 101 may also display detailed information of the notification. Alternatively, the notification may be a notification of other applications such as a social application, a game application, etc., and no specific limitation is made here.

[0070] In the related art, only the wallpapers with foreground and background pre-set by the developer can support the depth of field effect. The photos taken by the user or the pictures downloaded do not support the depth of field effect, and cannot meet the personalized needs of the user.

[0071] In view of this, an embodiment of the present application provides a method for setting wallpaper, which can set photos taken by the user or pictures downloaded by the user as depth of field wallpaper to meet the user's personalized needs.

[0072] It should be noted that the method for setting wallpaper provided in the embodiment of the present application can be applied to electronic devices. The electronic device can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device, etc. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.

[0073] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3 As shown, the electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0074] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0075] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0076] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In an embodiment of the present application, the processor 110 may determine a cropping area of ​​a picture, and perform operations such as cropping the picture according to the determined cropping area.

[0077] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0078] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0079] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0080] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.

[0081] Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. In an embodiment of the present application, the internal memory 121 may also store picture data, parameters required for use by the processor 110 in determining the cropping area, and parameters of the cropping area determined by the processor 110, etc.

[0082] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.

[0083] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0084] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc. In some embodiments, the antenna 1 of the electronic device is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.

[0085] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0086] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.

[0087] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.

[0088] The wireless communication module 160 can provide wireless communication solutions for electronic devices including WLAN (such as wireless fidelity, Wi-Fi) network, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), nearfield communication technology (NFC), infrared technology (IR), etc.

[0089] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 2.

[0090] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0091] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In the embodiment of the present application, the display screen 194 can be used to display a lock screen interface, a lock screen preview interface, etc. Optionally, the display screen 194 can be a touch screen, and the touch screen can receive an operation of setting a wallpaper by a user and display the above-mentioned lock screen preview interface.

[0092] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor. ISP is used to process the data fed back by camera 193. Camera 193 is used to capture static images or videos. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0093] The electronic device can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and an application processor. For example, music playback, recording, etc. The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, or for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.

[0094] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.

[0095] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0096] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Figure 4 The layered architecture shown is used to exemplify the software structure of the electronic device.

[0097] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through interfaces. In some embodiments, the terminal device may include an application layer, an application framework layer, and a kernel layer. It should be noted that Figure 4 The layered architecture shown is for illustrative purposes only and may vary from one operating system to another (e.g. Android TM system, IOS system, etc.), as long as the functions implemented by each functional module are similar to the embodiments of the present application, the solution of the present application can also be implemented.

[0098] The application layer can include a series of applications. Figure 4 As shown, the application layer may include applications such as gallery, etc. The gallery application allows users to view and manage pictures taken or downloaded by users, and provides an entry to set pictures as lock screen wallpapers.

[0099] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The API may include an object detection interface (also referred to as a first interface), a clipping interface (a second interface), and the like.

[0100] The application framework layer also includes some predefined functions, such as an object detection module, a cutout module, a peak point detection module, and a cropping module, etc., which are not limited in any way in the present embodiment.

[0101] The object detection module is used to perform object detection on a picture (e.g., a picture to be processed transmitted by a gallery application), obtain a detection result of whether the picture includes an object, and determine the location information of the object when the picture includes an object. The object can be a human image (which can be referred to as a portrait), flowers, trees, animals, fruits, etc.

[0102] Among them, the object detection module can include one or more of a face detection module, an animal detection module, and a fruit detection module, which are respectively used to detect faces, animals, fruits, etc. in the picture and obtain corresponding position information.

[0103] In an embodiment of the present application, an application (such as the above-mentioned gallery application) can call an object detection module through the above-mentioned object detection interface, and use the object detection module to detect whether a corresponding object exists in the picture.

[0104] The cutout module is used to separate the foreground of the image from the image to obtain the cutout result.

[0105] The highest point detection module is used to determine the highest point of an object in an image. The explanation of the highest point of an object can be found later and will not be described here.

[0106] The cropping module is used to determine the cropping area according to the highest point and the center of the object.

[0107] In an embodiment of the present application, the gallery application may call the cropping module through the above-mentioned cropping interface to determine the cropping area of ​​the image.

[0108] The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, etc.

[0109] like Figure 4 As shown, the electronic device also includes a hardware layer. The hardware layer may include the above-mentioned display screen 194, which is used to display all interfaces involved in the process of setting the lock screen wallpaper and for the electronic device to interact with the user.

[0110] The following takes the electronic device as a mobile phone and the object as a portrait as an example, and describes in detail the method for setting wallpaper provided by the present application in conjunction with the accompanying drawings.

[0111] In some embodiments, the mobile phone has a function for users to set wallpapers by themselves.

[0112] For example, Figure 5 As shown in (a) of FIG. 5 , the mobile phone may set a “more” button 502 in a location such as the picture preview interface 501. The picture preview interface 501 also includes the previewed picture, for example, the picture preview interface 501 includes the previewed picture 503. When the user needs to perform further operations on the picture 503, such as moving, copying, setting as wallpaper, etc., the user may click the “more” button 502. In response to the user clicking the “more” button 502, the mobile phone may present multiple operation options to the user for the user to select.

[0113] In the embodiment of the present application, in response to the user's operation on the "more" button 502, the mobile phone may display a function bar 504. Figure 5As shown in (b) of FIG. 5 , function bar 504 may provide multiple options, including but not limited to “move”, “copy”, “set to” 505 and other options. In response to the user’s operation on the “set to” 505 option, the mobile phone may display option bar 506. Option bar 506 is used to provide the user with multiple usage options of picture 503, each usage option corresponding to a usage of picture 503. Figure 5 As shown in (c) in the figure, the multiple usage options may include "wallpaper" 506a, "display when the screen is off" 506b, "contact picture" 506c, etc., which are respectively used to set picture 503 as wallpaper, set picture 503 as a picture to be displayed when the screen is off, and set picture 503 as a contact picture.

[0114] In response to the user's operation on "wallpaper" 506a, the mobile phone may display a lock screen preview interface. The lock screen preview interface is used to preview the lock screen interface of the mobile phone, and the lock screen preview interface may include a lock screen wallpaper. Among them, the lock screen wallpaper can be a picture obtained by cropping the picture 503 by the mobile phone, or it can be the picture 503.

[0115] For another example, the mobile phone can also set a function option for setting wallpaper in the thumbnail interface of the gallery application. The thumbnail interface is used to display thumbnails of photos or videos. In this way, the user can use this function option to set the photo as the depth of field wallpaper without clicking on the large picture, simplifying the user operation.

[0116] In the embodiment of the present application, depending on whether the image 503 supports the depth of field effect, the mobile phone can display the lock screen wallpaper in the lock screen preview interface in a depth of field effect or a non-depth of field effect. For the process of determining whether the image 503 supports the depth of field effect, refer to S210 to S250 and S310 to S370, which will not be described here for the time being.

[0117] Among them, if picture 503 supports depth of field effect, the mobile phone displays the lock screen wallpaper with depth of field effect on the lock screen preview interface; if picture 503 does not support depth of field effect, the mobile phone displays the lock screen wallpaper without depth of field effect on the lock screen preview interface.

[0118] For example, when the image 503 supports the depth of field effect, the lock screen preview interface may be Figure 5 The lock screen preview interface 507 shown in (d) in FIG. Figure 5As shown in (d) in FIG. 5 , the lock screen preview interface 507 includes a clock control 508, a lock screen wallpaper 509, and a function bar 510. The clock control 508 is used to display the current time, including year, month, day, hour, minute, etc. The lock screen wallpaper 509 includes a background 509a and a foreground 509b, and the clock control 508 is partially blocked by the foreground 509b to indicate that the lock screen wallpaper 509 is displayed with a depth of field effect. The function bar 510 includes options such as cancel 510a, blur 510b, depth of field effect 510c, and confirm 510d.

[0119] In other implementations, the clock control 508 is not limited to Figure 5 For example, a clock control may not include the date or day of the week, or the numbers in the clock control indicating the current time (such as "16:37") may be presented in the form of Chinese characters (such as 16:37) or images.

[0120] If it is detected that the user clicks the cancel operation 510a, the mobile phone can stop displaying the lock screen preview interface 507 and redisplay the interface 501.

[0121] If it is detected that the user clicks on the blur 510b, the mobile phone can blur / cancel the blur of the background of the lock screen wallpaper 509 (that is, other areas except the foreground).

[0122] If the mobile phone detects that the user clicks on the depth of field effect 510 c , the mobile phone can turn on / off the depth of field effect of the lock screen wallpaper 509 .

[0123] If the user clicks to confirm 510d, the mobile phone can save the wallpaper setting operation. After the mobile phone saves the wallpaper setting operation, the lock screen interface of the mobile phone can be as follows: Figure 1A Optionally, in response to the user clicking the confirm operation 510d, the mobile phone may also redisplay the interface 501.

[0124] For example, when the image 503 does not support the depth of field effect, the lock screen preview interface may be Figure 6 The lock screen preview interface 601 shown in FIG. The lock screen preview interface 601 includes a clock control 602 , a lock screen wallpaper 603 and a function bar 604 . Figure 6 The lock screen preview interface 601 shown is Figure 5 The lock screen preview interface 507 shown in (d) is similar to the lock screen preview interface 507, except that, in the lock screen preview interface 601, the clock control 602 is located above the lock screen wallpaper 603 and partially blocks the lock screen wallpaper 603.

[0125] In the embodiment of the present application, in response to the user's preset operation on the lock screen wallpaper on the lock screen preview interface, the mobile phone can adjust the lock screen wallpaper, such as enlarging / reducing the lock screen wallpaper, moving the wallpaper in any direction, etc. The preset operations include pinching with two fingers, spreading with two fingers, sliding / swiping in any direction, etc.

[0126] In addition, in response to the above-mentioned preset operations, the mobile phone can also display the adjusted lock screen wallpaper with depth of field effect if the adjusted lock screen wallpaper supports depth of field effect, and display the adjusted lock screen wallpaper with non-depth of field effect if the adjusted lock screen wallpaper does not support depth of field effect.

[0127] Among them, if the lock screen wallpaper before adjustment supports depth of field effect, and the lock screen wallpaper after adjustment does not support depth of field effect, the lock screen wallpaper switches from depth of field effect to non-depth of field effect. Or, if the lock screen wallpaper before adjustment does not support depth of field effect, and the lock screen wallpaper after adjustment supports depth of field effect, the lock screen wallpaper switches from non-depth of field effect to depth of field effect. It can be seen that during the process of adjusting the lock screen wallpaper on the mobile phone, the lock screen wallpaper can switch between depth of field effect and non-depth of field effect.

[0128] For example, in response to receiving a two-finger pinch operation by the user on the lock screen preview interface, the mobile phone can reduce the lock screen wallpaper on the lock screen preview interface. Fig. 7A As shown in (a) of FIG. 1 , the mobile phone may display a lock screen preview interface 701, which includes a clock widget 702 and a lock screen wallpaper 703 displayed with a depth of field effect. The mobile phone may receive a two-finger pinch operation by the user on the lock screen wallpaper 703, and respond to the operation, such as Fig. 7A As shown in (b) in FIG. 1 , the mobile phone displays a lock screen wallpaper 704 on the lock screen preview interface 701. The lock screen wallpaper 704 is a reduced lock screen wallpaper 703, and the lock screen wallpaper 704 is displayed with a non-depth of field effect.

[0129] For another example, in response to receiving a two-finger pinch operation on the lock screen wallpaper, the mobile phone can enlarge the lock screen wallpaper on the lock screen preview interface. Fig. 7A The lock screen wallpaper 704 in the image is switched to the lock screen wallpaper 703, that is, the lock screen wallpaper is enlarged and the lock screen wallpaper is switched from being displayed with a non-depth of field effect to being displayed with a depth of field effect.

[0130] For example, Figure 7B As shown in (a) of FIG. 1 , the mobile phone can receive the user's operation of opening two fingers on the lock screen wallpaper 703. In response to the user's operation, as shown in FIG. Figure 7BAs shown in (b) in FIG. 1 , the mobile phone displays a lock screen wallpaper 705 on the lock screen preview interface 701. The lock screen wallpaper 705 is an enlarged lock screen wallpaper 703, and the lock screen wallpaper 705 is displayed with a non-depth of field effect.

[0131] For another example, in response to receiving a user's sliding down operation on the lock screen preview interface, the phone can move the lock screen wallpaper downward. Fig. 8A As shown in (a) of FIG. 8 , the mobile phone can display a lock screen preview interface 801, which includes a clock control 802 and a lock screen wallpaper 803 displayed with a depth of field effect. The mobile phone can receive a user's sliding operation on the lock screen wallpaper 803, and in response to the operation, the mobile phone displays a lock screen wallpaper 804 on the lock screen preview interface 801. Among them, the lock screen wallpaper 804 is the lock screen wallpaper 803 after being moved down, and the lock screen wallpaper 804 is displayed without a depth of field effect.

[0132] For another example, in response to a user's upward swipe operation on the lock screen preview interface, the mobile phone can move the lock screen wallpaper upward. Fig. 8A The lock screen wallpaper 804 in (b) is switched to the lock screen wallpaper 803, that is, the lock screen wallpaper is moved up and the lock screen wallpaper is switched from being displayed with a non-depth of field effect to being displayed with a depth of field effect.

[0133] For example, Figure 8B As shown in (a) of FIG. 8 , the mobile phone can receive a user's upward sliding operation on the lock screen wallpaper 803. In response to the operation, as shown in FIG. Figure 8B As shown in (b) in FIG. 8 , the mobile phone displays a lock screen wallpaper 805 on the lock screen preview interface 801. The lock screen wallpaper 805 is the lock screen wallpaper 803 after being moved up, and the lock screen wallpaper 805 is displayed with a non-depth of field effect.

[0134] In an optional implementation, when the display screen of the mobile phone is a folding screen, the user can choose to set the picture as the lock screen wallpaper of the inner screen or the lock screen wallpaper of the outer screen. Fig.9A The figure shows the appearance of a folding screen mobile phone. Fig.9A (a) is a schematic diagram of the mobile phone when it is fully unfolded. Fig.9A (b) is a schematic diagram of the mobile phone in a semi-unfolded state. Fig.9A (c) is a schematic diagram of the mobile phone in a folded state. Fig.9A The folding screen shown in (a) can be formed after being folded along the folding edge. Fig.9A The A and B screens shown in (b) of FIG. Fig.9AAs shown, the mobile phone may include an inner screen and an outer screen. When the mobile phone is in a folded state, the outer screen can be used to display images; when the mobile phone is in an unfolded state, both the inner screen and the outer screen can be used to display images.

[0135] Both the internal and external screens of the phone support users setting wallpapers. Fig. 9B , shows an interface diagram for setting a depth of field wallpaper on the outer screen of a folding screen mobile phone. Fig. 9B As shown in FIG. 1 , when the mobile phone is a foldable screen mobile phone, the lock screen preview interface also includes an inner screen option 901a and an outer screen option 901b. Among them, when the inner screen option 901a is selected, the mobile phone can display the following Fig. 9B The interface 901 shown in (a) of FIG. 1 can be used to preview the lock screen preview interface of the inner screen. When the outer screen option 901b is selected, the mobile phone can display the following Fig. 9B Interface 902 shown in (b) in the figure may be used to preview the lock screen preview interface of the external screen.

[0136] See also Fig. 9C , shows an interface diagram for setting a depth of field wallpaper on the outer screen of a folding screen mobile phone. Fig. 9C As shown, if the user sets the depth of field wallpaper on the external screen, when the external screen option 901b is selected, the mobile phone can display the following Fig. 9C In the example shown in (a), the interface 903 can be used to preview the lock screen preview interface of the external screen. When the internal screen option 901a is selected, the mobile phone can display the following Fig. 9C Interface 904 shown in (b) may be used to preview the lock screen preview interface of the inner screen.

[0137] By comparing interface 901 with interface 902, and interface 903 with interface 904, it can be seen that when previewing the lock screen preview interface, the mobile phone can refer to the shape of the inner screen or the outer screen for preview, which not only makes it easier for users to distinguish, but also makes it easier for users to understand the unlock screen effect.

[0138] The specific implementation of the method for setting wallpaper provided in the embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0139] See also Fig.10 , which is a flowchart of a method for setting wallpaper provided in an embodiment of the present application, and the method for setting wallpaper can be applied to Figure 3 The electronic equipment shown. Fig.10 As shown, the method for setting wallpaper includes S210 to S250.

[0140] S210, receiving a first operation of the user to set picture 1 as wallpaper.

[0141] Among them, picture 1 is a picture selected by the user to be set as wallpaper. It can be a photo taken by the user himself, or a picture downloaded by the user from the Internet or a picture from other sources. There is no specific limitation here.

[0142] For example, picture 1 can be Figure 5 The first operation may be an operation in which the user clicks on wallpaper 506a, or the first operation may include an operation in which the user clicks on more button 502, an operation in which the user clicks on set as 505, and an operation in which the user clicks on wallpaper 506a. Alternatively, the first operation may be other operations that can set picture 1 as wallpaper, which are not specifically limited herein.

[0143] S220 , in response to the first operation, obtaining parameter information 1 of picture 1 .

[0144] The parameter information 1 includes the size of the picture 1, the position information of the center of the portrait in the picture 1, and the position information of the highest point of the portrait.

[0145] In the embodiment of the present application, the mobile phone can obtain the size of the picture 1. The size of the picture 1 may refer to the width and height of the picture 1, which can be expressed as "width × height". For example, if the size of the picture 1 is 1980 × 1080, it means that the width of the picture 1 is 1980 pixels and the height is 1080 pixels. For another example, the size of the picture 1 can also be 800 × 600, 1280 × 720, etc., which is not specifically limited here.

[0146] The picture 1 may include one or more person images (which may be referred to as portraits).

[0147] In the embodiment of the present application, the portrait center is used to reflect the horizontal distribution of all the character images in the picture 1. The portrait center may be the axis of symmetry between the third boundary perpendicular to the x-axis and the fourth boundary perpendicular to the x-axis. The third boundary and the fourth boundary are two boundaries of one or more character images in the first direction.

[0148] The position information of the center of the portrait may be the coordinate of the symmetry axis on the x-axis, where the x-axis is a straight line where the width of the image is located. The direction where the x-axis is located may also be referred to as a first direction.

[0149] It should be noted that the portrait center is the symmetry axis of the third boundary perpendicular to the x-axis and the fourth boundary perpendicular to the x-axis, and does not indicate that the image 1 is symmetrical about the portrait center in the x-axis direction.

[0150] In an optional implementation, the third boundary is the left boundary of the face frame of the leftmost person image in Picture 1, and the fourth boundary is the right boundary of the face frame of the rightmost person image in Picture 1. The mobile phone can determine the third boundary based on the position information of the leftmost face in Picture 1, and determine the fourth boundary based on the position information of the rightmost face in Picture 1. It should be noted that, in the case where only one person image is included in Picture 1, the leftmost person image and the rightmost person image are the same person image. Accordingly, the leftmost face and the rightmost face are the faces of the same person image.

[0151] For ease of understanding, the position information of the face is first explained below with reference to the accompanying drawings.

[0152] In an optional implementation, the position information of the face may include the coordinates of two vertices of the face frame located at opposite corners. The two vertices located at opposite corners may be the upper left vertex and the lower right vertex of the face frame, or the lower left vertex and the upper right vertex of the face frame, and no specific limitation is made here.

[0153] For example, Fig.11 As shown, the coordinate system where the coordinates of the above vertices are located has the upper left corner of the image as the coordinate origin, the straight line where the width of the image is located as the x-axis, and the straight line where the height of the image is located as the y-axis. It should be noted that, unless otherwise specified, the coordinates involved in the embodiments of the present application are all based on the above coordinate system as the reference coordinate system.

[0154] For example, Fig.11 As shown in (a), the position information of the face may include the coordinates (x1, y1) of the upper left vertex of the face frame, and the coordinates (x2, y2) of the lower right vertex, which may be expressed as [(x1, y1), (x2, y2)].

[0155] In another optional implementation, the position information of the face may include the distances from the four sides of the face frame to the corresponding sides of the image.

[0156] For example, Fig.11 As shown in (b), the face frame includes an upper boundary, a lower boundary, a left boundary and a right boundary, and the picture includes an upper boundary, a lower boundary, a left boundary and a right boundary. The position information of the face includes the distance L1 from the upper boundary of the face frame to the upper boundary of the picture, the distance L2 from the lower boundary of the face frame to the lower boundary of the picture, the distance L3 from the left boundary of the face frame to the left boundary of the picture, and the distance L4 from the right boundary of the face frame to the right boundary of the picture, which can be expressed as [L1, L2, L3, L4].

[0157] The following example illustrates a process in which the mobile phone determines the third boundary according to the position information of the leftmost face, and determines the fourth boundary according to the position information of the rightmost face.

[0158] For example, the position information of a face includes the coordinates of the upper left vertex and the lower right vertex of the face frame. Fig.12 As shown in (a), picture 1 only includes face a, and the position information of face a is [(x a1 ,y a1 ), (x a2 ,y a2 )], then the third boundary is x=x a1 , the fourth boundary is x=x a2 , so the center of the portrait is x=(x a1 +x a2 ) / 2.

[0159] For example, Fig.12 As shown in (b), picture 1 includes face a, face b, face c, and face d. Face a is located at the leftmost of all the person images in picture 1, face c is located at the rightmost of all the person images in picture 1, and the position information of face a is [(x a1 ,y a1 ), (x a2 ,y a2 )], the position information of face c is [(x c1 ,y c1 ), (x c2 ,y c2 )], then the third boundary is x=x a1 , the fourth boundary is x=x c2 , so the center of the portrait is x=(x a1 +x c2 ) / 2.

[0160] In another optional implementation, the third boundary may be the left boundary of the human frame of the leftmost person image, and the fourth boundary may be the right boundary of the human frame of the rightmost person image. The mobile phone may determine the third boundary based on the position information of the leftmost person image in picture 1, and determine the fourth boundary based on the position information of the rightmost person image in picture 1. The principle is similar to the principle of determining the center of the portrait using the position information of the face, and will not be repeated here.

[0161] In another optional implementation, the mobile phone can determine the third boundary according to the center of gravity position of the leftmost person image, and determine the fourth boundary according to the center of gravity position of the rightmost person image. Specifically, the third boundary is a straight line passing through the center of gravity of the leftmost person and perpendicular to the x-axis, and the fourth boundary is a straight line passing through the center of gravity of the rightmost person and perpendicular to the x-axis.

[0162] In an optional embodiment, the mobile phone can use a key point detection algorithm to detect key points on the character image, such as the eyes, nose, mouth, neck, arms, knees, ankles and other human body positions, and then use the positions of the key points to determine the center of gravity of the character image.

[0163] In the embodiment of the present application, the highest point of the portrait is the highest point among the highest points of the target portrait in the portraits included in the picture 1. The position information of the highest point of the portrait may include the distance from the highest point of the portrait to the upper boundary and / or the lower boundary of the picture 1.

[0164] In an optional implementation, the target object may be a portrait within a first range of the image 1. The two boundaries of the first range are respectively a first boundary obtained by moving the center of the portrait to the left (also referred to as the first horizontal direction) by a first distance and a second boundary obtained by moving the center of the portrait to the right (also referred to as the second horizontal direction) by a second distance. Optionally, the first range also includes an upper boundary, a lower boundary, etc., which are not specifically limited here.

[0165] In the case where only one person is included in the picture 1, the first distance and the second distance can be determined according to the width of the face frame. The first distance and the second distance are greater than or equal to half of the width of the face frame to ensure that the first range can cover the face frame. It should be noted that the first distance and the second distance can be the same or different.

[0166] by Fig.13 Taking (a) in the figure as an example, the position information of the face is [(x a1 ,y a1 ), (x a2 ,y a2 )] (not shown), the width of the face frame is x a2 -x a1 , the portrait center is x=(x a1 +x a2 ) / 2. The first distance can be (x a2 -x a1 ) / 2+Δ1, the second distance can be (x a2 -x a1 ) / 2+Δ2, Δ1≥0, Δ2≥0. Thus, the first boundary can be x=(x a1 +x a2 ) / 2-[(x a2 -x a1 ) / 2+Δ1]=x a1 -Δ1, the second boundary can be x=(x a1 +x a2 ) / 2+[(x a2 -x a1 ) / 2+Δ2]=x a2+Δ2, the first range is x a1 -Δ1≤x≤x a2 In this way, it can be ensured that the first range can cover the face frame.

[0167] The portrait included in the first range is the target object, and the highest point of the portrait is the top of the head A. Therefore, the highest point of the portrait is the top of the head A, and the position information of the highest point of the portrait can be the distance M1 from the top of the head A to the upper boundary of the picture 1.

[0168] In the case where multiple portraits are included in picture 1, the first distance and the second distance can be determined according to the width of the first control. The first distance and the second distance are greater than or equal to half of the width of the first control to ensure that the first range can cover the first control. It should be noted that the first distance and the second distance can be the same or different. The first control can be a clock view for displaying time, and the width of the first control is the width of the clock view.

[0169] It should also be noted that the first control is a control displayed on the lock screen preview interface (also referred to as the first interface), for example Figure 5 The clock control 508 in the first control. The width of the first control refers to the width of the first control when the size of the lock screen preview interface is scaled to a preset cropping size.

[0170] For example, the size of the lock screen preview interface is 800*600, and the width of the first control in the lock screen preview interface is 500. If the preset size is 400*300, the width of the first control is 250.

[0171] For example, Fig.13 Take (b) in the figure as an example, the width of the first control is L, and the center of the portrait is x=a. The first distance can be L / 2+Δ3, and the second distance can be L / 2+Δ4, where Δ3≥0 and Δ4≥0. Therefore, the first boundary can be x=a-(L / 2+Δ3)=m1, and the second boundary can be x=a+(L / 2+Δ4)=m2. The first range is the area formed by m1≤x≤m2 (i.e., the area of ​​the shaded part). In this way, it can be ensured that the first range can cover the first control.

[0172] Among them, there are portraits A and B in the first range, and the target objects are portraits A and B. Among them, the highest point of portrait A is the top of its head, that is, point B1; the highest point of portrait B is the top of its head, that is, point B2. Since point B1 and point B2 have the same vertical coordinate, the highest point of the portrait is the highest point B1 and the highest point B2 of the person image in the first range, and the position information of the highest point of the portrait can be the distance M2 from the highest point B1 / the highest point B2 to the upper boundary of picture 1.

[0173] In an optional implementation, if the ordinate value of point B1 is less than the ordinate value of point B2, the highest point among the highest points of the target object is point B1, and thus the highest point of the portrait is point B1; if the ordinate value of point B1 is greater than the ordinate value of point B2, the highest point among the highest points of the target object is point B2, and thus the highest point of the portrait is point B2.

[0174] In other implementations, the first range may be other ranges that can cover the face frame or the first control, and the area where the first range is located may be open, closed, a regular shape, or an irregular shape, which is specifically limited here.

[0175] In another optional implementation, the target objects may be all the portraits in the picture 1 .

[0176] Continue with Fig.13 Taking (b) in the figure as an example, the target objects are portrait C, portrait A, portrait B, and portrait D. Among them, the highest point of portrait C is higher than the highest points of other portraits, so the highest point of the object is the highest point of portrait C, that is, the top of portrait C's head.

[0177] The above explains the relevant concepts of the highest point of the portrait. The following will explain in detail the process of the mobile phone determining the highest point of the portrait. For details, see S410 to S440, which will not be described here.

[0178] S230: Determine cropping area 1 according to parameter information 1 and parameter information 2.

[0179] The parameter information 2 includes the cropping size and the position information of the first control.

[0180] The cropping size is preset, for example, the cropping size may be 2340×1080 pixels.

[0181] In an optional embodiment, in order to avoid deformation problems when displaying the cropped image, the ratio of the cropped size is the same as the ratio of the display screen. For example, the ratio of width to height is the aspect ratio of the internal screen of devices such as foldable screen mobile phones and straight-screen mobile phones. No specific restrictions are made here.

[0182] The position information of the first control is used to indicate the position of the first control in the adjusted lock screen preview interface, wherein the adjusted lock screen preview interface refers to the interface obtained by adjusting the size of the lock screen preview interface to the crop size. Alternatively, it can be understood as the position of the first control in the crop area 1 when the first control is mapped to the crop area 1.

[0183] For example, the position information of the first control may include the width of the first control, the height of the first control, and the distance from the upper boundary of the first control to the upper boundary and / or lower boundary of the adjusted first interface (or the cropping area 1).

[0184] For another example, the position information of the first control may be similar to the position information of a face, including the coordinates of two diagonally opposite vertices of the first control. In this case, the mobile phone may calculate the width of the first control, the height of the first control, and the distance from the upper boundary of the first control to the upper boundary and / or lower boundary of the adjusted first interface based on the position information of the first control.

[0185] In the embodiment of the present application, the mobile phone can determine the size and position of the cropping area 1 according to parameter information 1 and parameter information 2.

[0186] The size of the cropping area 1 is the same as the cropping size. For example, if the cropping size is 2340×1080 pixels, the size of the cropping area 1 is also 2340×1080 pixels. In addition, since the ratio of the cropping size is the same as the ratio of the display screen, the ratio of the cropping area 1 is also the same as the ratio of the display screen.

[0187] The position of the cropping area 1 is used to indicate the relative position of the cropping area 1 and the picture 1. In an optional implementation, the position of the cropping area 1 may include a distance S1 from the upper boundary of the cropping area 1 to the upper boundary of the picture 1, a distance S2 from the lower boundary of the cropping area 1 to the lower boundary of the picture 1, a distance S3 from the left boundary of the cropping area 1 to the left boundary of the picture 1, and a distance S4 from the right boundary of the cropping area 1 to the right boundary of the picture 1.

[0188] In the embodiment of the present application, the mobile phone can determine the position of the cropping area from the x-axis direction and the y-axis direction respectively.

[0189] Among them, in the y-axis direction, the distance from the highest point of the portrait to the first side of the cropping area 1 satisfies the first condition; in the x-axis direction, the distance from the highest point of the portrait to the second side of the cropping area 1 satisfies the second condition, so that when the picture 2 cropped according to the cropping area 1 is displayed, the portrait included in the picture 2 obstructs part of the first control area.

[0190] The first side edge may be an upper boundary of the cropping area 1 or a lower boundary of the cropping area 1 .

[0191] In the case where the first side is the upper boundary of the cropping area 1, the first condition includes: the distance from the highest point of the portrait to the first side of the cropping area 1 is less than the distance from the lower boundary of the first control to the first side of the cropping area 1. Optionally, the distance from the highest point of the portrait to the first side of the cropping area 1 is greater than the distance from the upper boundary of the first control to the first side of the cropping area 1.

[0192] In the case where the first side is the lower boundary of the cropping area 1, the first condition includes: the distance from the highest point of the portrait to the first side of the cropping area 1 is greater than the distance from the lower boundary of the first control to the first side of the cropping area 1. Optionally, the distance from the highest point of the portrait to the first side of the cropping area 1 is less than the distance from the upper boundary of the first control to the first side of the cropping area 1.

[0193] Among them, when the ratio of the distance from the highest point of the portrait to the lower boundary of the first control to the height of the first control is k, and 0<k<1, the distance from the highest point of the portrait to the first side of the cropping area 1 can meet the first condition. Therefore, the mobile phone determines the above distance S1 and distance S2 based on the above k, the height of the picture 1, the height of the cropping area 1, the height of the first control, and the distance from the upper boundary of the first control to the upper boundary / lower boundary of the cropping area 1.

[0194] In this way, the highest point of the portrait can be located in the area where the first control is located in the y-axis direction, so that the mobile phone can achieve a depth of field effect by adjusting the position of the first control and the portrait in picture 1.

[0195] Among them, the second side is the left boundary of the cropping area 1 or the right boundary of the cropping area 1, and the second condition includes: the distance from the highest point of the portrait to the second side of the cropping area 1 is the same as the distance from the center line of the first control to the second side of the cropping area 1.

[0196] In the embodiment of the present application, in the x-axis direction, the mobile phone can use the center of the portrait of picture 1 as the symmetry axis of the cropping area 1, and the symmetry axis of the cropping area 1 coincides with the symmetry axis of the first control, and the distance S3 and the distance S4 are determined in combination with the width of the picture 1 and the width of the cropping area 1. In this way, when the display screen displays the content contained in the cropping area 1 (i.e., picture 2), the characters in the picture can be evenly distributed on the display screen, making the picture more coordinated.

[0197] For example, parameter information 1 and parameter information 2 may be as follows: Fig.14 As shown, the cropping size is w1×h1, the height of the first control is h3, the distance from the upper boundary of the first control to the upper boundary of the cropping area 1 is h4, the size of the picture 1 is w2×h2, the distance from the highest point of the portrait to the upper top edge of the picture 1 is M1, and the center of the portrait is x=a.

[0198] according to Fig.14 The mobile phone can determine the cropping area 1 by using the parameter information 1 and the parameter information 2 shown in FIG. Fig.15 The shaded area shown.

[0199] Among them, in the x-axis direction, the mobile phone takes the portrait center of picture 1 as the symmetry axis of cropping area 1, and the symmetry axis of cropping area 1 coincides with the symmetry axis of the first control, and the width of cropping area 1 is w1 and the width of picture 1 is w2, so it can be determined that: S3=a-w1 / 2, S4=w2-(a-w1 / 2).

[0200] In the y-axis direction, the mobile phone can determine that the distance between the highest point of the portrait and the lower boundary of the first control is k*h3, and the distance between the highest point of the portrait and the upper boundary of the first control is (1-k)*h3. On this basis, the mobile phone can determine: S1 = M1-h4-(1-k)*h3, S2 = h2-h1-S1 = h2-h1-(M1-h4-(1-k)*h3).

[0201] S240: If the cropping area 1 meets the preset condition 1, the image 1 is cropped according to the cropping area 1 to obtain the image 2.

[0202] Among them, the preset condition 1 is used to predict whether the picture 2 can be displayed with a depth of field effect.

[0203] In an optional implementation, the preset condition 1 may include at least two of the following:

[0204] (1) Cropping area 1 does not exceed the area where image 1 is located.

[0205] In an optional implementation, the mobile phone may determine whether the four vertices of cropping area 1 are all located in the area where picture 1 is located. If the four vertices of cropping area 1 are all located in the area where picture 1 is located, it means that cropping area 1 does not exceed the area where picture 1 is located. In this case, the mobile phone may crop picture 1 according to cropping area 1.

[0206] If any vertex is not in the area where image 1 is located, it means that cropping area 1 exceeds the area where image 1 is located. In this case, since image 1 cannot satisfy cropping area 1, the mobile phone may not crop image 1 according to cropping area 1.

[0207] (2) The area ratio of the portrait in the cropping area 1 is within a first preset range.

[0208] In the embodiment of the present application, the area ratio of the portrait can be the ratio of the area of ​​the person in the cropping area 1 to the area of ​​the cropping area 1. Optionally, the mobile phone can perform human body recognition on the cropping area 1 to obtain a human body frame, and calculate the area of ​​the human body frame. Then, the area of ​​the human body frame is used as the area of ​​the person in the cropping area 1, and the area ratio of the portrait is calculated in combination with the area of ​​the cropping area 1.

[0209] Among them, the first preset range can be a range determined by a first threshold and a second threshold, and the first threshold is less than the second threshold. For example, the first threshold can be 3%, and the second threshold can be 18%, that is, the first preset range is 3% to 18%. In other embodiments, the preset range can also be other, and no specific limitation is made here. In an optional embodiment, the first preset range can be associated with the number of portraits in Picture 1. For example, in the case where Picture 1 includes a portrait, the first preset range can be 3% to 18%, and in the case where Picture 1 includes multiple portraits, the first preset range can be 2% to 9%.

[0210] If the area ratio of the portrait is within the first preset range, it means that the size of the person in the cropping area 1 is moderate, and a better display effect can be achieved when displayed with a depth of field effect. The mobile phone can crop the picture 1 according to the cropping area 1.

[0211] If the area ratio of the portrait is not within the first preset range, it means that the person in the cropping area 1 is too large or too small, and the effect when displayed with the depth of field effect is poor. It is not recommended to display with the depth of field effect. Therefore, the mobile phone does not need to crop picture 1 according to cropping area 1.

[0212] If cropping area 1 does not satisfy any one of the above conditions (1) and (2), it means that cropping area 1 does not meet preset condition 1. The mobile phone can crop image 1 according to the above cropping area 1 or in other ways, and display the cropped image with a non-depth of field effect, or the mobile phone can directly display image 1 with a non-depth of field effect.

[0213] S250, displaying picture 2 with depth of field effect.

[0214] For example, Fig.16 As shown, the mobile phone can determine cropping area 1 from picture 1, and when cropping area 1 meets preset condition 1, cropping picture 1 according to cropping area 1 to obtain picture 2. In this way, when displaying picture 2, by superimposing picture 2, the first control and the cutout result of picture 2, the cutout result (i.e., the portrait part of picture 2) can cover part of the first control to create a depth of field effect.

[0215] In an optional implementation, to obtain a better display effect, the mobile phone can enlarge the picture 1 into multiple pictures 3, and obtain the cropping area 2 corresponding to each picture 3. Then, the mobile phone can select the best cropping area from the multiple cropping areas 2 as the cropping area 1, and crop the picture 3 corresponding to the cropping area 1 to obtain the picture 2, and display the picture 2 with the depth of field effect. Fig.17 This embodiment will be described.

[0216] like Fig.17FIG. 1 is a flowchart of another method for setting wallpaper provided in an embodiment of the present application. Fig.10 The process of setting wallpaper is similar. Fig.17 As shown, the method for setting wallpaper may include S310 to S370.

[0217] S310, receiving a first operation of setting picture 1 as wallpaper by a user.

[0218] For the description of the first operation, please refer to S210 and will not be repeated here.

[0219] S320, enlarge the size of picture 1 by n times to obtain picture 3.

[0220] Where n is the adjustment factor, and n min ≤n≤n max .n max is the maximum value of the adjustment coefficient n pre-stored in the mobile phone, for example, it can be 2, 3, 3.5, 4, etc.; n min It is the minimum value of the adjustment coefficient n pre-stored in the mobile phone, for example, 1.

[0221] In an optional implementation, in response to the first operation, the mobile phone may obtain a maximum value n of the adjustment coefficient n. max , and enlarge the size of image 1 by n max times to get picture 3.

[0222] In an optional implementation, the mobile phone can zoom in on the image 1 using the coordinate origin (eg, the upper left vertex of the image 1) as an anchor point, so that the images before and after zooming in can have the same coordinate system for ease of calculation.

[0223] Exemplarily, the size of Picture 1 is w1*h1, the distance from the highest point of the portrait in Picture 1 to the upper boundary of Picture 3 is M1, and the center of the portrait in Picture 1 is x=a, then the size of Picture 3 is (n*w1)*(n*h1), and the distance from the highest point of the portrait in Picture 3 to the upper boundary of Picture 3 is n*M1, and the center of the portrait in Picture 3 is x=n*a.

[0224] S330, obtain parameter information 3 of picture 3.

[0225] The parameter information 3 includes the size of the picture 3 , the position information of the highest point of the object in the picture 3 , and the position information of the center of the object in the picture 3 .

[0226] The process of obtaining parameter information 3 of picture 3 is described in S220 and S410 to S440, which will not be described in detail here.

[0227] In an optional implementation, if only one portrait is included in picture 1 and picture 3, the mobile phone can determine parameter information 3 by combining parameter information 1, parameter information 2 and adjustment coefficient n. For example, the size of picture 1 is w×h, the center of the portrait of picture 1 is x=a, the distance from the highest point of the portrait to the upper top edge of picture 1 is m, and picture 3 is n times the size of picture 1, then the size of picture 3 is nw×nh, the center of the portrait of picture 3 is x=na, and the distance from the highest point of the portrait to the upper top edge of picture 3 is n×m.

[0228] S340, determining the cropping area 2 in the picture 3 according to the parameter information 3 and the parameter information 2.

[0229] The size of the cropping area 2 is the same as the cropping size.

[0230] In an embodiment of the present application, the mobile phone can determine the position of the cropped area 2 in the picture 3 according to the size of the picture 3, the distance from the highest point of the portrait in the picture 3 to the upper boundary of the picture 3, the position of the center of the portrait, and the parameter information 2.

[0231] The process of determining the position of the cropping area 2 is similar to the process of determining the cropping area 1 in S230 , and will not be described in detail herein.

[0232] For example, parameter information 1 and parameter information 2 may be as follows: Fig.18 As shown in (a) in the figure, the size of the display screen is w1×h1, the height of the first control is h3, the distance from the upper boundary of the first control to the upper boundary of the cropping area is h4, the size of the picture 1 is w2×h2, the distance from the highest point of the portrait to the upper top edge of the picture 1 is M1, and the center of the portrait is x=a.

[0233] Among them, after enlarging picture 1 by n times, we get picture 3, such as Fig.18 As shown in (b), the size of Picture 3 is (n*w2)*(n*h2), the distance from the highest point of the portrait in Picture 3 to the upper boundary of Picture 3 is n*M1, and the center of the portrait in Picture 3 is x=n*a.

[0234] according to Fig.18 The parameter information shown in (b) can be obtained Fig.18 The position of the cropped area 2 shown in (c).

[0235] In the x-axis direction, the mobile phone takes the portrait center of picture 3 as the symmetry axis of cropping area 2, and the symmetry axis of cropping area 2 coincides with the symmetry axis of the first control, and the width of the display screen is w1 and the width of picture 3 is w2. It can be determined that: S3=n*a-w1 / 2, S4=n*w2-(n*a-w1 / 2).

[0236] In the y-axis direction, the mobile phone can determine that the distance between the highest point of the portrait and the lower boundary of the first control is k*h3, and the distance between the highest point of the portrait and the upper boundary of the first control is (1-k)*h3. On this basis, the mobile phone can determine that S1=n*M1-h4-(1-k)*h3, S2=n*h2-h1-S1=n*h2-h1-[n*M1-h4-(1-k)*h3].

[0237] S350, determining whether the cropping area 2 meets the preset condition 2.

[0238] The preset condition 2 is used to determine whether the content in the second cropping area supports the depth of field effect, and to determine whether the mobile phone needs to continue to determine a new cropping area 2. In an optional implementation, the preset condition 2 includes:

[0239] (1) The cropped area 2 does not exceed the area where the image 3 is located; (2) The area ratio of the portrait in the cropped area 2 is greater than or equal to a first threshold, and the first threshold is the minimum value of the area ratio of the portrait.

[0240] In the case where the cropping area 2 exceeds the area where the picture 3 is located, if the adjustment coefficient n is further reduced, the new cropping area 2 obtained according to the adjusted adjustment coefficient n will still exceed the area where the picture 1 is located.

[0241] When the area ratio of the portrait in the cropped area is less than the first threshold, if the adjustment coefficient n is further reduced, the area ratio of the portrait in the new cropped area 2 will be reduced, that is, still less than the first threshold, affecting the display effect.

[0242] For example, Fig.19 As shown in (a) in , picture a is the picture obtained by magnifying picture 1 by n1 times, and cropping area a is cropping area 2 corresponding to picture a. Fig.19 As shown in (b), picture b is the picture obtained by magnifying picture 1 by n2 times, cropping area b is cropping area 2 corresponding to picture b, and n1>n2. Among them, the dotted line is the straight line where the highest portrait point in picture a and picture b is located.

[0243] In the case where the cropped area a exceeds the area where the picture a is located, the cropped area b must also exceed the area where the picture b is located. In the case where the area ratio of the portrait in the cropped area a is less than the first threshold, the area ratio of the portrait in the cropped area b must be less than the first threshold. In other words, when it is determined that the cropped area a does not meet the preset condition 2, there is no need to further reduce the adjustment coefficient n.

[0244] If the cropping area 2 meets the preset condition 2, execute S360; if the cropping area 2 does not meet the preset condition 2, execute S370.

[0245] S360, reduce n.

[0246] In an optional implementation, the mobile phone may determine whether n is greater than the minimum adjustment coefficient n min , and when n>n min When n≤n min In the case of , n is not reduced and S370 is directly executed.

[0247] The mobile phone may reduce the adjustment coefficient n according to a preset step size, for example, the preset step size may be 0.1, 0.2, etc.

[0248] For example, n1=3, and the preset step size is 0.1, then n can be 2.9, 2.8, 2.7, ..., 1 in sequence.

[0249] In an optional implementation, the initial value of the adjustment coefficient n may also be the minimum value (i.e., 1). Also, the preset condition 2 is adjusted to: (1) the cropping area 2 does not exceed the area where the image 3 is located; (2) the area ratio of the portrait in the cropping area 2 is greater than a second threshold, and the second threshold is the maximum area ratio of the portrait. Also, S360 may be replaced by: enlarge n.

[0250] In the embodiment of the present application, through S320 to S360, the mobile phone can obtain at least one picture 3 and the cropping area 2 corresponding to each picture 3. The adjustment coefficient n corresponding to each picture 3 is different.

[0251] For example, at least one picture 3 includes picture a, picture b, picture c... picture m, where picture a is a picture obtained by enlarging picture 1 by A1 times, picture b is a picture obtained by enlarging picture 1 by A2 times, picture c is a picture obtained by enlarging picture 1 by A3 times,..., picture m is a picture obtained by enlarging picture 1 by Am times.

[0252] In addition, the mobile phone can also determine the cropping area a corresponding to the picture a, the cropping area b corresponding to the picture b, the cropping area c corresponding to the picture c, ... the cropping area m corresponding to the picture m.

[0253] S370, cropping and displaying the corresponding picture 3 according to the cropping area 1.

[0254] The cropping region 1 is the cropping region that meets the most preset conditions 3 among all the cropping regions 2.

[0255] In the embodiment of the present application, preset condition 3 is a condition for predicting the display effect of the cropped image.

[0256] In the embodiment of the present application, the preset condition 3 may include:

[0257] Condition A: When picture 1 includes two human figures, cropping area 2 also includes the two human figures.

[0258] In an optional implementation, when the picture 1 includes two portraits, the mobile phone can determine the face positions of the two portraits, and the mobile phone can determine whether the face positions of the two portraits are located within the cropping area 2.

[0259] If both faces are located in the cropping area 1, it means that the two portraits are included in the cropping area 1. In this way, the portraits of the image cropped according to the cropping area 2 are evenly distributed and have a good display effect.

[0260] If the face position of at least one portrait is not located in the cropping area 2, it means that the two portraits are not included in the cropping area 2. In this way, the image cropped according to the cropping area 2 does not include the two portraits, and the cropping effect is poor.

[0261] Condition B: When the image 1 includes only a portrait, the human body is not cut off in the cropping area.

[0262] Condition C: The composition index of the cropped area is greater than the first value. The composition index is used to reflect the composition effect of the image. The higher the composition index, the better the composition effect of the image.

[0263] It should be noted that the above-mentioned preset condition 3 is only an example, and the preset condition 3 may also be other conditions for predicting the display effect of the cropped image.

[0264] For example, the mobile phone obtains picture a, picture b, and picture c according to S320 to S350, and determines that cropping area 2 of picture a is cropping area a, cropping area 2 of picture b is cropping area b, and cropping area 2 of picture c is cropping area c.

[0265] Among them, if cropping area a and cropping area b satisfy the above-mentioned condition C, and cropping area c satisfies the above-mentioned conditions A and C, then cropping area c is cropping area 2 that satisfies at most preset conditions 3. The mobile phone can use cropping area c as cropping area 1, and crop picture c according to cropping area c to obtain picture 2, and display picture 2 with depth of field effect.

[0266] In an optional implementation, if there are multiple cropping areas 2 that satisfy the same number of preset conditions 3, and the number is the largest, the mobile phone can use the cropping area 2 with the largest adjustment coefficient among the multiple cropping areas 2 as the cropping area 1. In this way, the portrait in the final picture 2 will be the largest portrait among all pictures supporting the depth of field effect, and the display effect will be better.

[0267] In an optional implementation, before executing S320, the mobile phone may first determine the cropping area 3 (i.e., the cropping area 2 when n=1) of the image 1 according to the parameter information 1 and the parameter information 2. If the area ratio of the portrait in the cropping area 3 is less than or equal to the second threshold, the size of the image 1 is enlarged by n times to obtain the image 3.

[0268] If the area ratio of the portrait in cropping area 3 is greater than the second threshold, it means that the cropping area with the smallest area ratio of the portrait cannot achieve a good display effect. As the image 1 is enlarged, the area ratio of the portrait in cropping area 2 will only increase, and a good display effect cannot be achieved. Therefore, if the area ratio of the portrait in cropping area 3 is greater than the second threshold, S340 may not be executed, but the image 1 may be directly cropped and the cropped image may be displayed with a non-depth of field effect, or the mobile phone may directly display the image 1 with a non-depth of field effect.

[0269] In another optional implementation, the mobile phone may obtain all values ​​of the adjustment coefficient n, and enlarge the picture 1 according to all values ​​of the adjustment coefficient n to obtain the corresponding picture 3. Then, the mobile phone may obtain the cropping area 2 corresponding to each picture 3, and determine the cropping area 1 from all the cropping areas 2. Then, the corresponding picture 3 is cropped according to the cropping area 1 and displayed.

[0270] contrast Fig.10 and Fig.17 The flowchart shown, Fig.10 and Fig.17 The flowcharts provided can both achieve the setting of depth of field wallpaper. However, the effects achieved by the two are different. Fig.10 The process provided is simpler and requires less calculation, which can save the computing resources of the equipment; Fig.17 The provided process can obtain multiple cropping areas, and then select the optimal cropping area from the multiple cropping areas for cropping, which can obtain a better display effect.

[0271] See also Fig. 20 , which is another method for setting wallpaper provided in an embodiment of the present application, specifically describes the process of determining the position information of the highest point of the above-mentioned portrait. Fig. 20 As shown, the method includes: S410~S440.

[0272] S410, performing face detection on the image 1 to determine the position information of all faces.

[0273] In an embodiment of the present application, the mobile phone can use the face detection module of the application framework layer to perform face detection on the original image, identify all the faces in image 1, and the location information of each face.

[0274] Among them, the face detection module can be implemented using face recognition algorithms such as recognition algorithms based on facial feature points, recognition algorithms based on the entire face image, recognition algorithms based on templates, and algorithms using neural networks for recognition, without specific restrictions here.

[0275] S420, determine a first range.

[0276] In an embodiment of the present application, the mobile phone obtains a third boundary by moving the portrait center to the left by a first distance and obtains a fourth boundary by moving the portrait center to the right by a second distance, and the first range is determined by the third boundary and the fourth boundary.

[0277] If the image 1 includes only one person, the mobile phone can determine the first distance and the second distance according to the width of the face frame. The first distance and the second distance are greater than or equal to half of the width of the face frame. For details, see the relevant description in S220, which will not be repeated here.

[0278] If the picture 1 includes multiple portraits, the mobile phone can determine the first distance and the second distance according to the width of the first control, wherein the first distance and the second distance are greater than or equal to half of the width of the first control.

[0279] S430, performing cutout on the image 1 to obtain a cutout result.

[0280] The cutout result is the result of separating the foreground and the non-foreground of the picture 1. In an optional implementation, the cutout result may also be referred to as a fourth picture.

[0281] In an embodiment of the present application, the cutout result includes a first type of pixel points and a second type of pixel points. The first type of pixel points are pixel points belonging to the foreground in picture 1, and the second type of pixel points are pixel points other than the foreground in picture 1.

[0282] For example, the cutout result may be a grayscale image, and the grayscale value of each pixel indicates whether each pixel of the image 1 belongs to the foreground object or does not belong to the foreground. For example, a pixel value of 0 (i.e., the pixel is black) may indicate that the pixel belongs to the foreground of the image 1, and a pixel value of 0 (i.e., the pixel is white) may indicate that the pixel does not belong to the foreground of the image 1.

[0283] For example, Fig.21 By cutting out the picture 1 shown in (a) in the figure, we can get Fig.21 The cutout result is shown in (b) in the figure. The foreground part is black and the non-foreground part is white.

[0284] S440: Determine the highest point of the portrait according to the first range and the cutout result.

[0285] In an embodiment of the present application, the electronic device can determine the position information of the target pixel point in the cutout result, and use the position information of the target pixel point as the position information of the highest point of the object.

[0286] In an optional implementation, the target pixel point is the highest point among all first-category pixel points of the cutout result.

[0287] In another optional implementation, the target pixel point is the highest point among all first-category pixel points within the first range of the matting result.

[0288] Combine the following Figure 4 The layered architecture shown illustrates the method for setting wallpaper provided in an embodiment of the present application.

[0289] See also Fig. 22 , is a flow chart of another method for setting wallpaper provided in an embodiment of the present application. Fig. 22 As shown, the method for setting wallpaper may include S501 to S516.

[0290] S501: A first application receives a first operation of a user to set picture 1 as wallpaper.

[0291] For example, the first application may be a gallery application, or other applications that have a wallpaper setting function.

[0292] S502: The first application sends a face detection request to the face detection module.

[0293] The face detection request carries the data of picture 1.

[0294] In an optional implementation, the first application may send a face detection request to the face detection module through a face detection interface.

[0295] S503: The face detection module sends the face detection result to the first application.

[0296] Among them, the face detection result includes the location information of all faces in picture 1.

[0297] S504: The first application determines whether there is a face in the image 1 according to the face detection result.

[0298] If there is a face in picture 1, execute S505; if there is no face in picture 1, the first application can preview picture 1 without depth of field effect.

[0299] S505: The first application sends a cropping request to the cropping module.

[0300] The cropping request may carry the face detection result and the data of picture 1.

[0301] In an optional implementation, the first application may send a cropping request to the cropping module through a cropping interface.

[0302] S506: The cropping module sends a cutout request to the cutout module.

[0303] The cutout request carries the data of picture 1.

[0304] S507: The cutout module sends the cutout result to the cropping module.

[0305] S508, the cropping module determines parameter information 1 according to the cutout result and the face detection result.

[0306] For the description of parameter information 1, please refer to S220 and will not be repeated here.

[0307] S509 , the cropping module enlarges the size of the image 1 by n times to obtain the image 3 .

[0308] S510, the cropping module determines the cropping area 2 in the picture 3 according to the parameter information 1 and the parameter information 2.

[0309] S511, the cropping module determines whether the cropping area 2 meets the preset condition 2.

[0310] If the cropping area 2 meets the preset condition 2, S512 is executed; if the cropping area 2 does not meet the preset condition 2, S514 is executed.

[0311] S512, determining whether n is greater than the minimum adjustment coefficient.

[0312] Among them, the minimum adjustment coefficient is the minimum value n of the adjustment coefficient n min .

[0313] If n>n min , then execute 513; if n≤n min , then execute S514.

[0314] S513, the cropping module reduces n.

[0315] S514: The cropping module determines cropping area 1 from cropping area 2.

[0316] S515: The cropping module sends the cropping area 1 to the first application.

[0317] S516: The first application crops the corresponding image 3 according to the cropping area 1 and displays it.

[0318] In summary, the method for setting wallpaper provided in the embodiment of the present application crops the photos taken by the user or the pictures downloaded so that they can be displayed with a depth of field effect, and can meet the personalized needs of the user when using a depth of field wallpaper.

[0319] In an optional implementation, the face detection module can perform face detection on all pictures in the gallery application during a preset time period (e.g., 12:00-3:00 a.m., when the user is sleeping) to obtain face detection results. In this way, when the first application receives the first operation of the user to set picture 1 as wallpaper, the first application can directly obtain the face detection result of picture 1 from the face detection module, without the need for the face detection module to perform temporary detection, thus shortening the time consumed by face detection and making the process of users setting depth of field wallpaper smoother.

[0320] In an optional implementation, the cutout result can be obtained by cutting out all pictures in the gallery application in a preset time period (e.g., 12:00-3:00 a.m., when the user is sleeping). In this way, after receiving the cutout request, the cropping module can directly obtain the cutout result of picture 1 from the cutout module, without the need to perform a cutout operation temporarily based on the cutout result, thus shortening the time consumed by the cutout operation and making the process of setting the depth of field wallpaper smoother for the user.

[0321] It should be noted that, Picture 1 in the above embodiment may also be called the first picture, Picture 2 may also be called the third picture, Picture 3 may also be called the second picture, parameter information 1 may also be called the third parameter information, parameter information 2 may also be called the second parameter information, parameter information 3 may also be called the first parameter information, preset condition 1 and preset condition 2 may also be called the first preset condition, preset condition 3 may also be called the second preset condition, cropping area 1 may also be called the second cropping area, and cropping area 2 may also be called the first cropping area.

[0322] It should be noted that the above embodiment describes a specific process when the object is a portrait. The highest point of the portrait is the highest point of the object, the center of the portrait is the center of the object, and the area ratio of the portrait is the area ratio of the object.

[0323] The above embodiments can also be applied to the case where the object is an animal, a landscape, a fruit or other object. The difference is that when the object is an animal, a landscape, a fruit or other object, the object recognition algorithm used by the electronic device is different. For example, when the object is an animal, an animal recognition algorithm can be used to recognize the animal in the picture. That is, the picture can be recognized using an algorithm corresponding to the recognized object.

[0324] In addition, when the object is not a portrait, the third boundary may be the left boundary of the leftmost object in the first picture, and the fourth boundary may be the right boundary of the rightmost object in the first picture. The left boundary of the leftmost object may be a straight line passing through the leftmost pixel of the leftmost object and perpendicular to the x-axis, and the right boundary of the rightmost object may be a straight line passing through the rightmost pixel of the rightmost object and perpendicular to the x-axis.

[0325] Furthermore, when the first image includes an object, the first distance and the second distance are greater than or equal to half of the width of the object, wherein the width of the object may be the distance from the leftmost pixel of the object to the rightmost pixel of the object.

[0326] The embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as the memory of the electronic device). For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read the instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device or server can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.

[0327] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0328] This embodiment also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0329] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes each function or step performed by the mobile phone in the above method embodiment.

[0330] Among them, the electronic device, communication system, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0331] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0332] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0333] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.

[0334] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0335] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0336] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A method for setting wallpaper, characterized in that: Applied to an electronic device including a display screen, the method comprises: receiving a first operation of a user setting a first picture as a wallpaper, wherein a foreground of the first picture includes one or more objects; In response to the first operation, enlarging the first picture according to at least one adjustment coefficient to obtain at least one second picture, where the at least one second picture corresponds to the at least one adjustment coefficient in one-to-one manner; Determine at least one first cropping region according to the at least one second picture; wherein the at least one second picture corresponds to the at least one first cropping region one by one; determining a second cropping region from the at least one first cropping region; Cropping the second image corresponding to the second cropping area according to the second cropping area to obtain a third image; Display a first interface; wherein the first interface includes the third picture and a first control, and the object of the third picture covers a partial area of ​​the first control.

2. The method according to claim 1, characterized in that The determining, according to the at least one second picture, at least one first cropping area comprises: Determine first parameter information of the at least one second picture; wherein the first parameter information of each second picture includes the size of the second picture, the position information of the highest point of an object in the second picture, and the position information of the center of the object in the second picture, the highest point of the object is the highest point among the candidate highest points in the first picture, the candidate highest point is the highest point of the target object among the one or more objects, and the object center is used to reflect the center of the one or more objects in the horizontal direction; Determine the at least one first cropping area according to at least one first parameter information and second parameter information; wherein the at least one first parameter information corresponds one-to-one to the at least one first cropping area, and the second parameter information includes the cropping size and the position information of the first control.

3. The method according to claim 2, characterized in that The size of the first cropping area is the same as the cropping size, the ratio of the cropping size is the same as the ratio of the display screen, the highest point of the object and the first control are located within the first cropping area, and the distance from the highest point of the object to the first side of the first cropping area satisfies a first condition, and the distance from the highest point of the object to the second side of the first cropping area satisfies a second condition, so that when the second image cropped according to the first cropping area is displayed, the object included in the second image obscures a portion of the first control.

4. The method according to claim 3, characterized in that The first side is the upper boundary of the first cropping area, and the first condition includes: the distance from the highest point of the object to the first side of the first cropping area is less than the distance from the lower boundary of the first control to the first side of the first cropping area; or, the first side is the lower boundary of the first cropping area, and the first condition includes: the distance from the highest point of the object to the first side of the first cropping area is greater than the distance from the lower boundary of the first control to the first side of the first cropping area; The second side is the left border of the first cropping area or the right border of the first cropping area, and the second condition includes: the distance from the highest point of the object to the second side of the first cropping area is the same as the distance from the center line of the first control to the second side of the first cropping area.

5. The method according to claim 4, characterized in that The first side is the upper boundary of the first cropping area, and the first condition further includes: the distance from the highest point of the object to the first side of the first cropping area is greater than the distance from the upper boundary of the first control to the first side of the first cropping area; Alternatively, the first side is the lower boundary of the first cropping area, and the first condition also includes: the distance from the highest point of the object to the first side of the first cropping area is less than the distance from the upper boundary of the first control to the first side of the first cropping area.

6. The method according to claim 4, characterized in that The distance from the highest point of the object to the lower border of the first control accounts for 50% of the distance from the lower border of the first control to the upper border of the first control.

7. The method according to any one of claims 1 to 6, characterized in that: The first cropping area satisfies a first preset condition, where the first preset condition includes: the first cropping area does not exceed the area where the first image is located, and the area ratio of the object in the first cropping area is within a first preset range.

8. The method according to any one of claims 1 to 6, characterized in that: The determining the second cropping area from the at least one first cropping area comprises: A first cropping region that satisfies the largest number of conditions in the second preset condition among the at least one first cropping region is determined as the second cropping region.

9. The method according to claim 8, characterized in that The determining of the second cropping area from the at least one first cropping area further comprises: If there are multiple first cropping areas among the at least one first cropping area, the first cropping area with the largest number of conditions that meet the second preset condition is determined as the second cropping area.

10. The method according to claim 8 or 9, characterized in that: The second preset condition includes: Condition 1: All objects included in the first picture are within the second cropping area; Condition 2: When the first picture includes an object, the object is not truncated.

11. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: Determine third parameter information of the first picture; wherein the third parameter information includes the size of the first picture, the position information of the highest point of the object in the first picture, and the position information of the center of the object in the first picture; Determine a third cropping area according to the third parameter information and the second parameter information; The enlarging the first picture according to at least one adjustment coefficient to obtain at least one second picture includes: If the object area ratio of the third cropping area is less than a threshold, the first image is enlarged according to at least one adjustment coefficient to obtain at least one second image.

12. The method according to any one of claims 2 to 11, characterized in that: The first picture includes multiple objects, and the target object is all objects included in the first picture.

13. The method according to any one of claims 2 to 11, characterized in that: The target object is all objects within a first range of the first image, the first range includes a first boundary and a second boundary, the first boundary is a boundary obtained by moving the center of the object in a first horizontal direction by a first distance, and the second boundary is a boundary obtained by moving the center of the object in a second horizontal direction by a second distance.

14. The method according to claim 13, characterized in that The first picture includes an object, and the first distance and the second distance are half of the width of the object; Alternatively, the first picture includes a plurality of objects, and the first distance and the second distance are half of the width of the first control.

15. The method according to any one of claims 2 to 14, characterized in that: Acquiring the position information of the highest point of the object in the second picture includes: Cutting out the second picture to obtain a fourth picture; wherein the fourth picture includes first-category pixel points, and the first-category pixel points are pixel points belonging to the foreground in the second picture; Determine position information of a target pixel point in the fourth picture; wherein the target pixel point is the highest point among all first-category pixel points in the fourth picture, or the target pixel point is the highest point among all first-category pixel points in a first range of the fourth picture; The position information of the target pixel point is used as the position information of the highest point of the object.

16. The method according to any one of claims 2 to 14, characterized in that: The object center is the axis of symmetry between the third boundary perpendicular to the first direction and the fourth boundary perpendicular to the first direction, the position information of the object center is the coordinate of the axis of symmetry in the first direction, and the third boundary and the fourth boundary are two boundaries of the one or more objects in the first direction.

17. The method according to any one of claims 1 to 16, characterized in that: The first control is a time indicator.

18. An electronic device, characterized in that: The electronic device comprises: a memory, a processor and a display screen; The processor is coupled to the memory and the display screen; wherein the memory is used to store computer program codes, and the computer program codes include computer instructions; When the computer instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 17.

19. A computer-readable storage medium, characterized in that: The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 17.