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

By obtaining the side face angle information of the side face image and using the front face image to determine the target side face proportion information, adjusting the side face image, the problem of difficulty in repairing the side face image in the prior art is solved, and high-quality side face image adjustment and visual effect improvement are achieved.

CN119741742APending Publication Date: 2025-04-01TCL COMMUNICATION TECHNOLOGY (NINGBO) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411707404.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art is difficult to effectively repair side face images, especially while ensuring visual effects, the function of one-click photo editing cannot be realized.

Method used

By obtaining the side face angle information of the side face image, and using the corresponding front face image to determine the target side face proportion information, adjusting the side face image to obtain a satisfactory target image.

Benefits of technology

It realizes convenient adjustment of side face images, optimizes facial presentation in side face situations, and improves visual effects and user satisfaction during side faces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741742A_ABST
    Figure CN119741742A_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image processing method, device, electronic device and computer-readable storage medium, the method comprising: obtaining a side face image to be processed, determining the side face angle information corresponding to the side face image; obtaining a front face image corresponding to the side face image, and determining the target side face ratio information corresponding to the side face angle information according to the front face image; adjusting the side face image according to the target side face ratio information to obtain a target image. By determining the target side face ratio information suitable for the side face angle information corresponding to the side face image according to the front face image corresponding to the side face image when recognizing the existence of the side face image, and adjusting the side face image based on the target side face ratio information to obtain the target image, the adjustment of the facial image in the side face condition is achieved, the facial presentation in the side face condition is optimized, and the visual effect in the side face condition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and specifically to an image processing method, device, electronic device, and computer-readable storage medium. Background Art

[0002] There are many scenarios for image processing, for example, retouching an image after it is captured to obtain an image that satisfies the user and has good visual effects.

[0003] However, manual photo editing is time-consuming and laborious, and it tests the user's proficiency in photo editing. Therefore, it is not easy to get a satisfactory image after photo editing. At present, there are also tools that can perform one-click photo editing according to the golden ratio, but this type of photo editing is mainly for frontal face images, and cannot achieve the repair of side face images, or it is difficult to guarantee the effect of side face images after repair. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, device, electronic device and computer-readable storage medium, which can conveniently adjust the side face image, obtain an image with better side face effect, and improve the user experience.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:

[0006] Acquire a side face image to be processed, and determine side face angle information corresponding to the side face image;

[0007] Acquire a frontal face image corresponding to the side face image, and determine target side face ratio information corresponding to the side face angle information according to the frontal face image;

[0008] The side face image is adjusted according to the target side face ratio information to obtain a target image.

[0009] In a second aspect, an embodiment of the present application further provides an image processing device, the device comprising:

[0010] A response module, used for acquiring a side face image to be processed and determining side face angle information corresponding to the side face image;

[0011] A determination module, used to obtain a frontal face image corresponding to the side face image, and determine target side face ratio information corresponding to the side face angle information according to the frontal face image;

[0012] The adjustment module is used to adjust the side face image according to the target side face ratio information to obtain a target image.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and which implements the steps in the above-mentioned image processing method when the computer program is executed by the processor.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned image processing method are implemented.

[0015] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.

[0016] The embodiment of the present application obtains a side face image to be processed, determines the side face angle information corresponding to the side face image, obtains a front face image corresponding to the side face image, and determines the target side face ratio information corresponding to the side face angle information based on the front face image, adjusts the side face image based on the target side face ratio information, and obtains a target image that matches the side face angle information.

[0017] Among them, the embodiment of the present application determines the target side face ratio information suitable for the side face angle information corresponding to the side face image according to the front face image corresponding to the side face image when the existence of the side face image is identified, and adjusts the side face image based on the target side face ratio information to obtain the target image, thereby adjusting the facial image in the side face condition, optimizing the facial presentation in the side face condition, and improving the visual effect in the side face condition.

[0018] Among them, the target side face proportion information corresponding to the current side face angle is determined through the frontal face image, which improves the effectiveness of the target side face proportion information and the degree of matching with user expectations, thereby improving the visual presentation effect of the target user's side face at the side face angle and improving the user satisfaction corresponding to the target image. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1is a schematic diagram of a scenario in which an electronic device according to an embodiment of the present application performs the image processing method;

[0021] Figure 2 is a flowchart of an image processing method provided in an embodiment of the present application;

