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

By obtaining facial key point information and dividing local areas, and adjusting the pixel position according to the pixel movement strategy parameters, the problem of unnatural visual effects caused by existing beauty and face-slimming technology is solved, and a more natural face-slimming effect is achieved.

CN113591562BActive Publication Date: 2024-09-24BEIJING KUANGSHI TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110701338.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-23
Publication Date
2024-09-24
Estimated Expiration
2041-06-23

AI Technical Summary

Technical Problem

Existing beautification and face-slimming technology results in unnatural visual effects on the human face, and even distortion of the human face, which cannot meet the needs of users.

Method used

By obtaining the face key point information of the image to be processed, the moving reference point is determined, and the face area is divided into multiple local areas. According to the pixel moving strategy parameters of each local area, the pixel points in the local area are moved towards the moving reference point. Move the point direction to achieve a natural face slimming effect.

Benefits of technology

The visual effect of the image after face-slimming processing is improved, making the final face-slimming effect more natural and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113591562B
    Figure CN113591562B
Patent Text Reader

Abstract

The present invention relates to an image processing method, device, electronic device and computer-readable storage medium, and belongs to the field of image processing. When it is necessary to perform face-thinning processing on an image to be processed, the face key point information of the image to be processed is first obtained, and then according to the face key point information, a moving reference point when moving the pixel points in the face area is determined and the face area is divided into different local areas, so that when performing face-thinning processing, the pixel points included in each local area are moved in the direction of the moving reference point according to the pixel moving strategy parameters corresponding to the local area to which they belong, so that the final face-thinning effect can be as natural as possible, thereby improving the visual effect presented after face-thinning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of the pan-entertainment trend, beauty and face-slimming technology will be involved in application scenarios such as video conferencing, live streaming, taking pictures, and photo processing.

[0003] The existing beautification and face-thinning technologies generally require the staff to pre-set a facial contour template, and then move the facial contour included in the acquired image to be processed by a fixed distance according to the fixed parameters provided by the facial contour template. Although this operation can make the image appear to have a face-thinning effect, the effect is to optimize the facial curve of the image to be processed into a uniform cone face shape, which makes the face appear unnatural visually, and even causes the face to be distorted. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide an image processing method, device, electronic device and computer-readable storage medium, which can improve the visual effect of the image to be processed obtained after face-slimming processing.

[0005] The embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising: obtaining facial key point information of an image to be processed, the image to be processed comprising a face area; determining, based on the facial key point information, a moving reference point when moving pixels in the face area; dividing the face area into a plurality of local areas based on the facial key point information; for each of the local areas, moving each pixel in the local area toward the direction of the moving reference point based on a pixel movement strategy parameter corresponding to the local area.

[0007] In combination with the embodiment of the first aspect, in a possible implementation, the pixel movement strategy parameters include a pixel position adjustment ratio; accordingly, based on the pixel movement strategy parameters corresponding to the local area, each pixel point in the local area is moved toward the direction of the moving reference point, including: for each pixel point in the local area, determining a first distance between the pixel point and the moving reference point; based on the first distance and the corresponding pixel position adjustment ratio, determining a second distance between the pixel point and the moving reference point; moving the pixel point toward the direction of the moving reference point so that the distance between the pixel point and the moving reference point after the movement is equal to the second distance.

[0008] In combination with the embodiment of the first aspect, in a possible implementation manner, determining the second distance between the pixel point and the moving reference point based on the first distance and the corresponding pixel position adjustment ratio includes: determining a first product value of the first distance and the pixel position adjustment ratio corresponding to the local area to which the pixel point belongs; and determining the first product value as the second distance.

[0009] In combination with the embodiment of the first aspect, in a possible implementation, after moving each pixel point in the local area toward the direction of the moving reference point based on the pixel movement strategy parameters corresponding to the local area, the method also includes: in response to a face adjustment instruction triggered by a user, obtaining the position information of each pixel point in the face area before and after the movement; wherein the face adjustment instruction carries a face thinning intensity coefficient; based on the face thinning intensity coefficient, the position information before and after the movement, determining the target position information corresponding to each pixel point in the face area that has been moved; and moving each pixel point in the face area that has been moved to the target position information.

[0010] In combination with the first aspect embodiment, in a possible implementation manner, the position information is represented by coordinate information; the target position information corresponding to each pixel point in the face area that has been moved is determined based on the face-slimming intensity coefficient, the position information before the movement, and the position information after the movement, including: for each pixel point in the face area that has been moved, determining a first coordinate difference between second coordinate information and first coordinate information; wherein the position information before the movement is represented by the first coordinate information, and the position information after the movement is represented by the second coordinate information; calculating a second product value between the face-slimming intensity coefficient and the first coordinate difference; and determining the sum of the first coordinate information and the second product value as the target position information.

[0011] In combination with the first aspect embodiment, in a possible implementation manner, determining the moving reference point when moving the pixel points in the face area according to the face key point information includes: determining the face key point corresponding to the center position of both eyes in the face area; determining the face key point corresponding to the center position of both eyes as the moving reference point;

[0012] Alternatively, a facial key point corresponding to the position of the nose tip in the face region is determined, and the facial key point corresponding to the position of the nose tip is determined as the moving reference point.

[0013] In combination with the embodiment of the first aspect, in a possible implementation manner, determining the moving reference point when moving the pixel points in the face area based on the facial key point information includes: determining a reference line based on the facial key points located on the center line in the vertical direction of the face area; for each pixel point in the face area, determining the facial key point on the reference line with the smallest distance from the pixel point as the moving reference point corresponding to the pixel point; accordingly, moving each pixel point in the local area toward the direction of the moving reference point includes: moving each pixel point in the local area toward the direction of the moving reference point corresponding to it.

[0014] In combination with the embodiment of the first aspect, in a possible implementation manner, the facial key point information includes identification information of the facial key points, and the facial area is divided into multiple local areas based on the facial key point information, including: determining a set of facial key points corresponding to each facial organ based on the correspondence between the acquired identification information of the facial key points and the facial organs; and determining the area enclosed by each facial key point in each set of facial key points as a local area.

