A method for beautifying a photo, an electronic device, a storage medium and a program product

CN122554722APending Publication Date: 2026-08-11HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]本申请实施例提供一种美颜拍照的方法、电子设备、存储介质及程序产品,用于解决现有技术中美颜效果参数无法满足个性化需求的问题

Benefits of technology

[0029]本申请实施例通过同时检测相机拍摄预览界面的人脸环境信息和/或焦段信息,以及身份信息,获取匹配的美颜效果参数拍照,能够满足不同用户针对不同环境信息和/或焦段信息情况下的个性化美颜效果参数设置的需求,此外,针对不同的人脸的身份信息,环境信息和/或焦段信息场景下,可以设置不同的美颜效果参数,有利于获得最佳美颜效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122554722A_ABST
    Figure CN122554722A_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a method for beautifying a photograph, an electronic device, a storage medium and a program product. The method comprises: starting a camera, obtaining a first preview image of a photograph preview interface; detecting identity information of a face in the first preview image; detecting environment information and / or focus segment information of the first preview image; obtaining matched beautifying effect parameters according to the environment information and / or the focus segment information and the identity information; displaying a second preview image on the photograph preview interface, the second preview image being an image obtained by processing the first preview image according to the matched beautifying effect parameters; and taking a photograph according to the matched beautifying effect parameters. Through the above method, the demand of different users for personalized beautifying effect parameter setting under different environment information and / or focus segment information can be met. In addition, different beautifying effect parameters can be set for different face identity information, environment information and / or focus segment information, which is conducive to obtaining a better beautifying effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method for beautifying photos, an electronic device, a storage medium, and a program product. Background Technology

[0002] With the widespread use of electronic devices with shooting functions, it is generally possible to automatically beautify facial images during the process of taking photos or videos. That is, facial images are beautified according to preset beautification effect parameters. However, the universal beautification processing of facial images by preset beautification effect parameters cannot meet the personalized needs of users. For example, users do not want to over-beautify children, as over-beautification will prevent the natural and delicate texture of children's skin from being displayed. Summary of the Invention

[0003] This application provides a method, electronic device, storage medium, and program product for taking beautified photos, which solves the problem that the beautification effect parameters in the prior art cannot meet personalized needs.

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

[0005] Firstly, a method for beautifying photos is provided, which includes:

[0006] Launch the camera and capture the first preview image from the shooting preview interface;

[0007] Detect the identity information of the face in the first preview image;

[0008] Detect environmental information and / or focal length information of the first preview image;

[0009] Based on environmental information and / or focal length information, as well as identity information, obtain matching beautification effect parameters;

[0010] The shooting preview interface displays a second preview image, which is the first preview image processed with matching beauty effect parameters;

[0011] Take photos based on the matched beauty effect parameters.

[0012] In one alternative implementation, before acquiring the first preview image from the shooting preview interface, the method further includes: storing and associating environmental information and / or focal length information, identity information, and matching beautification effect parameters.

[0013] In an optional implementation, after the second preview image is displayed on the shooting preview interface, the method further includes:

[0014] The first beauty effect parameter is received in the shooting preview interface and is used to adjust the second preview image;

[0015] The shooting preview interface displays a third preview image, which is the second preview image processed by the first beauty effect parameters;

[0016] Take a photo based on the parameters of the first beauty filter.

[0017] Optionally, the first beautification effect parameters corresponding to environmental information and / or focal length information and identity information can be stored and updated.

[0018] In an optional implementation, if the matching beautification effect parameters fail to be obtained, the face user is prompted to set the beautification effect parameters.

[0019] Optionally, the second beautification effect parameters are received, and a fourth preview image is displayed in the shooting preview interface. The fourth preview image is the first preview image processed by the second beautification effect parameters.

[0020] Take photos based on the parameters of the second beauty effect.

[0021] Optionally, the data transmission module switch can be activated to receive the second beautification effect parameters.

[0022] Optionally, the environmental information and / or focal length information, the identity information, and the second beautification effect parameters are stored and associated.

[0023] In one optional implementation, when the first preview image includes multiple faces, a first bounding box is used for faces whose beautification effect parameters cannot be obtained, and a prompt is made to set the beautification effect parameters for the faces in the first bounding box.

[0024] Optionally, in response to the user's operation on the first bounding box, the data transmission module switch is activated to obtain the beautification effect parameters of the face in the first bounding box.

[0025] Optionally, in response to the user's operation on the first bounding box, a beauty adjustment module is displayed, which can set the beauty effect parameters of the face in the first bounding box.

[0026] In a second aspect, an electronic device is provided, comprising: one or more cameras, a processor, a display screen, a memory, and a communication module; the cameras, display screen, memory, communication module, and processor are coupled; wherein the memory is used to store computer program code, the computer program code including computer instructions, which, when executed by the electronic device, cause the electronic device to perform a beautification photo taking method as described in any of the first aspects.

[0027] Thirdly, a computer-readable storage medium is provided that stores computer instructions, which, when executed on an electronic device, enable the electronic device to perform the beautification photo-taking method described in any of the first aspects above.

[0028] Fourthly, a computer program product is provided that, when run on a computer, enables the computer to perform any of the beautification photo-taking methods described in the first aspect above.