[0022] Figure 3 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0023] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0025] The embodiments of the present application provide an image processing method, device, electronic device and computer-readable storage medium. Specifically, the embodiments of the present application provide an image processing device suitable for electronic devices, which is used to perform facial optimization processing on photographed side face images to obtain side face images with higher satisfaction. The electronic device includes a terminal device or a server, and the terminal device includes but is not limited to mobile phones, tablet computers, laptops, cameras, televisions and other devices with image processing capabilities. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, etc. The server can be directly or indirectly connected via wired or wireless communication.

[0026] See also Figure 1 , Figure 1 : is a schematic diagram of a scenario in which an electronic device according to an embodiment of the present application performs the image processing method, wherein the specific execution process of the electronic device performing the image processing method is as follows:

[0027] The electronic device 10 obtains a side face image to be processed, determines a side face angle corresponding to the side face image, obtains a front face image corresponding to the side face image, determines a target side face ratio corresponding to the side face angle based on the front face image, and adjusts the side face image based on the target side face ratio to obtain a target image that meets the target side face ratio requirement at the side face angle.

[0028] Among them, the side face image can be obtained by taking pictures through a shooting device with a shooting function such as a camera or a mobile phone. For example, after the shooting device takes the side face image, the side face image is processed as mentioned above through the captured image to obtain the target image, or the side face image is processed as mentioned above through other processing devices to obtain the target image.

[0029] In summary, the embodiments of the present application determine, when a side face image is identified, target side face ratio information suitable for the side face angle information corresponding to the side face image based on the front face image corresponding to the side face image, and adjust the side face image based on the target side face ratio information to obtain the target image, thereby adjusting the facial image in the side face state, optimizing the facial presentation in the side face state, and improving the visual effect in the side face state.

[0030] Among them, the target side face proportion information corresponding to the current side face angle is determined through the frontal face image, which improves the effectiveness of the target side face proportion information and the degree of matching with user expectations, thereby improving the visual presentation effect of the target user's side face at the side face angle and improving the user satisfaction corresponding to the target image.

[0031] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.

[0032] See also Figure 2 , Figure 2 A flowchart of an image processing method provided in an embodiment of the present application. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings. Specifically, the process of the image processing method specifically includes:

[0033] 101. Obtain a side face image to be processed, and determine side face angle information corresponding to the side face image.

[0034] Among them, the side face image is an image obtained when the face is not facing the shooting device directly. For example, the user chooses to face the side face of the shooting device directly to obtain the side face image in order to match the shooting scene.

[0035] Among them, in the embodiment of the present application, the side face image refers to an image with a side face angle greater than a preset angle, and the preset angle can be customized. For example, the preset angle is set to 0, then all images obtained by non-frontal shooting are side face images, or the preset angle can be set to 30 degrees, then the image with a side face angle greater than 30 degrees is determined to be a side face image.

[0036] Wherein, whether the face is in profile can be analyzed by computer vision and image processing technology, for example, by analyzing the direction of eye gaze, by analyzing the relative positions of facial key points, etc. For example, the step of "obtaining a profile image to be processed, and determining the profile angle information corresponding to the profile image" includes:

[0037] Acquire a side face image to be processed, and extract side face key point information of the side face image;

[0038] The side face angle information corresponding to the side face image is determined according to the relative position information of at least one side face key point information.

[0039] Among them, the profile key point information is the key point information of the face when in profile, mainly the position information of the key points, wherein the key points mainly include eyes, nose, ears, mouth and cheekbones.

[0040] Among them, the side face angle of the face can be analyzed by analyzing the relative positions of multiple side face key point information. For example, the side face angle information can be calculated by analyzing the relative positions of multiple key points of the eyes. For example, the side face key point information obtained by image recognition is: [x1, y1], [x2, y2]..., and the key point information of the four upper and lower points of the eyes is obtained by screening, and [0,0], [0,1], [1,0], [1,1] are obtained, which are: the key point above the left eye, the key point above the right eye, the key point below the left eye and the key point below the right eye. Then, the function of calculating the inverse tangent (such as np.arctan2) can be used to calculate the eye angle, and the eye angle is used as the side face angle.

[0041] 102. Acquire a frontal face image corresponding to the side face image, and determine target side face ratio information corresponding to the side face angle information according to the frontal face image.

[0042] The front face image is an image of the front face corresponding to the side face image. For example, after the side face image of the target user is captured, the front face image is an image of the front face of the target user.

