Wallpaper setting method and electronic equipment

By determining the highest point of the object in the photo and cropping, the user's photo is set as a depth of field wallpaper, solving the problem that the existing technology cannot meet the user's personalized needs and improving the visual experience of the lock screen interface.

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

Patent Information

Application Number
CN202310955084.3
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 determining the highest point of the object in the photo and cropping the photo based on this point, the depth of field effect can be displayed. The method includes receiving an operation of a user, acquiring pixel point position information of the image, determining the highest point of the object, and displaying the cropped image with a depth of field effect.

Benefits of technology

It realizes setting users' photos as depth of field wallpaper, meeting users' personalized needs and improving the visual experience of the lock screen interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440677A_ABST
    Figure CN119440677A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a wallpaper setting method and electronic equipment, and relates to the technical field of terminals. The method comprises the following steps: receiving a first operation of setting a first picture as wallpaper by a user, wherein a foreground of the first picture comprises one or more objects; acquiring position information of a first type of pixel points of the first image, wherein the first type of pixel points are pixel points belonging to a foreground in the first image; determining an object highest point of the first picture according to the position information of the first type of pixel points; wherein the highest point of the object is the highest point in the highest points of the target objects in the objects included in the foreground of the first picture; and cutting the first picture according to the highest point of the object, and displaying the cut first picture in a depth-of-field effect. Therefore, the picture shot or downloaded by the user can be set as the depth-of-field wallpaper by determining the highest point of the object of the picture, and the personalized requirements of the user are 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 determine the highest point of an object in a photo, so that users can set the photos they have taken or downloaded as depth of field wallpapers to meet the personalized needs of users.

[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, the foreground of the first picture including one or more objects; obtaining position information of a first category of pixel points of the first image, the first category of pixel points being pixel points belonging to the foreground in the first picture; determining the highest point of an object in the first picture according to the position information of the first category of pixel points; wherein the highest point of the object is the highest point among the highest points of a target object included in the foreground of the first picture; and cropping the first picture according to the highest point of the object, and displaying the cropped first picture with a depth of field effect.

[0006] That is, the present application can first determine the highest point of the object, then crop the first picture based on the highest point of the object, and finally display the cropped picture with a depth of field effect. Thus, the present application can set the photos taken or downloaded by the user as depth of field wallpapers to meet the personalized needs of the user.

[0007] In an implementation provided in the first aspect, the obtaining of the position information of the first type of pixel points of the first image includes: performing a cutout process on the first image to obtain a cutout result, wherein the cutout process is used to separate the foreground and non-foreground of the first image, and the cutout result includes the first type of pixel points; and obtaining the position information of the first type of pixel points of the first image according to the cutout result. That is, the foreground can be separated from the first image by cutout, so as to determine the position information of the first type of pixel points.

[0008] In an implementation provided in the first aspect, the target object is an object within a first range of the first image, the first range includes a first boundary and a second boundary, and the method further includes: determining an object center of the first image, the object center being used to reflect the center of the one or more objects in a horizontal direction; moving the object center in a first horizontal direction by a first distance to obtain the first boundary, and moving the object center in a second horizontal direction by a first distance to obtain the second boundary, so as to obtain the first range; wherein the first horizontal direction and the second horizontal direction are opposite.

[0009] In an implementation provided in the first aspect, the foreground includes an object, and the distance between the first boundary and the second boundary is greater than or equal to the width of the key area of ​​the object; or, the foreground includes multiple objects, the distance between the first boundary and the second boundary is greater than or equal to the width of a first control, the first control is a control in an interface where the first cropped image is displayed with a depth of field effect, the first control is a control included in a first interface, and the first interface is an interface for displaying the first cropped image with a depth of field effect.

[0010] That is to say, when the foreground includes one object or multiple objects, the first range used to determine the highest point of the object is different. When the foreground includes one object, the distance between the first boundary and the second boundary is greater than or equal to the width of the key area of ​​the object, so that the first range can cover the area where the object is located, that is, the highest point of the object is the highest point of the object; when the foreground includes multiple objects, the distance between the first boundary and the second boundary is greater than or equal to the width of the first control, so that the first range can cover the area where the second control is located, that is, the highest point of the object is the highest point of the object in the area covered by the first control.

[0011] In an implementation provided in the first aspect, the object is a person image, and the key area of ​​the object is a face area of ​​the person object. That is, when the object is a person image, the first range is based on covering the face area.

[0012] In an implementation method provided in the first aspect, the object center is the axis of symmetry between a third boundary perpendicular to the first direction and a 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.

[0013] In an implementation method provided in the first aspect, determining the object center of the first picture includes: detecting one or more objects of the first picture to obtain position information of key points of the first picture, the position information of the key points including the coordinates of the key points in the first direction; using the minimum coordinates of the key points in the first direction as the coordinates of the third boundary, and using the maximum coordinates of the key points in the first direction as the coordinates of the fourth boundary; and determining the axis of symmetry between the third boundary and the fourth boundary as the object center of the first picture based on the coordinates of the third boundary and the coordinates of the fourth boundary.

[0014] In an implementation manner provided in the first aspect, the object is a person image, and the key point is a face.

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

[0016] 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.

[0017] 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.

[0018] 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.

[0019] 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0044] Fig. 21B A flow chart for determining the highest point of a portrait provided in an embodiment of the present application;

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

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

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

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