[0029] This application embodiment obtains matching beautification effect parameters for taking photos by simultaneously detecting facial environment information and / or focal length information, as well as identity information, on the camera shooting preview interface. This can meet the needs of different users for personalized beautification effect parameter settings under different environmental and / or focal length information conditions. In addition, different beautification effect parameters can be set for different facial identity information, environmental information and / or focal length information scenarios, which is conducive to obtaining the best beautification effect. Attached Figure Description

[0030] Figure 1 This is a flowchart illustrating a method for taking photos with beautification features disclosed in an embodiment of this application;

[0031] Figure 2 This is a schematic diagram of a shooting preview interface disclosed in an embodiment of this application;

[0032] Figure 3 This is a flowchart illustrating another method for beautifying photos disclosed in an embodiment of this application;

[0033] Figure 4 This is a schematic diagram of another shooting preview interface disclosed in an embodiment of this application;

[0034] Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation

[0035] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0036] It should be noted that the terms "first," "second," "third," and "fourth" in the claims and specification of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features, nor are they used to describe a particular order. The terms "comprising" and "having," and any variations thereof, in the embodiments of this application are intended to cover non-exclusive inclusion. For example, a process, method, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses. In the description of these embodiments, unless otherwise stated, "a plurality of" means two or more.

[0037] The previous camera's beautification function required users to manually set and select settings each time, which was not intelligent and inefficient. The embodiments of this application can automatically match the corresponding beautification effect parameters, thereby improving the efficiency of camera use.

[0038] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a method for taking photos with beautification features disclosed in an embodiment of this application. Figure 1 The method includes:

[0039] 101. Launch the camera and capture the first preview image from the shooting preview interface;

[0040] Specifically, the camera is an application (app) on an electronic device. Users can launch the camera app via touch operations, entering its shooting preview interface, where they can preview the image to be captured. For example, the camera app uses the front-facing camera to obtain a preview image and displays it on the shooting preview interface.

[0041] Furthermore, the shooting preview interface displays a beauty switch, which users can choose to turn on or off. For example, when the camera is launched and the shooting preview interface is entered, the beauty switch is turned on by default.

[0042] 102. Detect the identity information of the face in the first preview image;

[0043] Specifically, by detecting one or more of the following in the preview image: facial features and contours, hair texture, skin color, skin quality, and specific personal markers, the identity information corresponding to the face is obtained. Furthermore, skin quality information can include skin condition, wrinkles, and muscle laxity, while specific personal markers can include scars, moles, and tattoos. For example, beautification effect parameters can be preset based on the identity information of the face in the image. Furthermore, users can manually modify the beautification effect parameters based on these preset parameters and view the beautification effect on the preview image in real time, ultimately determining the beautification effect parameters that meet their needs.

[0044] 103. Detect the environmental information and / or focal length information of the first preview image;

[0045] The system detects environmental information in the preview image. Specifically, it can detect whether the preview image is indoors or outdoors, in strong light or low light, on a sunny, cloudy, or rainy day, or in a forest, ocean, desert, or urban environment. For example, different environmental information allows for the preset of different beautification effect parameters. Strong light will highlight skin texture and imperfections. For instance, on a sunny outdoor day, when sunlight is directly overhead, details such as pores and wrinkles on a person's face will be more obvious. Therefore, when presetting beautification effect parameters, the skin smoothing parameter can be appropriately increased to reduce the magnified skin imperfections under strong light. Furthermore, users can manually modify the beautification effect parameters based on the preset parameters, view the beautification effect of the image in real time on the preview interface, and ultimately obtain a beautified image that better suits their personal preferences.

[0046] In one alternative implementation, the detected environmental information is displayed directly on the preview interface. Furthermore, the user can click to delete the detected environmental information, and the camera will re-detect and display the detected environmental information again. By combining machine recognition with manual correction, the accuracy of environmental information detection can be improved.

[0047] The image focal length information in the preview interface can be ultra-wide-angle (e.g., less than 24mm), wide-angle (e.g., around 24mm), standard (e.g., around 50mm), medium telephoto (e.g., around 85mm-135mm), telephoto (e.g., 200mm and above), etc. Different focal lengths exhibit different distortions, requiring different beautification parameters. For example, a wide-angle focal length makes the subject appear relatively small in the image, with less noticeable facial blemishes, thus requiring less heavy skin smoothing to avoid losing skin texture. A telephoto focal length portrait close-up further magnifies facial details, requiring stronger skin smoothing to reduce blemishes, while still preserving natural skin texture. Furthermore, the commonly used 1X (24mm) focal length interface results in a narrower face, a larger forehead, and a larger nose, while the 2X (48mm) focal length interface results in a wider face, a smaller nose, and a flatter face. Therefore, by preset beautification effect parameters, the problems caused by distortion at different focal lengths can be avoided. Furthermore, users can manually modify the beauty effect parameters based on the preset parameters, view the beauty effect of the preview image in real time, and ultimately obtain a beauty image that better suits their personal preferences.

[0048] 104. Obtain matching beautification effect parameters based on environmental information and / or focal length information, as well as identity information;