[0043] Among them, the frontal face image basically contains the global feature information of the front face of the target user, such as the height of the nose bridge, the size of the mouth, the angle of the mouth and the distance between the eyes, etc. Determining the target side face proportion information that matches the side face angle through the frontal face image helps to improve the effectiveness of the target side face proportion information and the degree of matching with the user's expectations.

[0044] The target side face ratio information refers to the ratio relationship between different facial features in the side face image, such as the ratio of the length of the nose bridge to the length of the face, the ratio of the distance between the eyes to the length of the nose bridge, the ratio of the position of the eyes to the length of the face, the ratio of the position of the ears to the length of the face, the ratio of the width of the mouth to the width of the nose bridge, the width of the mouth is usually smaller than the width of the nose bridge, etc. In the embodiment of the present application, the target side face ratio information is also called face shape information, that is, information that characterizes the ratio between facial features.

[0045] It should be noted that the target side face ratio information is the optimal ratio of the side face of the target user at the side face angle corresponding to the side face angle information, that is, the ratio with better visual presentation effect and more in line with the user's aesthetic taste. For example, the target side face ratio information is the side face ratio information of the user's face at the side face angle that is basically recognized by the general public and conforms to the general public's aesthetic taste. In addition, the target user's aesthetic tendencies, habits and other data can also be collected to match the target side face ratio information at the side face angle that conforms to the target user's aesthetic tendencies and habits.

[0046] 103. Adjust the side face image according to the target side face ratio information to obtain a target image.

[0047] It is understandable that the side face image is adjusted based on the target side face ratio information so that the visual effect of the adjusted target image is better, more in line with the user's expectations, and the user experience is improved.

[0048] In summary, the embodiments of the present application determine, when a side face image is identified, target side face ratio information suitable for the side face angle information corresponding to the side face image based on the front face image corresponding to the side face image, and adjust the side face image based on the target side face ratio information to obtain the target image, thereby adjusting the facial image in the side face state, optimizing the facial presentation in the side face state, and improving the visual effect in the side face state.

[0049] Among them, the target side face proportion information corresponding to the current side face angle is determined through the frontal face image, which improves the effectiveness of the target side face proportion information and the degree of matching with user expectations, thereby improving the visual presentation effect of the target user's side face at the side face angle and improving the user satisfaction corresponding to the target image.

[0050] Optionally, in an embodiment of the present application, the target side face ratio information can be determined by outputting a facial analysis model, that is, optionally, in some embodiments of the present application, the step of “determining the target side face ratio information corresponding to the side face angle information according to the frontal face image” includes:

[0051] The front face image and the side face angle information are input into a facial analysis model to obtain target side face ratio information of the front face image when the side face angle corresponds to the side face angle information.

[0052] Among them, the facial analysis model includes a machine learning model, and the facial analysis model can be obtained by training multiple sample data. For example, at least one group of sample data is obtained, each group of the sample data includes a sample frontal face image and sample side face ratio information corresponding to at least one side face angle information of the sample frontal face image and the facial presentation effect meets preset conditions; the original facial recognition model is trained according to the sample frontal face image, side face angle information and sample side face ratio information of each group of the sample data to obtain a facial analysis model.

[0053] Among them, the facial analysis model includes but is not limited to convolutional neural networks CNN (such as VGGFace, FaceNet and DeepFace, etc.), key point-based models (such as Dlib and MTCNN (Multi-task Cascaded ConvolutionalNetworks)), generative adversarial networks GANA (such as CycleGAN and StyleGAN, etc.), etc.

[0054] Optionally, in an embodiment of the present application, the face type information of the frontal face image may be analyzed, and the target side face ratio information at the side face angle may be determined based on the face type information. That is, optionally, in some embodiments of the present application, the step of “determining the target side face ratio information corresponding to the side face angle information according to the frontal face image” includes:

[0055] Identify face type information corresponding to the frontal face image;

[0056] Acquire a mapping relationship set according to the face type information, the mapping relationship set including side face proportion information of the face type information at different side face angles and a face presentation effect that meets a preset condition;

[0057] The target side face proportion information of the side face angle information is matched with the face type information from the mapping relationship set.

[0058] Among them, the face type information includes type information of roughly classified faces, such as whether the face is square, oval or round. Different from the face shape information, the face shape information focuses on the specific proportions of the face. Different face proportions correspond to different face shape information.

