An image processing method, apparatus and computer-readable storage medium

By identifying the distance between the face and the device in the image and targeted face slimming based on preset strategies, the problem of uneven face size in group photos is solved, and the intelligent and efficient processing of face slimming needs of multiple people is realized.

CN114387157BActive Publication Date: 2025-07-18SHENZHEN SHENZHAN NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111672535.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-07-18
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The existing image beautification processing technology is difficult to coordinate the problem of uneven face sizes for multiple people in group photos, resulting in large differences in face sizes in photos, which cannot meet the face slimming needs of multiple people.

Method used

By identifying the faces in the image captured by the image acquisition device and obtaining the distance between them and the device, targeted face slimming processing is performed based on the preset face slimming strategy and distance, including identifying all faces, faces with characteristic information that meet the conditions or faces with distance and size ratio that meet the conditions for face slimming processing.

Benefits of technology

It realizes the problem of uneven face size in group photos, meets the face-slimming needs of multiple people, is intelligent and efficient, and does not need to deal with faces one by one.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114387157B_ABST
    Figure CN114387157B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses an image processing method, apparatus, and computer-readable storage medium for meeting the face slimming requirements of multiple people taking pictures. The method of the embodiment of the present invention includes: acquiring an image collected by an image acquisition device; identifying a human face in the image, and acquiring the distance between the photographed object corresponding to the human face and the image acquisition device when the image acquisition device collects the image; performing face slimming processing on the human face based on a preset face slimming strategy and the distance. By performing face slimming processing on the human face identified according to the distance, problems such as uneven face sizes caused by different distances between photographed objects and the image acquisition device in a group photo can be coordinately processed, the face slimming requirements of multiple people can be met, and the method does not need to perform face slimming processing on each human face one by one, and has the characteristics of intelligence and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image technology, and in particular, to an image processing method, apparatus, and computer-readable storage medium. Background Art

[0002] In today's era, various image beautification processes have been developed and widely applied. In particular, the beautification of human faces has been reflected in various intelligent devices.

[0003] However, for group photos, the existing image beautification processing results in a large difference in the sizes of human faces in the image, making it difficult to meet the needs of multiple people. Summary of the Invention

[0004] Embodiments of the present invention provide an image processing method, apparatus, and computer-readable storage medium for the face slimming requirements of taking group photos.

[0005] In a first aspect, embodiments of the present invention provide an image processing method, the method including:

[0006] Obtain an image collected by an image acquisition device;

[0007] Identify the human faces in the image, and obtain the distance between the shooting object corresponding to the human face and the image acquisition device when the image acquisition device collects the image;

[0008] Perform face slimming processing on the human face based on a preset face slimming strategy and the distance.

[0009] Optionally, the performing face slimming processing on the human face based on a preset face slimming strategy and the distance includes:

[0010] Perform face slimming processing on all the identified human faces in the image respectively based on the corresponding distances; or,

[0011] Obtain the feature information of the human face;

[0012] If the feature information of the target human face in the human faces meets a preset condition, perform face slimming processing on the target human face based on the distance.

[0013] Optionally, the feature information includes the distance and / or the size ratio of the human face in the image.

[0014] Optionally, the if the feature information of the target human face in the human faces meets a preset condition, perform face slimming processing on the target human face based on the distance includes:

[0015] If the distance corresponding to the target face in the face is less than the target distance, perform face slimming processing on the target face based on the distance corresponding to the target face, where the target distance is the average value of the distances between all the faces recognized in the image and the distance when the image acquisition device acquires the image.

[0016] Optionally, if the feature information of the target face in the face meets a preset condition, performing face slimming processing on the target face that meets the condition based on the distance includes:

[0017] If the size ratio corresponding to the target face in the face is greater than the target size ratio, perform face slimming processing on the target face based on the distance corresponding to the target face, where the target size ratio is the average size ratio of all the faces recognized in the image in the image.

[0018] Optionally, if the feature information of the target face in the face meets a preset condition, performing face slimming processing on the target face that meets the condition based on the distance includes:

[0019] If the distance corresponding to the target face in the face is less than the target distance, and the size ratio corresponding to the target face in the face is greater than the target size ratio, perform face slimming processing on the target face based on the distance corresponding to the target face, where the target distance is the average value of the distances between all the faces recognized in the image and the distance when the image acquisition device acquires the image, and the target size ratio is the average size ratio of all the faces recognized in the image in the image.

[0020] Optionally, the method further includes:

[0021] Obtain a user instruction;

[0022] Select a target face slimming mode from multiple face slimming modes based on the user instruction;

[0023] The performing face slimming processing on the face based on a preset face slimming strategy and the distance includes:

[0024] Perform face slimming processing on the face based on a preset face slimming strategy, the target face slimming mode, and the distance.

[0025] Optionally, the performing face slimming processing on the face based on a preset face slimming strategy and the distance includes:

[0026] Obtain the mapping relationship between the preset distance and the face slimming ratio coefficient, and perform face slimming processing on the face based on a preset face slimming strategy, the mapping relationship, and the distance; or,

[0027] Input the distance into a preset face slimming model to obtain a face slimming strategy based on the distance, and perform face slimming processing on the human face based on the preset face slimming strategy and the face slimming strategy based on the distance.

[0028] In a second aspect, an embodiment of the present invention provides an image processing apparatus, and the distance detection apparatus includes:

[0029] A memory for storing a computer program;

[0030] A processor for implementing the steps of the method described in the first aspect above when executing the computer program stored in the memory.

[0031] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method described in the first aspect above.

[0032] An embodiment of the present invention provides an image processing method, apparatus, and computer-readable storage medium. By identifying the image collected by the image acquisition device, when a human face is recognized, the distance between the corresponding shooting object and the image acquisition device when the human face is collected can be further obtained, so that face slimming processing can be performed on the human face based on the preset face slimming strategy and this distance. In this way, by performing face slimming processing on the specifically identified human face according to the distance, problems such as uneven face sizes caused by different distances between the shooting object and the image acquisition device in a group photo can be coordinated and processed, and the face slimming needs of multiple people can be met. Moreover, this method does not require face slimming processing for each face one by one, and has the characteristics of intelligence and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic flowchart of an image processing method provided by an embodiment of the present invention;

[0034] Figure 2 It is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0035] An embodiment of the present invention provides an image processing method, apparatus, and computer-readable storage medium for realizing fast search.

[0036] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0037] In the description and claims of the present invention and the above-mentioned drawings, the terms "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0038] It can be understood that during the shooting process, due to the principle of objects being larger when closer and smaller when farther away, objects closer will appear larger and objects farther away will appear relatively smaller. In the case of group photos, due to different positions of people, the distances between each person and the image acquisition device are different, resulting in different proportions of the human face in the photo. In particular, people near the image acquisition device are prone to having large faces, with a significant difference / incoordination in face size compared to those far from the image acquisition device, and the generated photos are likely to cause discomfort to people near the image acquisition device, especially in today's era where being thin is considered beautiful.

[0039] Based on this, the embodiments of the present invention provide a face slimming method, device, and computer-readable storage medium. The face slimming method can, by recognizing the image acquired by the image acquisition device, further obtain the distance between the corresponding shooting object and the image acquisition device when the face is acquired in the case of recognizing a human face, and thus can perform face slimming processing on the face based on a preset face slimming strategy and this distance. In this way, by performing face slimming processing on the face recognized based on the distance, it is possible to coordinately handle problems such as uneven face sizes caused by different distances between the shooting object and the image acquisition device in a group photo, meet the face slimming needs of multiple people, and this method does not require face slimming processing for each face one by one, having the characteristics of intelligence and high efficiency.

[0040] Among them, this method can be applicable to any electronic device with image processing capabilities, such as mobile phones, tablets, cameras, desktop computers, laptop computers, smart wearable electronic devices, etc. Further, this electronic device can also have an image acquisition function to achieve an integrated presentation of image acquisition and processing in the same product. Of course, it can be understood that these two functions can also be embodied in different products, but an electronic device with image processing capabilities can obtain relevant information acquired by an electronic device with image acquisition capabilities, and the embodiments of the present invention do not make any limitations in this regard.