[0049] Specifically, it can obtain matching beautification effect parameters based on environmental information and identity information, or based on focal length information and identity information, or based on environmental information, focal length information, and identity information.

[0050] Specifically, beauty effect parameters can include one or more of the following: skin smoothing, blemish and acne removal, face and body slimming, skin tone adjustment, eye enlargement, and makeup touch-ups. Furthermore, beauty effect parameters can include filters.

[0051] In one optional implementation, beautification effect parameters are associated with identity information and environmental information. Based on the identity information and environmental information of the image in the preview interface, matching beautification effect parameters are obtained from the stored data. It is understood that the matching beautification effect parameters have the same or similar identity information and environmental information. For example, the camera stores a large amount of data, and each beautification effect parameter has corresponding identity information and environmental information. When the identity information of the face in the first preview image has a similarity of greater than or equal to 90% with the identity information of the face in the stored data A, and the environmental information in the first preview image has a similarity of greater than or equal to 90% with the environmental information in the stored data A, then the beautification effect parameters of the stored data A are the matching beautification effect parameters.

[0052] In one optional implementation, the beautification effect parameters are associated with identity information and focal length information. Based on the identity information and focal length information of the image in the preview interface, matching beautification effect parameters are obtained from the stored data. It is understood that the matching beautification effect parameters have the same or similar identity information and focal length information. For example, the camera stores a large amount of data, and each beautification effect parameter has corresponding identity information and focal length information. When the identity information of the face in the first preview image has a similarity of greater than or equal to 90% with the identity information of the face in the stored data B, and the focal length information in the first preview image has a similarity of greater than or equal to 90% with the focal length information in the stored data B, then the beautification effect parameters of the stored data B are the matching beautification effect parameters.

[0053] In one optional implementation, beautification effect parameters are associated with identity information, environmental information, and focal length information. Based on the identity information, environmental information, and focal length information of the image in the preview interface, matching beautification effect parameters are obtained from stored data. It is understood that the matching beautification effect parameters have the same or similar identity information, environmental information, and focal length information. For example, the camera stores a large amount of data, and each beautification effect parameter has corresponding identity information, environmental information, and focal length information. When the identity information of the face in the first preview image has a similarity of greater than or equal to 90% with the identity information of the face in the stored data C, and the environmental information in the first preview image has a similarity of greater than or equal to 90% with the environmental information in the stored data C, and the focal length information in the first preview image has a similarity of greater than or equal to 90% with the focal length information in the stored data C, then the beautification effect parameters of the stored data C are the matching beautification effect parameters.

[0054] 105. Display a second preview image on the shooting preview interface. The second preview image is the first preview image after being processed with matching beauty effect parameters.

[0055] Specifically, users can directly see the second preview image after beautification on the shooting preview interface, and further choose whether to use this beautification effect parameter to take a photo. This avoids the need to re-apply beautification software or repeatedly retake photos to get a satisfactory result after taking a photo. Therefore, it can improve the efficiency of beautification photography. In addition, it reduces the shooting and storage of unsatisfactory photos, thus improving the user experience.

[0056] 106. Take photos using the matching beauty effect parameters.

[0057] Specifically, matching beautification parameters are applied to the face in the second preview image on the shooting preview interface. Furthermore, after the user clicks to take a photo, the matching beautification parameters are applied to the photo, resulting in a picture with the applied beautification parameters. Since both the second preview image and the captured photo apply beautification parameters, the beautification effect of the captured photo is consistent with that of the second preview image, preventing users from taking unsatisfactory photos due to the inability to preview the beautification effect, thus improving user shooting efficiency. By associating beautification parameters with identity information and with environmental information and / or focal length information, beautification parameters that better match the preview image can be obtained. This facilitates refined management of image beautification parameters, allowing users to obtain the beautification parameters already set in the camera when taking photos under similar environmental and / or focal length conditions, improving shooting efficiency and enhancing the user experience.

[0058] In one alternative implementation, before acquiring the first preview image from the shooting preview interface, the method further includes: storing and associating environmental information and / or focal length information, identity information, and matching beautification effect parameters.

[0059] For example, when a user uses the camera for the first time, they are prompted to set beauty effect parameters. After the user manually sets the beauty effect parameters, the user-set beauty effect parameters are stored and associated with environmental information and / or focal length information, as well as identity information. When taking photos later, the environmental information and / or focal length information, as well as identity information in the shooting preview interface are detected. If they are the same as or similar to the stored data, the beauty effect parameters corresponding to the environmental information and / or focal length information, as well as identity information, are called.

[0060] In an optional implementation, after the second preview image is displayed on the shooting preview interface, the method further includes:

[0061] The first beauty effect parameter is received in the shooting preview interface and is used to adjust the second preview image;

[0062] The shooting preview interface displays a third preview image, which is the second preview image processed by the first beauty effect parameters;

[0063] Take a photo based on the parameters of the first beauty filter.

[0064] Optionally, the first beautification effect parameters corresponding to environmental information and / or focal length information and identity information can be stored and updated.