[0015] In combination with the embodiment of the first aspect, in a possible implementation manner, different local areas correspond to different pixel position adjustment ratios.

[0016] In combination with the embodiment of the first aspect, in a possible implementation manner, obtaining facial key point information of the image to be processed includes: inputting the image to be processed into a facial key point detection model, performing facial key point detection on the image to be processed through the facial key point detection model; and obtaining the facial key point information output by the facial key point detection model.

[0017] In combination with the embodiment of the first aspect, in a possible implementation manner, the facial key point information includes coordinate information of a face positioning frame and coordinate information of the facial key points; before determining a moving reference point when moving pixels in the face area according to the facial key point information, the method further includes:

[0018] The coordinate information of the key points of the face is normalized based on the coordinate information of the face positioning frame to obtain the normalized coordinate information of the key points of the face.

[0019] In a second aspect, an embodiment of the present application provides an image processing device, which includes: an acquisition module, a determination module, a division module and an adjustment module.

[0020] An acquisition module is used to acquire facial key point information of an image to be processed, wherein the image to be processed includes a facial region; a determination module is used to determine a moving reference point when moving pixels in the facial region based on the facial key point information; a division module is used to divide the facial region into multiple local regions based on the facial key point information; and an adjustment module is used to move each pixel in the local region toward the moving reference point based on a pixel movement strategy parameter corresponding to the local region for each local region.

[0021] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are connected; the memory is used to store programs; the processor calls the program stored in the memory to execute the method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment.

[0022] In a fourth aspect, an embodiment of the present application further provides a non-volatile computer-readable storage medium (hereinafter referred to as computer-readable storage medium), on which a computer program is stored. When the computer program is run by a computer, it executes the method provided by the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment.

[0023] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by implementing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work. As shown in the drawings, the above and other purposes, features and advantages of the present application will be clearer. The same reference numerals indicate the same parts in all the drawings. The drawings are not deliberately scaled to the actual size, and the focus is on showing the main purpose of the present application.

[0025] Figure 1 A flowchart of an image processing method provided in an embodiment of the present application is shown.

[0026] Figure 2 A structural block diagram of an image processing device provided in an embodiment of the present application is shown.

[0027] Figure 3A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0028] Reference numerals: 100 - electronic device; 110 - processor; 120 - memory; 130 - display screen; 400 - image processing device; 410 - acquisition module; 420 - determination module; 430 - division module; 440 - adjustment module. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0030] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in the subsequent figures. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the statement "comprise one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0031] Furthermore, the term "and / or" in this application is merely a term used to describe the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0032] In recent years, research on computer vision, deep learning, machine learning, image processing, image recognition and other technologies based on artificial intelligence has made important progress. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline involving many types of technologies such as chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, neural networks, etc. Computer vision, as an important branch of artificial intelligence, specifically allows machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning and other technologies. With the research and advancement of artificial intelligence technology, this technology has been applied in many fields, such as security, urban management, traffic management, building management, park management, facial access, facial attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone imaging, cloud services, smart homes, wearable devices, unmanned driving, automatic driving, smart medical care, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile Internet, live streaming, beauty, makeup, medical beauty, and smart temperature measurement.

[0033] With the development of pan-entertainment, the demand for beauty and face slimming is increasing in various fields. However, the current face slimming technology has the problem of face movement distortion and cannot meet the needs of users.

[0034] In order to solve the above problems, the embodiments of the present application provide an image processing method, device, electronic device and computer-readable storage medium, which can improve the visual effect of the image to be processed after the face-slimming process. In addition, the defects of the face-slimming technology in the prior art (presenting unnatural visual effects and even causing the face to be distorted) are the results obtained by the applicant after practice and careful research. Therefore, the discovery process of the above defects and the solutions proposed by the embodiments of the present application for the above defects below should be recognized as the applicant's contribution to this application.

[0035] The technology can be implemented by using corresponding software, hardware or a combination of software and hardware. The following is a detailed introduction to the embodiments of the present application.

[0036] First, the embodiment of the present application provides an image processing method for performing face thinning processing on an image to be processed including a face area. Figure 1 , the method may include the following steps:

[0037] Step S110: Acquire facial key point information of an image to be processed, where the image to be processed includes a face area.

[0038] Step S120: determining a moving reference point when moving the pixel points in the face area according to the face key point information;

[0039] Step S130: dividing the face region into a plurality of local regions according to the face key point information;

[0040] Step S140: for each of the local areas, based on the pixel movement strategy parameters corresponding to the local area, move each pixel point in the local area toward the direction of the movement reference point.

[0041] In an embodiment of the present application, all images to be processed are no longer adjusted according to the fixed distance specified by the facial contour template. Instead, the face area is first divided into different local areas, and different local areas have corresponding pixel movement strategy parameters. Then, when making adjustments, the pixels included in each local area are moved in the direction of the moving reference point according to the pixel movement strategy parameters corresponding to the local area to which it belongs, so that the final face-slimming effect can be as natural as possible, thereby improving the visual effect after face-slimming.

[0042] The following will focus on Figure 1 Detailed description of each step in the.

[0043] Step S110: Acquire facial key point information of an image to be processed, where the image to be processed includes a face area.

[0044] Among them, the image processing method provided in the embodiment of the present application can perform real-time processing on the image to be processed, and can also perform post-processing on the image to be processed, that is, non-real-time processing.

[0045] When real-time processing is performed on the image to be processed, the image processing method can be applied to application scenarios such as live video broadcasting, video conferencing, and portrait photography. In this implementation, the image to be processed can be determined based on the picture and / or video stream collected by the camera in real time.

[0046] When post-processing is performed on the image to be processed, the image processing method can be applicable to the image processing application scenario. In this embodiment, the image to be processed can be determined based on pre-downloaded pictures and / or video streams, pictures and / or video streams pre-taken by a camera.

