Image processing method, electronic device, and storage medium
By automatically cropping different objects as wallpaper objects in the wallpaper recommendation interface, it solves the problem that users find it difficult to quickly select beautiful wallpapers, and quickly set wallpapers with better display effects, improving user experience.
Patent Information
- Application Number
- PCT/CN2024/138524
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-08
- Filing Date
- 2024-12-11
- Publication Date
- 2025-07-03
AI Technical Summary
When users set up electronic device wallpapers, it is difficult for them to quickly select beautiful and suitable pictures, and the existing methods require multiple operations to obtain wallpapers with better display effects.
By displaying candidate wallpapers in the wallpaper recommendation interface, different objects are automatically cropped as wallpaper objects according to the image changes in the gallery application, improving the accuracy of wallpaper recommendations and making the recommended wallpaper more in line with user expectations.
Users can quickly determine wallpapers with better display effects, which improves the efficiency and user experience of setting wallpapers.
Smart Images

Figure CN2024138524_03072025_PF_FP_ABST
Abstract
Description
Image processing method, electronic device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 26, 2023, with application number 202311816503.1 and application name “Image processing method and electronic device”, and claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 8, 2024, with application number 202410035396.7 and application name “Wallpaper recommendation method, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of terminal technology, and in particular to a wallpaper recommendation method, electronic device, and storage medium. Background Art
[0003] In order to improve the display effect of the lock screen interface of the electronic device, the user can select a picture from the gallery application to set the wallpaper displayed on the electronic device.
[0004] However, when setting wallpapers for electronic devices, users often struggle to quickly select aesthetically pleasing photos suitable for wallpaper from gallery apps. Furthermore, when users manually select a picture as a candidate wallpaper, they often have to perform multiple operations to set it as a wallpaper with optimal display quality. For example, users need to manually edit the photo's proportions, size, and wallpaper template to obtain a wallpaper that satisfies them and provides optimal display quality. Summary of the Invention
[0005] The embodiments of the present application provide an image processing method, an electronic device, and a storage medium, which display candidate wallpapers on a wallpaper recommendation interface, thereby not only allowing users to quickly determine wallpapers with better display effects, but also improving the efficiency of users in setting wallpapers.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, an image processing method is provided, including: when all pictures in a gallery application belong to a first picture set, displaying a wallpaper recommendation interface, wherein the wallpaper recommendation interface includes a first portrait in the first picture; when all pictures in the gallery application belong to a second picture set, displaying a second object in the first picture on the wallpaper recommendation interface, wherein the second object is a second portrait different from the first portrait or a non-human object, and the second picture set is at least partially different from the first picture set.
[0008] It can be understood that when all the pictures in the gallery application change from the first picture set to the second picture set, and the central figure determined based on all the pictures in the gallery application changes from the first portrait in the first picture to the second portrait, the candidate wallpaper displayed in the wallpaper recommendation interface changes from the first candidate wallpaper to the second candidate wallpaper. Alternatively, when the second picture set does not include the central figure, the second wallpaper object in the wallpaper recommendation interface is a non-human object. In this application, the electronic device can crop different objects as wallpaper objects in real time according to the changes in the pictures in the gallery application, thereby improving the accuracy of wallpaper recommendations and making the recommended wallpapers more in line with user expectations.
[0009] In a possible implementation of the first aspect, the first portrait corresponds to the first person, the second portrait corresponds to the second person, the portrait pictures corresponding to the first person in the first picture set are the first portrait set, and the portrait pictures corresponding to the second person in the first picture set are the second portrait set; the portrait pictures corresponding to the first person in the second picture set are the third portrait set, and the portrait pictures corresponding to the second person in the second picture set are the fourth portrait set; the first picture set and the second picture set are at least partially different, including: the first portrait set is different from the third portrait set and / or the second portrait set is different from the fourth portrait set.
[0010] It can be understood that after the gallery application performs portrait clustering on all pictures to obtain the first person and the second person, when the pictures in the gallery application change from the first picture set to the second picture set, the portrait picture of the first person in the first picture set is different from the portrait picture of the first person in the second picture set, and the portrait picture of the second person in the first picture set is also different from the portrait picture of the second person in the second picture set.
[0011] In another possible implementation of the first aspect, the first portrait set is different from the third portrait set in that: the shooting time and / or shooting location distribution of the pictures in the third portrait set is more concentrated than the shooting time and / or shooting location distribution of the pictures in the first portrait set; the second portrait set is different from the fourth portrait set in that: the shooting time and / or shooting location distribution of the pictures in the second portrait set is more concentrated than the shooting time and / or shooting location distribution of the pictures in the fourth portrait set.
[0012] It can be understood that, assuming that a large number of pictures of the first person are added to the second picture set, or a large number of pictures of the first person are deleted from the second picture set, the shooting time and / or location distribution of the pictures in the third portrait set is different from the time and / or location distribution of the pictures in the first portrait set.
[0013] In another possible implementation of the first aspect, the first image further includes a portrait of a third person; the portrait of the third person has the largest area;
[0014] When all pictures in the gallery application are the third picture set, the third person portrait in the first picture is displayed on the wallpaper recommendation interface.
[0015] It can be understood that when the first picture used to generate the candidate wallpaper does not include the central person, the portrait with the largest face area in the first picture can be cropped to generate the candidate wallpaper.
[0016] In another possible implementation manner of the first aspect, the portrait pictures in the third picture set include only the first picture.
[0017] It can be understood that the electronic device determines that the portrait pictures in the third picture set only include the first picture, and the electronic device determines that the central person is not included based on all pictures in the gallery application. The electronic device can crop the third portrait with the largest face area from the first picture used to generate the candidate wallpaper.
[0018] In another possible implementation of the first aspect, when all pictures in the gallery application are a fourth picture set, the fourth picture set does not include portrait pictures, the fourth object in the second picture is displayed on the wallpaper recommendation interface, and the area of the second picture including the fourth object is the largest.
[0019] It can be understood that when the gallery application does not include portrait pictures, the electronic device generates a fourth candidate wallpaper by cropping the fourth object with the largest area from the second picture, so that the generated candidate wallpaper better meets user expectations.
[0020] In another possible implementation of the first aspect, before displaying the wallpaper recommendation interface, the wallpaper recommendation method may further include:
[0021] Determining whether the first picture includes a central figure; when it is determined that the first picture includes a central figure and the first portrait is the central figure, cropping the first picture based on the first portrait; generating a first candidate wallpaper;
[0022] When it is determined that the first picture includes a central figure and the second object is the central figure, or when it is determined that the first picture does not include a central figure and the second object has the largest area, the first picture is cropped based on the second object; and a second candidate wallpaper is generated.
[0023] It can be understood that when the central character changes, the cropping object used to generate the first picture in the candidate wallpaper also changes, thereby achieving the purpose of updating the candidate wallpaper in real time according to the pictures in the gallery application.
[0024] In another possible implementation of the first aspect, before determining whether the first picture includes a central figure, the wallpaper recommendation method may further include:
[0025] When a first picture set sent by a gallery application is received, a character image heterogeneous graph is determined based on all the pictures in the first picture set. Based on the character image heterogeneous graph, divergence calculations are performed on the pictures corresponding to each of the multiple characters to obtain the time distribution divergence and location distribution divergence of the pictures corresponding to each of the multiple characters; based on the time distribution divergence and location distribution divergence, the central character is identified.
[0026] In another possible implementation of the first aspect, the time distribution divergence and location distribution divergence of the first picture corresponding to the central person meet a first preset condition, and the first preset condition includes: the divergence sum is in the top Q1 of the first ranking; the divergence sum is the sum of the time distribution divergence and the location distribution divergence, and the first ranking is obtained by ranking multiple characters in order of the divergence sum from small to large, and Q1 is a positive integer; or, the divergence ranking sum is in the top Q2 of the second ranking; the divergence ranking sum is the sum of the time divergence ranking and the location divergence ranking, and the second ranking is obtained by ranking multiple characters in order of the divergence ranking sum from small to large, and Q2 is a positive integer.
[0027] In another possible implementation of the first aspect, based on the person image heterogeneous graph, divergence calculation is performed on each picture corresponding to a plurality of people to obtain a time distribution divergence and a location distribution divergence of the pictures corresponding to each person in the plurality of people, including:
[0028] According to the shooting time of the pictures corresponding to each of the multiple characters, the distribution of the pictures corresponding to each character in multiple preset time intervals is counted to obtain the corresponding first time distribution; the divergence between the first time distribution and the uniform time distribution is determined to obtain the time distribution divergence of the pictures corresponding to each character; according to the shooting location of the pictures corresponding to each character, the distribution of the shooting location of the pictures corresponding to each character in multiple known locations is counted to obtain the first location distribution, and the multiple known locations include the shooting locations of all images in the gallery application; the divergence between the first location distribution and the uniform location distribution is determined to obtain the location distribution divergence of the pictures corresponding to each character.
[0029] It can be understood that by calculating the divergence of the image corresponding to each character, the central character is determined, and the user experience is further improved by accurately identifying the central character.
[0030] In another possible implementation of the first aspect, before determining whether the first picture includes a central person, the method further includes:
[0031] When the first picture set sent by the gallery application is received, face clustering is performed on all pictures in the first picture set, and the person who appears most frequently in the face clustering results is determined as the central person.
[0032] It can be understood that the electronic device can also perform face clustering on the pictures in the gallery application, and determine the person who appears most frequently as the central person based on the face clustering results.
[0033] In another possible implementation of the first aspect, before determining whether the first picture includes a central person, the method further includes:
[0034] Determine whether the first image includes a face; perform area detection on the subject in the first image to determine the subject with the largest area in the first image; when it is determined that the first image includes a face, determine that the subject with the largest area is the subject where the face is located, or determine that the subject with the largest area is not the subject where the face is located and the area ratio of the subject where the face is located to the subject with the largest area is less than a ratio threshold.
[0035] It can be understood that when the first picture includes a face and the subject where the face is located has the largest area, the subject where the face is located is determined to be the central person; or, when the first picture includes a face, but the subject with the largest area is not a face and the area of the subject where the face is located is relatively small, the subject with the largest area is determined to be the central person.
[0036] In another possible implementation of the first aspect, cropping the first picture based on the first person portrait includes:
[0037] After determining multiple candidate frames based on the position of the first portrait, a cropping frame is determined from the multiple candidate frames based on the aesthetic scores of the first portrait contained in the multiple candidate frames; and the first image is cropped based on the area corresponding to the cropping frame.
[0038] It can be understood that when determining to crop the first portrait in the first picture as a candidate object in the candidate wallpaper, the candidate object with the highest aesthetic score can be cropped, thereby generating a candidate wallpaper with a higher aesthetic score.
[0039] In another possible implementation of the first aspect, before generating the first candidate wallpaper, the method further includes:
[0040] After subject detection is performed on the first picture and a subject tag of the first picture is determined, the first picture is matched to a corresponding wallpaper display area according to at least one of a central person, a depth of field effect corresponding to the first picture, and the subject tag.
[0041] It can be understood that different wallpaper display areas correspond to different wallpaper generation rules. The electronic device can match the first picture as a candidate wallpaper to the corresponding wallpaper display area based on the central character, the depth of field effect of the first picture and the subject label.
[0042] In another possible implementation of the first aspect, when the main body in the first candidate wallpaper and / or the second candidate wallpaper overlaps with a partial area of the control on the lock screen interface, the overlapping area between the control on the lock screen interface and the main body is blocked by the main body.
[0043] In another possible implementation of the first aspect, the wallpaper recommendation method may further include:
[0044] Receive a user's operation on the first candidate wallpaper or the second candidate wallpaper on the wallpaper recommendation interface, and set the first candidate wallpaper or the second candidate wallpaper as the lock screen wallpaper.
[0045] In a second aspect, the present application proposes an image processing method, comprising:
[0046] Perform central person detection on all images in the gallery application. After determining the central person, determine whether the first image includes an object corresponding to the central person; when the first image includes the central person, determine that the first wallpaper object is the target subject of the first image; perform composition processing on the first image based on the target subject to obtain the target image; generate candidate wallpapers based on the target image; and display the candidate wallpapers on the wallpaper recommendation interface.
[0047] It can be understood that the electronic device determines that the first picture as a candidate wallpaper includes a central person, performs composition processing on the first picture, and generates a candidate wallpaper.
[0048] In a possible implementation of the second aspect, before determining whether the first image includes an object corresponding to the central person, the wallpaper recommendation method further includes:
[0049] Perform subject area detection on the first image to determine the area of each subject in the first image; when it is determined that the first image includes a face, determine whether the subject where the face is located is the subject with the largest area; and determine that the subject where the face is located is the subject with the largest area.
[0050] In a possible implementation of the second aspect, the method further includes:
[0051] It is determined that the subject where the face is located is not the subject with the largest area, and the area ratio of the subject where the face is located to the subject with the largest area is less than a ratio threshold.
[0052] In a possible implementation of the second aspect, performing central person detection on all images in a gallery application to determine the central person further includes:
[0053] An image set of each person in all pictures in the gallery application is determined; and a person in the image set of each person that meets a first preset condition is determined as a central person.
[0054] In a possible implementation of the second aspect, determining a person in each person image set that meets a first preset condition as a central person includes:
[0055] Calculate the time uniformity of each character's image distribution in multiple preset time intervals and the location uniformity of each character's image distribution; determine the central character based on the time and / or location uniformity, and the first preset condition includes the time and / or location distribution uniformity ranking first.
[0056] It can be understood that when the pictures in the gallery application change, the central person determined by the electronic device based on the uniformity of time and / or location distribution may also change.
[0057] In a possible implementation of the second aspect, calculating the temporal uniformity of the distribution of each person's image in a plurality of preset time intervals and the locational uniformity of the distribution of each person's image includes:
[0058] Determine the time dispersion of each character's image and the location dispersion of each character's image; and determine the uniformity of time and / or location distribution based on the time dispersion and / or location dispersion.
[0059] In a possible implementation of the second aspect, determining a person in each person image set that meets a first preset condition as a central person further includes:
[0060] A character image heterogeneous graph is determined based on all the images in the gallery application. Based on the character image heterogeneous graph, divergence calculation is performed on the images corresponding to each of the multiple characters to obtain the time distribution divergence and location distribution divergence of the images corresponding to each of the multiple characters. A character whose time distribution divergence and location distribution divergence of the corresponding image meet a first preset condition is determined as the central character. The first preset condition includes: the divergence sum is in the top Q1 of the first ranking; the divergence sum is the sum of the time distribution divergence and the location distribution divergence, and the first ranking is obtained by ranking multiple characters in ascending order of the divergence sum, and Q1 is a positive integer; or, the divergence ranking sum is in the top Q2 of the second ranking; the divergence ranking sum is the sum of the time divergence ranking and the location divergence ranking, and the second ranking is obtained by ranking multiple characters in ascending order of the divergence ranking sum, and Q2 is a positive integer.
[0061] In a possible implementation of the second aspect, the first preset condition includes that the person is the most frequently appearing person, and the person in each person image set that meets the first preset condition is determined as the central person, further comprising:
[0062] Perform face clustering on all images in the image collection of each person to obtain face clustering results; based on the face clustering results, determine the person with the highest frequency of appearance as the central person.
[0063] In a third aspect, the present application provides an electronic device comprising: one or more processors; a memory; and a display screen; wherein the display screen is used to display a wallpaper recommendation interface, and one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes an image processing method as described in any one of the first or second aspects above.
[0064] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the image processing method as described in any one of the first aspect or the second aspect.
[0065] In a fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the image processing method as described in any one of the first aspect or the second aspect.
[0066] It can be understood that the electronic device described in the third aspect, the computer storage medium described in the fourth aspect, and the computer program product described in the fifth aspect 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] FIG1 is an example of setting wallpaper in the related art;
[0068] FIG2 is a second example of setting wallpaper in the related art;
[0069] FIG3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0070] FIG4 is a software structure diagram of an electronic device provided in an embodiment of the present application;
[0071] FIG5 is an example diagram of setting a lock screen wallpaper according to an embodiment of the present application;
[0072] FIG6 is an example diagram of generating candidate wallpapers provided in an embodiment of the present application;
[0073] FIG7 is a flowchart of a wallpaper recommendation method provided in an embodiment of the present application;
[0074] FIG8 is an example diagram of subject detection provided by an embodiment of the present application;
[0075] FIG9 is a schematic diagram of a slot matching process according to an embodiment of the present application;
[0076] FIG10 is an example diagram of candidate wallpaper generation provided by an embodiment of the present application;
[0077] FIG11 is a schematic diagram of a process for determining a target subject according to an embodiment of the present application;
[0078] FIG12 is a schematic diagram of a process for determining a central figure according to an embodiment of the present application;
[0079] FIG13 is a diagram of a person image provided in an embodiment of the present application;
[0080] FIG14 is a diagram of a face clustering interface provided in an embodiment of the present application;
[0081] FIG15 is a schematic diagram of a lock screen interface provided in an embodiment of the present application;
[0082] FIG16 is a schematic flowchart of another image processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] The following describes the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents "or." For example, A / B can represent A or B. "And / or" in this document is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, or B exists alone.
[0084] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0085] In the embodiments of this 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 this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0086] In the related art, when there are many pictures in the gallery, for example, there are hundreds or thousands of pictures in the gallery, it is difficult for the user to quickly select a beautiful picture that is suitable for use as a wallpaper. After the user selects a picture from the gallery, it takes multiple operations by the user to set the picture as a wallpaper with a good display effect.
[0087] For example, Figure 1 is an example of setting wallpaper in the related art. As shown in (a) in Figure 1, the display interface 101 of the mobile phone includes a picture 103 and a toolbar. Among them, the toolbar includes a "Share" button, a "Favorites" button, an "Edit" button, a "Delete" button and a "More" button 102. When the user needs to perform further operations on the picture 103, such as moving, copying, setting as wallpaper, etc., the user can click the "More" button 102. In response to the user's click operation on the "More" button 102, the display interface of the mobile phone switches from (a) in Figure 1 to (b) in Figure 1.
[0088] As shown in FIG1(b), in response to a user's operation on the "More" button 102, the mobile phone may display a function bar 104. As shown in FIG1(b), the function bar 104 may provide multiple options, including but not limited to "Move," "Copy," and "Set to" 105. In response to the user's triggering operation on the "Set to" option 105, the mobile phone's display interface switches from FIG1(b) to FIG1(c).
[0089] As shown in FIG1(c), in response to a user triggering the "Set as" option 105, the mobile phone display interface may display an options bar 106. Options bar 106 is used to provide the user with multiple usage options for image 103, each usage option corresponding to a usage of image 103. The multiple usage options may include "Wallpaper" 106a, "Off Screen Display", and "Contact Picture", which are respectively used to set image 103 as wallpaper, set image 103 as the off-screen display picture, and set image 103 as a contact picture.
[0090] In response to the user's operation on "Wallpaper" 106a, the mobile phone may display a wallpaper preview interface. As shown in (d) of Figure 1, this wallpaper preview interface is used to preview the mobile phone's desktop interface, which may include a desktop wallpaper. The desktop wallpaper can be a cropped image of image 103, or image 103 itself. In response to the user's triggering operation on the "OK" control, the mobile phone successfully sets image 103 as the desktop wallpaper.
[0091] It can be understood that when the user sets the image 103 as the desktop wallpaper, the mobile phone can respond to the user's preset operation on the desktop wallpaper on the wallpaper preview interface and adjust the desktop wallpaper, for example, zooming in / out the desktop wallpaper, moving the wallpaper in any direction, etc. The preset operation includes pinching in, spreading out, sliding / swiping in any direction, etc. Alternatively, the mobile phone can also respond to the user's cropping operation on the desktop wallpaper on the wallpaper preview interface to obtain a cropped image, so that the user can set the cropped image as the desktop wallpaper.
[0092] As another example, FIG2 is an example of setting wallpaper in the related art. In response to the user's triggering operation on the setting application, the mobile phone displays the setting interface, as shown in (a) in FIG2. In response to the user's triggering operation on the "Desktop and Wallpaper" control, the mobile phone displays the interface for setting the desktop and wallpaper, as shown in (b) in FIG2. In response to the user's triggering operation on the "Wallpaper" control, the mobile phone displays the interface for setting wallpaper, as shown in (c) in FIG2. In response to the user's triggering operation on the "Gallery" control, the mobile phone displays the interface of all pictures in the gallery, as shown in (d) in FIG2. In response to the user's selection operation on a picture in the gallery, the mobile phone displays the wallpaper preview interface, as shown in (e) in FIG2. In response to the user's triggering operation on the "Apply" control, the mobile phone applies the picture to the wallpaper of the mobile phone desktop.
[0093] It should be noted that FIG1 and FIG2 are examples of setting a picture as a desktop wallpaper. The method of setting a picture in the gallery as a miniature wallpaper can refer to the process in FIG1 and FIG2, which will not be repeated here.
[0094] It can be seen that in the related art, the process of users setting pictures in the gallery as wallpapers is relatively cumbersome, and users cannot quickly determine satisfactory wallpapers from the gallery, thereby affecting the user's usage experience.
[0095] To this end, an embodiment of the present application provides a wallpaper recommendation method, which is applied to electronic devices. The method displays candidate wallpapers recommended based on pictures in a gallery in a wallpaper recommendation interface, and the user directly selects a target wallpaper from the candidate wallpapers and applies it to the electronic device.
[0096] In one possible case, the wallpaper recommendation interface displayed by the electronic device includes a first candidate wallpaper, which is generated based on the first portrait of the first picture in the gallery application. After the pictures in the gallery application are added or reduced, a second candidate wallpaper is displayed on the wallpaper recommendation interface, which is generated by the second object in the first picture.
[0097] That is, the candidate wallpapers displayed in the wallpaper recommendation interface change according to the increase or decrease of pictures in the gallery application, so that the wallpaper recommendation interface can recommend wallpapers that better meet the user's expectations, allowing users to quickly select wallpapers with better effects in the wallpaper recommendation interface.
[0098] Among them, the wallpaper can be desktop wallpaper, lock screen wallpaper, album cover, etc.
[0099] For example, the wallpaper recommendation method provided in the embodiments of the present application can be applied to mobile phones, tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, vehicle-mounted devices, smart cars, smart speakers, and other electronic devices with display screens, and the embodiments of the present application do not impose any restrictions on this.
[0100] In an optional embodiment, if the display screen of the electronic device is a foldable screen, the user can choose to set the candidate wallpaper selected in the gallery as the lock screen wallpaper of the inner screen or the outer screen. When the electronic device is in the folded state, the outer screen can be used to display the image; when the electronic device is in the unfolded state, both the inner screen and the outer screen can be used to display the image. Both the inner and outer screens of the electronic device support the user's operation of setting wallpaper.
[0101] As shown in FIG3 , FIG3 is a structural diagram of an electronic device provided in an embodiment of the present application.
[0102] The electronic device 100 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. Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0103] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0104] 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 processing unit (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). The different processing units may be independent devices or integrated into one or more processors.
[0105] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0106] The processor 110 may also include a memory for storing instructions and data.
[0107] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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.
[0108] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0109] The charging management module 140 is configured to receive charging input from a charger, which may be a wireless charger or a wired charger.
[0110] 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 provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance), etc.
[0111] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0112] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.
[0113] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0114] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with a network and other devices via wireless communication technology. Wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0115] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0116] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0117] In the embodiment of the present application, the electronic device detects an operation of setting a wallpaper, and the display screen 194 displays a wallpaper recommendation interface, that is, candidate wallpapers are displayed on the display screen 194.
[0118] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0119] The ISP is used to process data fed back by the camera 193 .
[0120] The camera 193 is used to capture still images or videos.
[0121] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0122] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0123] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0124] 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 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0125] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. 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 100 (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.
[0126] FIG4 is a software structure diagram of an electronic device provided in an embodiment of the present application.
[0127] It is understood that a layered architecture divides software into several layers, each with distinct roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the system of an electronic device may include an application layer (abbreviated as the application layer), an application framework layer (abbreviated as the framework layer), a system library, and a kernel layer.
[0128] The above application layer may include a series of application packages.
[0129] As shown in Figure 4, the application package may include system applications. System applications refer to applications that are installed in the electronic device before leaving the factory. For example, system applications may include applications such as camera, gallery, calendar, music, weather, wallpaper, and multimedia editor.
[0130] Among them, the multimedia editor is an upper-layer application that calls the wallpaper recommendation function.
[0131] Application packages can also include third-party applications, which are applications that users install by downloading the installation package from an app store (or app market). Examples include map applications, food delivery applications, reading applications (such as e-books), social applications, and travel applications.
[0132] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0133] As shown in FIG4 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
[0134] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0135] Content providers are used to store and retrieve data and make it accessible to applications. Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0136] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0137] The phone manager is used to provide communication functions for electronic devices, such as call status management (including answering, hanging up, etc.).
[0138] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0139] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager can be used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating the phone, or flashing indicator lights.
[0140] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.
[0141] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0142] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0143] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0144] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional and three-dimensional layers for multiple applications.
[0145] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0146] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0147] A 2D graphics engine is a drawing engine for 2D drawings.
[0148] The system library may also include an algorithm engine layer, which may include an image screening module, a central person detection module, a subject detection module, a composition module, and a wallpaper recommendation module.
[0149] The image screening module is configured to screen candidate images from all images in the gallery application that meet preset condition 2 (a third preset condition). Preset condition 2 includes at least one of the following: the image size is within a preset size range, the image contains positive information, the similarity between any two images is less than a similarity threshold, the image clarity is greater than a clarity threshold, or the image aesthetic score is greater than a score threshold.
[0150] The central person detection module is used to detect the central person in all pictures in the gallery application and determine the central person.
[0151] The composition module is used to determine the target subject of the candidate image and then crop the candidate image according to the target subject to obtain the target image.
[0152] The subject detection module is used to perform subject detection on the target image to determine the subject label corresponding to the target image.
[0153] The wallpaper generation module is used to determine at least one target picture from multiple target pictures based on at least one of the aesthetic scores, depth of field effects, and subject labels corresponding to the central person and the target picture respectively, and generate at least one candidate wallpaper based on the at least one target picture.
[0154] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver and sensor driver.
[0155] The following takes a mobile phone as an example of an electronic device and describes in detail the wallpaper recommendation method provided by the present application in conjunction with the accompanying drawings.
[0156] In an embodiment of the present application, the mobile phone can automatically recommend pictures in the gallery application as candidate wallpapers, and the user can directly select the target wallpaper from the candidate wallpapers as the lock screen wallpaper.
[0157] For example, FIG5 is an example diagram of setting a lock screen wallpaper provided in an embodiment of the present application. As shown in FIG5(a), the settings interface 501 of the mobile phone displays multiple controls for setting the mobile phone, such as WLAN, Bluetooth, mobile network, wallpaper, display, and brightness. When the user needs to set up the mobile phone, the user can click the corresponding control in the settings interface, and the mobile phone responds to the user's triggering operation to set the corresponding function. For example, the user clicks the "Wallpaper" control 502, and the mobile phone responds to the user's triggering operation on the "Wallpaper" control 502 to display the wallpaper setting interface. As shown in FIG5(b), the display interface of the mobile phone displays the wallpaper setting interface 503, and the mobile phone responds to the user's triggering operation on the "Lock Screen" control 504 to display the wallpaper recommendation interface. The wallpaper recommendation interface is used to preview the application effect of the lock screen wallpaper. The wallpaper recommendation interface includes at least one candidate wallpaper. As shown in FIG5(c), the display interface of the mobile phone displays the wallpaper recommendation interface 505.
[0158] The candidate wallpaper refers to a lock screen wallpaper generated based on images recommended in the gallery application. The gallery application includes multiple images, which can be photos taken by the user, downloaded from the Internet, or from other sources, without specific restrictions.
[0159] In response to a user selecting a candidate wallpaper in the wallpaper recommendation interface, the mobile phone can set the candidate wallpaper as the lock screen wallpaper. For example, in response to a user selecting candidate wallpaper 506 from the gallery selection, candidate wallpaper 506 is selected. Candidate wallpaper 506 is a preview image of the lock screen wallpaper. In response to a user triggering an "Apply" control 508 in the wallpaper recommendation interface 505, the mobile phone sets candidate wallpaper 506 as the lock screen wallpaper. The display interface of the mobile phone using candidate wallpaper 506 as the lock screen wallpaper is shown in (d) of Figure 5.
[0160] It should be explained that the setting interface in the mobile phone shown in Figure 5 as the entry for setting wallpaper is only an example. The user can also interact with the mobile phone through other entrances to display the setting wallpaper interface, which is not limited here. For example, the user can control the mobile phone to display the setting wallpaper interface through voice interaction. The pictures recommended as lock screen wallpapers in the gallery selection shown in (c) of Figure 5 are character pictures. However, in the embodiment of the present application, the lock screen wallpapers in the gallery selection are not limited and can be character pictures, animal pictures, plant pictures or landscape pictures.
[0161] In addition, the lock screen wallpaper may or may not have a depth of field effect, which is not limited in the embodiments of the present application. If the lock screen wallpaper supports the depth of field effect, the mobile phone displays the lock screen wallpaper in the lock screen interface with the depth of field effect; the lock screen wallpaper in the lock screen interface shown in (e) of Figure 5 is displayed with the depth of field effect. If the lock screen wallpaper does not support the depth of field effect, the mobile phone displays the lock screen wallpaper in the lock screen interface without the depth of field effect.
[0162] In one scenario, the phone displays the wallpaper recommendation interface again in response to the user's action to set a wallpaper, and the candidate wallpapers displayed in the wallpaper recommendation interface have changed. As shown in Figure 5, the phone displays the wallpaper recommendation interface shown in Figure 5 (e) in response to the user's triggering action, and the candidate wallpapers recommended in the wallpaper recommendation interface include four characters.
[0163] Assume that candidate wallpaper 506 and candidate wallpaper 507 displayed in the wallpaper recommendation interface in Figure 5 (c) are not the candidate wallpapers expected by the user. After the mobile phone detects the user's trigger operation on the "change batch" control 509, other candidate wallpapers can be displayed in the wallpaper recommendation interface in Figure 5 (c) in response to the user's trigger operation.
[0164] In addition, the wallpaper recommendation interface shown in (c) and (e) in Figure 5 may include multiple slots (i.e., areas for displaying candidate wallpapers). Due to the limited size of the display screen, only two slots are shown in Figure 5. The user can display more slots by sliding the display screen. Alternatively, the mobile phone detects the user's triggering operation on the "more" controls in (c) and (e) in Figure 5. In response to the user's triggering operation, the mobile phone displays the wallpaper recommendation interface shown in (f) in Figure 5. Each slot in the wallpaper recommendation interface shown in (f) in Figure 5 displays candidate wallpapers generated based on the pictures in the gallery application.
[0165] The wallpaper recommendation interface shown in (f) of FIG5 shows four slots, which is only an example. When the user slides the display screen downward, the wallpaper recommendation interface may display more slots.
[0166] In a possible scenario of an embodiment of the present application, the picture recommended in the gallery application for generating candidate wallpapers contains only one subject. In this case, the subject contained in the picture is the target subject in the candidate wallpaper.
[0167] Elements within the same connected region in an image are considered a subject. A connected region is an image region consisting of adjacent foreground pixels with the same pixel value. Subjects can be people, animals, or even landscapes, without limitation.
[0168] For example, if the two characters shown in candidate wallpaper 506 are located in the same connected area as shown in FIG5(c), the two characters are one subject. If the two characters shown in candidate wallpaper 506 are not holding hands, that is, the two characters are located in corresponding connected areas, then the two characters correspond to two subjects.
[0169] In another possible scenario of an embodiment of the present application, the image recommended in the gallery application for generating candidate wallpapers contains multiple subjects. In this case, after the mobile phone determines the target subject corresponding to the candidate wallpaper from the multiple subjects, it crops the image containing the target subject from the image, and then generates the candidate wallpaper based on the image containing the target subject.
[0170] In one example, assume that the images recommended by the gallery app for candidate wallpaper generation include image 601 shown in Figure 6(a). Image 601 contains four subjects: subject a, subject b, subject c, and subject d. If the phone determines that subject b corresponds to the central figure, it crops subject b from image 601 and generates candidate wallpaper 606 shown in Figure 6(e) based on the cropped subject b.
[0171] If the mobile phone determines that the picture 601 does not contain the central person, it will crop the subject a with the largest face area from the picture 601 and generate the candidate wallpaper 604 shown in FIG6 (d) based on the cropped subject a.
[0172] In another example, suppose the images recommended by the gallery app for candidate wallpaper generation include image 602 shown in Figure 6(b), which contains two main subjects: a tree and a giraffe. In this case, the phone crops the giraffe, which is the largest subject, from image 602 as the target subject, generating candidate wallpaper 605 shown in Figure 6(d).
[0173] In another example, suppose the images recommended by the gallery app for candidate wallpaper generation include image 603 shown in Figure 6(c). Image 603 contains three human subjects and subject e, and the area of subject e is much larger than the areas of the other three subjects. In this case, the phone crops subject e, which has the largest area, from image 603 as the target subject, generating candidate wallpaper 607 shown in Figure 6(f).
[0174] The central person may be the person who appears most frequently in the gallery application. In one embodiment, the central person may be the person who has taken the most selfies. In another embodiment, the central person may be the person who has the most social connections with other people and is the most closely connected person in the social circle. In another embodiment, the central person may be a person for whom the user has assigned a special tag in the gallery application (e.g., tags such as "myself," "Dad," or "Mom").
[0175] It is understandable that the number of central figures can be one or more, and can be set according to actual needs. The central figure can be the owner of the electronic device or a non-owner, for example, the central figure can be a family member of the owner.
[0176] Here, we will not introduce in detail how to determine the central person based on the images in the gallery application. The specific implementation process can be found in the subsequent embodiments.
[0177] The following will describe in detail the specific implementation of the wallpaper recommendation method provided in the embodiment of the present application with reference to the accompanying drawings.
[0178] Figure 7 is a flowchart of a wallpaper recommendation method provided by an embodiment of the present application, which can be applied to the electronic devices shown in Figures 3 and 4. As shown in Figure 7, the wallpaper recommendation method may include steps S701 to S711.
[0179] S701: The central person detection module obtains a picture from the gallery application.
[0180] S702 , a central person detection module performs central person detection on a picture obtained from a gallery application to determine a central person.
[0181] In an embodiment of the present application, the electronic device can perform face recognition and clustering on each picture in the gallery application when charging or when the screen is off, and obtain a face clustering result. The face clustering result includes at least one class, and each class corresponds to a person. Specifically, the central person detection module performs face recognition on each picture in the gallery application to obtain the face that appears in the picture. Afterwards, the electronic device clusters the faces, and clusters faces with the same or similar features into the same class as the faces of a certain person (different people are distinguished by person IDs, and the same clustered face corresponds to the same person ID, and the "person" referred to below is the "person ID") to obtain a face clustering result.
[0182] In a possible implementation, the central person detection module may determine the person whose face appears most frequently as the central person based on the face clustering result.
[0183] In another embodiment, the central person detection module determines that the central person is the person whose face appears in the most front-facing selfie photos. For example, if the gallery application has the most front-facing selfie photos with the face of person A, the central person detection module determines person A as the central person based on the face clustering results.
[0184] In another possible implementation, the central person detection module may determine the central person by combining both the frequency of appearance and the person labels in the gallery application. For example, if the gallery application contains as many images of "colleagues" with the face label "child" as there are images of "children," the central person detection module may determine that the person with the face label "child" is the central person.
[0185] In another possible implementation, the central person detection module may determine, based on the face clustering result, a person whose face appears more frequently at multiple fixed locations as the central person.
[0186] For example, suppose the central person detection module determines that Face B appears most frequently in images taken at "Company" and "Home," and thus determines Face B as the central person. "Company" and "Home" can be fenced areas learned by the electronic device based on user usage habits, or user-defined geographic locations; this solution does not impose any restrictions.
[0187] In another possible implementation, the central person detection module can determine the central person based on the time distribution divergence and location distribution divergence of the face images in the gallery application. The time distribution divergence is the distribution divergence of the time when the images were taken, and the location distribution divergence is the distribution divergence of the location where the images were taken.
[0188] It can be understood that images containing central characters may be generated at multiple times and multiple locations, and thus images containing central characters are relatively evenly distributed in terms of time and location. In other words, the time distribution divergence and location distribution divergence of images containing central characters are small. Compared with non-central characters, images containing central characters are generally not concentratedly generated at only one or several times, and / or are not concentratedly generated at only one or several locations. For example, the owner of a device may take a photo with a mobile phone at any time to generate an image containing the owner himself. For non-owners (such as the owner's friends), images containing the friend may be generated by taking a photo with the owner's mobile phone only during a period of time when they are traveling with the owner. Therefore, the distribution of images containing the owner himself is more evenly distributed than that of images containing the owner's friends. Recommending a central character for a wallpaper using a person whose face is evenly distributed in terms of shooting time and / or location is more in line with the user's experience.
[0189] Based on this, in this application, the central person can be determined based on the uniformity of the time distribution and location distribution of the images of each person in the person image heterogeneous graph. In one possible implementation, the central person can be determined based on the uniformity of the time and location distribution. The more uniform the distribution of the images corresponding to the person, the greater the probability that it is the central person.
[0190] In this application, the specific implementation process of determining the central person based on the uniformity of time distribution and / or location distribution can be found in the subsequent introduction process of Figure 12, which will not be described in detail here.
[0191] Based on the above overview of the central person generation method, it should be understood that when the photos in the gallery application change due to addition, deletion or editing, the results of the central person detection module on the pictures obtained from the gallery application may be different. For example, when the set formed by all the pictures in the gallery application is picture set 1, the face clustering result includes person A and person B. Among them, all the portrait pictures of person A form a portrait set as person A's portrait set, and the portrait pictures of person B form a portrait set of person B. In conjunction with the example of Figure 14, the interface 1400 in the gallery application can display person A's portrait set 1401 and person B's portrait set 1402. In response to the user's operation on 1401 or 1402, the electronic device can display all portrait pictures of person A or person B (not shown in the figure). Among them, person A is determined to be the central person based on any of the aforementioned methods for determining the central person, for example, because portrait set A 1401 contains the most pictures.
[0192] When the collection of all images in the gallery application changes to Picture Collection 2, which is different from Picture Collection 1, for example, the number of photos of Person A is significantly reduced or completely deleted, while the number of photos of Person B is increased, the central person may change. For example, in Picture Collection 2, Person B is identified as the central person, while Person A is no longer identified as the central person.
[0193] S703: The central person detection module sends the central person to the wallpaper generation module.
[0194] S704, the image screening module obtains images from the gallery application and screens candidate images from the images.
[0195] Because the images in the gallery application may contain duplicate images, negative images, unclear images, or images that do not meet aesthetic standards, the electronic device can filter the images in the gallery application to select multiple candidate images that meet preset condition 2. Preset condition 2 includes, but is not limited to, at least one of: a size within a preset size range, containing positive information, a similarity between any two images less than a similarity threshold, a clarity greater than a clarity threshold, or an aesthetic score greater than a score threshold.
[0196] First, the image filtering module filters out images 1 within a preset size range from the images in the gallery application.
[0197] The size can refer to the width and height of an image in the gallery application, and can be expressed as "width x height". For example, if the size of an image is 1980 x 1080, it means that the image is 1980 pixels wide and 1080 pixels high. For example, the size of an image can also be 800 x 600, 1280 x 720, etc., without any specific limitation here.
[0198] The preset size range may be a range determined by a first size threshold and a second size threshold, where the first size threshold is smaller than the second size threshold. For example, the first size threshold may be 800×600, and the second size threshold may be 1980×1080, meaning the preset size range is from 800×600 to 1980×1080. In other embodiments, the preset size range may also be other size ranges, which are not specifically limited herein.
[0199] It can be understood that the gallery application may contain smaller or larger images. Smaller images may appear blurry after being enlarged, and larger images may also appear blurry after being compressed. Therefore, the image filtering module filters images within a preset size range from the gallery application. Here, the electronic device refers to the set of images within the preset size range in the gallery application as set 1.
[0200] Secondly, the image screening module performs sensitive information detection on the image set 1, discards the images containing sensitive information, and obtains the image set 2 that does not contain sensitive information.
[0201] Among them, sensitive information may include pornographic, violent, bloody, political, religious and other information.
[0202] The image screening module performs sensitive information detection on image set 1. If any image is detected to contain sensitive information, the image containing sensitive information is discarded and the image without sensitive information is retained. Here, the images without sensitive information filtered out from set 1 are referred to as set 2.
[0203] In some embodiments, sensitive information may include general sensitive information and specific sensitive information. General sensitive information may be sensitive information applicable to the user. For example, general sensitive information may include pornographic, violent, or gory information. Specific sensitive information refers to sensitive information specific to a specific country or group of people. For example, if a certain animal is taboo in country A, the electronic device may set that animal as specific sensitive information.
[0204] For example, when the image filtering module performs sensitive information detection on set 1, the image filtering module can first discard images containing general sensitive information, and then discard images containing specific sensitive information corresponding to a specific location based on the location information of the electronic device to obtain set 2 that does not contain sensitive information.
[0205] Next, the image screening module performs similarity detection on set 2, removes duplicate images, and obtains set 3 in which the similarity between any two images is less than the similarity threshold.
[0206] It can be understood that a gallery application may contain duplicate or highly similar images, such as multiple images taken in succession, two images before and after beautification, and so on. Therefore, the electronic device can perform a similarity check on the images in Set 2 to remove duplicate images from Set 2 and obtain Set 3. The similarity between any two images in Set 3 is less than the similarity threshold.
[0207] In some embodiments, the image screening module may use a similarity detection algorithm to perform similarity detection on all images in set 2 to determine the similarity of the images in set 2.
[0208] The above-mentioned similarity detection algorithm can be a histogram similarity algorithm, a hash algorithm, etc. Algorithms that can detect image similarity in related technologies are all applicable to the embodiments of this application and are not introduced one by one here.
[0209] In an embodiment of the present application, the image screening module may perform semantic similarity and vector similarity detection on the images in set 2 to remove images in set 2 whose similarity is greater than a similarity threshold.
[0210] Next, the image screening module performs a clarity test on set 3, discards images whose clarity is less than the clarity threshold, and obtains set 4 whose clarity is greater than the clarity threshold.
[0211] Among them, clarity is an important indicator to measure image quality. The most intuitive manifestation of low image clarity is blurry images.
[0212] In some embodiments, the image screening module may use a clarity detection algorithm to perform clarity detection on Set 3. For example, the image screening module may use a Sobel gradient operator-based detection method to calculate the clarity of Set 3 and obtain a corresponding clarity value. The method for calculating image clarity based on the Sobel gradient operator is not described in detail here. Of course, the image screening module may also use other clarity detection algorithms to calculate the clarity value of the image. The specific algorithm for calculating the clarity of the image in the embodiments of this application is not limited here.
[0213] After the image filtering module determines the clarity value of each image in set 3, it discards images with clarity values less than the clarity threshold, resulting in set 4 with clarity values greater than the clarity threshold. Thus, by discarding blurry images and retaining clear images, a clear wallpaper is generated.
[0214] Then, the aesthetic score detection is performed on set 4, and the pictures with scores less than the score threshold are discarded, and multiple pictures with scores greater than the score threshold are obtained.
[0215] The aesthetic score is used to evaluate the subjective beauty of an image, providing a rating of its aesthetic quality. Based on the aesthetic score, the electronic device can select the most subjectively aesthetically pleasing images from among multiple images.
[0216] In some embodiments, the image screening module can use an aesthetic scoring algorithm to perform an aesthetic evaluation on each image in Set 4 to determine a corresponding score. The image screening module then discards images with scores below a threshold, resulting in a plurality of images (Set 5) with scores above the threshold. The process of using the aesthetic scoring algorithm to determine the scores corresponding to the images is not described in detail in the present embodiments.
[0217] It can be understood that when there are many pictures in the gallery application, for example, hundreds or thousands of pictures, the above screening process can screen out multiple pictures of appropriate size, containing positive information, without duplication, clear and aesthetically pleasing from the gallery application.
[0218] It should be noted that the image filtering module can first perform sensitive information detection on the images in the gallery application, and then perform size detection on the images that contain sensitive information. Alternatively, the image filtering module can first perform aesthetic score detection on the images in the gallery application, and then perform similarity detection and clarity detection on images with scores greater than a score threshold, etc. In other words, the order in which the above-mentioned filtering processes are executed is not limited in the embodiments of this application. The image filtering module can execute the above-mentioned filtering processes simultaneously or in any order, and no specific limitation is made here.
[0219] It should be understood that steps S701-S703 and step S704 are not absolutely executed in sequence, that is, when the electronic device fails to determine the central person after executing steps S701-S703, the face with the largest area can be cropped from the picture used to generate the candidate wallpaper as the target subject, or, if the pictures in the gallery application do not include portrait pictures, the subject with the largest area can be cropped from the picture used to generate the candidate wallpaper as the target subject.
[0220] S705: The picture screening module sends the candidate pictures to the composition module.
[0221] In one possible embodiment of the present application, the image filtering module may send different candidate images to the composition module based on different image filtering requirements. In one possible implementation, the image filtering module does not need to filter the images in the gallery application. That is, all images in the gallery application are candidate images, and the electronic device does not need to execute the above S704.
[0222] S706: The composition module performs composition processing on the candidate images to obtain a target image.
[0223] The target image refers to an image containing the target subject obtained by cropping the candidate image according to the target subject of the candidate image.
[0224] In one case, if a candidate image contains only one subject, that subject is determined to be the target subject. The composition module can directly determine the candidate image as the target image. Alternatively, the composition module can determine whether to crop the candidate image based on the target subject's position information to obtain a target image with a higher aesthetic score.
[0225] In another case, if the candidate image contains multiple subjects, the composition module determines the target subject from the multiple subjects in the candidate image and then crops the candidate image to obtain the target image containing the target subject. During the cropping process, the target subject must be intact, as non-target subjects may not remain intact due to the cropping process.
[0226] Here, the process of the composition module determining the target subject from multiple subjects contained in the candidate images can be referred to the process described in the following FIG11, which will not be described in detail here. The following describes the implementation process of the composition module cropping the target image containing the target subject from the candidate images.
[0227] In one embodiment, for each candidate image in the gallery application, the composition module in the electronic device can identify the target subject in the candidate image and, based on the position information of the target subject, use a classic composition algorithm to determine multiple candidate frames corresponding to the target subject. The target subject is located in different candidate frames. Then, the composition module uses an aesthetic scoring algorithm to perform aesthetic scoring on the target subjects contained in different candidate frames, and determines the aesthetic scores corresponding to the target subjects in each candidate frame to determine the target candidate frame containing the target subject with the highest aesthetic score. Then, the composition module crops the area containing the candidate frame containing the target subject with the highest aesthetic score to obtain the target image.
[0228] Among them, the above-mentioned classic composition algorithm can be a symmetrical composition algorithm, the rule of thirds, a horizontal line composition algorithm, a vertical line composition algorithm, etc. The specific implementation process of using the classic composition algorithm to determine the multiple candidate frames corresponding to the target subject will not be introduced in detail.
[0229] In some embodiments, the aesthetic scoring algorithm may include a composition algorithm, so that the electronic device can directly determine the area where the candidate frame containing the target subject with the highest aesthetic score is located based on the position information of the target subject in each picture using the aesthetic scoring algorithm.
[0230] Exemplarily, as shown in FIG8 , the candidate image includes two subjects, a “giraffe” and a “tree”. Assuming that the composition module of the electronic device determines that the target subject in the image is a “giraffe”, the composition module presets three candidate frames based on the position information of the “giraffe”. The composition module can determine a cropping frame from multiple candidate frames based on the aesthetic scores corresponding to the target subjects included in different candidate frames. Here, the candidate frame containing the target subject with the highest aesthetic score can be used as the cropping frame for cropping the target subject. Optionally, the composition module uses an aesthetic scoring algorithm to perform aesthetic scoring on the target subjects contained in different candidate frames, and determines the aesthetic scores corresponding to the target subjects in each candidate frame, so as to determine the candidate frame containing the target subject with the highest aesthetic score. Furthermore, the composition module crops the subject image according to the area where the candidate frame containing the target subject with the highest aesthetic score is located, to obtain a target image containing a “giraffe”.
[0231] It should also be explained that after the composition module determines the candidate frame corresponding to the target subject, in order to ensure the integrity of the target subject, there may be incomplete non-target subjects included in the candidate frame. The composition module can also use the candidate frame in which both the target subject and non-target subjects are complete as the cropping frame. The cropping size of the image used by the composition module can be pre-set, for example, the cropping size can be 640×480 pixels.
[0232] 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 of the electronic device. 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.
[0233] S707: The composition module sends the target image to the wallpaper generation module.
[0234] S708 , the subject detection module performs subject detection on the target image and determines a subject detection result.
[0235] S709: The subject detection module sends the subject detection result to the wallpaper generation module.
[0236] Among them, the subject label refers to the type corresponding to the target subject in the target image. For example, if the subject detection module determines that the target subject of the target image is a person, then the subject label of the target image is determined to be a person; if the subject detection module determines that the target subject of the target image is a scenery, then the subject label of the target image is determined to be scenery, that is, the target image is a scenery-type image.
[0237] Optionally, the subject detection module in the electronic device can use a trained subject detection model to perform subject detection on the target image and determine the subject label corresponding to the target image based on the output of the subject detection model. The subject detection model has the ability to detect any type of subject contained in the image.
[0238] It should be explained that the subject detection module determines the subject label corresponding to the target image in order to determine whether the target image matches the slot according to the subject label corresponding to each target image in the subsequent slot matching process.
[0239] S710: The wallpaper generation module determines a depth of field effect corresponding to the target image.
[0240] Optionally, before the wallpaper generation module of the electronic device determines at least one target picture from the multiple target pictures, the electronic device may determine whether the multiple target pictures support display with a depth of field effect.
[0241] In an embodiment of the present application, the wallpaper generation module can determine whether the target image supports display with a depth of field effect based on the area ratio of the target subject in the target image. The area ratio of the target subject can be the ratio between the area of the target subject in the target image and the area of the target image.
[0242] If the area ratio of the target subject is within the preset range, it means that the target subject in the target image is of moderate size and can achieve a better display effect when displayed with a depth of field effect. The wallpaper generation module determines that the target image supports display with a depth of field effect.
[0243] If the area ratio of the target subject is not within the preset range, it means that the target subject in the target image 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. The wallpaper generation module determines that the target image does not support display with the depth of field effect.
[0244] S711, the wallpaper generation module matches the target image to the target slot according to the central person, the subject detection result corresponding to the target image, and the depth of field effect to generate a candidate wallpaper.
[0245] When the target image is the first image, the generated candidate wallpaper is the first candidate wallpaper.
[0246] The wallpaper recommendation interface of the electronic device includes multiple slots, and different slots are used to place wallpapers generated by matching pictures according to different preset rules. For example, referring to FIG5 (c) above, candidate wallpaper 506 and candidate wallpaper 507 are respectively located in corresponding slots. FIG5 (f) shows the four slots included in the wallpaper recommendation interface, which are respectively placed with candidate wallpapers generated by matching pictures according to different preset rules.
[0247] In one possible scenario, a wallpaper generation module of an electronic device may determine a target image from multiple target images that matches preset rules for a target slot based on a central character, and at least one of the aesthetic scores, depth of field effects, and subject tags corresponding to the multiple target images. The preset rules include that the target image corresponding to the target slot includes the central character, the aesthetic score of the target image corresponding to the target slot is the highest, the target image corresponding to the target slot supports display with a depth of field effect, and the subject tag in the target image corresponding to the target slot satisfies at least one of the preset tags.
[0248] The wallpaper generation module can perform face detection on each of the at least one target image to determine whether the at least one target image contains a central figure. The wallpaper generation module then determines a target image that matches the target slot from the at least one target image based on whether the at least one target image contains a central figure, at least one of the subject labels corresponding to the at least one target image, an aesthetic score, and a depth of field effect. Furthermore, the wallpaper generation module generates candidate wallpapers based on the wallpaper template corresponding to the target slot and displays the candidate wallpapers in the order of the target slots.
[0249] In another embodiment, the wallpaper generation module may further determine a target image that matches the target slot from the at least one target image based on whether the at least one target image contains a central figure, a subject tag corresponding to the at least one target image, an aesthetic score, and a depth of field effect. Furthermore, the wallpaper generation module generates candidate wallpapers based on the wallpaper template corresponding to the target slot and displays the candidate wallpapers in the order of the target slots.
[0250] It should be understood that the steps S701-S711 above are not necessary steps for generating candidate wallpapers. For example, when all the pictures in the gallery application meet the preset condition 2, there is no need to screen the pictures in the gallery application, that is, there is no need to perform the above steps S704 and S705. For example, when the pictures in the gallery application are all portrait pictures, the subject labels corresponding to the target pictures composed by the composition module are all portraits. In this case, the subject detection module does not need to perform subject detection on the target picture, that is, there is no need to perform the above steps S708 and S709. The candidate wallpaper in the embodiment of the present application can intuitively display the effect of the target picture applied to the lock screen interface. For example, the candidate wallpaper is the candidate wallpaper 506 shown in (c) of Figure 5. As a result, the user does not need to switch to the wallpaper preview interface, and can directly determine the lock screen effect based on the candidate wallpaper, which simplifies the process of users setting wallpapers.
[0251] In one embodiment, before generating candidate wallpapers based on the target image that matches the target slot, the wallpaper generation module may first perform image enhancement processing on the target image, for example, enhancing images of people, animals, plants, buildings, landscapes, etc. Thus, the enhanced image is clearer.
[0252] The number of slots displayed in the wallpaper recommendation interface may be a preset value. For example, the number of slots displayed in the wallpaper recommendation interface may be 5, 7, or 10, and so on.
[0253] For example, assume that the number of slots displayed in the wallpaper recommendation interface is N, N>1, and each slot is used to place candidate wallpapers generated by matching pictures according to different preset rules. For example, the preset rule for slot 1 is that the target picture has a depth of field effect and a central figure, and the target picture has the highest aesthetic score. When the wallpaper generation module determines that the target picture meets the preset rules of the slot, the wallpaper generation module fills the target picture into the target slot. The following is an exemplary introduction to the process of matching the target picture to slot 1 with reference to Figure 9. As shown in Figure 9, the process includes steps S901 to S903.
[0254] S901, determine whether the target image matches slot 1 successfully.
[0255] In one embodiment, the electronic device may determine whether the target image is successfully matched with slot 1 based on whether the target image contains a central person, a subject tag corresponding to the target image, and a depth of field effect.
[0256] In another embodiment, the electronic device may also determine whether the target image matches slot 1 based on whether the target image contains a central person, a subject label corresponding to the target image, an aesthetic score, and at least one of a depth of field effect.
[0257] Exemplarily, the electronic device first determines whether the target picture in the target picture list contains a central person. If there is a target picture containing a central person, the electronic device determines target picture 1 that supports depth of field effect and has the highest aesthetic score from the target pictures containing the central person. At this time, target picture 1 is successfully matched with slot 1.
[0258] If the electronic device determines that none of the target images in the target image list contains a central person, the electronic device determines target image 2 from the target image list that contains a face, supports depth of field effect, and has the highest aesthetic score. At this time, target image 2 is successfully matched with slot 1.
[0259] If the electronic device determines that none of the target images in the target image list contains a central person and there is no person that supports the depth of field effect, the electronic device determines target image 3 from the target image list that contains an animal that supports the depth of field effect and has the highest aesthetic score. At this time, target image 3 is successfully matched with slot 1.
[0260] It should be explained that when the electronic device determines from the target image list that target image 3 contains an animal that supports depth of field effects and has the highest aesthetic score, if the electronic device determines that none of the target images in the target image list contain animals that support depth of field effects, then the electronic device can sequentially determine target images such as art, scenery, and plants that support depth of field effects from the target image list. If the electronic device determines that the target image list does not contain animals, art, scenery, or plants that support depth of field effects, then the electronic device determines that there is no target image in the target image list that matches slot 1. In this case, S903 is executed, i.e., slot 1 is deleted.
[0261] The above is a process of determining a target image to be matched with slot 1 from a target image list, taking preset slot 1 as an example. Similarly, slots 2 to slot N also correspond to preset rules. For example, the preset rule corresponding to slot 2 is to prioritize determining a landscape image that supports depth of field effects and has the highest aesthetic score from the target image list. If the electronic device determines that the target image list contains a landscape image that supports depth of field effects and has the highest aesthetic score, the landscape image is matched to slot 2. If the electronic device determines that the target image list does not contain a landscape image that supports depth of field effects and has the highest aesthetic score, the electronic device matches the landscape image with the highest aesthetic score in the target image list to slot 2. If the electronic device determines that there is no landscape image in the target image list, the electronic device can match an art image that supports depth of field effects and has the highest aesthetic score from the target image list to slot 2.
[0262] Similarly, the preset rule for slot 3 is to prioritize determining the target image that contains people and has the highest aesthetic score from the target image list. If the electronic device determines that there is no image containing people in the target image list, the electronic device can determine the landscape image with the highest aesthetic score from the target image list and match the landscape image to the preset slot 3.
[0263] It should be noted that each slot has its own image matching rule, and each slot's corresponding image matching rule is different. I will not provide examples here. Because each slot has a different image matching rule, the same target image can only match one slot.
[0264] S902: After slot 1 is filled with the target image, candidate wallpaper 1 is generated using the corresponding wallpaper template.
[0265] In an embodiment of the present application, after the electronic device determines the target image matching slot 1 from the target image list, the electronic device fills the preset slot with the target image matching slot 1 and uses the wallpaper template corresponding to slot 1 to generate candidate wallpaper 1.
[0266] Exemplarily, as shown in FIG10 , after the electronic device determines the target image that matches slot 1 from the target image list, it fills slot 1 with the target image according to the preset template 2 corresponding to slot 1 to generate candidate wallpaper 1. When the electronic device fills slot 1 with the target image, the electronic device can scale the target image according to the size requirements of the target image in wallpaper template 2, so that after the scaled target image is filled into slot 1, the generated candidate wallpaper 1 has a depth of field effect. Similarly, after the electronic device determines the target images that match slots 2 to 6 respectively from the target image list, the electronic device can determine whether slots 2 to 6 have wallpaper templates to determine whether to generate corresponding candidate wallpapers according to the wallpaper template.
[0267] It can be understood that different slots correspond to different wallpaper templates. After the electronic device determines the target image corresponding to the slot, it generates the corresponding candidate wallpaper according to the wallpaper template of the slot.
[0268] S903: Delete slot 1.
[0269] In this embodiment of the present application, if the electronic device determines that all target images in the target image list do not meet the requirements of slot 1 for the central person, aesthetic score, subject label, and depth of field effect, slot 1 is deleted. This avoids the problem of slot 1 in the wallpaper recommendation interface being matched with a target image, displaying a blank slot, and affecting the user experience.
[0270] 11 , S706 , in which the composition module performs composition processing on the candidate image to obtain the target image, is described in detail. The specific process may include S1101 to S1109 .
[0271] S1101, performing face detection on the candidate image to determine whether the candidate image contains a face.
[0272] In an embodiment of the present application, the electronic device may use a face detection algorithm to perform face detection on the candidate image to determine whether the candidate image contains a face. If the electronic device determines that the candidate image contains a face, step S1102 is executed. Otherwise, step S1109 is executed.
[0273] Optionally, the electronic device extracts features from the candidate image. If the electronic device determines that the extracted features include features of facial key points, then the candidate image is determined to include a face. If the electronic device determines that the extracted features do not include features of facial key points, then the candidate image is determined to include no face. Facial key points include the facial contour, eyes, eyebrows, lips, and nose contour.
[0274] It should be noted that the method for determining whether a candidate picture contains a human face described above is only an exemplary description, and face detection algorithms in related technologies can all be used to determine whether a candidate picture contains a human face, which will not be introduced one by one here.
[0275] S1102. The electronic device performs a main body area detection on the candidate picture to determine the area of each main body in the picture.
[0276] After the electronic device determines that the candidate picture includes a human face, the electronic device performs a main body detection on the candidate picture to determine the multiple main bodies included in the candidate picture. Then, the electronic device performs a contour recognition on the multiple main bodies in the candidate picture to obtain the contours corresponding to the multiple main bodies. Furthermore, the electronic device calculates the area of the contour corresponding to each main body, and thus can obtain the area of the main body.
[0277] Exemplarily, assume that the main bodies in candidate picture A are a person, a bird, and a big tree. After the electronic device recognizes the contours of the person, the bird, and the big tree, and calculates the areas of each contour respectively, the areas corresponding to the person, the bird, and the big tree in the main body can be obtained as S1, S2, and S3 respectively.
[0278] S1103. The electronic device determines whether the main body where the human face is located is the main body with the largest area.
[0279] If the electronic device determines that the main body where the human face is located is the main body with the largest area, it executes step S1105. Otherwise, it executes step S1104.
[0280] S1104. The electronic device determines whether the ratio of the area of the main body where the human face is located to the area of the largest main body is greater than the ratio threshold.
[0281] When the electronic device determines that the main body where the human face is located is not the main body with the largest area, the electronic device calculates the ratio of the area of the main body where the human face is located to the area of the largest main body to determine whether the ratio of the area of the main body where the human face is located to the area of the largest main body is greater than the ratio threshold.
[0282] Exemplarily, for the main bodies of the person, the bird, and the big tree in the above candidate picture A, the corresponding areas are S1, S2, and S3 respectively. If S1 < S2 < S3, then the ratio of the area of the main body where the human face is located to the area of the largest main body, the big tree, is calculated as S1 / S3. Then, the electronic device determines whether the value of S1 / S3 is greater than the ratio threshold.
[0283] If the electronic device determines that the ratio of the area of the main body where the human face is located to the area of the largest main body is greater than the ratio threshold, it executes step S1105. Otherwise, it executes step S1109.
[0284] S1105. The electronic device performs a person relationship detection on the pictures in the picture library application to determine the central person.
[0285] Here, the electronic device performs character relationship detection on the pictures in the gallery application. The process of determining the central person can be referred to in the implementation process of determining the central person later, and will not be described in detail here. It should be understood that S1105 can also be performed before S1101, that is, the electronic device can detect all photos in the gallery in advance to determine the central person.
[0286] S1106: The electronic device determines whether the faces in the candidate image include a central person.
[0287] In an embodiment of the present application, the electronic device may use a face matching algorithm to determine whether the face in the candidate image and the face corresponding to the central person are the same person, so as to determine whether the candidate image contains the central person.
[0288] The face matching algorithm determines whether the faces in any two facial images belong to the same person. Specifically, the electronic device can extract features from the faces in the candidate images and the face of the central person, then compare the distance between the features of the different faces. If the distance is less than a distance threshold, the face in the candidate image is determined to be the face of the central person.
[0289] If the electronic device determines that the faces in the candidate image include the central person, step S1107 is executed. Otherwise, step S1108 is executed.
[0290] S1107, the electronic device determines the subject where the central person is located as the target subject.
[0291] In one possible scenario, the electronic device determines that the subject where the face is located in the candidate image is the subject with the largest area, and the subject where the face is located includes a central person. In this case, the electronic device determines that the subject where the central person is located is the target subject.
[0292] For example, assume that candidate image B contains subjects including people, animals, and trees, and the corresponding areas of the people, animals, and trees are S4, S5, and S6, respectively. If the electronic device determines that the maximum area of the subjects containing people is S4, and the subjects contain a central person, the electronic device determines that the subject containing the person is the target subject.
[0293] S1108, the electronic device determines the subject where the face with the largest area is located as the target subject.
[0294] In one possible scenario, the electronic device determines that the subject containing the human face in the candidate image is the subject with the largest area, but the subject containing the human face does not contain the central person. In this case, the electronic device determines that the subject containing the human face with the largest area is the target subject.
[0295] For example, assume that candidate image B contains subjects including people, animals, and trees, and the corresponding areas of the people, animals, and trees are S4, S5, and S6, respectively. If the electronic device determines that the maximum area of the subjects containing people is S4, but the subjects do not contain a central person, the electronic device determines that the subject containing the people is the target subject.
[0296] In another possible scenario, the electronic device determines that there are multiple subjects containing a human face in the candidate image, that is, the candidate image includes multiple faces. The electronic device determines that none of the multiple faces is the subject with the largest area. Then, if the electronic device determines that the ratio of the multiple faces to the subject with the largest area is greater than a ratio threshold, and none of the multiple faces include a central figure, the electronic device may determine that the face with the largest area among the multiple faces is the target subject.
[0297] For example, assume that the candidate image contains subject 1, subject 2, and subject 3, and that both subject 1 and subject 2 contain a human face. The electronic device determines that subject 3 is the subject with the largest area, that is, the subject containing the human face is not the subject with the largest area. The electronic device determines that neither subject 1 nor subject 2 contains a central person. The electronic device determines that the area ratio of subject 1 to subject 3 is greater than a ratio threshold, and that the ratio of subject 2 to subject 3 is also greater than the ratio threshold, and that the area of subject 1 is greater than the area of subject 2. Then, the electronic device determines that subject 1 is the target subject of the candidate image.
[0298] S1109: The electronic device determines the subject with the largest area as the target subject.
[0299] In one possible case, if the electronic device determines that the candidate image does not contain a human face, the electronic device determines the subject with the largest area in the candidate image as the target subject.
[0300] Exemplarily, assuming that the candidate image includes three subjects, namely a kitten, a tree and an apple, if the electronic device determines that the subject with the largest area among the three subjects is the tree, the electronic device determines that the target subject of the candidate image is the tree.
[0301] In another possible case, if the electronic device determines that the candidate image contains a face, the subject where the face is located is not the subject with the largest area, and the area ratio of the subject where the face is located to the largest subject is less than the ratio threshold, then the electronic device determines that the subject with the largest area is the target subject.
[0302] For example, assuming that the candidate image includes three subjects, namely a person, a big tree and an apple, if the electronic device determines that the subject with the largest area among the three subjects is the big tree, and the area ratio of the subject where the person is located and the subject where the big tree is located is less than the ratio threshold, then the electronic device determines that the target subject of the candidate image is the big tree.
[0303] In some embodiments, when the electronic device determines the target subject in the candidate image, it does not sequentially execute the above steps S1101-S1109, but selectively executes the above steps based on the face detection result of the electronic device on the candidate image. For example, when the electronic device detects that the candidate image includes a central figure, the electronic device executes steps S1102-S1107. For another example, when the electronic device detects that the candidate image includes a face but does not include a central figure, the electronic device executes steps S1102-S1104, and S1108 or S1109. For another example, when the electronic device detects that the candidate image does not include a face, the electronic device takes the subject with the largest area in the candidate image as the target subject, that is, the electronic device executes steps S1102 and S1109. Thus, based on the area of each subject in the candidate image, the target subject with the largest area can be quickly determined.
[0304] The specific process of determining the central person according to the time distribution divergence and location distribution divergence of each person in step S702 will be described in detail below with reference to the accompanying drawings.
[0305] For example, Figure 12 is a schematic diagram of a process for determining a central figure according to an embodiment of the present application. As shown in Figure 12, the method may include the following steps.
[0306] S1210: Generate a person image heterogeneous graph based on the face clustering result.
[0307] Among them, the person image heterogeneous graph is used to represent the correspondence between the person and the image containing the person.
[0308] Specifically, each person in the face clustering results can be treated as a person node, each image containing a face as an image node, and the image node containing a face can be connected to the person node corresponding to the face through an edge to obtain a person image heterogeneous graph. For example, image A includes face 1, and according to the face clustering results, the person corresponding to face 1 is a. Then, the node of image A is connected to the node of person a through an edge; the same is true for other images and other people in the face clustering results. In this way, a person image heterogeneous graph can be obtained. In other words, the person image heterogeneous graph contains person nodes and image nodes, and the edge between a person node and an image node indicates that the image contains the person, or in other words, the edge between a person node and an image node indicates that the person belongs to the image.
[0309] Optionally, the person image heterogeneous graph may also include node information of person nodes and image nodes. Specifically, the information of the person node is also the information of the person corresponding to the person node, including but not limited to the person ID, the person gender and the person age. The information of the image node is also the information of the image corresponding to the image node, including but not limited to the image hash ID, the image shooting time information, the image shooting location and the camera used to shoot the image (for example, whether it was shot with the front camera).
[0310] For example, Figure 13 shows an example of a person image heterogeneous graph provided in an embodiment of the present application. In Figure 13, circular-bordered icons represent person nodes, and square-bordered icons represent image nodes. It should be understood that Figure 13 is merely an example, used to illustrate the composition and structure of a person image heterogeneous graph, and is not intended to be limiting, nor does it represent actual data.
[0311] It should be noted that Figure 13 is a concrete representation of the character image isomeric graph. In actual applications, the character image isomeric graph can have various forms of expression. The embodiment of the present application does not impose any limitation on the specific form of expression of the character image isomeric graph, as long as it can reflect its content.
[0312] In a specific embodiment, the character image heterogeneous graph can also be represented by a list. Specifically, the table corresponding to the character image heterogeneous graph may include a character node list, an image list, and a connection matrix list. The character node list is used to store information about each character node. The image list is used to store information about each image node. The connection matrix list is used to store the connection relationship between the character node and the image node, wherein the connection relationship can be represented in the form of a matrix. The connection matrix list reflects the information of the edges in the character image heterogeneous graph, representing the characters included in each image, or the image to which each character belongs.
[0313] S1220: Determine an image set of each person according to the person image heterogeneous graph.
[0314] In the embodiment of the present application, an image containing a certain person is referred to as an image of the person. Specifically, based on the person image heterogeneous graph, all image nodes connected to a certain person node can be determined, and a set of images corresponding to these image nodes can be generated, that is, an image set of the person of the person node can be obtained. Taking any person a as an example, assuming that the image nodes including person node a are: image node A, image node C, and image node N, etc., the images corresponding to these image nodes can be generated into a set to obtain an image set of person a.
[0315] S1230 , for any person, determine the time dispersion of the image of person a and the location dispersion of the image of person a based on the image information of each image in the image set of person a.
[0316] The electronic device can determine the central person based on the uniformity of the time and / or location distribution. The more uniform the distribution of images corresponding to the person is, the greater the probability that the person is the central person.
[0317] This solution does not limit the method for determining the uniformity of time distribution and / or location. In one possible implementation method, the number of locations and / or time distribution of facial photos corresponding to different characters can be compared, and the person corresponding to the face with the highest number of location distribution and / or time distribution can be taken as the central character.
[0318] It can be understood that when the pictures in the gallery application change, the central person determined by the electronic device based on the uniformity of time and / or location distribution may also change. For example, after the electronic device determines that the central person is person A based on the pictures in the gallery application, the user deletes a large number of pictures of person A in the gallery application (for example, deletes pictures of person A taken in the past week). The time distribution number of pictures corresponding to person A changes, and the time distribution number of person B ranks first. The central person determined by the electronic device based on the remaining pictures in the gallery application switches to person B.
[0319] In another implementation, for any person, the time divergence and location divergence of person a's images are determined based on the image information of each image in a set of images of person a. The uniformity of the time and / or location distributions is then determined based on the time divergence and / or location divergence. The divergence measures the difference between two distributions. The larger the divergence value, the greater the difference between the two distributions. The smaller the divergence value, the smaller the difference between the two distributions. The divergence value can be [0, 1]. When the two distributions are consistent, the divergence value is 0.
[0320] It should be noted that the description herein uses person a as an example of any person in the person image heterogeneous graph. That is, the time dispersion and location dispersion of each person in the person image heterogeneous graph are determined according to the method in this step, thereby obtaining the time dispersion and location dispersion of each person.
[0321] In a specific embodiment, the time dispersion and location dispersion of character a may be determined according to the following process:
[0322] a. According to the shooting time of each image in the image set of person a, the time distribution of the images of person a (hereinafter referred to as the time distribution of person a) is counted.
[0323] The temporal distribution of person a is used to characterize the distribution of the shooting times of person a's images in multiple preset time intervals. Optionally, the electronic device first counts the matching images in person a's images whose timing information belongs to the preset time interval. For example, matching images in the preset time interval [08:00, 09:00) refer to images of person a whose timing information belongs to [08:00, 09:00). For example, the shooting time of a certain person a's image x (hereinafter referred to as image x) is 08:18:12 on April 12, 2023, and the timing information of image x is 08:18:12. This timing information belongs to [08:00, 09:00), so image x is a matching image in the preset time interval [08:00, 09:00). According to this method, matching images in each preset time interval are determined, and the number of matching images in each preset time interval is counted. Then, the electronic device determines the temporal distribution of person a based on the number of matching images in each preset time interval.
[0324] b. Determine the divergence between the time distribution of person a and the uniform time distribution to obtain the time divergence of person a.
[0325] Uniform temporal distribution means that all images of person a are evenly distributed across multiple preset time intervals. That is, the proportion of images corresponding to each preset time interval is the same, which is 1 / the number of preset time intervals. For example, if the number of preset time intervals is 24, uniform temporal distribution means that the proportion of images corresponding to each preset time interval is 1 / 24.
[0326] The temporal dispersion of person a represents the difference between the temporal distribution of person a and the uniform temporal distribution. In other words, the temporal dispersion of person a represents the uniformity of the distribution of person a's images across multiple preset time intervals, reflecting the uniformity of person a's temporal appearance.
[0327] The time uniform distribution can be represented as a vector d u,t ∈R 24×1 , all elements in this set are 1 / 24. Then the time divergence of character a can be calculated by formula (1):
[0328] Among them, D a,t represents the time divergence of character a, d u,t [i] represents vector d u,t Any element in d u,t [i]=1 / 24.
[0329] c. Based on the shooting locations of each image in the image set of person a, the location distribution of person a's images (hereinafter referred to as the location distribution of person a) is calculated. The location distribution of person a is used to represent the distribution of the shooting locations of the images of person a.
[0330] In a specific embodiment, the location distribution of person a can be counted according to the following process:
[0331] (1) Determine a set of shooting locations, which includes the shooting locations of all images in the gallery application.
[0332] Optionally, the set of shooting locations may be represented as N={N1, N2, ..., Ny}, where N1, N2, ..., Ny are elements of the set N, representing shooting locations, and y represents the total number of shooting locations.
[0333] For ease of description, the elements in the shooting location set are referred to as location elements below. That is, the shooting location set includes multiple location elements, each of which is a shooting location of an image in the gallery application data storage module.
[0334] (2) Count the number of images of person a corresponding to each location element.
[0335] For any location element Ni, the number of images of person a corresponding to that location element is the number of images of person a taken at location Ni. For example, the number of images of person a corresponding to the location element "Beijing" is the number of images of person a taken at location "Beijing."
[0336] (3) Determine the location distribution of person a based on the number of images of person a corresponding to each location element.
[0337] Based on the number of images of person a corresponding to each location element determined above, the proportion of the number of images of person a corresponding to each location element in all images of person a is determined to obtain the location distribution of person a.
[0338] (4) Determine the divergence between the location distribution of person a and the uniform location distribution to obtain the location divergence of person a.
[0339] The location divergence of person a represents the difference between the location distribution of person a and a uniform location distribution. In other words, the location divergence of person a represents the uniformity of the distribution of person a's images across multiple preset time intervals, thereby reflecting the uniformity of person a's appearance across locations.
[0340] The distribution of locations can be represented as a vector d u,l ∈R y×1 , all elements in this set are 1 / y. Then the location divergence of person a can be calculated using formula (2):
[0341] Among them, D a,lrepresents the location divergence of character a, d u,l [j] represents vector d u,l Any element in d u,l [j] = 1 / y.
[0342] S1240: Determine a central character based on the time dispersion and location dispersion of all characters.
[0343] Specifically, among the persons included in the face clustering result, the person whose corresponding image's time distribution divergence and location distribution divergence meet the preset condition 1 can be determined as the central person.
[0344] Among them, preset condition 1 is any one of the following conditions: the divergence and ranking are in the top Q1 of the first ranking, and the first ranking is obtained by ranking the characters in order of divergence and ranking from small to large; the divergence ranking and are in the top Q2 of the second ranking, and the second ranking is obtained by ranking the characters in order of divergence and ranking from small to large.
[0345] In one embodiment, the time divergence and location divergence of each character can be summed to obtain the divergence sum of each character. Afterwards, the divergence and ranking of all characters (i.e., the first ranking) are performed, and the Q1 characters with the smallest divergence and the smallest divergence are taken as the central characters, where Q1 is an integer greater than or equal to 1. If the ranking is in the order of the divergence and the smallest, the top Q1 characters (TOP Q1) in the divergence and the ranking are taken as the central characters. If the ranking is in the order of the divergence and the smallest, the last Q1 characters (END Q1) in the divergence and the ranking are taken as the central characters. It can be understood that when summing the divergence, it can be a direct summation or a weighted summation, and the embodiments of the present application do not impose any restrictions on this.
[0346] In another embodiment, the time divergence of all characters can be ranked in ascending order, and the location divergence can be ranked in ascending order. The time divergence ranking and location divergence ranking of each character are then summed to obtain the sum of the divergence rankings corresponding to each character. The Q2 characters with the smallest divergence ranking sum are taken as the central characters, where Q2 is an integer greater than or equal to 1. For example, the time divergence ranking of characters A, B, and C is (1, 2, 3), and the location divergence ranking is (2, 3, 1). Then, the two rankings are summed to obtain the divergence ranking sum of characters A, B, and C as (3, 5, 4). If Q2 is 1, character A with the smallest divergence ranking sum is taken as the central character. It should be noted that when determining the central character, if it is impossible to directly obtain Q2 central characters because the divergence ranking sums of multiple characters are the same, the character with the smaller time divergence and / or location divergence is selected from the multiple characters as the central character. In addition, when summing the rankings, it can be a direct summation or a weighted summation, and this embodiment of the application does not impose any restrictions on this. That is to say, the person whose time dispersion and location dispersion meet the above-mentioned preset condition 1 is determined as the central person.
[0347] 15 and 16 , S710 , in which the composition module performs composition processing on the candidate image to obtain the target image, and how to determine whether the target subject of the candidate image can be displayed according to the depth of field effect will be described in detail.
[0348] 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 area on the lock screen interface (such as the clock control) is blocked by the foreground.
[0349] For example, see Figure 15, which is a schematic diagram of a lock screen interface using a depth of field wallpaper. As shown in Figure 15 (a), a lock screen interface 1501 includes a lock screen wallpaper 1502 and a clock control 1503. The lock screen wallpaper 1502 includes a background 1502a and a foreground 1502b.
[0350] As shown in (b) of Figure 15 , the lock screen interface 1501 includes at least three layers, namely the layer where the background 1502a is located, the layer where the clock control 1503 is located, and the layer where the foreground 1502b is located. Among them, the layer where the clock control 1503 is located is located above the layer where the background 1502a is located, and the layer where the foreground 1502b is located is located above the layer where the clock control 1503 is located. When the above three layers overlap, as shown in (a) of Figure 15 , part of the clock control 1503 is blocked by the foreground 1502b. In addition, as shown in (b) of Figure 15 , the background 1502a includes all the contents on the lock screen wallpaper 1502, and the foreground 1502b only includes the main objects on the lock screen wallpaper 1502, that is, the characters on the lock screen wallpaper 1502.
[0351] It should be noted that the dotted lines in FIG15 are only used to identify the area and do not actually exist. For example, the clock control 1503 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.
[0352] [Corrected 26.12.2024 in accordance with Rule 91] As shown in FIG15(c), a cropping frame 1512 can be set within an image to be processed 1511. The highest point of the target subject of the image to be processed is located in an edge region 1513 of a preset region 1514 in the middle of cropping frame 1512. Edge region 1513 is located at the bottom of preset region 1514, and the ratio between the height of edge region 1513 and the height of preset region 1514 is a preset overlap ratio. The preset region can be understood as a clock region.
[0353] The position of the highest point of the target subject within cropping frame 1512 remains unchanged. The image to be processed is scaled and then cropped according to the cropping frame to obtain a depth-of-field cropped image. The position of the highest point of the target subject within cropping frame 1512 remains unchanged, i.e., the position of the highest point of the target subject within clock region 1514 remains unchanged. The highest point of the target subject remains within edge region 1513 after scaling at various ratios.
[0354] According to the depth of field cropped image, a target image can be obtained. The depth of field cropped image can be used as the target image, or an image in the depth of field cropped image that meets the depth of field wallpaper condition can be used as the target image. The depth of field wallpaper condition includes one or more of the following conditions: (1) the ratio of the area of the target subject in the depth of field cropped image in the image to be processed to the area of the target subject in the image to be processed is greater than or equal to the preset subject retention ratio; (2) the ratio of the area of the target subject in the depth of field cropped image to the area of the cropping frame is greater than or equal to the preset subject area ratio; (3) when the depth of field cropped image is magnified to obtain the depth of field cropped image, the magnification is less than or equal to the preset magnification; (4) when the target subject includes a person and the image to be processed includes the face image of the target subject, the depth of field cropped image includes the face image of the target subject; (5) when the target subject is an animal, the target image records the facial area of the animal in the image to be processed.
[0355] [Corrected 26.12.2024 in accordance with Rule 91] Thus, in the target image, the highest point of the target subject is located in the edge area, that is, in the area near the bottom of the clock area. When the target image is used as wallpaper, the clock area is used to display the clock control. Part of the clock control area is blocked by the target subject, so the target image can be used as wallpaper and displayed according to the depth of field effect. In other words, the lock screen interface includes the target image displayed with the depth of field effect.
[0356] The target image may be processed according to the image processing method shown in FIG16 to determine whether the target image can be displayed according to the depth of field effect.
[0357] Figure 16 is a schematic flow chart of an image processing method provided by an embodiment of the present application. The image processing method 1600 shown in Figure 16 may include steps S1601 to S1603, which are described in detail below.
[0358] Step S1601 , determining whether a portion of a subject in a target image exists in a clock area where a clock control is located and whether the portion of the subject in the clock area is less than or equal to a first preset portion.
[0359] The first preset ratio is greater than 0 and less than 1.
[0360] If the result of the determination in step S1601 is negative, it is determined that the target image cannot be displayed according to the depth of field effect. If the result of the determination in step S1601 is positive, the process proceeds to step S1602.
[0361] Step S1602 , determining whether the proportion of the portion of the subject in the target image in the time-division digital region where each digit of the time-division information is located is less than or equal to a second preset proportion.
[0362] The second preset ratio is greater than 0 and less than 1. The first preset ratio and the second preset ratio may be equal or unequal. For example, the first preset ratio and the second preset ratio may be equal to the preset overlap ratio.
[0363] If the result of the determination in step S1602 is negative, it is determined that the target image cannot be displayed according to the depth of field effect. If the result of the determination in step S1602 is positive, the process proceeds to step S1603.
[0364] Step S1603 , determining whether there is a portion of the subject in the target image located in the date area where the date is located.
[0365] If the subject of the target image is partially located in the date area where the date is located, it is determined that the target image cannot be displayed according to the depth of field effect. If the subject of the target image is partially located in the date area where the date is located, it can be determined that the target image can be displayed according to the depth of field effect.
[0366] That is, for the target image, it can be determined whether the target image meets the following depth of field display conditions: (1) the portion of the subject in the target image that is in the clock area exists and the proportion of the portion of the subject in the clock area is less than or equal to a first preset proportion, (2) the portion of the subject in the target image that is in the time-division digital area where each digit of the time-division information is located accounts for a proportion of the portion of the subject in the time-division digital area that is less than or equal to a second preset proportion, and (3) the portion of the subject in the target image that is in the date area where the date is located does not exist.
[0367] The first preset ratio and the second preset ratio may be equal or unequal. For example, the first preset ratio and the second preset ratio may both be 40%.
[0368] In the case where the target image meets the depth of field display condition, the target image can be displayed according to the depth of field effect.
[0369] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or variations based on the above examples, and such modifications or variations also fall within the scope of the embodiments of the present application.
[0370] An embodiment of the present application provides an image processing device, including a unit for executing various image processing methods that can execute the aforementioned embodiments of the present application.
[0371] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the aforementioned functionality. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functionality.
[0372] The present application also provides a chip, comprising a data interface and one or more processors. When the one or more processors execute instructions, the one or more processors read instructions stored in a memory through the data interface to implement the image processing method described in the above method embodiment.
[0373] The one or more processors may be general-purpose processors or special-purpose processors. For example, the one or more processors may be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices such as discrete gates, transistor logic devices, or discrete hardware components.
[0374] The chip can be used as a component of a terminal device or other electronic devices. For example, the chip can be located in the electronic device 100.
[0375] The processor and memory can be provided separately or integrated together. For example, the processor and memory can be integrated on a system-on-chip (SOC) of a terminal device. In other words, the chip can also include memory.
[0376] The memory may store a program, which may be executed by the processor to generate instructions, so that the processor executes the image processing method described in the above method embodiment according to the instructions.
[0377] Optionally, data may be stored in the memory. Optionally, the processor may read data stored in the memory, which may be stored at the same storage address as the program or at a different storage address than the program.
[0378] Exemplarily, the memory may be used to store programs related to the image processing method provided in the embodiments of the present application, and the processor may be used to call the programs related to the image processing method stored in the memory to implement the image processing method in the embodiments of the present application. For example, in at least one candidate facial image in the image to be processed, a target facial image corresponding to a target person is determined, where the target person is the same person as at least one preset person in at least one candidate person corresponding to the at least one candidate facial image; and the image to be processed is cropped to obtain a target image, where the target image includes the target facial image.
[0379] The chip can be provided in an electronic device.
[0380] The embodiments of this application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).
[0381] In the description of this application, the terms "first," "second," etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance, or a specific order or precedence. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.
[0382] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0383] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0384] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0385] In the several embodiments provided in this 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 merely illustrative; for example, the division of the units is merely a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, 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 an indirect coupling or communication connection of some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0386] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0387] 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.
[0388] It is understood that, in order to implement the above-mentioned functions, the above-mentioned electronic devices, etc., include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily appreciate that, in combination with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a manner where computer software drives hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention. The embodiments of the present application can divide the above-mentioned electronic devices, etc. into functional modules based on the above-mentioned method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present invention is schematic and is only a logical functional division. In actual implementation, other division methods may be used.
[0389] A schematic diagram of a possible configuration of the electronic device involved in the above embodiment, in which each functional module is divided according to its function, may include a display unit, a transmission unit, and a processing unit. It should be noted that all relevant content of each step involved in the above method embodiment can be referred to in the functional description of the corresponding functional module and will not be repeated here.
[0390] An embodiment of the present application further provides an electronic device comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors and are configured to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the aforementioned related method steps to implement the wallpaper recommendation method and / or image processing method described in the aforementioned embodiments.
[0391] An embodiment of the present application further provides a computer-readable storage medium having computer instructions stored therein. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the wallpaper recommendation method and / or image processing method in the above-mentioned embodiment.
[0392] The computer-readable storage medium is, for example, a memory. The memory may be a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0393] An embodiment of the present application further provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the wallpaper recommendation method and / or image processing method in the above-mentioned embodiment.
[0394] The computer program product may be stored in a memory, for example, a program, which is converted into an executable target file that can be executed by a processor after undergoing processes such as preprocessing, compilation, assembly, and linking.
[0395] 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 to enable the device to execute the wallpaper recommendation method performed by the electronic device in the above-mentioned method embodiments.
[0396] Among them, the electronic device, computer-readable storage medium, computer program product or device 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.
[0397] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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. The specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0398] The functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0399] 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 computer-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, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
[0400] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An image processing method, characterized in that, The method includes: When the application picture set of the gallery application is the first picture set, display a first candidate wallpaper on a first interface, the first candidate wallpaper being generated based on a first picture, the first picture including a first object and a second object, the first object not being cropped in the first candidate wallpaper, and the second object being cropped; When the application picture set is a second picture set, display a second candidate wallpaper on the first interface, the second candidate wallpaper being generated based on the first picture, the first object being cropped in the second candidate wallpaper, and the second object not being cropped.
2. The method according to claim 1, wherein The first object is a first person, and the second object is a second person; The method further includes: Before displaying the first candidate wallpaper on the first interface, determine that the first person belongs to a target person; Crop the first picture according to the area where the first person is located in the first image to obtain a first target picture, the target person being associated with the application picture set; Generate the first candidate wallpaper based on the first target picture; Before displaying the second candidate wallpaper on the first interface, determine that the first person does not belong to the target person; Crop the first picture according to the area where the second person is located in the first picture to obtain a second target picture; Generate the second candidate wallpaper based on the second target picture.
3. The method according to claim 2, wherein Before determining that the first person belongs to the target person or before determining that the first person does not belong to the target person, the method further includes: Perform divergence calculation according to the application picture set to obtain a time distribution divergence and a location distribution divergence corresponding to each person in the application picture set; Determine the target person according to the time distribution divergence and the location distribution divergence corresponding to each person.
4. The method according to claim 3, characterized in that, The time distribution divergence corresponding to any person in the application picture set is the divergence between the first time distribution of the any person and a uniform time distribution. The value corresponding to each preset time interval in the first time distribution of the any person represents the ratio of the number of first portrait pictures whose shooting time belongs to the preset time interval to the total number of person pictures corresponding to the any person. The first portrait picture is a picture in the application picture set that records the any person. The value corresponding to each preset time interval in the uniform time distribution represents the reciprocal of the number of the preset time intervals; The location distribution divergence corresponding to any person in the application picture set is the divergence between the first location distribution of the any person and a uniform location distribution. The value corresponding to each location in the first location distribution of the any person represents the ratio of the number of the first portrait pictures whose shooting location is the location to the total number of person pictures corresponding to the any person. The value corresponding to each location in the uniform location distribution represents the reciprocal of the number of the locations; 5. The method according to claim 3 or 4, characterized in that, The target person is a person among multiple persons in the application picture set who meets a preset condition, and the preset condition includes: The corresponding divergence sum is among the top Q1 in the first ranking; the divergence sum corresponding to any one of the multiple characters is the sum of the time distribution divergence and the location distribution divergence corresponding to the any one of the multiple characters, the divergence sums corresponding to the multiple characters in the first ranking are arranged in ascending order, and Q1 is a positive integer; or, The corresponding divergence ranking sum is among the top Q2 in the second ranking; the divergence ranking sum corresponding to any one of the multiple characters is the sum of the ranking of the time distribution divergence and the ranking of the location distribution divergence corresponding to the any one of the multiple characters, the divergence ranking sums corresponding to the multiple characters in the second ranking are arranged in ascending order, and Q2 is a positive integer.
6. The method according to claim 2, characterized in that, The target character is the character with the largest number of portrait pictures among the multiple characters in the application picture set, and the portrait picture corresponding to any one of the multiple characters is the picture in the application picture set that records the any one of the multiple characters.
7. The method according to any one of claims 2-6, characterized in that The first character is the character in the object including a face when there is a candidate character in the object including a face, and the ratio of the area of the candidate character to the area of the object with the largest area in the first picture is greater than or equal to the ratio threshold.
8. The method according to claim 7, wherein It further includes: Before determining that the first character belongs to the target character, or before determining that the first character does not belong to the target character, Determine whether the object including a face in the first picture includes the object with the largest area in the first picture; When the object including a face does not include the object with the largest area in the first picture, determine whether there is the candidate character in the object including a face.
9. The method according to claim 7 or 8, characterized in that, When the object including a face includes the object with the largest area in the first picture, or the object including a face includes the candidate character, the second character belongs to the target character associated with the second picture set, or the second character is the character with the largest area in the object including a face.
10. The method according to any one of claims 2-9, characterized in that, The cropping of the first picture according to the area where the first character is located in the first image includes: Determine multiple candidate boxes with different positions in the first picture according to the first area where the first character is located in the first image, and the area in each candidate box includes the first area; Determine a cropping box from the multiple candidate boxes according to the aesthetic score of the image in each candidate box, and the image in the cropping box is the first target picture.
11. The method according to any one of claims 1-10, characterized in that, The displaying of the first candidate wallpaper on the first interface includes: when there is a candidate character in the object including a face in the first picture, display the first candidate wallpaper on the first interface, and the ratio of the area of the candidate character to the area of the object with the largest area in the first picture is greater than or equal to the ratio threshold; The displaying of the second candidate wallpaper on the first interface includes: when there is the candidate character in the object including a face, display the second candidate wallpaper on the first interface; The method further includes: In the case where the first picture does not include a human face, or in the case where the candidate person does not exist among the objects including a human face, a third candidate wallpaper is displayed on the first interface, and a third object in the third candidate wallpaper is not cropped, and the third object is the object with the largest area in the first picture.
12. The method according to any one of claims 1-10, characterized in that, In the case where a second area where a target object is located in a target picture overlaps with a clock display area, a control icon layer in the clock display area of the target candidate wallpaper is located below a first layer and above a second layer. The target picture is obtained by cropping the first picture. The target object is the first object or the second object. The target candidate wallpaper is the first candidate wallpaper or the second candidate wallpaper. The first layer includes an image of the second area in the target picture, and the second layer includes an image of other areas in the target picture except the second area.
13. The method according to claim 12, characterized in that, The clock display area includes a plurality of digital areas for displaying a clock and a date area for displaying a date. In the case where the second area overlaps with the clock display area, a proportion of a first overlapping area between the second area and the clock display area in the clock display area is less than or equal to a first preset proportion, a proportion of a second overlapping area between the second area and any one of the digital areas in the any one of the digital areas is less than or equal to a second preset proportion, and the second area does not overlap with the date area, the control icon layer in the clock display area of the target candidate wallpaper is located below the first layer and above the second layer.
14. The method according to any one of claims 1-13, characterized in that, Before displaying the first candidate wallpaper, the method further includes: Determining a target slot for which a target candidate wallpaper meets corresponding conditions according to conditions corresponding to each slot among a plurality of slots. The target candidate wallpaper is the first candidate wallpaper or the second candidate wallpaper. The wallpaper recommendation interface includes the plurality of slots. In the wallpaper recommendation interface, the target candidate wallpaper is located in the target slot. The conditions corresponding to the target slot include at least one of the following multiple sub-conditions: The type of the target object recorded in the target candidate wallpaper is a preset type. The target object is the first object or the second object. The target object belongs to a target person, and the target person is associated with the application picture set. A second area where the target object is located in the target candidate wallpaper overlaps with a clock display area, and a control icon layer in the clock display area of the target candidate wallpaper is located below a first layer and above a second layer. The first layer includes an image of the second area in the target picture, and the second layer includes an image of other areas in the target picture except the second area. The target picture is obtained by cropping a first picture in the application picture set.
15. The method according to any one of claims 1-14, characterized in that, The method further includes: In response to a user's triggering operation on a target wallpaper among multiple candidate wallpapers in the wallpaper recommendation interface, set the target wallpaper as the lock screen wallpaper, where the multiple candidate wallpapers include the first candidate wallpaper or the second candidate wallpaper.
16. An electronic device, characterized in that, Comprising: One or more processors; A memory; A display screen; Wherein, the display screen is used to display the wallpaper recommendation interface, and one or more computer programs are stored in the memory. The one or more computer programs include instructions that, when executed by the electronic device, cause the electronic device to execute the image processing method according to any one of claims 1-15.
17. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium, and when the instructions are read and executed by one or more processors, the image processing method according to any one of claims 1-15 is executed.
18. A computer program product, characterized in that Comprising computer instructions that, when run, cause the method according to any one of claims 1-15 to be executed.
Citation Information
Patent Citations
Desktop wallpaper configuration method and device, electronic equipment and readable storage medium
CN115129410A
Method for generating cover and electronic equipment
CN115268742A
Wallpaper processing method and equipment
CN117135267A
Desktop wallpaper configuration method and apparatus, electronic device and readable storage medium
WO2023241209A1