[0065] Specifically, after applying matching beautification parameters to the face in the second preview image on the shooting preview interface, if the user is not satisfied, they can further adjust the beautification parameters and check the effect in real time to obtain a beautified image that better meets their current needs. For example, when a user enters the beautification adjustment module on the shooting preview interface to set the first beautification parameter, upon exiting the module, they will be prompted whether to save the adjusted beautification parameter and overwrite the original data. If the user selects "yes," the original beautification parameter is refreshed, meaning the first beautification parameter matching the identity information, environment information, and / or focal length information is stored and associated. If the user selects "no," the first beautification parameter is only applied to the current second preview image to obtain the third preview image. Specifically, beautification parameters can include one or more of the following: skin smoothing, blemish removal, face and body slimming, skin color adjustment, eye enlargement, and makeup enhancement. Furthermore, beautification parameters can include filters. For example, each beautification parameter has a scale ranging from 0 to 10. Users can drag the scale of each beautification parameter and place it on the desired beautification parameter scale.

[0066] This application embodiment simultaneously detects and stores facial identity information, environmental information, and / or focal length information on the camera preview interface, and retrieves matching beautification effect parameters for taking photos. This satisfies the needs of different users for personalized beautification effect parameter settings under different environmental information and / or focal length conditions. Furthermore, different beautification effect parameters can be set for different environmental information and / or focal length scenarios, which is beneficial for obtaining the best beautification effect. On the other hand, since users' beautification needs change over time, allowing users to manually readjust the beautification effect parameters, storing and updating new beautification effect parameters corresponding to environmental information and / or focal length information and identity information—that is, obtaining matching beautification effect parameters through machine acquisition and allowing users to manually readjust the beautification effect parameter settings—is beneficial for obtaining beautification effect parameters that better meet user needs.

[0067] Figure 2 This is a schematic diagram of a shooting preview interface disclosed in an embodiment of this application, such as... Figure 2 As shown, if the matching beautification effect parameters fail to be obtained, the face user will be prompted to set the beautification effect parameters.

[0068] In this embodiment, if the beauty effect parameter acquisition fails, meaning that a matching beauty effect parameter cannot be obtained from the stored data, it may be because the identity information of the face is different from the identity information corresponding to the stored beauty effect parameter, i.e., a new face appears, or the current user of the camera is someone else. In this case, the new face user is prompted to set the beauty effect parameter. Alternatively, it may be that the identity information of the face is the same as the identity information corresponding to the stored beauty effect parameter, but the environmental information and / or focal length information of the image in the shooting preview interface is different from the environmental information and / or focal length information corresponding to the stored beauty effect parameter. In this case, the face user is prompted to set the beauty effect parameter.

[0069] In this embodiment, a second beautification effect parameter is received, and a fourth preview image is displayed in the shooting preview interface. The fourth preview image is the image after the first preview image has been processed by the second beautification effect parameter; a photo is taken according to the second beautification effect parameter.

[0070] In this embodiment, a beauty adjustment module can be accessed in the shooting preview interface. By adjusting various beauty parameters in the beauty adjustment module, a second beauty effect parameter is obtained and applied to the first preview image to obtain a fourth preview image. The shooting preview interface can preview the effect on the user's face after adjusting the beauty effect parameters in the beauty adjustment module in real time. The beauty effect parameters are saved when the user exits the beauty adjustment module. Specifically, the beauty adjustment module is located on the shooting preview interface; for example, the beauty adjustment module floats on the shooting preview interface, and the text of the beauty adjustment module is close to the edge of the preview interface to minimize obstruction of the face. The user can view the preview image with the adjusted beauty effect parameters in real time while adjusting them to select the most suitable beauty effect parameter.

[0071] Specifically, beauty effect parameters may include one or more of the following: skin smoothing, blemish and acne removal, face and body slimming, skin tone adjustment, eye enlargement, and makeup touch-up. Furthermore, beauty effect parameters may include filters. For example, each beauty effect parameter has a scale ranging from 0 to 10, and users can drag the scale of each beauty effect parameter and place it on the desired scale.

[0072] After setting up beautification effect parameters, users can choose to save these parameters to the camera app. The next time the same or similar identity, environmental, and / or focal length information is detected, the camera app will directly call up the pre-set beautification effect parameters, improving the efficiency of beautification photography. Furthermore, users can choose to share beautification effect parameters by clicking the share button, for example, sharing beautification photo parameters to other electronic devices. This allows the sharer to use the matching beautification effect parameters when taking photos with similar or identical identity, environmental, and / or focal length information on other electronic devices. In other words, users can take photos with the desired beautification effect on different electronic devices, enhancing the social aspect of beautification effect parameters. Additionally, beautification photo parameters can be shared to the cloud, ensuring that even if users switch electronic devices, they can still access the previously set matching beautification effect parameters in a timely manner.

[0073] In an alternative implementation, the second beautification effect parameters can be received by activating the data transmission module switch. For example, if a user has multiple mobile phones, the beautification effect parameters can be transmitted through the data transmission module to improve the user's photo-taking efficiency.