[0047] Of course, the camera can be a built-in component of the electronic device that executes or calls the image processing method, or it can be an external component of the electronic device. In an optional implementation, in the above step S110, the process of obtaining facial key point information can be a process of obtaining facial key point information for the image to be processed from a third-party application, software, facial key point detection model or other device with facial key point detection function, or it can be a process of performing facial key point detection on the image to be processed through a facial key point model; that is, when the method provided in the embodiment of the present application is executed, the original parameters obtained can be facial key point information or an image to be processed including a facial area. The specific implementation process can be selected according to the actual application scenario, and the embodiment of the present application does not limit this.

[0048] In an optional embodiment, the image processing method provided in the embodiment of the present application itself also includes a process of performing facial key point detection on the image to be processed, that is, the original parameters acquired by the electronic device executing the image processing method are the image to be processed including the face area, and then the acquired image to be processed is input into a facial key point detection model with a facial key point detection function for detection to obtain facial key point information.

[0049] In this implementation, in order to enable the facial key point detection model to have the function of detecting facial key points, it needs to be trained in advance. Specifically, the above-mentioned facial key point detection model can be trained before processing the image using the method provided in the embodiment of the present application. The training process is as follows.

[0050] A large number of pictures containing face areas are obtained, and each picture is labeled to form a training set S including multiple samples.

[0051] Among them, for the i-th sample x in the training set S i , assuming that the corresponding label is y i , then y i Can include x i The position information G of each facial key point in the image. Where G = [(a i1 , b i1 ), (a i2 , b i2 )…(a in , b in )], n is the identification information of the key points of the face, such as a number, ID (Identity Document, identity identification), etc., (a in , b in ) indicates that in the i-th sample x i The coordinate information of the facial key point marked as n in .

[0052] It is worth noting that in the embodiment of the present application, the encoding rules for the identification information of the facial key points in each sample are set in advance, so that the facial key points with the same identification information in different samples have the same meaning, and the identification information of the facial key points belonging to a specific local area or a specific facial organ in the face is limited to the range of the identification information corresponding to the specific local area or the specific facial organ.

[0053] For example, in some embodiments, the identification information is the number of facial key points. When 81 facial key points need to be marked for each face, the pre-set identification information encoding rule can be: the forehead above the eyes including the eyes is taken as a region, and the number range of the facial key points belonging to the region is 1-20; the chin area below the mouth including the mouth is taken as a region, and the number range of the facial key points belonging to the region is 21-40; the left face is taken as a region, and the number range of the facial key points belonging to the region is 41-55; the right face is taken as a region, and the number range of the facial key points belonging to the region is 56-70; the hairline is taken as a region, and the number range of the facial key points belonging to the region is 71-81.

[0054] For another example, in some embodiments, the identification information is the number of facial key points. When 81 facial key points need to be marked for each face, the pre-set identification information encoding rule may be: the facial key points belonging to the facial contour in the facial organ are numbered in the range of 1-20, the facial key points belonging to the mouth in the facial organ are numbered in the range of 21-40, the facial key points belonging to the nose in the facial organ are numbered in the range of 41-55, the facial key points belonging to the eyes in the facial organ are numbered in the range of 56-70, and the facial key points belonging to the eyebrows in the facial organ are numbered in the range of 71-81.

[0055] Of course, the above identification information encoding rules are only examples, and it can be understood that in other implementations, the identification information encoding rules can also adopt other similar schemes.

[0056] After the labeling is completed, the deep learning model is trained using the training set S. The training process is as follows: input each sample image in the training set S into the deep learning model, and obtain the corresponding output (the facial key points and their coordinate information of the sample image), and let the deep learning model automatically learn the intrinsic relationship between the sample image and the output, thereby obtaining a facial key point detection model.

[0057] Generally speaking, in the annotation stage, N facial key points need to be annotated for each sample. The facial key point detection model obtained through subsequent training performs facial key point detection on the input image to be processed, and the facial key point information outputted includes N facial key points with identification information and their coordinate information. For example, in the annotation stage, 81 facial key points are annotated for each sample. The facial key point detection model performs facial key point detection on the input image to be processed, and the facial key point information outputted includes 81 facial key points with identification information and their coordinate information.

[0058] In addition, in some embodiments, during the marking stage, marking y i You can also include samples x i The information of the face positioning frame in K=(u i , v i , m, f), where (u i , v i ) represents the coordinate information of the face positioning frame, which is generally the coordinate information of a vertex of the face positioning frame (such as the point where the lower left corner is located), and (m, f) represent the width and height of the face positioning frame respectively.

[0059] It is worth pointing out that the coordinate information of the lower left corner of the face positioning frame and the coordinate information of each face key point belong to the same rectangular coordinate system (for the sake of distinction, it is called the first coordinate system), which is generally based on the sample x i A vertex (such as the point where the lower left corner is located) is used as the origin, and the two edges connected to the vertex are used as the X-axis and Y-axis respectively.

[0060] Under this implementation mode, after the trained facial key point detection model performs facial key point detection on the image to be processed, the output facial key point information may include not only the facial key points with identification information included in the image to be processed and their coordinate information, but also the information of the face positioning frame included in the image to be processed, that is, the output facial key point information includes G and K.

[0061] After obtaining the facial key point detection model, the acquired image to be processed can be input into the facial key point detection model, and the facial key point detection model is used to perform facial key point detection on the image to be processed, and then the facial key point information output by the facial key point detection model is obtained.

[0062] In some implementations, the acquired image to be processed may be a face image including only the face area, or may be a large image including the face area and other areas of the human body.

[0063] Generally speaking, when the image to be processed is a large image, the subsequent face-slimming processing process can be directly based on the large image, with the face area of ​​the large image as the processing object.

[0064] In addition, since face slimming processing mainly performs image processing on the facial area, in some embodiments, when the image to be processed is a large image, and the facial key point information obtained after the image to be processed is input into the facial key point detection model includes information of the face positioning frame, it is also possible to cut out the face image corresponding to the face positioning frame from the image to be processed (i.e., the large image) based on the obtained face positioning frame information, so that the face area of ​​the face image can be used as the processing object of the subsequent face slimming processing directly based on the face graphic, without the need to process the remaining areas of the large image.

[0065] It can be understood that the data volume of the facial images including the same facial area is smaller than the data volume of the image to be processed. Therefore, when the facial image is used as the processing object, it is helpful to reduce the delay caused by the face slimming processing process.