[0052] 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.

[0053] 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.

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

[0055] For example, see Figure 1A , is a schematic diagram of the lock screen interface using a depth of field wallpaper. Figure 1AAs 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 .

[0056] 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.

[0057] 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 1B As 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.

[0058] 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.

[0059] contrast Figure 1A , Figure 1BIt 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.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] In view of this, an embodiment of the present application provides a method for setting wallpaper, which can determine the highest point of an object in a photo and crop the photo based on the highest point of the object, so that the device displays the cropped photo according to the depth of field effect, making it convenient for users to set the photos they have taken or downloaded as depth of field wallpapers to meet the user's personalized needs.

[0064] 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.

[0065] 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.

[0066] 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.

[0067] 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.

[0068] 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.

[0069] 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.

[0070] 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.

[0071] 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.

[0072] 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.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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.

[0078] 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.

[0079] 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.

[0080] 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.

[0081] 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.

[0082] 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.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] 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.

[0087] 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.

[0088] 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.

[0089] 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.

[0090] 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.

[0091] 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.

[0092] 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.

[0093] 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.

[0094] 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.

[0095] 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.

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

[0097] 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.

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

[0099] 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.

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

[0101] 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.

[0102] 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.

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

[0104] 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.

[0105] 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 5 As 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.

[0106] 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.

[0107] 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.

[0108] 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 with or without the depth of field effect on the lock screen preview interface. For the process of determining whether the image 503 supports the depth of field effect, refer to S210 to S250 and S310 to S360, which will not be described here for the time being.

[0109] 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.

[0110] 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 5 As 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.

[0111] 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.

[0112] 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.

[0113] 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).

[0114] 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 .

[0115] 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.

[0116] 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.

[0117] 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.

[0118] 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.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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 7B As 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.

[0123] 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.

[0124] 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.

[0125] For example, Figure 8BAs 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.

[0126] 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.9A As 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.

[0127] 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.

[0128] 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.

[0129] 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.

[0130] 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.

[0131] 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.

[0132] S210: receiving a first operation of setting a first picture as wallpaper by a user.

[0133] The first picture is a picture selected by the user to be set as wallpaper. It can be a picture 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.

[0134] Exemplarily, the first picture may 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 the first image as wallpaper, which is not specifically limited herein.

[0135] S220: In response to the first operation, obtain first parameter information of the first picture.

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

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

[0138] The first picture may include one or more character images (which may be referred to as portraits).

[0139] In the embodiment of the present application, the portrait center is used to reflect the horizontal distribution of all the character images in the first picture. The portrait center can be the symmetry axis of 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.

[0140] 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.

[0141] 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 first image is symmetrical about the portrait center in the x-axis direction.

[0142] In an optional implementation, the third boundary is the left boundary of the face frame of the leftmost person image in the first picture, and the fourth boundary is the right boundary of the face frame of the rightmost person image in the first picture. The mobile phone can determine the third boundary based on the position information of the leftmost face in the first picture, and determine the fourth boundary based on the position information of the rightmost face in the first picture. It should be noted that, in the case where only one person image is included in the first picture, 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.

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