[0041] Further, at least one of the electronic device with an image acquisition function and the electronic device with an image processing function may also have a distance detection function to achieve multifunctional integration. Of course, it can be understood that the distance detection function can also be embodied in products other than the electronic device with an image acquisition function and the electronic device with an image processing function. However, at least one of the electronic device with an image acquisition function and the electronic device with an image processing function can obtain relevant information collected by the electronic device with a distance detection function, so that the electronic device with an image processing function can perform face slimming processing based on the relevant information collected by the electronic device with a distance detection function. The embodiments of the present invention do not make any limitations here.

[0042] It should be noted that when the above-mentioned electronic devices are different products, they can be communicatively connected to each other to achieve information interaction, or obtain relevant information based on forms such as SD cards.

[0043] For ease of understanding, the specific process in the embodiments of the present invention will be described below. Please refer to Figure 1 , the image processing method in the embodiments of the present invention includes:

[0044] 01: Obtain the image collected by the image acquisition device;

[0045] 02: Identify the face in the image, and obtain the distance between the photographed object corresponding to the face and the image acquisition device when the image is collected;

[0046] 03: Perform face slimming processing on the face based on the preset face slimming strategy and the distance.

[0047] The image processing method in this embodiment can be implemented by an image processing device (that is, the above-mentioned electronic device with an image processing function), and this image processing device can obtain the image collected by the image acquisition device. Among them, the image acquisition device can be integrated with or independent of the image processing device, and the image acquisition device can include but is not limited to mobile phones, tablets, cameras, and smart wearable electronic devices.

[0048] Specifically, after obtaining the image collected by the image acquisition device, the face in the image can be recognized to effectively and specifically perform face slimming processing on the face. Among them, the face recognition method can refer to the image recognition method in the related art. For example, the image is recognized by using a face recognition model obtained through machine learning, which will not be elaborated here.

[0049] After detecting a human face in an image, the distance between the subject corresponding to the detected human face and the image acquisition device at the time of acquisition can be obtained. Among them, the distance between the subject corresponding to each detected human face and the image acquisition device at the time of acquisition can be obtained, or the distance between the subject corresponding to some of the detected human faces and the image acquisition device at the time of acquisition can be obtained. Specifically, it can be determined according to the need for face slimming processing. This selection can be based on a predetermined rule or selected by the user, and no specific limitation is made here.

[0050] In some embodiments, the image acquisition device can be a device with a binocular camera, so as to be able to use the images acquired by the image acquisition device and based on the principle of image parallax to obtain the distance between the subject corresponding to the human face and the image acquisition device at the time of acquisition.

[0051] In some other embodiments, the image acquisition device can be carried on a mobile device. By the movement of the mobile device, the position of the image acquisition device can be changed and the image acquisition device can take pictures at different positions to achieve the effect of binocular photography, so as to obtain the distance between the subject corresponding to the human face and the image acquisition device at the time of acquisition based on the principle of image parallax. The mobile device can be, for example, a pan-tilt head.

[0052] In some other embodiments, a distance detection device can be mounted on the image acquisition device to obtain the distance between the subject corresponding to the human face and the image acquisition device at the time of acquisition through the distance detection device. The sensing range of the distance detection device can cover the sensing range of the image acquisition device. The distance detection device can be, for example, a time-of-flight (TOF) sensor, a lidar.

[0053] Furthermore, after obtaining the corresponding distance, face slimming processing can be performed on the corresponding human face based on a preset face slimming strategy and the obtained corresponding distance. In this way, by introducing the factor of distance, the problem of the size difference of human faces in the foreground and background in a group photo due to distance can be improved, so that the proportion of the human face of the subject near the image acquisition device in the image is relatively less different from the proportion of the human face of the subject far from the image acquisition device in the image, thus meeting the face slimming requirements for group photos.

[0054] In some embodiments, the face slimming process based on the preset face slimming strategy and the distance may include: obtaining the mapping relationship between the preset distance and the face slimming ratio coefficient, and performing face slimming on the face based on the preset face slimming strategy, the mapping relationship, and the distance. Specifically, for each preset distance, the slimming effects corresponding to multiple face slimming ratio coefficients can be pre-tested. After adjusting to a reasonable face slimming ratio coefficient, the mapping relationship between the preset distance and its corresponding reasonable face slimming ratio coefficient can be stored locally or in the cloud in a form such as a table. After obtaining the distance corresponding to the face that needs to be slimmed currently, the corresponding face slimming ratio coefficient can be found in the table based on this distance, so as to perform face slimming on the face based on this face slimming ratio coefficient and the preset face slimming strategy.