[0066] Of course, since the coordinate origin of the coordinate system (first coordinate system) in which the various coordinate information output by the facial key point detection model is located is a vertex of the large image, when the face image is used as the processing object, the coordinate origin is most likely outside the face image.

[0067] In order to facilitate the operation only on the pixels within the face area of ​​the face image, in some embodiments, the various coordinate information output by the face key point detection model can also be normalized, so as to convert the coordinate information of the face key points output by the face key point detection model into new coordinate information within the intercepted face area. In specific implementation, the normalization operation can be performed before executing the above step S120 and determining the moving reference point when moving the pixels in the face area according to the face key point information. Of course, the normalization operation can also be performed before executing the above step S130 and dividing the face area into multiple local areas according to the face key point information. The embodiment of the present application does not limit the specific execution process of the above normalization operation.

[0068] In a specific implementation, the coordinate information of the key points of the face may be normalized based on the coordinate information of the face positioning frame to obtain the normalized coordinate information of the key points of the face.

[0069] In this way, the subsequent steps of the method provided in the embodiment of the present application are performed based on the normalized coordinate information of the key points of the face. That is, the coordinates of the key points of the face are converted into coordinates within the face area of ​​the intercepted face image, so that when performing a face-slimming operation, only the pixels within the face area need to be operated, and the pixels outside the face area remain unchanged. After the face-slimming operation is completed, the face area is redrawn according to the operated pixels and the original face area is replaced.

[0070] Among them, the origin of the coordinate system (first coordinate system) corresponding to the coordinate information before the normalization operation is one of the vertices of the image to be processed, and the origin of the coordinate system (second coordinate system) corresponding to the coordinate information after the normalization operation is one of the vertices of the face positioning frame referenced by the normalization operation.

[0071] Correspondingly, when the face image is used as the processing object in the future, the processing can be performed based on the normalized face key point information.

[0072] The normalization conversion process is introduced below.

[0073] Optionally, the coordinate difference between the coordinate information of the face positioning frame and the coordinate information of the face key points may be calculated, and then the coordinate difference may be used to update and replace the original coordinate information of the face key points, so as to obtain the normalized face key point information.