[0144] 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.

[0145] 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.

[0146] 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)].

[0147] 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.

[0148] 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].

[0149] 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.

[0150] 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), the first picture 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.

[0151] For example, Fig.12 As shown in (b), the first picture includes face a, face b, face c and face d. Face a is located at the leftmost of all the person images in the first picture, face c is located at the rightmost of all the person images in the first picture, 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.

[0152] 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 the first picture, and determine the fourth boundary based on the position information of the rightmost person image in the first picture. 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.

[0153] 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.

[0154] 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.

[0155] 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 first picture. 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 first picture.

[0156] In an optional implementation, the target object may be a portrait within a first range of the first image. 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.

[0157] In the case where the first image includes only a portrait, the first distance and the second distance may 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 may be the same or different.

[0158] 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=(xa1 +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.

[0159] 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 first picture.

[0160] In the case where the first picture includes multiple portraits, 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.

[0161] 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.

[0162] 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.

[0163] For example, Fig.13Take (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.

[0164] Among them, the first range includes portrait A and portrait B, and the target objects are portrait A and portrait 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 the first picture.

[0165] 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.

[0166] 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.

[0167] In another optional implementation, the target object may be all portraits in the first picture.

[0168] 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.

[0169] 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.

[0170] S230: Determine a first cropping area according to the first parameter information and the second parameter information.

[0171] The second parameter information includes the cropping size and the position information of the first control.

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

[0173] 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.

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

[0175] 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 first cropping area).

[0176] 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.

[0177] In the embodiment of the present application, the mobile phone can determine the size and position of the first cropping area according to the first parameter information and the second parameter information.

[0178] The size of the first cropping area is the same as the cropping size. For example, if the cropping size is 2340×1080 pixels, the size of the first cropping area 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 first cropping area is also the same as the ratio of the display screen.

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

[0180] 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.

[0181] Among them, in the y-axis direction, the distance from the highest point of the portrait to the first side of the first cropping area satisfies the first condition; in the x-axis direction, the distance from the highest point of the portrait 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 portrait included in the second picture obstructs part of the first control area.

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

[0183] In the case where the first side is the upper boundary of the first cropping area, the first condition includes: the distance from the highest point of the portrait 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. Optionally, the distance from the highest point of the portrait 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.

[0184] In the case where the first side is the lower boundary of the first cropping area, the first condition includes: the distance from the highest point of the portrait 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. Optionally, the distance from the highest point of the portrait 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.

[0185] 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 first cropping area 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 first picture, the height of the first cropping area, 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 first cropping area.

[0186] 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 the first picture.

[0187] Among them, 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 portrait 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.

[0188] In the embodiment of the present application, in the x-axis direction, the mobile phone can use the portrait center of the first picture as the symmetry axis of the first cropping area, and the symmetry axis of the first cropping area 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 first picture and the width of the first cropping area. In this way, when the display screen displays the content contained in the first cropping area (i.e., the second picture), the characters in the picture can be evenly distributed on the display screen, making the picture more coordinated.

[0189] Exemplarily, the first parameter information and the second parameter information 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 first cropping area is h4, the size of the first picture is w2×h2, the distance from the highest point of the portrait to the upper top edge of the first picture is M1, and the center of the portrait is x=a.

[0190] according to Fig.14 The mobile phone can determine the first cropping area based on the first parameter information and the second parameter information shown in FIG. Fig.15 The shaded area shown.

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

[0192] 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).

[0193] S240: If the first cropping area meets the first preset condition, crop the first image according to the first cropping area to obtain a second image.

[0194] The first preset condition is used to predict whether the second image can be displayed with a depth of field effect.

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

[0196] (1) The first cropping area does not exceed the area where the first image is located.

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

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

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

[0200] 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 first cropping area to the area of ​​the first cropping area. Optionally, the mobile phone can perform human body recognition on the first cropping area 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 first cropping area, and the area ratio of the portrait is calculated in combination with the area of ​​the first cropping area.