[0055] In other embodiments, the face slimming process based on the preset face slimming strategy and the distance may include: inputting the distance into a preset face slimming model to obtain a face slimming strategy based on the distance, and performing face slimming on the face based on the preset face slimming strategy and the face slimming strategy based on the distance. Specifically, a face slimming model associated with the distance can be pre-trained using machine learning. This face slimming model can be stored locally or in the cloud. After obtaining the distance corresponding to the face that needs to be slimmed currently, this distance can be input into the face slimming model to obtain a face slimming strategy based on the distance, such as a face slimming ratio coefficient, so as to perform face slimming on the face based on the preset face slimming strategy and the face slimming strategy based on the distance. Among them, the pre-training of the face slimming model associated with the distance using machine learning can refer to relevant machine learning techniques, which will not be elaborated here.

[0056] It can be understood that after the face slimming model is trained, the face slimming model can be continuously optimized based on the face slimming strategy based on the distance obtained from the current face slimming process, so as to continuously increase the training samples of the face slimming model and improve the accuracy of the face slimming strategy output by the face slimming model.

[0057] Among them, the preset face slimming strategy can be preset or user-defined. The preset face slimming strategy is to control the number of times of face slimming for the recognized face to meet different face slimming requirements and achieve different beautification effects of the photo. The following describes how to perform face slimming on the face based on the preset face slimming strategy and the distance:

[0058] In some embodiments, the face slimming process for the face based on the preset face slimming strategy and the distance may include: performing face slimming processing on all the faces recognized in the image respectively based on the corresponding distances. That is, each face recognized in the image will be subjected to face slimming processing based on its corresponding distance. It can be understood that when multiple faces are recognized, since the distances between the corresponding photographed objects and the image acquisition device during the acquisition of each face are different, it has already caused the problem that the proportions of the faces in the image are different. Then, when performing face slimming processing based on the distance, the degree of face slimming should be inconsistent to try to maintain the coordination of the proportion of the face of the photographed object near the image acquisition device in the image and the proportion of the face of the photographed object far from the image acquisition device in the image. For example, the degree of face slimming can be inversely related to the distance.

[0059] In other embodiments, the face slimming process for the face based on the preset face slimming strategy and the distance may include: obtaining the feature information of the face; if the feature information of the target face in the face meets the preset conditions, then performing face slimming processing on the target face based on the distance. That is, for each face recognized in the image, it is not necessarily subjected to face slimming processing based on its corresponding distance, which specifically depends on the comparison result between the feature information of the target face in the face and the preset conditions.

[0060] Among them, the feature information includes the distance and / or the size proportion of the face in the image. For example, in some embodiments, the distance can be used to determine whether there is a target face that needs face slimming processing; in other embodiments, the size proportion of the face in the image can be used to determine whether there is a target face that needs face slimming processing; in other embodiments, both the distance and the size proportion of the face in the image can be used to determine whether there is a target face that needs face slimming processing. Which specific method to choose can be preset in advance or defined by the user, and no specific limitation is made here.

[0061] The following will separately describe several methods for performing face slimming processing on the target face:

[0062] 1. The step of, if the feature information of the target face in the face meets the preset conditions, then performing face slimming processing on the target face based on the distance may include: if the distance corresponding to the target face in the face is less than the target distance, then performing face slimming processing on the target face based on the distance corresponding to the target face, where the target distance is the average value of the distances between all the faces recognized in the image and the image acquisition device when acquiring the image.

[0063] Specifically, when using distance to determine whether there is a target face that needs face-slimming processing, the preset condition may be that the distance corresponding to the target face is less than the target distance. After obtaining the distance corresponding to the recognized face, the distance can be compared with the target distance. If the distance is less than the target distance, it means that the face corresponding to the distance may have a large face ratio in the image, and the face ratio of other photographed subjects in the image may be quite different and relatively inconsistent. In this case, the face corresponding to the distance is the target face, and the distance will also be used to perform face-slimming processing on the target face. In this way, face-slimming processing can be performed on a targeted basis, rather than performing face-slimming on all recognized faces, which is conducive to reducing the computing resources for face-slimming processing and improving face-slimming efficiency.