[0074] Specifically, assuming that the information of the face positioning frame in the i-th image to be processed is (u i , v i , m, f), the coordinate information of the key points of the face is ((a i1 , b i1 ), (a i2 , b i2 )…(a in , b in )), then the coordinate information of the face positioning frame is (u i , v i After normalization, the coordinate information of each facial key point included in the face image is ((a i1 -u i , b i1 -v i ), (a i2 -u i , b i2 -v i )…(a in -u i , b in -v i )), at this time, the coordinate origin is the point where the coordinate information of the face positioning frame is located.

[0075] Of course, it can be understood that the embodiment corresponding to the above-mentioned normalization can be combined with any embodiment in the previous or later text (the implementation of any embodiment needs to not conflict with the implementation of this embodiment), for example: this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the moving reference point based on the pixel movement strategy parameters in the previous text; this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the moving reference point based on the pixel position adjustment ratio included in the pixel movement strategy parameters in the later text; this embodiment can also be combined with the embodiment corresponding to determining the target position information corresponding to each pixel point in the face area after moving according to the face thinning intensity coefficient included in the face adjustment instruction triggered by the user and the acquired position information of each pixel point in the face area before moving and after moving, etc.

[0076] Step S120: determining a moving reference point when moving pixels in the face area according to the face key point information.

[0077] Among them, the moving reference point is used to guide the subsequent face-slimming processing.

[0078] In an embodiment of the present application, all pixel points in the entire face area may correspond to a same moving reference point; in addition, each pixel point in the entire face area may also correspond to a different moving reference point.

[0079] As mentioned above, the meanings represented by the facial key points corresponding to each piece of identification information are predetermined.

[0080] In some implementations, the facial key point corresponding to a specific position (such as the center of both eyes or the tip of the nose, etc.) can be determined from the face area based on the identification information of each facial key point, and the facial key point can be determined as the moving reference point.

[0081] In a specific implementation, the above step S120: determining the moving reference point when moving the pixel points in the face area according to the face key point information, may include at least the following two implementation methods:

[0082] Determine the facial key points corresponding to the center positions of the two eyes in the facial area, and determine the facial key points corresponding to the center positions of the two eyes as the above-mentioned moving reference points; or determine the facial key points corresponding to the tip of the nose in the facial area, and determine the facial key points corresponding to the tip of the nose as the above-mentioned moving reference points.

[0083] Of course, the above is just an illustrative explanation using the specific positions as the center positions of both eyes and the tip of the nose as examples. In addition, the above specific positions can also be other positions, such as the midpoint of the line connecting the center positions of both eyes and the tip of the nose, etc. The embodiments of the present application will not be described one by one.

[0084] For example, in a specific implementation, if the predefined facial key points belonging to the eye area are numbered in the range of 56-70, and the facial key point numbered 63 is used to represent the center position of both eyes, then the facial key point numbered 63 can be determined as the moving reference point.

[0085] In this implementation manner, the moving reference points corresponding to the respective pixel points in the face region are the same as the face key points corresponding to the center positions of the two eyes in the face region.

[0086] Of course, it can be understood that the above-mentioned embodiment of using a specific position as a moving reference point when moving pixels in the face area can be combined with any embodiment in the previous or later text (the implementation of any embodiment needs to not conflict with the implementation of this embodiment), for example: this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the moving reference point based on the pixel movement strategy parameters appearing in the previous text; this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the moving reference point based on the pixel position adjustment ratio included in the pixel movement strategy parameters appearing in the later text; this embodiment can also be combined with the embodiment corresponding to determining the target position information corresponding to each pixel point in the face area that has been moved according to the face adjustment intensity coefficient included in the face adjustment instruction triggered by the user and the acquired position information of each pixel point in the face area before and after the movement, etc.

[0087] In some implementations, a reference line may be determined, and for different pixels in the face area, the moving reference point corresponding to the pixel may be determined from the reference line according to a set rule. Therefore, the above step S120: determining the moving reference point when moving the pixel in the face area according to the face key point information may also be implemented by the following process:

[0088] A reference line is determined based on the facial key points located on the center line of the face area in the vertical direction; for each pixel point in the face area, the facial key point on the reference line with the smallest distance to the pixel point is determined as the moving reference point corresponding to the pixel point.

[0089] In a specific implementation, the key point corresponding to the center position of both eyes on the center line can be used as the first facial key point, the facial key point corresponding to the center position of the chin on the center line can be used as the second facial key point, and the line segment formed by the first key point and the second facial key point can be determined as the reference line.

[0090] For example, in a specific implementation, assuming that the number range of the facial key points in the eye region is 56-70, the number range of the facial key points in the face contour region is 1-20, the facial key point numbered 63 is the center of both eyes, and the facial key point numbered 10 is the center of the chin. At this time, the line connecting the facial key point numbered 10 and the facial key point numbered 63 is determined as the reference line.

[0091] Of course, in another specific implementation, the key point corresponding to the center of the eyebrows on the center line can be used as the first facial key point, and the facial key point corresponding to the center of the lips on the center line can be used as the second facial key point. The line segment formed by the first facial key point and the second facial key point can be determined as the above-mentioned reference line.

[0092] On the basis of obtaining the reference line, for each pixel point in the face area, a facial key point on the reference line with the smallest distance from the pixel point is determined as a moving reference point corresponding to the pixel point.

[0093] In this implementation manner, the moving reference points corresponding to the various pixels in the face area are different, that is, there are corresponding moving reference points for the various pixels in the face area.

[0094] Of course, it can be understood that the above-mentioned implementation method of using the facial key points on the reference line as the moving reference points when moving the pixels in the face area can be combined with any embodiment in the previous or later text (the implementation of any embodiment needs to not conflict with the implementation of this embodiment), for example: this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the moving reference point based on the pixel movement strategy parameters appearing in the previous text; this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the moving reference point based on the pixel position adjustment ratio included in the pixel movement strategy parameters appearing in the later text; this embodiment can also be combined with the embodiment corresponding to determining the target position information corresponding to each pixel point in the face area that has been moved according to the face adjustment intensity coefficient included in the face adjustment instruction triggered by the user and the acquired position information of each pixel point in the face area before and after the movement, etc.

[0095] Step S130: Divide the face region into a plurality of local regions according to the face key point information.

[0096] As mentioned above, the facial key point information includes identification information of the facial key points. Accordingly, the above step S130, based on the facial key point information, divides the facial region into a plurality of local regions, specifically including:

[0097] According to the correspondence between the acquired identification information of the facial key points and the facial organs, the facial key point sets corresponding to the facial organs are determined; and the area enclosed by the facial key points in each facial key point set is determined as a local area.

[0098] The above-mentioned facial organs may be eyes, nose, mouth, eyebrows, face, etc.

[0099] Of course, in some other specific implementations, the local areas may not be divided according to the areas corresponding to the above-mentioned facial organs, but may be divided in other ways. For example, the forehead above the eyes including the eyes is regarded as one area, the chin area below the mouth including the mouth is regarded as one area, the left face area (including a part of the nose) located between the forehead area and the chin area is regarded as one area, and the right face area (including a part of the nose) located between the forehead area and the chin area is regarded as one area. Of course, in the specific implementation, the area division may also be performed in other ways, which will not be described in detail in the embodiments of the present application.

[0100] To facilitate understanding, the following examples are given to illustrate.

[0101] For example, the facial key points numbered in the number range of 1-20 are divided into a group, and it is determined that the facial key points included in the group belong to the facial contour area; the facial key points numbered in the number range of 21-40 are divided into a group, and it is determined that the facial key points included in the group belong to the mouth area; the facial key points numbered in the number range of 41-55 are divided into a group, and it is determined that the facial key points included in the group belong to the nose area; the facial key points numbered in the number range of 56-70 are divided into a group, and it is determined that the facial key points included in the group belong to the eye area; the facial key points numbered in the number range of 71-81 are divided into a group, and it is determined that the facial key points included in the group belong to the eyebrow area.

[0102] After obtaining multiple groups, each group is a set of facial key points. The area surrounded by the coordinate information of each facial key point in each set of facial key points is a local area.

[0103] Of course, it can be understood that the above-mentioned method determines the set of facial key points corresponding to each facial organ based on the correspondence between the identification information of the acquired facial key points and the facial organs; the embodiment of determining the area enclosed by each facial key point in each set of facial key points as a local area can be combined with any embodiment in the previous or later text (the implementation of any embodiment needs to not conflict with the implementation of this embodiment), for example: this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the direction of the moving reference point based on the pixel movement strategy parameters appearing in the previous text; this embodiment can be combined with the embodiment corresponding to moving each pixel point in the local area toward the direction of the moving reference point based on the pixel position adjustment ratio included in the pixel movement strategy parameters appearing in the later text; this embodiment can also be combined with the embodiment corresponding to determining the target position information corresponding to each pixel point in the face area after moving according to the face thinning intensity coefficient included in the face adjustment instruction triggered by the user and the acquired position information of each pixel point in the face area before moving and the position information after moving, etc.

[0104] Step S140: for each of the local areas, based on the pixel movement strategy parameters corresponding to the local area, move each pixel point in the local area toward the direction of the movement reference point.

[0105] A face slimming operation is performed, that is, pixel adjustments are performed on each local area divided from the face area that needs face slimming.

[0106] As mentioned above, each local area has a corresponding pixel movement strategy parameter, and the pixel movement strategy parameters corresponding to different local areas are different.

[0107] In some embodiments, the pixel movement strategy parameter is a pixel position adjustment ratio. In this embodiment, each pixel point included in each local area can be moved and adjusted in the direction of the moving reference point to achieve a face-thinning effect. The degree of adjustment is determined by the pixel position adjustment ratio corresponding to the local area where the pixel point is located.

[0108] In this embodiment, when each pixel point in each local area is moved toward the moving reference point, the first distance d between each pixel point in each local area and the moving reference point can be determined; then, based on the first distance d and the pixel position adjustment ratio T corresponding to the local area where the pixel point is located, the second distance d' between the pixel point and the moving reference point is determined; then, the pixel point is moved toward the moving reference point so that the distance between the pixel point and the moving reference point after the movement is equal to the second distance.

[0109] In some implementations, a first product value of the first distance d and the pixel position adjustment ratio T corresponding to the local area to which the pixel point belongs may be calculated, and the first product value may be determined as the second distance d′.

[0110] For example, the above process can be implemented based on the formula d'=d×T, T∈[0,1].

[0111] Taking the case where the moving reference point of each pixel in the face area is the same, which is the face key point 63 at the center of both eyes, as an example, assuming that the pixel position adjustment ratio corresponding to the face contour area is T1, and the pixel position adjustment ratio corresponding to the mouth area is T2, then when moving the pixels, each pixel included in the face contour area is moved in the direction of the moving reference point represented by the face key point 63, and the moving distance is the product of the distance d from the pixel to the face key point 63 and T1; each pixel included in the mouth contour area is moved in the direction of the moving reference point represented by the face key point 63, and the moving distance is the product of the distance d from the pixel to the face key point 63 and T2.

[0112] Of course, it can be understood that in this specific example, other local areas not listed and their corresponding pixel position adjustment ratios are also included, and they will all move in the direction of the moving reference point represented by the facial key point 63 in a similar manner as described above.

[0113] In addition, it is worth pointing out that when the moving reference points corresponding to each pixel point in the face area are different, in the above-mentioned pixel movement process, when each pixel point moves in the direction where the moving reference point is located, it moves in the direction where the moving reference point corresponding to itself is located.

[0114] In addition, it should be noted that in an embodiment of the present application, the above-mentioned pixel movement strategy parameter can also be the ratio between the distance between the position of the pixel after movement and the pixel reference point and the distance between the position of the pixel before movement and the pixel reference point. In this way, when moving the pixel, the target position information of the pixel can be determined according to this ratio.

[0115] Of course, in some specific implementations, the above-mentioned pixel strategy movement parameter can also be the distance of pixel movement, etc.; the above-mentioned pixel strategy movement parameter can also be other parameters, which will not be described in detail in the embodiments of the present application.

[0116] For the method of determining the moving reference point corresponding to each pixel point, please refer to the relevant description above and will not be repeated here.

[0117] Of course, the pixel position adjustment ratios corresponding to the various local areas are independent of each other, and may be partially the same or completely different.

[0118] In the embodiment of the present application, in order to ensure a natural effect after face slimming, the backstage staff pre-configures the corresponding pixel position adjustment ratio for each local area of ​​the face. Among them, the backstage staff can take different pixel position adjustment ratios for each local area for testing, and observe the corresponding visual effects, so as to determine the best pixel position adjustment ratio corresponding to each local area, and save it. In actual use, the user cannot directly adjust the pixel position adjustment ratio of each local area separately.

[0119] Of course, in some implementations, after the above-mentioned pixel movement operation, the effect may not satisfy the user. In this case, the user can also trigger custom adjustments through virtual buttons or physical buttons to trigger face adjustment instructions.

[0120] The face adjustment instruction includes a face thinning intensity coefficient k, and the size of the face thinning intensity coefficient k can be adjusted by the user, so that the user can adjust the current face thinning degree based on the face thinning intensity coefficient k.

[0121] In the embodiment of the present application, when the electronic device running the image processing method obtains and responds to the face adjustment instruction (wherein the face adjustment instruction carries the face thinning strength coefficient), the position information before and after the movement of each pixel point in the face area of ​​the processed image (which can be the image to be processed or the face image cut out from the image to be processed) can be obtained. Then, based on the face thinning strength coefficient k, the position information before and after the movement, the target position information corresponding to each pixel point in the face area of ​​the processed image (which can be the image to be processed or the face image cut out from the image to be processed) is determined, and each pixel point in the face area after the movement is moved is moved to the target position corresponding to the target position information.

[0122] In a specific implementation, the above position information is represented by coordinate information; accordingly, the above determination of the target position information corresponding to each pixel point in the face area of ​​the processed image after the movement based on the face-slimming strength coefficient k, the position information before the movement, and the position information after the movement can be specifically implemented by the following process:

[0123] For each pixel point in the face area that has been moved, determine the second coordinate information (x i ',y i ') and the first coordinate information (x i ,y i ), then calculate the second product value between the face-thinning intensity coefficient k and the first coordinate difference, and convert the first coordinate information (x i ,yi ) and the second product value are determined as the target position information

[0124] The position information before the movement is represented by the first coordinate information, and the position information after the movement is represented by the second coordinate information.

[0125] For example, the above process can be based on the formula To achieve this, k∈[0,1].

[0126] Of course, it is worth pointing out that when the processing object during face-slimming processing is the image to be processed, the above-mentioned coordinate information is the coordinate information belonging to the first coordinate system; when the above-mentioned processing object is a face image captured from the image to be processed, the above-mentioned coordinate information is the coordinate information belonging to the second coordinate system.

[0127] Optionally, in some embodiments, the movement information of each pixel in the face area of ​​the processed image (which may be the image to be processed or the face image captured from the image to be processed) on the X-axis and Y-axis (the movement information includes the movement distance and the movement direction) can be determined based on the face-slimming intensity coefficient k, the position information before the movement, and the position information after the movement, and each pixel point in the face area can be moved based on the above movement information.

[0128] Optionally, in a specific implementation, the above position information may be represented by coordinate information, and accordingly, the movement information corresponding to each pixel point may be determined by the following process:

[0129] For each pixel point in the face area that has been moved, determine the second coordinate information (x i ',y i ') and the first coordinate information (x i ,y i ) between the first coordinate difference; then calculate the difference between the set value and the face-slimming intensity coefficient k, calculate the product between the difference and the first coordinate difference, and determine the product value as the above-mentioned movement information. The above-mentioned product value can be positive or negative, and the positive or negative value of the above-mentioned product value indicates the direction of movement.

[0130] Of course, the embodiments of the present application only exemplarily list possible implementation methods of face slimming based on the face slimming intensity coefficient. In addition to this, other methods can also be used to slim the face based on the face slimming intensity coefficient, which will not be described one by one here.

[0131] In addition, in some embodiments, when the processing object during face slimming processing is a facial image captured from an image to be processed, after the face slimming processing is performed on the facial image, it is also necessary to replace the original facial image included in the image to be processed with the facial image after the face slimming processing, so that the image to be processed presents a face slimming effect.

[0132] In addition, please refer to Figure 2 The embodiment of the present application further provides an image processing device 400 , which may include: an acquisition module 410 , a determination module 420 , a division module 430 , and an adjustment module 440 .

[0133] An acquisition module 410 is used to acquire facial key point information of an image to be processed, wherein the image to be processed includes a facial region;

[0134] A determination module 420, configured to determine a moving reference point when moving pixels in the face region according to the face key point information;

[0135] A division module 430, configured to divide the face region into a plurality of local regions according to the face key point information;

[0136] The adjustment module 440 is used to move each pixel point in the local area toward the direction of the movement reference point based on the pixel movement strategy parameters corresponding to the local area for each local area.

[0137] In one possible implementation, the pixel movement strategy includes a pixel position adjustment ratio; the adjustment module 440 is used to determine, for each pixel point in the local area, a first distance between the pixel point and the moving reference point; based on the first distance and the corresponding pixel position adjustment ratio, determine a second distance between the pixel point and the moving reference point; and move the pixel point toward the moving reference point so that the distance between the pixel point and the moving reference point after the movement is equal to the second distance.

[0138] In a possible implementation, the adjustment module 440 is used to determine a first product value of the first distance and a pixel position adjustment ratio corresponding to the local area to which the pixel point belongs; and determine the first product value as the second distance.

[0139] In a possible implementation, the adjustment module 440 is also used to respond to a face adjustment instruction triggered by a user, and obtain the position information of each pixel point in the face area that has been moved before and after the movement; wherein the face adjustment instruction carries a face thinning strength coefficient; based on the face thinning strength coefficient, the position information before and after the movement, determine the target position information corresponding to each pixel point that has been moved in the face area; and move each pixel point that has been moved in the face area to the target position corresponding to the target position information.

[0140] In a possible implementation, the position information is represented by coordinate information; the adjustment module 440 is used to determine the first coordinate difference between the second coordinate information and the first coordinate information for each pixel point in the face area that has been moved; wherein the position information before the movement is represented by the first coordinate information, and the position information after the movement is represented by the second coordinate information; calculate the second product value between the face-slimming intensity coefficient and the first coordinate difference; and determine the sum of the first coordinate information and the second product value as the target position information.

[0141] In a possible implementation, the determination module 420 is used to determine the facial key points corresponding to the center positions of the two eyes in the face region, and determine the facial key points corresponding to the center positions of the two eyes as the moving reference points;

[0142] Or, it is used to determine the facial key point corresponding to the position of the nose tip in the face area, and determine the facial key point corresponding to the position of the nose tip as the moving reference point.

[0143] In a possible implementation, the determination module 420 is configured to determine a reference line based on the facial key points located on the center line in the vertical direction of the face region; for each pixel point in the face region, determine the facial key point on the reference line with the smallest distance from the pixel point as the moving reference point corresponding to the pixel point;

[0144] Correspondingly, the adjustment module 440 is used to move each pixel point in the local area toward the direction of the corresponding moving reference point.

[0145] In a possible implementation, the facial key point information includes identification information of the facial key points, and the division module 430 is used to determine the facial key point set corresponding to each facial organ based on the correspondence between the acquired identification information of the facial key points and the facial organs; and determine the area enclosed by each facial key point in each facial key point set as a local area.

[0146] In a possible implementation manner, different local areas correspond to different pixel position adjustment ratios.

[0147] In a possible implementation, the acquisition module 410 is used to input the image to be processed into a facial key point detection model, perform facial key point detection on the image to be processed through the facial key point detection model; and obtain facial key point information output by the facial key point detection model.

[0148] In a possible implementation, the facial key point information includes coordinate information of a face positioning frame and coordinate information of the facial key points; the device also includes a normalization module, which is used to normalize the coordinate information of the facial key points based on the coordinate information of the face positioning frame to obtain normalized coordinate information of the facial key points.

[0149] The image processing device 400 provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0150] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computer, the steps included in the above-mentioned image processing method are executed.