[0201] 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 the first picture. For example, in the case where the first picture includes a portrait, the first preset range can be 3% to 18%, and in the case where the first picture includes multiple portraits, the first preset range can be 2% to 9%.

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

[0203] If the area ratio of the portrait is not within the first preset range, it means that the person in the first cropping area 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 may not crop the first picture according to the first cropping area.

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

[0205] S250, displaying the second picture with a depth of field effect.

[0206] For example, Fig.16 As shown, the mobile phone can determine the first cropping area from the first picture, and when the first cropping area meets the first preset condition, the first picture is cropped according to the first cropping area to obtain the second picture. In this way, when the second picture is displayed, the second picture, the first control, and the cutout result of the second picture can be superimposed so that the cutout result (i.e., the portrait part of the second picture) can cover part of the first control area to create a depth of field effect.

[0207] In an optional implementation, to obtain a better display effect, the mobile phone can enlarge the first image into multiple third images, and obtain the second cropping area corresponding to each third image. Then, the mobile phone selects the best cropping area from the multiple second cropping areas as the first cropping area, and crops the corresponding third image according to the first cropping area to obtain the second image, and displays the second image with a depth of field effect. Fig.17 This embodiment will be described.

[0208] like Fig.17 FIG. 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.

[0209] S310: receiving a first operation of setting a first picture as wallpaper by a user.

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

[0211] S320, enlarging the size of the first picture by n times to obtain a third picture.

[0212] 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 minIt is the minimum value of the adjustment coefficient n pre-stored in the mobile phone, for example, 1.

[0213] 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 the first image by n max times to get the third picture.

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

[0215] Exemplarily, the size of the first picture is w1*h1, the distance from the highest point of the portrait in the first picture to the upper boundary of the third picture is M1, and the center of the portrait in the first picture is x=a, then the size of the third picture is (n*w1)*(n*h1), and the distance from the highest point of the portrait in the third picture to the upper boundary of the third picture is n*M1, and the center of the portrait in the third picture is x=n*a.

[0216] S330, obtaining third parameter information of the third picture.

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

[0218] The process of obtaining the third parameter information of the third picture refers to S220 and S410 to S440, which will not be repeated here.

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

[0220] S340: Determine a second cropping area in the third picture according to the third parameter information and the second parameter information.

[0221] The size of the second cropping area is the same as the cropping size.

[0222] In an embodiment of the present application, the mobile phone can determine the position of the second cropped area in the third picture based on the size of the third picture, the distance from the highest point of the portrait in the third picture to the upper boundary of the third picture, the position of the center of the portrait, and the second parameter information.

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

[0224] Exemplarily, the first parameter information and the second parameter information 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 first picture is w2×h2, the distance from the highest point of the portrait to the upper top edge of the first picture is M1, and the center of the portrait is x=a.

[0225] Among them, the third picture is obtained by magnifying the first picture n times, such as Fig.18 As shown in (b), the size of the third picture is (n*w2)*(n*h2), the distance from the highest point of the portrait in the third picture to the upper boundary of the third picture is n*M1, and the center of the portrait in the third picture is x=n*a.

[0226] according to Fig.18 The parameter information shown in (b) can be obtained Fig.18 The position of the second cropping area shown in (c).

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

[0228] 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].

[0229] S350: Determine whether the second cropping area meets a second preset condition.

[0230] The second preset condition 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 second cropping area. In an optional implementation, the second preset condition includes:

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

[0232] In the case where the second cropping area exceeds the area where the third picture is located, if the adjustment coefficient n is further reduced, the new second cropping area obtained according to the adjusted adjustment coefficient n will still exceed the area where the first picture is located.

[0233] 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 second cropped area will be reduced, that is, it will still be less than the first threshold, affecting the display effect.

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

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

[0236] If the second cropping area meets the second preset condition, S350 is executed; if the second cropping area does not meet the second preset condition, S360 is executed.

[0237] S360, reduce n.

[0238] 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 S360 is directly executed.

[0239] 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.

[0240] 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.

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

[0242] In the embodiment of the present application, through S320 to S350, the mobile phone can obtain at least one third picture and the second cropping area corresponding to each third picture, wherein the adjustment coefficient n corresponding to each third picture is different.