[0074] Furthermore, the second beautification effect parameters are associated with the face's identity information, as well as environmental information and / or focal length information, and stored in the camera. When the user takes a photo later, if the same or similar face's identity information, environmental information, and / or focal length information appear after activating the camera, the matching beautification effect parameters are automatically retrieved and applied. For example, when storing beautification effect parameters, they are categorized using identity information. Beautification effect parameters with the same identity information are stored in the same folder. When users share beautification effect parameters, they can choose to transmit the parameters according to identity information, improving the transmission efficiency of beautification effect parameters.

[0075] Please refer to Figure 3 , Figure 3 This is a schematic flowchart illustrating another beautification photography method disclosed in an embodiment of this application. Figure 3 The method includes:

[0076] 301. Start the camera and capture the preview image from the shooting preview interface;

[0077] Specifically, the camera is an application (app) on an electronic device. Users can launch the camera app via touch operations, entering its shooting preview interface, where they can preview the image to be captured. For example, the camera app uses the front-facing camera to obtain a preview image and displays it on the shooting preview interface.

[0078] Furthermore, the shooting preview interface displays a beauty switch, which users can choose to turn on or off. For example, when the camera is launched and the shooting preview interface is entered, the beauty switch is turned on by default.

[0079] 302. Detect the identity information of faces in the preview image; there are multiple faces.

[0080] Specifically, in a group photo scenario, the preview image contains multiple faces. For example, valid facial information can be confirmed by the distance between faces and the integrity of the faces.

[0081] Specifically, by detecting one or more of the following in the preview image: facial features and contours, hair texture, skin color, skin quality, and specific personal markers, the identity information corresponding to the face is obtained. Furthermore, skin quality information can include skin condition, wrinkles, and muscle laxity, while specific personal markers can include scars, moles, and tattoos. For example, beautification effect parameters can be preset based on the identity information of the face in the image. Furthermore, users can manually modify the beautification effect parameters based on these preset parameters and view the beautification effect on the preview image in real time, ultimately determining the beautification effect parameters that meet their needs.

[0082] 303. Detect environmental information and / or focal length information of the preview image;

[0083] The system detects environmental information in the preview image. Specifically, it can detect whether the preview image is indoors or outdoors, in strong light or low light, on a sunny, cloudy, or rainy day, or in a forest, ocean, desert, or urban environment. For example, different environmental information allows for the preset of different beautification effect parameters. Strong light will highlight skin texture and imperfections. For instance, on a sunny outdoor day, when sunlight is directly overhead, details such as pores and wrinkles on a person's face will be more obvious. Therefore, when presetting beautification effect parameters, the skin smoothing parameter can be appropriately increased to reduce the magnified skin imperfections under strong light. Furthermore, users can manually modify the beautification effect parameters based on the preset parameters, view the beautification effect of the image in real time on the preview interface, and ultimately obtain a beautified image that better suits their personal preferences.

[0084] In one alternative implementation, the detected environmental information is displayed directly on the preview interface. Furthermore, the user can click to delete the detected environmental information, and the camera will re-detect and display the detected environmental information again. By combining machine recognition with manual correction, the accuracy of environmental information detection can be improved.

[0085] The image focal length information in the preview interface can be ultra-wide-angle (e.g., less than 24mm), wide-angle (e.g., around 24mm), standard (e.g., around 50mm), medium telephoto (e.g., around 85mm-135mm), telephoto (e.g., 200mm and above), etc. Different focal lengths exhibit different distortions, requiring different beautification parameters. For example, a wide-angle focal length makes the subject appear relatively small in the image, with less noticeable facial blemishes, thus requiring less heavy skin smoothing to avoid losing skin texture. A telephoto focal length portrait close-up further magnifies facial details, requiring stronger skin smoothing to reduce blemishes, while still preserving natural skin texture. Furthermore, the commonly used 1X (24mm) focal length interface results in a narrower face, a larger forehead, and a larger nose, while the 2X (48mm) focal length interface results in a wider face, a smaller nose, and a flatter face. Therefore, by preset beautification effect parameters, the problems caused by distortion at different focal lengths can be avoided. Furthermore, users can manually modify the beauty effect parameters based on the preset parameters, view the beauty effect of the preview image in real time, and ultimately obtain a beauty image that better suits their personal preferences.

[0086] 304. Based on environmental information and / or focal length information, as well as identity information, retrieve matching beautification effect parameters from the stored data;

[0087] Specifically, it can retrieve matching beautification effect parameters from stored data based on environmental and identity information, or based on focal length and identity information, or based on environmental, focal length, and identity information.

[0088] Specifically, beauty effect parameters can include one or more of the following: skin smoothing, blemish and acne removal, face and body slimming, skin tone adjustment, eye enlargement, and makeup touch-ups. Furthermore, beauty effect parameters can include filters.

[0089] In one optional implementation, beautification effect parameters are associated with identity information and environmental information. Based on the identity information and environmental information of the image in the preview interface, matching beautification effect parameters are obtained from the stored data. It is understood that the matching beautification effect parameters have the same or similar identity information and environmental information. For example, the camera stores a large amount of data, and each beautification effect parameter has corresponding identity information and environmental information. When the identity information of the face in the first preview image has a similarity of greater than or equal to 90% with the identity information of the face in the stored data D, and the environmental information in the first preview image has a similarity of greater than or equal to 90% with the environmental information in the stored data D, then the beautification effect parameters of the stored data D are the matching beautification effect parameters.