[0151] In addition, please refer to Figure 3 The embodiment of the present application also provides an electronic device 100 for implementing the image processing method and apparatus.

[0152] The electronic device 100 is a mobile phone, a smart camera, a tablet computer, a personal computer (PC), etc. A user can use the electronic device 100 to perform activities such as taking photos, live streaming videos, and image processing.

[0153] The electronic device 100 may include: a processor 110 , a memory 120 , and a display screen 130 .

[0154] It should be noted that Figure 3 The components and structures of the electronic device 100 shown are only exemplary and non-restrictive. The electronic device 100 may also have other components and structures as required. For example, in some cases, the electronic device 100 may also include a camera for capturing images to be processed in real time.

[0155] The processor 110, the memory 120, the display screen 130, and other components that may appear in the electronic device 100 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, the processor 110, the memory 120, the display screen 130, and other components that may appear may be electrically connected to each other via one or more communication buses or signal lines.

[0156] The memory 120 is used to store programs, for example, a program corresponding to the image processing method mentioned above or an image processing device mentioned above. Optionally, when the image processing device is stored in the memory 120, the image processing device includes at least one software function module that can be stored in the memory 120 in the form of software or firmware.

[0157] Optionally, the software function modules included in the image processing apparatus may also be embedded in the operating system (OS) of the electronic device 100 .