[0064] The target distance is the average of the distances between all faces identified in the image and the image acquisition device when the image is acquired. For example, assuming that the faces identified in the image include A, B, and C, and the distances between the corresponding photographed objects and the image acquisition device when A, B, and C are acquired are L1, L2, and L3, then the target distance is the average of the three values of L1, L2, and L3.

[0065] It is understandable that the target distance may be other than the above average value, such as a preset fixed value, or a user-defined value, which is not limited here.

[0066] 2. If the feature information of the target face among the faces meets the preset conditions, then performing face slimming processing on the target face based on the distance, which may include: if the size ratio corresponding to the target face among the faces is greater than the target size ratio, then performing face slimming processing on the target face based on the distance corresponding to the target face, wherein the target size ratio is the average size ratio of all faces recognized in the image in the image.

[0067] Specifically, when using the size ratio of the face in the image to determine whether there is a target face that needs face-slimming processing, the preset condition may be that the size ratio corresponding to the target face is greater than the target size ratio. After obtaining the size ratio of the recognized face in the image, the size ratio can be compared with the target size ratio. If the size ratio is greater than the target ratio, it means that the face corresponding to the size ratio and the face ratio of other photographed subjects in the image may be quite different and relatively uncoordinated. In this case, the face corresponding to the size ratio is the target face, and the distance corresponding to the target face will also be used to perform face-slimming processing on the target face. In this way, face-slimming processing can be performed on a targeted basis, rather than performing face-slimming on all recognized faces, which is beneficial to reducing the computing resources for face-slimming processing and improving face-slimming efficiency.

[0068] Among them, the target size ratio is the average size ratio of all the human faces recognized in the image in the image. For example, assuming that the human faces recognized in the image include A, B, and C, and the size ratios of A, B, and C in the image are F1, F2, and F3 respectively, then the target size ratio is the average value of these three values F1, F2, and F3. This size ratio can be determined by the pixel ratio or area ratio of the human face in the image. The area occupied by the human face in the image can be represented by the area occupied by its contour, or can also be represented by the area occupied by the annotation box. The annotation box can be the smallest box covering the human face, and its shape is not specifically limited.

[0069] It can be understood that the target size ratio can be other values in addition to the above average value. For example, it can be a preset fixed value, or set by the user customarily, and no limitation is made here.

[0070] 3. If the feature information of the target human face in the human face meets the preset conditions, then based on the distance, slimming processing is performed on the target human face that meets the conditions, which may include: if the distance corresponding to the target human face in the human face is less than the target distance, and the size ratio corresponding to the target human face in the human face is greater than the target size ratio, then based on the distance corresponding to the target human face, slimming processing is performed on the target human face, where the target distance is the average value of the distances between all the human faces recognized in the image and the image acquisition device when acquiring the image, and the target size ratio is the average size ratio of all the human faces recognized in the image in the image.

[0071] Specifically, when determining whether there is a target human face that needs slimming processing by using the distance and the size ratio of the human face in the image, the preset condition can be that the distance corresponding to the target human face is less than the target distance, and the size ratio corresponding to the target human face is greater than the target size ratio. Compared with the above two methods, the condition for performing slimming processing in this method is relatively strict, which is beneficial to further optimizing computing resources and avoiding unnecessary slimming processing.

[0072] For its related content, reference can be made to the content corresponding to the above two methods, and details are not repeated here.

[0073] In order to provide users with relatively rich image beautification methods to meet different image beautification needs, multiple slimming modes can be set for users to actively select.

[0074] In some embodiments, the image processing method may further include: obtaining a user instruction; selecting a target slimming mode from multiple slimming modes based on the user instruction. Further, the slimming processing of the human face based on the preset slimming strategy and the distance may include: performing slimming processing on the human face based on the preset slimming strategy, the target slimming mode, and the distance.