[0090] In one optional implementation, the beautification effect parameters are associated with identity information and focal length information. Based on the identity information and focal length information of the image in the preview interface, matching beautification effect parameters are obtained from the stored data. It is understood that the matching beautification effect parameters have the same or similar identity information and focal length information. For example, the camera stores a large amount of data, and each beautification effect parameter has corresponding identity information and focal length information. When the identity information of the face in the first preview image has a similarity of greater than or equal to 90% with the identity information of the face in the stored data E, and the focal length information in the first preview image has a similarity of greater than or equal to 90% with the focal length information in the stored data E, then the beautification effect parameters of the stored data E are the matching beautification effect parameters.

[0091] In one optional implementation, beautification effect parameters are associated with identity information, environmental information, and focal length information. Based on the identity information, environmental information, and focal length information of the image in the preview interface, matching beautification effect parameters are obtained from stored data. It is understood that the matching beautification effect parameters have the same or similar identity information, environmental information, and focal length information. For example, the camera stores a large amount of data, and each beautification effect parameter has corresponding identity information, environmental information, and focal length information. When the identity information of the face in the first preview image has a similarity of greater than or equal to 90% with the identity information of the face in the stored data F, and the environmental information in the first preview image has a similarity of greater than or equal to 90% with the environmental information in the stored data F, and the focal length information in the first preview image has a similarity of greater than or equal to 90% with the focal length information in the stored data F, then the beautification effect parameters of the stored data F are the matching beautification effect parameters.

[0092] 305. For faces whose beauty effect parameters cannot be obtained, a first bounding box is used, and a prompt is given to set the beauty effect parameters for the face in the first bounding box.

[0093] For example, in response to a user's operation on the first marker box, the data transmission module is activated to obtain the beautification effect parameters of the face within the first marker box. This operation may include clicking, pressing, etc., and is not limited here. For instance, by activating the data transmission module of a camera device, the user with the first marker box can transmit the beautification effect parameters to the camera device via a local area network, Bluetooth, or a satellite flash. The camera device receives the beautification effect parameters from the user with the first marker box and saves them in the camera app. If multiple faces cannot obtain beautification effect parameters, the same marker box (the first marker box) can be used for each face, and clicking the first marker box will activate the beautification effect parameter transmission for each face. Alternatively, different marker boxes can be used for multiple faces, such as circular, triangular, or square marker boxes, and clicking different marker boxes will activate the beautification effect parameter transmission for each face. For example, the beautification effect parameters of the face user in the first bounding box can be shared by launching the camera and entering the beautification adjustment module in the photo preview interface. The current beautification effect parameters are those that match the current identity information (face user in the first bounding box) and environmental information, or those that match the identity information (face user in the first bounding box) and focal length information, or those that match the identity information (face user in the first bounding box), environmental information, and focal length information.

[0094] For example, in response to the user's operation on the first marked box, a beauty adjustment module is displayed, allowing the user to set beauty effect parameters for the face within the first marked box. This operation may include clicking, pressing, etc., and is not limited here. The beauty adjustment module can be accessed in the shooting preview interface, where various beauty parameters can be adjusted. The shooting preview interface provides a real-time preview of the effects after the user adjusts these parameters. The beauty effect parameters are saved when the user exits the beauty adjustment module. Specifically, the beauty adjustment module floats on the shooting preview interface, with its text positioned near the edge to minimize obstruction of the face. Users can view the preview image with adjusted beauty effect parameters in real-time to select the most suitable parameter. For example, beauty effect parameters may include one or more of the following: skin smoothing, blemish removal, face and body slimming, skin tone adjustment, eye enlargement, and makeup enhancement. Further, beauty effect parameters may include filters. For example, each beauty effect parameter is set with a scale ranging from 0 to 10. Users can drag the scale of each beauty effect parameter and place it on the scale of the desired beauty effect parameter.

[0095] 306. Take photos using the matching beauty effect parameters.

[0096] Specifically, the matching beautification effect parameters can be obtained from stored data, or they can be beautification effect parameters set by the user when they cannot be obtained.

[0097] This application embodiment detects the identity information, environmental information, and / or focal length information of multiple faces on the shooting preview interface simultaneously, obtains and uses matching beautification effect parameters to take photos, which can meet the needs of multiple users for personalized beautification effect parameter settings under different environmental information and / or focal length conditions. Since multiple faces can use multiple matching beautification effect parameters for differentiated beautification processing, the beautification effect of the final group photo meets the needs of everyone, improves the image processing effect and the satisfaction of everyone in the image, and enhances the user's photo-taking experience.

[0098] Figure 4 This is a schematic diagram of another shooting preview interface disclosed in an embodiment of this application, such as... Figure 4 As shown, in the group photo mode, faces for which beauty effect parameters could not be obtained are marked with the first marker box, and the user of the face is reminded to set beauty effect. Clicking the first marker box will take you to the beauty adjustment module. The shooting preview interface includes the beauty adjustment module. Finally, the photo is taken using the matched beauty effect parameters. Specifically, the matched beauty effect parameters can be obtained from the stored data, or they can be the beauty effect parameters set by the user when beauty effect parameters cannot be obtained.