[0158] The processor 110 is used to execute executable modules stored in the memory 120, such as software function modules or computer programs included in the image processing device. After receiving the execution instruction, the processor 110 can execute the computer program, for example, to execute: obtaining facial key point information of the image to be processed, the image to be processed includes a face area; according to the facial key point information, determining a moving reference point when moving pixels in the face area; according to the facial key point information, dividing the face area into multiple local areas; for each of the local areas, based on the pixel movement strategy parameters corresponding to the local area, moving each pixel in the local area toward the direction of the moving reference point.

[0159] Of course, the method disclosed in any embodiment of the present application can be applied to the processor 110 or implemented by the processor 110.

[0160] To summarize, the image processing method, device, electronic device and computer-readable storage medium proposed in the embodiments of the present invention, when it is necessary to perform face-slimming processing on the image to be processed, first obtain the facial key point information of the image to be processed, and then determine the moving reference point and divide the facial area into different local areas based on the facial key point information. Then, when performing face-slimming processing, the pixel points included in each local area are moved in the direction of the moving reference point according to the pixel moving strategy corresponding to the local area to which it belongs, so that the final face-slimming effect can be as natural as possible, thereby improving the visual effect presented after face-slimming.

[0161] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0162] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0163] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0164] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a laptop, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0165] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire facial key point information of an image to be processed, wherein the image to be processed includes a facial area; Determining, based on the facial key point information, a moving reference point when moving the pixel points in the facial area; Dividing the face region into a plurality of local regions according to the face key point information; For each of the local areas, based on the pixel movement strategy parameters corresponding to the local area, each pixel point in the local area is moved toward the movement reference point; After moving each pixel point in the local area toward the moving reference point based on the pixel moving strategy parameter corresponding to the local area, the method further includes: In response to a face adjustment instruction triggered by a user, obtaining position information of each pixel point in the face area before and after the movement; wherein the face adjustment instruction carries a face thinning intensity coefficient; Determining target position information corresponding to each pixel point in the face area that has been moved based on the face-slimming strength coefficient, the position information before the movement, and the position information after the movement; Move each pixel point in the face area that has been moved to the target position corresponding to the target position information.