[0075] Specifically, the image processing device may be integrated with a user interaction device, which includes physical operation components and may also include virtual operation components, such as touch screens, buttons, sliders, etc. Through this user interaction device, the user can select from multiple face slimming modes, and the generated user instruction may carry the target face slimming mode selected by the user. Of course, the user instruction may also be input through a user interaction device independent of the image processing device, but this user interaction device may be communicatively connected to the image processing device to transmit the user instruction to the image processing device.

[0076] In some embodiments, the multiple face slimming modes may be modes for performing face slimming processing on a target face that meets certain preset conditions as mentioned above. For example, the first face slimming mode may be to perform face slimming on a target face with a corresponding distance less than the target distance, the second face slimming mode may be to perform face slimming on a target face with a corresponding size ratio greater than the target size ratio, and the third face slimming mode may be to perform face slimming on a target face with a corresponding distance less than the target distance and a corresponding size ratio greater than the target size ratio.

[0077] In other embodiments, the multiple face slimming modes may also be modes for whether to attach other beautification effects. For example, the first face slimming mode may be to attach one - click whitening on the basis of face slimming, the second face slimming mode may be to attach one - click filtering on the basis of face slimming, and the third face slimming mode may be to attach makeup effects on the basis of face slimming.

[0078] It can be understood that the face slimming mode can be changed in various forms according to needs, and can be specifically designed diversely according to the user's needs, and no specific limitation is made here.

[0079] Furthermore, after performing face slimming processing on the face based on the preset face slimming strategy and distance, the image obtained after the face slimming processing can be saved locally in the image processing device or uploaded to the cloud. The user can also share it according to needs.

[0080] It should be noted that the images collected by the image acquisition device in the embodiments of the present invention may be not only the images collected in the photo - taking scenario, but also the images collected during video recording, and no specific limitation is made here.

[0081] The image processing method in the embodiments of the present invention has been described above from the perspective of software processing. Next, the image processing device in the embodiments of the present invention will be described from the perspective of hardware processing. Please refer to Figure 2 , the image processing device in the embodiments of the present invention includes:

[0082] A memory 202 for storing computer programs;

[0083] The processor 201, when executing the computer program stored in the memory, is configured to:

[0084] Obtain an image acquired by an image acquisition device;

[0085] Identify a human face in the image, and obtain the distance between the photographed object corresponding to the human face and the image acquisition device when the image is acquired;

[0086] Perform face slimming processing on the human face based on a preset face slimming strategy and the distance.

[0087] Optionally, the processor 201 is specifically configured to: perform face slimming processing on all the identified human faces in the image respectively based on the corresponding distances; or, obtain the feature information of the human face; if the feature information of the target human face in the human faces meets a preset condition, then perform face slimming processing on the target human face based on the distance.

[0088] Optionally, the feature information includes the distance and / or the size proportion of the human face in the image.

[0089] Optionally, the processor 201 is specifically configured to: if the distance corresponding to the target human face in the human faces is less than the target distance, then perform face slimming processing on the target human face based on the distance corresponding to the target human face, where the target distance is the average value of the distances between all the identified human faces in the image and the image acquisition device when the image is acquired.

[0090] Optionally, the processor 201 is specifically configured to: if the size proportion corresponding to the target human face in the human faces is greater than the target size proportion, then perform face slimming processing on the target human face based on the distance corresponding to the target human face, where the target size proportion is the average size proportion of all the identified human faces in the image in the image.

[0091] Optionally, the processor 201 is specifically configured to: if the distance corresponding to the target human face in the human faces is less than the target distance, and the size proportion corresponding to the target human face in the human faces is greater than the target size proportion, then perform face slimming processing on the target human face based on the distance corresponding to the target human face, where the target distance is the average value of the distances between all the identified human faces in the image and the image acquisition device when the image is acquired, and the target size proportion is the average size proportion of all the identified human faces in the image in the image.

[0092] Optionally, the processor 201 is further configured to: obtain a user instruction; select a target face slimming mode from multiple face slimming modes based on the user instruction; and the performing face slimming processing on the human face based on the distance includes: performing face slimming processing on the human face based on the target face slimming mode and the distance.