[0059] Among them, since the processing methods of faces of the same type at different side face angles are similar, for example, the side faces of faces of melon-seed type faces mostly need to be stretched to a certain extent, while the side faces of round faces mostly need to be shrunk to a certain extent, such as for face-slimming effects, faces of the same type have certain similarities in processing. Therefore, in the embodiment of the present application, the calculation process of the target side face ratio information is simplified, and faces of the same type and side face angle but with certain differences in facial proportions are all treated with the same set of target side face ratio information, thereby obtaining the side face ratio information of the same type of face type information at different side face angles, and obtaining the side face ratio information of different types of face type information at different side face angles.

[0060] Accordingly, by identifying the face type information of the human face in the frontal face image, the target side face proportion information is determined from the mapping relationship set according to the face type information, thereby improving the efficiency of determining the target side face proportion information.

[0061] Optionally, in an embodiment of the present application, the frontal face image corresponding to the side face image may be selected from a preset image list, or may be generated by an image generation model, that is, optionally, in some embodiments of the present application, the step of “obtaining the frontal face image corresponding to the side face image” includes:

[0062] Identify the side face image, and select a front face image corresponding to the side face image from a preset image list; and / or,

[0063] The side face image is input into a facial generation model, so that the facial generation model can predict a frontal face image corresponding to the side face image according to the side face feature information of the side face image.

[0064] The preset image list is a list of pre-set stored images, such as an album. For example, by comparing facial feature points, a frontal face image matching the side face image is selected from the album, that is, a frontal face image for the same target user is selected.

[0065] Among them, the face generation model is a picture-generated model, that is, by identifying and analyzing the features of the side face image, a complete frontal face image is generated. Optionally, in the embodiment of the present application, a frontal face model corresponding to the side face can also be generated by three-dimensional reconstruction, and then a frontal face image is obtained. For example, based on the principle of left-right symmetry of the face, the facial features recognized by the current side face are used to reconstruct the facial information of the other side to obtain a frontal face model, and then the frontal face image is captured.

[0066] Optionally, in an embodiment of the present application, adjusting the side face image according to the target side face ratio information includes adjusting the positions of key points in the side face, that is, optionally, in some embodiments of the present application, the step of “adjusting the side face image according to the target side face ratio information to obtain the target image” includes:

[0067] Identifying key point information of the side face contained in the side face image;

[0068] The position of the side face key point information is adjusted according to the target side face ratio information to obtain a target image.

[0069] Among them, the position adjustment can be achieved by establishing a transformation matrix based on the key point information of the side face, moving the position of the key point based on the transformation matrix, and then generating the target image through image resampling and detail processing. Among them, the transformation matrix includes but is not limited to operations such as rotation, scaling, translation and affine transformation. Image resampling can be performed based on the transformation matrix. For example, the original pixel mapping of the side face image is realized based on the transformation matrix to obtain the target image. After the pixel mapping process, the detail processing includes smoothing processing of texture, light and shadow, such as filtering processing of the image or pixel, so as to make the target image more natural.

[0070] In summary, the embodiments of the present application determine, when a side face image is identified, target side face ratio information suitable for the side face angle information corresponding to the side face image based on the front face image corresponding to the side face image, and adjust the side face image based on the target side face ratio information to obtain the target image, thereby adjusting the facial image in the side face state, optimizing the facial presentation in the side face state, and improving the visual effect in the side face state.

[0071] Among them, the target side face proportion information corresponding to the current side face angle is determined through the frontal face image, which improves the effectiveness of the target side face proportion information and the degree of matching with user expectations, thereby improving the visual presentation effect of the target user's side face at the side face angle and improving the user satisfaction corresponding to the target image.

[0072] Among them, through the image processing method of the embodiment of the present application, the user no longer has to worry about the "dead" angle of shooting, and can shoot at any angle, and then process it through the image processing method of the embodiment of the present application to obtain a target image with a better side face ratio.

[0073] Especially for large angles, such as wide-angle shooting scenes, due to the wide-angle distortion existing in wide-angle shooting, the traditional solution can only optimize the distortion problem through the wide-angle distortion model, but it is difficult to correct the face shape. The solution of the embodiment of the present application, after obtaining the side face image with wide-angle distortion, analyzes the front face image of the side face image and determines the target side face ratio information, and corrects the side face image based on the target side face ratio information to obtain the target image that meets the user's expectations, so that the entire processing process is basically no longer affected by the problem of wide-angle distortion, and can directly optimize to obtain the target image that meets the needs, thereby improving the user experience.