2. The method according to claim 1, characterized in that The pixel movement strategy parameters include a pixel position adjustment ratio; Accordingly, the moving each pixel point in the local area toward the moving reference point based on the pixel moving strategy parameter corresponding to the local area includes: For each pixel point in the local area, determining a first distance between the pixel point and the moving reference point; Determining a second distance between the pixel point and the moving reference point based on the first distance and a corresponding pixel position adjustment ratio; The pixel point is moved toward the moving reference point so that the distance between the pixel point and the moving reference point after the movement is equal to the second distance.

3. The method according to claim 2, characterized in that The determining, based on the first distance and the corresponding pixel position adjustment ratio, a second distance between the pixel point and the moving reference point comprises: Determine a first product value of the first distance and a pixel position adjustment ratio corresponding to the local area to which the pixel point belongs; The first product value is determined as the second distance.

4. The method according to claim 1, characterized in that: The location information is represented by coordinate information; The determining, based on the face-slimming strength coefficient, the position information before the movement, and the position information after the movement, target position information corresponding to each pixel point in the face area that has been moved includes: For each pixel point in the face area that has been moved, determine a first coordinate difference between the second coordinate information and the first coordinate information; wherein the position information before the movement is represented by the first coordinate information, and the position information after the movement is represented by the second coordinate information; Calculating a second product value between the face-thinning intensity coefficient and the first coordinate difference; The sum of the first coordinate information and the second product value is determined as the target position information.

5. The method according to any one of claims 1 to 4, characterized in that: The step of determining a moving reference point when moving pixels in the face region according to the face key point information includes: Determine the key points of the face corresponding to the center positions of the two eyes in the face area, and determine the key points of the face corresponding to the center positions of the two eyes as the moving reference points; or, A facial key point corresponding to the position of the nose tip in the face area is determined, and the facial key point corresponding to the position of the nose tip is determined as the moving reference point.

6. The method according to any one of claims 1 to 4, characterized in that: The step of determining a moving reference point when moving pixels in the face region according to the face key point information includes: Determining a reference line based on facial key points located on a center line in a vertical direction of the facial region; For each pixel point in the face area, determining the face key point on the reference line with the smallest distance from the pixel point as the moving reference point corresponding to the pixel point; Accordingly, moving each pixel point in the local area toward the direction of the moving reference point includes: Each pixel point in the local area is moved toward the direction of the corresponding moving reference point.

7. The method according to any one of claims 1 to 4, characterized in that The facial key point information includes identification information of the facial key points, and the facial region is divided into a plurality of local regions according to the facial key point information, including: Determine the set of facial key points corresponding to each facial organ according to the obtained correspondence between the identification information of the facial key points and the facial organs; The area enclosed by each facial key point in each facial key point set is determined as a local area.

8. The method according to claim 2 or 3, characterized in that: Different local areas correspond to different pixel position adjustment ratios.

9. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining facial key point information of the image to be processed includes: Inputting the image to be processed into a facial key point detection model, and performing facial key point detection on the image to be processed by the facial key point detection model; Obtain the facial key point information output by the facial key point detection model.

10. The method according to any one of claims 1 to 4, characterized in that: The facial key point information includes coordinate information of a facial positioning frame and coordinate information of the facial key points; before determining a moving reference point when moving pixels in the facial area according to the facial key point information, the method further includes: The coordinate information of the key points of the face is normalized based on the coordinate information of the face positioning frame to obtain the normalized coordinate information of the key points of the face.

11. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring facial key point information of an image to be processed, wherein the image to be processed includes a facial area; A determination module, used to determine a moving reference point when moving the pixel points in the face area according to the face key point information; A division module, used for dividing the face area into a plurality of local areas according to the face key point information; An adjustment module, configured to move each pixel point in the local area toward the moving reference point based on a pixel moving strategy parameter corresponding to the local area for each of the local areas; The adjustment module is also used to obtain the position information of each pixel point in the face area before and after the movement, in response to a face adjustment instruction triggered by a user, after each pixel point in the local area is moved toward the direction of the moving reference point based on the pixel movement strategy parameters corresponding to the local area; wherein the face adjustment instruction carries a face thinning strength coefficient; based on the face thinning strength coefficient, the position information before the movement and the position information after the movement, determine the target position information corresponding to each pixel point in the face area that has been moved; and move each pixel point in the face area that has been moved to the target position corresponding to the target position information.

12. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor calls the program stored in the memory to execute the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 10 is executed.