[0099] In an optional embodiment, in group photo mode, faces for which beauty effect parameters failed to be acquired are marked with a first bounding box, prompting the user to set beauty effects. Clicking the first bounding box activates the data transmission module, acquiring the beauty effect parameters of the face within the first bounding box. For example, activating the data transmission module of the camera's electronic device allows the user with the first bounding box to transmit beauty effect parameters to the camera via LAN, Bluetooth, or a satellite image. The camera receives the beauty effect parameters from the user with the first bounding box and saves them in the camera app. If there are multiple first bounding boxes, each box is clicked, and the beauty effect parameter transmission is initiated for each. For example, the beautification effect parameters of the face user in the first bounding box can be shared by launching the camera and entering the beautification adjustment module in the photo preview interface. The current beautification effect parameters are those that match the current identity information (face user in the first bounding box) and environmental information, or those that match the identity information (face user in the first bounding box) and focal length information, or those that match the identity information (face user in the first bounding box), environmental information, and focal length information.

[0100] Furthermore, if no click operation on the first marker box is detected, the default beautification effect parameters are used. The default beautification effect parameters can be beautification effect parameters that match the environment information, or beautification effect parameters that match the focal length information, or beautification effect parameters that match both the environment information and the focal length information.

[0101] In one optional implementation, clicking the first marker box displays the beauty adjustment module, allowing users to sequentially set beauty effect parameters for the face in the second marker box and store them in the camera. Specifically, beauty effect parameters may include one or more of the following: skin smoothing, blemish and acne removal, face and body slimming, skin color adjustment, eye enlargement, and makeup enhancement. Further, beauty effect parameters may include filters. For example, each beauty effect parameter has a scale ranging from 0 to 10, and users can drag the scale of each beauty effect parameter and place it on the desired scale. For example, when storing beauty effect parameters, they are categorized using identity information; beauty effect parameters with the same identity information are stored in the same folder. When sharing beauty effect parameters, users can choose to transmit them according to identity information, improving transmission efficiency.

[0102] This application embodiment detects and stores the identity information, environmental information, and / or focal length information of multiple faces on the shooting preview interface, and retrieves matching beautification effect parameters for taking photos. This can meet the needs of multiple users for personalized beautification effect parameter settings under different environmental and / or focal length information conditions. Since multiple faces can use multiple matching beautification effect parameters for differentiated beautification processing, the beautification effect of the final group photo meets everyone's needs, improves the image processing effect and the satisfaction of everyone in the image, and enhances the user's photo-taking experience.

[0103] This application provides an electronic device with a camera module. The electronic device can be mobile or fixed, such as a camera, camcorder, mobile phone, tablet personal computer, smart TV, laptop computer, personal digital assistant (PDA), personal computer, or wearable device such as a smartwatch. This application does not limit the scope of the application to this type of device. The following is a detailed description with reference to the accompanying drawings.

[0104] Please refer to Figure 5 This illustrates a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5As shown, the electronic device includes: one or more cameras 293, a processor 210, a display screen 294, an internal memory 221, and a mobile communication module 250 / wireless communication module 260; the camera 293, display screen 294, internal memory 221, mobile communication module 250 / wireless communication module 260, and processor 210 are coupled; wherein, the memory is used to store computer program code, the computer program code including computer instructions, which, when executed by the electronic device, cause the electronic device to perform the beautification photo taking method of any of the above embodiments.

[0105] Specifically, the electronic device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an accelerometer sensor 280E, a distance sensor 280F, a proximity sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.

[0106] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0107] Processor 210 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0108] The controller can serve as the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0109] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0110] Electronic devices implement display functions through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0111] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. The display panel may 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 miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 294, where N is a positive integer greater than 1.

[0112] Electronic devices can achieve shooting functions through ISP, camera 293, video codec, GPU, display 294 and application processor.

[0113] The ISP (Image Signal Processor) is used to process data fed back from the camera 293. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 293.

[0114] Camera 293 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device may include one or N cameras 293, where N is a positive integer greater than 1.

[0115] Internal memory 221 can be used to store executable program code, including instructions. Processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 221. Internal memory 221 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, phonebook, etc.). Furthermore, internal memory 221 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0116] Electronic devices can implement audio functions through audio modules 270, speakers 270A, receivers 270B, microphones 270C, headphone jacks 270D, and application processors. Examples include music playback and recording.

[0117] The audio module 270 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 270 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 270 may be located in the processor 210, or some functional modules of the audio module 270 may be located in the processor 210.

[0118] The speaker 270A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic devices can listen to music or make hands-free calls through the speaker 270A.

[0119] The receiver 270B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When an electronic device answers a phone call or voice message, the receiver 270B can be brought close to the ear to hear the voice.

[0120] Microphone 270C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 270C, inputting the sound signal into microphone 270C. An electronic device can have at least one microphone 270C. In some embodiments, the electronic device can have two microphones 270C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, the electronic device can also have three, four, or more microphones 270C, enabling sound signal collection, noise reduction, sound source identification, and directional recording, among other functions.