[0243] For example, at least one third picture includes picture 1, picture 2, picture 3... picture m, where picture 1 is a picture obtained by enlarging the first picture by A1 times, picture 2 is a picture obtained by enlarging the first picture by A2 times, picture 3 is a picture obtained by enlarging the first picture by A3 times,..., picture n is a picture obtained by enlarging the first picture by Am times.

[0244] In addition, the mobile phone can also determine the second cropping area 1 corresponding to the picture 1, the second cropping area 2 corresponding to the picture 2, the second cropping area 3 corresponding to the picture 3, ... the second cropping area m corresponding to the picture m.

[0245] S370: Crop and display the corresponding third image according to the first cropping area.

[0246] The first cropping area is a cropping area that meets at most the third preset condition among all the second cropping areas.

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

[0248] In the embodiment of the present application, the third preset condition may include:

[0249] Condition A: When the first picture includes two portraits, the second cropping area also includes the two portraits.

[0250] In an optional implementation, when the first image 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 in the second cropping area.

[0251] If both faces are located in the first cropping area, it means that the first cropping area includes the two portraits. In this way, the portraits in the image cropped according to the second cropping area are evenly distributed and have a good display effect.

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

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

[0254] 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.

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

[0256] For example, the mobile phone obtains picture 1, picture 2, and picture 3 according to S320 to S350, and determines that the second cropping area of ​​picture 1 is cropping area 1, the second cropping area of ​​picture 2 is cropping area 2, and the second cropping area of ​​picture 3 is cropping area 3.

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

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

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

[0260] If the area ratio of the portrait in the third cropping area 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 first image is enlarged, the area ratio of the portrait in the second cropping area will only increase, and a good display effect cannot be achieved. Therefore, if the area ratio of the portrait in the third cropping area is greater than the second threshold, S340 may not be executed, but the first image 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 first image with a non-depth of field effect.

[0261] In another optional implementation, the mobile phone can obtain all values ​​of the adjustment coefficient n, and enlarge the first image according to all values ​​of the adjustment coefficient n to obtain the corresponding third image. Then, the mobile phone can obtain the second cropping area corresponding to each third image, and determine the first cropping area from all the second cropping areas. Then, the corresponding third image is cropped and displayed according to the first cropping area.

[0262] 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.

[0263] See also Fig. 20 , is a method for determining the highest point of an object provided in an embodiment of the present application, which 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.

[0264] S410: Perform face detection on the first image to determine position information of all faces.

[0265] 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 faces in the first image, and the location information of each face.

[0266] 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.

[0267] S420, determine a first range.

[0268] 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.

[0269] If the first picture includes only a portrait, 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 the width of the face frame. For details, see the relevant description in S220, which will not be repeated here.

[0270] If the first picture 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.

[0271] S430, performing cutout on the first image to obtain a cutout result.

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

[0273] 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 the first image, and the second type of pixel points are pixel points other than the foreground in the first image.

[0274] For example, the cutout result may be a grayscale image, and the grayscale value of each pixel indicates whether each pixel of the first image belongs to a 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 first image, 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 first image.

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

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

[0277] 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.

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

[0279] In another optional implementation, the target pixel is the highest point of all first-category pixels within the first range of the cutout result, wherein the first range is related to the number of portraits included in the first image, and details are provided in S220 regarding the highest point of the portrait, which will not be described in detail here.

[0280] It should be noted that, when the electronic device executes S310 to S360, the electronic device needs to determine the highest point of the portrait in the third picture, wherein the process of determining the highest point of the portrait in the third picture can refer to S410 to S440.

[0281] For example, Fig. 21B As shown, the electronic device can obtain the size w*h of the first picture, then enlarge the first picture n times to obtain the third picture, and determine the size of the third picture to be nw*nh. Then the electronic device can determine the center of the portrait of the third picture. If the third picture includes only one portrait, the electronic device can determine the first range based on the center of the portrait and the width of the face frame, and then determine the highest point of the portrait in combination with the cutout result of the third picture and the first range; if the third picture includes multiple portraits, the electronic device can determine the first range based on the center of the portrait and the width of the first control, and then determine the highest point of the portrait in combination with the cutout result of the third picture and the first range.

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