[0093] Optionally, the processor 201 is specifically configured to: obtain a mapping relationship between a preset distance and a face slimming ratio coefficient, and perform face slimming processing on the face based on a preset face slimming strategy, the mapping relationship, and the distance; or, input the distance into a preset face slimming model to obtain a face slimming strategy based on the distance, and perform face slimming processing on the face based on the preset face slimming strategy and the face slimming strategy based on the distance.

[0094] The image processing apparatus provided by the embodiments of the present invention is used to execute the above image processing method, and the content and effects thereof can be referred to the content and effects of the foregoing method embodiments, and will not be elaborated herein.

[0095] The embodiments of the present invention also provide a computer-readable storage medium. The computer-readable storage medium of the embodiments of the present invention stores a computer program, and the computer program can be executed by a processor to complete the method of any of the above embodiments.

[0096] For example, the computer program can be executed by a processor to complete the control method described in the following steps:

[0097] 01: Obtain an image collected by an image acquisition device;

[0098] 02: Identify a face in the image, and obtain a distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device collects the image;

[0099] 03: Perform face slimming processing on the face based on a preset face slimming strategy and the distance;

[0100] For another example, the computer program can also be executed by a processor to complete the method described in the following steps:

[0101] 031: Perform face slimming processing on all the faces identified in the image respectively based on the corresponding distances; or,

[0102] 032: Obtain feature information of the face;

[0103] If the feature information of the target face in the face meets a preset condition, perform face slimming processing on the target face based on the distance.

[0104] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described system, apparatus, and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0105] In several embodiments provided by this application, it should be understood that the disclosed systems, 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 only a logical function division. In actual implementation, there may be other division methods. 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 displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical, or other forms.

[0106] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0107] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0108] If the above-mentioned 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 present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0109] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of various embodiments of the present invention.

Claims

1. An image processing method, characterized in that, Including: Obtain the image collected by the image acquisition device; Identify multiple faces in the image, and obtain the distance between the photographed objects corresponding to the multiple faces and the image acquisition device when the image is collected; Perform face slimming processing on the multiple faces based on a preset face slimming strategy and the distance; The performing face slimming processing on the multiple faces based on a preset face slimming strategy and the distance includes: Obtain the feature information of the multiple faces; If the feature information of the target face among the multiple faces meets the preset conditions, perform face slimming processing on the target multiple faces based on the distance; The feature information includes the distance and / or the size ratio of the multiple faces in the image; The if the feature information of the target face among the multiple faces meets the preset conditions, perform face slimming processing on the target multiple faces based on the distance includes: If the distance corresponding to the target face among the multiple faces is less than the target distance, perform face slimming processing on the target multiple faces based on the distance corresponding to the target multiple faces, where the target distance is the average value of the distances between all the multiple faces recognized in the image and the image acquisition device when the image is collected; and / or, The if the feature information of the target face among the multiple faces meets the preset conditions, perform face slimming processing on the target multiple faces based on the distance includes: If the size ratio corresponding to the target face among the multiple faces is greater than the target size ratio, perform face slimming processing on the target face based on the distance corresponding to the target multiple faces, where the target size ratio is the average size ratio of all the multiple faces recognized in the image in the image.

2. The method according to claim 1, wherein The method further includes: Obtain a user instruction; Select a target face slimming mode from multiple face slimming modes based on the user instruction; The performing face slimming processing on the multiple faces based on a preset face slimming strategy and the distance includes: Perform face slimming processing on the multiple faces based on a preset face slimming strategy, the target face slimming mode, and the distance.

3. The method according to claim 1, wherein The performing face slimming processing on the multiple faces based on a preset face slimming strategy and the distance includes: Obtain the mapping relationship between the preset distance and the face slimming ratio coefficient, and perform face slimming processing on the multiple faces based on a preset face slimming strategy, the mapping relationship, and the distance; or, Input the distance into a preset face slimming model to obtain a face slimming strategy based on the distance, and perform face slimming processing on the multiple faces based on a preset face slimming strategy and the face slimming strategy based on the distance.

4. An image processing apparatus, characterized in that, Including: A memory for storing a computer program; A processor for implementing the steps of the method according to any one of claims 1 to 3 when executing the computer program stored in the memory.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when executed by the processor, implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Image processing method and apparatus, electronic device and computer readable storage medium

    CN107680128A

  • Image processing method and electronic equipment

    CN111327814A