[0121] The headphone jack 270D is used to connect wired headphones. The headphone jack 270D can be a USB 230 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0122] Pressure sensor 280A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 280A can be disposed on display screen 294. There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 280A, the capacitance between the electrodes changes. The electronic device determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 294, the electronic device detects the touch operation intensity based on pressure sensor 280A. The electronic device can also calculate the touch position based on the detection signal from pressure sensor 280A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS message is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS message is executed.

[0123] The distance sensor 280F is used to measure distance. Electronic devices can measure distance using infrared or laser. In some embodiments, during a shooting scene, the electronic device can utilize the distance sensor 280F to measure distance for rapid focusing.

[0124] The ambient light sensor 280L is used to detect ambient light levels. Electronic devices can adaptively adjust the brightness of their displays 294 based on the detected ambient light. The ambient light sensor 280L can also be used to automatically adjust white balance when taking photos. The ambient light sensor 280L can also be used in conjunction with the proximity sensor 280G to detect whether electronic devices are in a pocket, preventing accidental touches.

[0125] The fingerprint sensor 280H is used to collect fingerprints. Electronic devices can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, app access locks, fingerprint photography, fingerprint answering of calls, etc.

[0126] Touch sensor 280K, also known as a "touch panel," can be located on display screen 294. The touch sensor 280K and display screen 294 together form a touchscreen, also known as a "touchscreen." Touch sensor 280K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 294. In other embodiments, touch sensor 280K may also be located on the surface of the electronic device, in a different position than display screen 294.

[0127] Buttons 290 include a power button, volume buttons, etc. Buttons 290 can be mechanical buttons or touch-sensitive buttons. The electronic device can receive button input and generate key signal inputs related to user settings and function control of the electronic device.

[0128] When the camera app is launched and the shooting preview interface is entered, users can observe the preview image. At the same time, the shooting preview interface also allows users to set application controls for beautifying the preview image. Based on this, users can choose whether to beautify the preview image that matches the beautification effect parameters, and adjust the beautification parameters used for beautification.

[0129] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the various functions or steps described in the above method embodiments.

[0130] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the various functions or steps described in the above method embodiments.

[0131] This application also provides a chip, which includes a processor and a communication interface. The communication interface is used to communicate with a communication module preceding the chip, and the processor is used to run computer programs or instructions to perform the various functions or steps in the above method embodiments.

[0132] Through the above description of the embodiments, those skilled in the art can 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.

[0133] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0134] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0135] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0136] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0137] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for taking a photo with beautification, characterized in that, include: Launch the camera and capture the first preview image from the shooting preview interface; Detect the identity information of the face in the first preview image; Detect the environmental information and / or focal length information of the first preview image; Based on the environmental information and / or the focal length information, and the identity information, obtain the matching beauty effect parameters; The shooting preview interface displays a second preview image, which is the first preview image processed by the matched beautification effect parameters; Take a photo based on the matched beauty effect parameters.

2. The method of claim 1, wherein, Before acquiring the first preview image from the shooting preview interface, the process also includes: Store and associate the environmental information and / or the focal length information, the identity information, and the matched beautification effect parameters.

3. The method of claim 1, wherein, After the second preview image is displayed on the shooting preview interface, the following is also included: The first beauty effect parameter is received in the shooting preview interface, and the first beauty effect parameter is used to adjust the second preview image; The shooting preview interface displays a third preview image, which is the second preview image processed by the first beauty effect parameters; Take a photo based on the first beauty effect parameters.

4. The method of claim 3, wherein, The method further includes: Store and update the first beautification effect parameters corresponding to the environmental information and / or the focal length information and the identity information.

5. The method of claim 1, wherein, The method further includes: If the matching beautification effect parameters fail to be obtained, the face user will be prompted to set the beautification effect parameters.

6. The method of claim 5, wherein, The method further includes: Receive the second beautification effect parameters and display the fourth preview image on the shooting preview interface. The fourth preview image is the first preview image processed by the second beautification effect parameters. Take a photo based on the second beauty effect parameters.

7. The method of claim 6, wherein, The parameters for receiving the second beauty effect include: Turn on the data transmission module to receive the parameters for the second beauty effect.

8. The method of claim 6, wherein, The method further includes: Store and associate the environmental information and / or the focal length information, the identity information, and the second beautification effect parameters.

9. The method of claim 1, wherein, The method further includes: When there are multiple faces in the first preview image, a first bounding box is used for the faces whose beautification effect parameters cannot be obtained, and a prompt is made to set the beautification effect parameters for the faces in the first bounding box; Take a photo using the beauty effect parameters you set.

10. The method of claim 9, wherein, Also includes: In response to the user's operation on the first bounding box, the data transmission module is activated to obtain the beautification effect parameters of the face in the first bounding box.

11. The method of claim 9, wherein, Also includes: In response to the user's operation on the first marker box, a beauty adjustment module is displayed, which can set the beauty effect parameters of the face in the first marker box.

12. An electronic device, comprising: The electronic device includes: one or more cameras, one or more processors, a display screen, a memory, and a communication module; the camera, the display screen, the memory, the communication module, and the processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device performs the method as described in any one of claims 1-11.

13. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-11.

14. A computer program product, characterised in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-11.