[0283] 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.

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

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

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

[0287] The face detection request carries data of the first image.

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

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

[0290] The face detection result includes the position information of all faces in the first image.

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

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

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

[0294] The cropping request may carry the face detection result and the data of the first image.

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

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

[0297] The cutout request carries the data of the first image.

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

[0299] S508: The cropping module determines first parameter information according to the cutout result and the face detection result.

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

[0301] S509: The cropping module enlarges the size of the first picture by n times to obtain a third picture.

[0302] S510: The cropping module determines a second cropping area in the third picture according to the first parameter information and the second parameter information.

[0303] S511: The cropping module determines whether the second cropping area meets a second preset condition.

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

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

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

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

[0308] S513, the cropping module reduces n.

[0309] S514: The cropping module determines a first cropping area from the second cropping area.

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

[0311] S516: The first application crops and displays the corresponding third image according to the first cropping area.

[0312] 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.

[0313] In an optional implementation, the face detection module can perform face detection on all images 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 the first image as wallpaper, the first application can directly obtain the face detection result of the first image 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 the user setting the depth of field wallpaper smoother.

[0314] In an optional implementation, the cutout result can be obtained by cutting out all the 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 the first picture 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.

[0315] 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.

[0316] 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.

[0317] 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.

[0318] 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.

[0319] 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.

[0320] 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.

[0321] 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.

[0322] 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.

[0323] 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.

[0324] 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.

[0325] 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.

[0326] 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.

[0327] 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.

[0328] 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.

[0329] 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; Acquire position information of first-category pixel points of the first image, where the first-category pixel points are pixel points belonging to the foreground in the first image; Determine the highest point of the object in the first picture according to the position information of the first type of pixel points; wherein the highest point of the object is the highest point among the highest points of the target object in the object included in the foreground of the first picture; The first image is cropped according to the highest point of the object, and the cropped first image is displayed with a depth of field effect.

2. The method according to claim 1, characterized in that The acquiring the position information of the first type of pixel points of the first image includes: Performing a cutout process on the first image to obtain a cutout result, wherein the cutout process is used to separate a foreground and a non-foreground of the first image, and the cutout result includes the first type of pixel points; According to the cutout result, position information of the first type of pixel points of the first image is obtained.

3. The method according to claim 1, characterized in that The target object is an object within a first range of the first image, the first range includes a first boundary and a second boundary, and the method further includes: Determine an object center of the first picture, where the object center is used to reflect the center of the one or more objects in a horizontal direction; The first boundary is obtained by moving the center of the object in a first horizontal direction by a first distance, and the second boundary is obtained by moving the center of the object in a second horizontal direction by a first distance, so as to obtain the first range; wherein the first horizontal direction is opposite to the second horizontal direction.

4. The method according to claim 3, characterized in that The foreground includes an object, and the distance between the first boundary and the second boundary is greater than or equal to the width of the key area of ​​the object; or The foreground includes multiple objects, the distance between the first boundary and the second boundary is greater than or equal to the width of a first control, the first control is a control in an interface where the first cropped image is displayed with a depth of field effect, the first control is a control included in a first interface, and the first interface is an interface for displaying the first cropped image with a depth of field effect.

5. The method according to claim 4, characterized in that The object is a person image, and the key area of ​​the object is a face area of ​​the person object.

6. The method according to any one of claims 3 to 5, 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.

7. The method according to claim 6, characterized in that The determining the object center of the first picture includes: Detecting one or more objects in the first image to obtain position information of key points in the first image, where the position information of the key points includes coordinates of the key points in the first direction; Using the minimum coordinate of the key point in the first direction as the coordinate of the third boundary, and using the maximum coordinate of the key point in the first direction as the coordinate of the fourth boundary; According to the coordinates of the third boundary and the coordinates of the fourth boundary, a symmetry axis between the third boundary and the fourth boundary is determined as the object center of the first picture.

8. The method according to claim 7, characterized in that The object is a person image, and the key point is a face.

9. 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 8.

10. 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 8.

Citation Information

Cited By

  • Wallpaper setting method and electronic device

    EP4708041A1

  • Wallpaper setting method and electronic device

    WO2025025657A1