[0074] In order to better implement the image processing method of the present application, the present application also provides an image processing device based on the above image processing method. The meanings of the terms are the same as those in the above image processing method, and the specific implementation details can refer to the description in the method embodiment.

[0075] See also Figure 3 , Figure 3 : is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application, wherein the image processing device may be specifically as follows:

[0076] A response module 201 is used to obtain a side face image to be processed and determine side face angle information corresponding to the side face image;

[0077] A determination module 202 is used to obtain a frontal face image corresponding to the side face image, and determine target side face ratio information corresponding to the side face angle information according to the frontal face image;

[0078] The adjustment module 203 is used to adjust the side face image according to the target side face ratio information to obtain a target image.

[0079] Optionally, in some embodiments of the present application, determining the target side face ratio information corresponding to the side face angle information according to the frontal face image includes:

[0080] The front face image and the side face angle information are input into a facial analysis model to obtain target side face ratio information of the front face image when the side face angle corresponds to the side face angle information.

[0081] Optionally, in some embodiments of the present application, before inputting the frontal face image and the side face angle information into a facial analysis model to obtain target side face ratio information of the frontal face image at a side face angle corresponding to the side face angle information, the method further includes:

[0082] Acquire at least one set of sample data, each set of the sample data comprising a sample front face image and sample side face ratio information corresponding to at least one side face angle information of the sample front face image and having a face presentation effect that meets a preset condition;

[0083] The original face recognition model is trained according to the sample frontal face images, side face angle information and sample side face ratio information of each group of sample data to obtain a face analysis model.

[0084] Optionally, in some embodiments of the present application, determining the target side face ratio information corresponding to the side face angle information according to the frontal face image includes:

[0085] Identify face type information corresponding to the frontal face image;

[0086] Acquire a mapping relationship set according to the face type information, the mapping relationship set including side face proportion information of the face type information at different side face angles and a face presentation effect that meets a preset condition;

[0087] The target side face proportion information of the side face angle information is matched with the face type information from the mapping relationship set.

[0088] Optionally, in some embodiments of the present application, the step of obtaining a frontal face image corresponding to the side face image includes:

[0089] Identify the side face image, and select a front face image corresponding to the side face image from a preset image list; and / or,

[0090] The side face image is input into a facial generation model, so that the facial generation model can predict a frontal face image corresponding to the side face image according to the side face feature information of the side face image.

[0091] Optionally, in some embodiments of the present application, adjusting the side face image according to the target side face ratio information to obtain the target image includes:

[0092] Identifying key point information of the side face contained in the side face image;

[0093] The position of the side face key point information is adjusted according to the target side face ratio information to obtain a target image.

[0094] Optionally, in some embodiments of the present application, the acquiring the side face image to be processed and determining the side face angle information corresponding to the side face image includes:

[0095] Acquire a side face image to be processed, and extract side face key point information of the side face image;

[0096] The side face angle information corresponding to the side face image is determined according to the relative position information of at least one side face key point information.

[0097] In the embodiment of the present application, the response module 201 obtains the side face image to be processed, determines the side face angle information corresponding to the side face image, and the determination module 202 is used to obtain the front face image corresponding to the side face image, and determines the target side face ratio information corresponding to the side face angle information based on the front face image, and the adjustment module 203 adjusts the side face image according to the target side face ratio information to obtain the target image.

[0098] Among them, the embodiment of the present application determines the target side face ratio information suitable for the side face angle information corresponding to the side face image according to the front face image corresponding to the side face image when the existence of the side face image is identified, and adjusts the side face image based on the target side face ratio information to obtain the target image, thereby adjusting the facial image in the side face condition, optimizing the facial presentation in the side face condition, and improving the visual effect in the side face condition.

[0099] Among them, the target side face proportion information corresponding to the current side face angle is determined through the frontal face image, which improves the effectiveness of the target side face proportion information and the degree of matching with user expectations, thereby improving the visual presentation effect of the target user's side face at the side face angle and improving the user satisfaction corresponding to the target image.

[0100] In addition, the present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0101] The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0102] The processor 301 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 301.

[0103] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0104] The electronic device also includes a power supply 303 for supplying power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 303 can also include any components such as one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, and power status indicators.

[0105] The electronic device may further include an input unit 304, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0106] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302, thereby implementing the steps in any one of the image processing methods provided in the embodiments of the present application.

[0107] The embodiment of the present application obtains a side face image to be processed, determines the side face angle information corresponding to the side face image, obtains a front face image corresponding to the side face image, and determines the target side face ratio information corresponding to the side face angle information based on the front face image, adjusts the side face image based on the target side face ratio information, and obtains a target image that matches the side face angle information.

[0108] Among them, the embodiment of the present application determines the target side face ratio information suitable for the side face angle information corresponding to the side face image according to the front face image corresponding to the side face image when the existence of the side face image is identified, and adjusts the side face image based on the target side face ratio information to obtain the target image, thereby adjusting the facial image in the side face condition, optimizing the facial presentation in the side face condition, and improving the visual effect in the side face condition.

[0109] Among them, the target side face proportion information corresponding to the current side face angle is determined through the frontal face image, which improves the effectiveness of the target side face proportion information and the degree of matching with user expectations, thereby improving the visual presentation effect of the target user's side face at the side face angle and improving the user satisfaction corresponding to the target image.

[0110] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0111] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0112] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any image processing method provided in the present application.

[0113] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0114] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0115] Since the instructions stored in the computer-readable storage medium can execute the steps in any image processing method provided in the present application, the beneficial effects that can be achieved by any image processing method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0116] The above is a detailed introduction to an image processing method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire a side face image to be processed, and determine side face angle information corresponding to the side face image; Acquire a frontal face image corresponding to the side face image, and determine target side face ratio information corresponding to the side face angle information according to the frontal face image; The side face image is adjusted according to the target side face ratio information to obtain a target image.

2. The image processing method according to claim 1, characterized in that: The step of determining target side face ratio information corresponding to the side face angle information according to the front face image includes: The frontal face image and the side face angle information are input into a facial analysis model to obtain target side face ratio information of the frontal face image at a side face angle corresponding to the side face angle information.

3. The image processing method according to claim 2, characterized in that: Before inputting the frontal face image and the side face angle information into a facial analysis model to obtain target side face ratio information of the frontal face image at a side face angle corresponding to the side face angle information, the method further comprises: Acquire at least one set of sample data, each set of the sample data comprising a sample front face image and sample side face ratio information corresponding to at least one side face angle information of the sample front face image and having a face presentation effect that meets a preset condition; The original face recognition model is trained according to the sample frontal face images, side face angle information and sample side face ratio information of each group of sample data to obtain a face analysis model.

4. The image processing method according to claim 1, characterized in that: The step of determining target side face ratio information corresponding to the side face angle information according to the front face image includes: Identify face type information corresponding to the frontal face image; Acquire a mapping relationship set according to the face type information, the mapping relationship set including side face proportion information of the face type information at different side face angles and a face presentation effect that meets a preset condition; The target side face proportion information of the side face angle information is matched with the face type information from the mapping relationship set.

5. The image processing method according to claim 1, characterized in that: The obtaining of the frontal face image corresponding to the side face image comprises: Identify the side face image, and select a front face image corresponding to the side face image from a preset image list; and / or, The side face image is input into a facial generation model, so that the facial generation model can predict a frontal face image corresponding to the side face image according to the side face feature information of the side face image.

6. The image processing method according to claim 1, characterized in that: The step of adjusting the side face image according to the target side face ratio information to obtain a target image includes: Identifying key point information of the side face contained in the side face image; The position of the side face key point information is adjusted according to the target side face ratio information to obtain a target image.

7. The image processing method according to claim 1, characterized in that: The step of obtaining a side face image to be processed and determining side face angle information corresponding to the side face image includes: Acquire a side face image to be processed, and extract side face key point information of the side face image; The side face angle information corresponding to the side face image is determined according to the relative position information of at least one side face key point information.

8. An image processing device, characterized in that: The device comprises: A response module, used for acquiring a side face image to be processed and determining side face angle information corresponding to the side face image; A determination module, used to obtain a frontal face image corresponding to the side face image, and determine target side face ratio information corresponding to the side face angle information according to the frontal face image; The adjustment module is used to adjust the side face image according to the target side face ratio information to obtain a target image.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image processing method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the image processing method according to any one of claims 1 to 7 are implemented.