Image processing method, device, equipment and storage medium
By obtaining and adjusting the position information of facial feature points in the video frame and determining the target processing position, the problem of insufficient flexibility in acne and freckle removal processing in the existing technology is solved, and flexible processing of designated spots and acne is achieved, which improves the processing efficiency. Accuracy and flexibility.
Patent Information
- Application Number
- CN202010947768.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-10
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-09-10
AI Technical Summary
The flexibility of the acne and spot removal treatment in the prior art is low, and it is impossible to perform personalized treatment on the spots and acne specified in the image.
By obtaining the position information of facial feature points in the video frame, adjusting the relative position information, determining the target treatment position, and performing skin resurfacing and other treatments, it can achieve flexible treatment of designated spots and acne.
Improves the flexibility of acne and freckle removal processing, allowing personalized treatment of spots and acne specified in the image, enhancing the accuracy and flexibility of processing.
Smart Images

Figure CN112052806B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to an image processing method, device, equipment and storage medium. Background Art
[0002] With the development of Internet technology and the rise of live streaming and short videos, the application of beauty functions is becoming more and more widespread.
[0003] The beauty function is to beautify the face image included in the image, for example, by using face recognition technology to identify the face image in the image, and then perform whitening, blemish and acne removal, face slimming and other processing on the face image. In related technologies, blemish and acne removal processing generally determines the area of blemishes and acne in the face image based on the difference between the color of blemishes and acne and the skin color of the face, and then performs skin resurfacing processing on the corresponding area to make the color of blemishes and acne fade and close to the skin color of the face, thereby achieving the effect of blemish and acne removal.
[0004] In the process of implementing this application, the inventors found that the related technology has at least the following problems:
[0005] Currently, the flexibility of acne and freckle removal is low, and only all freckles and pimples detected in the face image can be uniformly processed, but it is impossible to perform acne and freckle removal on one or more specified freckles and pimples in the face image. Summary of the invention
[0006] The embodiments of the present application provide an image processing method, apparatus, device and storage medium, which can improve the flexibility of acne and freckle removal processing. The technical solution is as follows:
[0007] In a first aspect, an image processing method is provided, the method comprising:
[0008] Acquire a first position for target processing in an input first video frame, and perform the target processing on an image at the first position in the first video frame;
[0009] Determine relative position information between the position of the facial feature point in the first video frame and the first position;
[0010] Based on the positions of facial feature points in the first video frame and the positions of facial feature points in the second video frame, the relative position information is adjusted to obtain adjusted relative position information, and based on the adjusted relative position information and the positions of facial feature points in the second video frame, a second position for performing the target processing is determined in the second video frame;
[0011] The target processing is performed on the image at the second position in the second video frame.
[0012] Optionally, determining the relative position information between the position of the target facial feature point in the first video frame and the first position includes:
[0013] Inputting the first video frame into a preset face recognition model to obtain positions of multiple facial feature points in the first video frame;
[0014] Determine the distances between the positions of the plurality of facial feature points and the first position, and determine a preset number of target facial feature points closest to the first position based on the distances between the positions of the plurality of facial feature points and the first position;
[0015] Determine the distance vectors between the positions of the preset number of target facial feature points in the first video frame and the first position respectively, and obtain relative position information.
[0016] Optionally, adjusting the relative position information based on the positions of the facial feature points in the first video frame and the positions of the facial feature points in the second video frame to obtain the adjusted relative position information includes:
[0017] Inputting the second video frame into the preset face recognition model to obtain positions of multiple facial feature points in the second video frame;
[0018] Determining a scaling factor of the face image in the first video frame and the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame and the positions of the plurality of face feature points in the first video frame;
[0019] The scaling coefficients are multiplied by the distance vectors corresponding to the preset number of target facial feature points to obtain the distance vectors corresponding to the preset number of adjusted target facial feature points.
[0020] Optionally, determining a scaling factor of a face image in the first video frame and a face image in the second video frame based on positions of a plurality of face feature points in the second video frame and positions of a plurality of face feature points in the first video frame includes:
[0021] Determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio;
[0022] Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image;
[0023] The product of the first scaling ratio and the second scaling ratio is determined as a scaling ratio coefficient of the face image in the first video frame and the face image in the second video frame.
[0024] Optionally, determining a second position for performing the target processing in the second video frame based on the adjusted relative position information and the position of the facial feature point in the second video frame includes:
[0025] Determine a position calculation weight of each target feature point according to the distances between the positions of the preset number of target facial feature points and the first position, wherein the farther the distance between each target feature point and the first position, the smaller the corresponding position calculation weight;
[0026] The distance vector corresponding to each adjusted target facial feature point is added to the position of the corresponding target facial feature point in the second video frame to obtain a preset number of initial second positions, and the preset number of initial second positions are multiplied and summed with the corresponding position calculation weights to obtain the second position for the target processing in the second video frame.
[0027] Optionally, the method further includes:
[0028] Determine a first face rotation angle corresponding to the face image in the first video frame, a second face rotation angle corresponding to the face image in the second video frame, and a distance between the second position and a center point of the face image in the second video frame;
[0029] The performing the target processing on the image at the second position in the second video frame includes:
[0030] Determining a second position adjustment value based on the first face rotation angle, the second face rotation angle, and the distance from the center point of the face image in the second video frame;
[0031] Determining an adjusted second position based on the second position and the second position adjustment value;
[0032] The target processing is performed on the image at the second position after the adjustment in the second video frame.
[0033] Optionally, the method further includes: acquiring an image processing range corresponding to the input first position;
[0034] The performing the target processing on the image at the first position in the first video frame comprises:
[0035] Perform the target processing on the image within the image processing range corresponding to the first position in the first video frame;
[0036] The performing the target processing on the image at the second position in the second video frame includes:
[0037] Determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio;
[0038] Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image;
[0039] Adjusting the image processing range based on the first scaling ratio and the second scaling ratio to obtain an adjusted image processing range;
[0040] The target processing is performed on the image within the adjusted image processing range corresponding to the second position in the second video frame.
[0041] Optionally, the performing the target processing includes:
[0042] Determine an image processing range corresponding to a position where the target processing is performed;
[0043] Determine at least one triangle processing area included in the image processing range and divided by a rendering algorithm;
[0044] Based on the positions of the vertices of the at least one triangular processing area, pixels to be processed in the at least one triangular processing area are determined, and the target processing is performed on the pixels to be processed.
[0045] In a second aspect, an image processing method is provided, the method comprising:
[0046] displaying a first video frame;
[0047] When a selection operation on a first spot position corresponding to the face image in the first video frame is detected, in response to the selection operation, target processing is performed on the image at the first spot position;
[0048] A second video frame to be displayed is acquired, target processing is performed on an image at a second spot position in the second video frame after the image moves relative to the first spot position, and the second video frame after the target processing is displayed.
[0049] Optionally, the selection operation is a click operation, the target processing is a skin resurfacing processing, and the target processing of the image at the first spot position includes:
[0050] A circular area is determined with the first spot position as the center and according to a preset radius value, and a skin resurfacing process is performed on the image within the circular area.
[0051] Optionally, before performing skin resurfacing processing on the image within the circular area, the method includes:
[0052] In response to the selected operation, displaying a radius adjustment window, in which a radius adjustment progress bar and a confirmation option are displayed;
[0053] When a drag operation of the radius adjustment progress bar is detected, in response to the drag operation of the radius adjustment progress bar, a circular area with the first spot position as the center and a radius value corresponding to the drag progress of the current radius adjustment progress bar is displayed at the first spot position;
[0054] When a click operation of the confirmation option is detected, the radius value corresponding to the dragging progress of the current radius adjustment progress bar is determined as the preset radius value.
[0055] In a third aspect, an image processing method is provided, the method comprising:
[0056] Acquire a first video frame, perform spot recognition processing on the first video frame, and determine a spot area existing in the face image of the first video frame;
[0057] Displaying the first video frame and a region mark corresponding to a spot region existing in the face image in the first video frame;
[0058] When a selection operation of a target area mark corresponding to the at least one area mark is detected, in response to the selection operation, a first spot position corresponding to the target area mark is acquired, and target processing is performed on an image at the first spot position in the first video frame;
[0059] A second video frame to be displayed is acquired, a skin resurfacing process is performed on an image at a second spot position in the second video frame after the image moves relative to the first spot position, and the second video frame after the target processing is displayed.
[0060] In a fourth aspect, an image processing device is provided, wherein the device comprises:
[0061] An acquisition module, used for acquiring a first position for target processing in an input first video frame;
[0062] A first determination module, used to determine relative position information between the position of the target facial feature point in the first video frame and the first position;
[0063] A second determination module is used to adjust the relative position information based on the position of the facial feature points in the first video frame and the position of the facial feature points in the second video frame to obtain adjusted relative position information, and determine a second position for performing the target processing in the second video frame based on the adjusted relative position information and the position of the facial feature points in the second video frame;
[0064] A processing module is used to perform the target processing on the image at the first position in the first video frame, and to perform the target processing on the image at the second position in the second video frame.
[0065] Optionally, the first determining module is used to
[0066] Inputting the first video frame into a preset face recognition model to obtain positions of multiple facial feature points in the first video frame;
[0067] Determine the distances between the positions of the plurality of facial feature points and the first position, and determine a preset number of target facial feature points closest to the first position based on the distances between the positions of the plurality of facial feature points and the first position;
[0068] Determine the distance vectors between the positions of the preset number of target facial feature points in the first video frame and the first position respectively, and obtain relative position information.
[0069] Optionally, the second determining module is used to:
[0070] Inputting the second video frame into the preset face recognition model to obtain positions of multiple facial feature points in the second video frame;
[0071] Determining a scaling factor of the face image in the first video frame and the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame and the positions of the plurality of face feature points in the first video frame;
[0072] The scaling coefficients are multiplied by the distance vectors corresponding to the preset number of target facial feature points to obtain the distance vectors corresponding to the preset number of adjusted target facial feature points.
[0073] Optionally, the second determination module is used to: determine a first face width of the face image in the first video frame based on the positions of the multiple face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the multiple face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio;
[0074] Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image;
[0075] The product of the first scaling ratio and the second scaling ratio is determined as a scaling ratio coefficient of the face image in the first video frame and the face image in the second video frame.
[0076] Optionally, the second determination module is used to: determine the position calculation weight of each target feature point according to the distances between the positions of the preset number of target facial feature points and the first position, wherein the farther the distance between each target feature point and the first position, the smaller the corresponding position calculation weight;
[0077] The distance vector corresponding to each adjusted target facial feature point is added to the position of the corresponding target facial feature point in the second video frame to obtain a preset number of initial second positions, and the preset number of initial second positions are multiplied and summed with the corresponding position calculation weights to obtain the second position for the target processing in the second video frame.
[0078] Optionally, the device further includes a third determining module, configured to:
[0079] Determine a first face rotation angle corresponding to the face image in the first video frame, a second face rotation angle corresponding to the face image in the second video frame, and a distance between the second position and a center point of the face image in the second video frame;
[0080] The processing module is used for:
[0081] Determining a second position adjustment value based on the first face rotation angle, the second face rotation angle, and the distance from the center point of the face image in the second video frame;
[0082] Determining an adjusted second position based on the second position and the second position adjustment value;
[0083] The target processing is performed on the image at the second position after the adjustment in the second video frame.
[0084] Optionally, the acquisition module is further used to: acquire an image processing range corresponding to the input first position;
[0085] The processing module is used for:
[0086] Perform the target processing on the image within the image processing range corresponding to the first position in the first video frame;
[0087] The processing module is used for:
[0088] Determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio;
[0089] Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image;
[0090] Adjusting the image processing range based on the first scaling ratio and the second scaling ratio to obtain an adjusted image processing range;
[0091] The target processing is performed on the image within the adjusted image processing range corresponding to the second position in the second video frame.
[0092] Optionally, the processing module is used to:
[0093] Determine an image processing range corresponding to a position where the target processing is performed;
[0094] Determine at least one triangle processing area included in the image processing range and divided by a rendering algorithm;
[0095] Based on the positions of the vertices of the at least one triangular processing area, pixels to be processed in the at least one triangular processing area are determined, and the target processing is performed on the pixels to be processed.
[0096] In a fifth aspect, an image processing device is provided, the device comprising:
[0097] A display module, used for displaying the first video frame;
[0098] a processing module, configured to, after detecting a selection operation on a first spot position corresponding to the face image in the first video frame, perform target processing on the image at the first spot position in response to the selection operation; obtain a second video frame to be displayed, and perform target processing on the image at a second spot position in the second video frame after the image moves relative to the first spot position;
[0099] The display module is used to display the second video frame after the target processing.
[0100] Optionally, the selection operation is a click operation, the target processing is a skin resurfacing processing, and the processing module is used to:
[0101] A circular area is determined with the first spot position as the center and according to a preset radius value, and a skin resurfacing process is performed on the image within the circular area.
[0102] Optionally, the device further includes a determining module, configured to:
[0103] In response to the selected operation, displaying the radius adjustment window, and displaying a radius adjustment progress bar and a confirmation option in the radius adjustment window;
[0104] When a drag operation of the radius adjustment progress bar is detected, in response to the drag operation of the radius adjustment progress bar, a circular area with the first spot position as the center and a radius value corresponding to the drag progress of the current radius adjustment progress bar is displayed at the first spot position;
[0105] When a click operation of the confirmation option is detected, the radius value corresponding to the dragging progress of the current radius adjustment progress bar is determined as the preset radius value.
[0106] In a sixth aspect, an image processing device is provided, the device comprising:
[0107] A processing module, used for acquiring a first video frame, performing spot recognition processing on the first video frame, and determining a spot area existing in a face image of the first video frame;
[0108] A display module, used for displaying the first video frame and a region mark corresponding to a spot region existing in the face image in the first video frame;
[0109] a processing module, configured to, when a selection operation of a target area mark corresponding to the at least one area mark is detected, obtain a first spot position corresponding to the target area mark in response to the selection operation, and perform target processing on an image at the first spot position in the first video frame; obtain a second video frame to be displayed, and perform skin resurfacing processing on an image at a second spot position in the second video frame that has moved relative to the first spot position;
[0110] The display module is used to display the second video frame after the target processing.
[0111] In a seventh aspect, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operations performed by the image processing method as described above.
[0112] In an eighth aspect, a computer-readable storage medium is provided, characterized in that at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the operations performed by the image processing method as described above.
[0113] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0114] The user inputs the first position of the spots, acnes, etc. in the first video frame, and then determines the relative position information between the first position and the target facial feature points in the first video frame, and then determines the second position of the spots, acnes, etc. in the second video frame based on the relative position information and the target facial feature points in the video frame after the first video frame (i.e., the second video frame), and processes the image at the second position. Since the first position of the acne and acne removal process in the video frame is obtained based on the position input of the spots, acnes, etc. in the first video frame, and the second position of the acne and acne removal process is determined based on the first position, the present application can be used to perform acne and acne removal processes on one or more specified spots and acnes, which can improve the flexibility of the acne and acne removal process. BRIEF DESCRIPTION OF THE DRAWINGS
[0115] In order to more clearly illustrate the technical solutions in the embodiments of 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0116] Figure 1 is a flow chart of the image processing method provided in an embodiment of the present application;
[0117] Figure 2 is a schematic diagram of an image processing method provided in an embodiment of the present application;
[0118] Figure 3 is a flow chart of the image processing method provided in an embodiment of the present application;
[0119] Figure 4 is a schematic diagram of an image processing method provided in an embodiment of the present application;
[0120] Figure 5 is a flow chart of the image processing method provided in an embodiment of the present application;
[0121] Figure 6 is a schematic diagram of an image processing method provided in an embodiment of the present application;
[0122] Figure 7 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0123] Figure 8 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0124] Fig. 9 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0125] Fig.10 It is a schematic diagram of the terminal structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0126] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0127] The image processing method provided in the present application can be implemented by a terminal, wherein the terminal can be equipped with components such as an image acquisition device, a processor, and a screen. The terminal can obtain image data from an image acquisition device (such as a camera), such as an image containing a user's face, and then process the image of the user's face through the processor, such as skin grinding, face thinning, whitening, etc., and then display the processed image through the screen. In addition, the terminal can also access the Internet to transmit the processed image to a server and other terminals through the network. The terminal can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, a smart wearable device, etc.
[0128] The image processing method provided in the present application can process images in a video, and can fade spots, acne marks, pimples, moles, etc. existing on the face of a face image included in a video frame. For example, by skin grinding, the color of spots, acne marks, etc. existing on the face is made close to the skin color of the face, thereby achieving the effect of removing spots and acne marks on the face in the video. The video to be processed can be a complete video file, or a video being recorded by a terminal through a camera. That is, the image processing method provided in the present application can be used in the process of video shooting, such as shooting a short video, broadcasting a live broadcast on the Internet, and can also be used for post-processing of a video.
[0129] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present application. Figure 1 , the embodiment comprises:
[0130] Step 101: Obtain a first position for target processing in an input first video frame, and perform target processing on an image at the first position in the first video frame.
[0131] Among them, the target processing can be skin smoothing, whitening, etc. of the image at the first position, and the color value displayed by the image at the first position can be close to the color value displayed by the images around the first position, so as to achieve the effect of fading or eliminating the spots, acne, etc. corresponding to the first position in the face image.
[0132] In implementation, when processing the spots, acne marks, etc. on the face in the video, the video screen can be displayed on the screen of the terminal first. For example, when the anchor is broadcasting live, the video screen of his live broadcast is displayed on the screen, or when the user is shooting a short video, the video screen shot by the user is displayed on the screen, or when the video is post-processed, a preview of the video to be processed can be displayed. Then the user can select the video frame (i.e., the first video frame) displayed on the current screen to include the location of the spots and acne marks in the face image. The user can click on the location where the spots and acne marks exist. After clicking, the terminal can record the location clicked by the user as the first location for target processing, and then target processing is performed on the image at the first location. Of course, there can be multiple locations clicked by the user, that is, there can be multiple first locations for target processing. When there are multiple first locations for target processing, the terminal can perform target processing on the images at the first locations respectively. In addition, the terminal can use the existing spot and acne recognition algorithm to identify the position of spots, acne marks, etc. in the face image in the first video frame, and then display a confirmation option. The user can click the confirmation option to confirm that there is no problem with the position identified by the recognition algorithm. If there is a problem, the user can also delete or change the problematic position, or manually add the first position for target processing again. In this way, by allowing the user to select the corresponding position of spots, acne marks, etc., the processing of spots, acne marks, etc. can be made more flexible, and the user can implement customized processing. It can also improve the accuracy of processing spots, acne marks, etc. in the image.
[0133] Optionally, after determining the first position for target processing, the user may also determine the range for target processing. The process is as follows: obtaining the image processing range corresponding to the input first position; and performing target processing on the image within the image processing range corresponding to the first position in the first video frame.
[0134] In implementation, the user can customize the processing range for processing spots, acne marks, etc. For example, the range for target processing can be an image covered by a circle with the first position as the dot. The range for target processing is determined by adjusting the radius of the circle with the first position as the dot. For example, the user can enter a value for the radius, or display an adjustment box on the display page of the current terminal, in which an adjustment progress bar for adjusting the radius size is provided, and the user can drag the adjustment progress bar in the adjustment box to adjust the radius of the circle.
[0135] Optionally, target processing of the image at the first position includes: determining an image processing range corresponding to the position where the target processing is performed; determining at least one triangular processing area divided by a rendering algorithm included in the image processing range; determining pixels to be processed in at least one triangular processing area based on positions of vertices of at least one triangular processing area, and performing target processing on the pixels to be processed.
[0136] In implementation, the image processing range can be an image covered by a circle with the first position as the dot, and the size of the corresponding radius can be preset by a technician or manually set by a user. Before performing target processing, the face image can be divided into multiple triangular facets (i.e., triangular processing areas) in advance according to the positions of the facial feature points in the face image of the first video frame by an OpenGL algorithm (rendering algorithm). When performing target processing, the positions of the vertices of at least one triangular facet covered by the image processing range in the first video frame can be determined to determine the pixels to be processed in the first video frame. The pixels included in the triangular facet. Then, according to the existing skin grinding algorithm or whitening algorithm, the pixels included in each triangular facet can be processed respectively to obtain the processed pixels, and then the processed pixels are rendered and displayed on the user's terminal screen by the OpenGL algorithm. The image displayed on the user's terminal screen is the image after processing, that is, the effect of eliminating or fading the spots and acnes at the user-selected position is achieved in the first video frame.
[0137] Step 102: Determine relative position information between the position of the facial feature point in the first video frame and the first position.
[0138] In implementation, after the terminal obtains the first position in the first video frame, the facial feature points in the face image in the first video frame can be obtained. Since the position of the facial feature points in the face will not change, and the position of the spots, acne marks, etc. clicked by the user will not change in the face, the facial feature points can be used as the position reference point of the first position (i.e., the target facial feature points), and then the relative position information of the position of the target facial feature points and the first position is determined. In this way, in the video frames after the first video frame, the position corresponding to the first position in the first video frame, i.e., the position corresponding to the spots, acne marks, etc. in the video frame can be determined through the position and relative position information of the target facial feature points.
[0139] The process of determining the relative position information between the position of the target facial feature point and the first position may be as follows:
[0140] The first video frame is input into a preset face recognition model to obtain the positions of multiple facial feature points in the first video frame; the distances between the positions of the multiple facial feature points and the first position are determined, and based on the distances between the positions of the multiple facial feature points and the first position, a preset number of target facial feature points closest to the first position are determined; the distance vectors between the positions of a preset number of target facial feature points in the first video frame and the first position are determined to obtain relative position information.
[0141] In implementation, the first video frame can be first input into a preset face recognition model, and the face recognition model outputs the positions of multiple facial feature points corresponding to the face in the first video frame in the first image. The positions can be two-dimensional coordinates in the coordinate system corresponding to the first video frame, and the coordinate system corresponding to the first video frame can be a coordinate system with the upper left corner of the first video frame as the origin. Facial feature points can be key points in the face, such as the corners of the eyes, the corners of the mouth, the tip of the nose, the contour points, etc., which can be approximately evenly distributed in the face image. Then, the distances of the multiple facial feature points from the first position can be determined based on the positions of the multiple facial feature points in the first image, and then the preset number of facial feature points from the first position are used as target facial feature points. The preset number can be set by the technician, and can be one or more, and the value of the preset number is not limited here. Figure 2 As shown, after the user determines the first position corresponding to the color spot, the facial feature points A1, B1, C1, and D1 closest to the first position can be used as target facial feature points. Finally, the distance vectors between the target facial feature points and the first position can be determined respectively, that is, the difference between the coordinates of the target facial feature points in the coordinate system corresponding to the first video frame and the coordinates of the first position in the coordinate system corresponding to the first video frame, and the obtained preset number of distance vectors can be determined as relative position information.
[0142] Step 103, based on the positions of the facial feature points in the first video frame and the positions of the facial feature points in the second video frame, the relative position information is adjusted to obtain adjusted relative position information, and based on the adjusted relative position information and the positions of the facial feature points in the second video frame, a second position for target processing is determined in the second video frame.
[0143] In implementation, when the video plays to the next video frame after the first video frame, i.e., the second video frame, it can be determined whether the facial image is scaled based on the positions of the facial feature points of the facial image in the second video frame and the positions of the facial feature points of the facial image in the first video frame. If scaling is present, the relative position information can be adjusted accordingly, and then the second position in the second video frame that needs to be target processed and corresponds to the first position is determined based on the adjusted relative position information and the positions of the facial feature points of the facial image in the second video frame, i.e., the positions of spots, acne marks, etc. in the second video frame.
[0144] The corresponding processing for determining the adjusted relative position information can be as follows: input the second video frame into a preset face recognition model to obtain the positions of multiple facial feature points in the second video frame; based on the positions of the multiple facial feature points in the second video frame and the positions of the multiple facial feature points in the first video frame, determine the scaling factor of the facial image in the first video frame and the facial image in the second video frame; multiply the scaling factor by the distance vectors corresponding to a preset number of target facial feature points, to obtain the distance vectors corresponding to a preset number of adjusted target facial feature points.
[0145] In implementation, after obtaining the second video frame, the second video frame can be first input into a preset face recognition model, and the face recognition model outputs the positions of the multiple facial feature points corresponding to the face in the second video frame in the second image, which can be two-dimensional coordinates in the coordinate system corresponding to the second video frame, and the coordinate system corresponding to the second video frame can be a coordinate system with the upper left corner of the second video frame as the origin. Then determine the positions of the preset number of target facial feature points determined in step 102 in the second video frame. Since the facial image may be scaled in the first video frame and the second video frame, that is, the distance between the face and the camera may be inconsistent, resulting in inconsistent sizes of the facial images in the two video frames. Therefore, the positions of the multiple facial feature points in the first video frame can be compared with the positions of the multiple facial feature points in the second video frame to obtain the scaling coefficient of the facial image. After obtaining the scaling coefficient of the facial image, the scaling coefficient can be multiplied by the relative position information to obtain the adjusted relative position information, that is, the scaling coefficient is multiplied by the distance vectors corresponding to the preset number of target facial feature points to obtain the distance vectors corresponding to the preset number of adjusted target facial feature points.
[0146] Among them, determining the scaling coefficient of the face image in the first video frame and the face image in the second video frame can be obtained by the following steps: determining a first face width of the face image in the first video frame based on the positions of multiple face feature points in the first video frame, and determining a second face width of the face image in the second video frame based on the positions of multiple face feature points in the second video frame; determining the ratio of the second face width to the first face width as the first scaling ratio; determining the second scaling ratio based on the area of the face image at the first position in the first video frame, and the ratio of the distance from the center point of the face image in the second video frame to the left edge of the face image to the distance from the center point of the face image to the right edge of the face image; and determining the product of the first scaling ratio and the second scaling ratio as the scaling coefficient of the face image in the first video frame and the face image in the second video frame.
[0147] In implementation, the first face width of the face image in the first video frame and the second face width of the face image in the second video frame can be determined respectively according to the positions of the leftmost face feature point and the rightmost face feature point among the multiple face feature points in the first video frame and the second video frame. Then, the scaling ratio of the face in the two video frames is determined by the ratio of the first face width to the second face width, that is, the corresponding first scaling ratio is obtained. Since the face image in the video frame may be rotated in addition to scaling, for example, after the face rotates to the left, the right face will become relatively larger. Therefore, the relative rotation angle of the face image in the second video frame can also be determined by the distance between the center point of the face image in the second video frame and the left edge of the face image and the distance between the center point of the face image and the right edge of the face image, that is, when the distance between the center point of the face image and the left edge of the face image is shorter, the face image in the current second video frame is relatively rotated to the left, and when the distance between the center point of the face image and the right edge of the face image is shorter, the face image in the current second video frame is relatively rotated to the right. Therefore, the second zoom ratio can be determined by the ratio of the distance from the center point of the face image in the second video frame to the left edge of the face image to the distance from the center point of the face image to the right edge of the face image. The center point of the face image can be the geometric center point of the face image determined based on the face contour in the face image, or it can be the center point set among the corresponding multiple facial feature points in the face image, such as the nose tip point. The distance from the center point of the face image to the left edge of the face image can be determined by the distance from the center point to the leftmost feature point among the multiple facial feature points in the second video frame, and the distance from the center point of the face image to the right edge of the face image can be determined by the distance from the center point to the rightmost feature point among the multiple facial feature points in the second video frame. Among them, if the second position is located in the left face of the face image, the ratio of the distance from the center point of the face image in the second video frame to the left edge of the face image to the distance from the center point of the face image to the right edge of the face image can be used as the second scaling ratio, and if the second position is located in the right face of the face image, the inverse of the ratio of the distance from the center point of the face image in the second video frame to the right edge of the face image to the distance from the center point of the face image to the left edge of the face image can be used as the second scaling ratio. After obtaining the first scaling ratio and the second scaling ratio, the scaling coefficient of the face image in the first video frame and the face image in the second video frame can be determined according to the product of the first scaling ratio and the second scaling ratio.
[0148] In addition, the scaling factor of the face image in the first video frame and the face image in the second video frame can also be determined by the area of the face image in the first video frame and the area of the face image in the second video frame. For example, the ratio of the area of the face image in the first video frame to the area of the face image in the second video frame is determined as the scaling factor. Alternatively, the positions of multiple facial feature points corresponding to the face image in the first video frame in the first video frame and the positions of multiple facial feature points corresponding to the face image in the second video frame in the second video frame are input into a pre-trained scaling factor determination model, and the pre-trained scaling factor determination model outputs the corresponding scaling factor.
[0149] Optionally, based on the adjusted relative position information and the position of the facial feature point in the second video frame, the process of determining the second position for target processing in the second video frame may be as follows:
[0150] According to the distances between the positions of a preset number of target facial feature points and the first position, a position calculation weight of each target feature point is determined, wherein the longer the distance between each target feature point and the first position, the smaller the corresponding position calculation weight; the distance vector corresponding to each adjusted target facial feature point is added to the position of the corresponding target facial feature point in the second video frame to obtain a preset number of initial second positions, the preset number of initial second positions and the corresponding position calculation weights are multiplied and summed to obtain the second position for target processing in the second video frame.
[0151] In implementation, since the face image may be scaled in the first video frame and the second video frame, the distance vector corresponding to each target feature point may be multiplied by the scaling factor to obtain the distance vector after scaling, and then the position of each target feature point may be added to the corresponding distance vector after scaling to obtain the initial second position based on each target feature point as the position reference point. Then, the second position of the target processing may be finally performed based on the obtained multiple initial second positions. For example, multiple initial second positions may be added and then averaged to obtain the second position.
[0152] The position calculation weight of each target feature point can also be determined by comparing the distance between the position of the target facial feature point and the first position. Since the target facial feature point that is farther from the first position has a lower correlation with the first position, when calculating the second position based on the initial second position determined based on the target facial feature point that is farther from the first position, the corresponding position calculation weight can be reduced, that is, the longer the distance between the target feature point and the first position, the smaller the corresponding position calculation weight. For example, the reciprocal of the distance between each target feature point and the first position can be summed to obtain a sum value, and then the reciprocal of the distance between each target feature point and the first position can be divided by the sum value to obtain the position calculation weight corresponding to each target feature point. Then, the initial second position obtained based on each target facial feature point can be multiplied by the corresponding position calculation weight, and then summed to obtain the second position.
[0153] After summing the positions of a preset number of target facial feature points in the second video frame with the corresponding distance vectors respectively, a preset number of initial second positions are obtained, and the preset number of initial second positions are multiplied and summed with the corresponding position calculation weights to obtain the second position for target processing in the second video frame.
[0154] Since the face displayed in the video does not necessarily always show the front of the face, when the display angle of the face in the video changes, that is, the face rotates in the video, and the rotation angle is too large, there may be a certain error in determining the second position only based on the relative position information. Therefore, the embodiment of the present application also provides a solution for adjusting the second position, and determines the corresponding second position adjustment value by the face rotation angle between video frames. The corresponding processing is as follows:
[0155] Determine a first face rotation angle corresponding to the face image in the first video frame, a second face rotation angle corresponding to the face image in the second video frame, and a distance between the second position and the center point of the face image in the second video frame; determine a second position adjustment value based on the first face rotation angle, the second face rotation angle, and the distance between the center point of the face image in the second video frame; determine an adjusted second position based on the second position and the second position adjustment value; and perform target processing on the image at the adjusted second position in the second video frame.
[0156] In implementation, the first video frame is input into a preset face recognition model, and the face recognition model can also output the face rotation angle (i.e., the first face rotation angle) corresponding to the face image in the first video frame. Similarly, the second video frame is input into a preset face recognition model, and the face recognition model can also output the face rotation angle (i.e., the second face rotation angle) corresponding to the face image in the second video frame. Then, the distance between the second position and the center point of the face image in the second video frame can be determined, wherein the center point of the face image can be the geometric center point of the face image determined based on the face contour in the face image, or it can be the center point set among the corresponding multiple face feature points in the face image, such as the tip of the nose. Then, the second position adjustment value is calculated using the first face rotation angle, the second face rotation angle, and the distance from the center point of the face image in the second video frame. The corresponding calculation formula can be as follows:
[0157]
[0158] Among them, θ new is the rotation angle of the second face, θ old is the rotation angle of the first face, D is the distance from the center point of the face image in the second video frame, and Θ is a preset coefficient.
[0159] After obtaining the second position adjustment value, the coordinates of the second position can be added with the second position adjustment value to obtain the adjusted second position, for example, the horizontal and vertical coordinates of the coordinates of the second position are added with the second position adjustment value. Target processing can be performed on the adjusted second position later.
[0160] Step 104: perform target processing on the image at the second position in the second video frame.
[0161] After determining the second position, the target processing can be performed on the image at the second position. The image processing range (first processing range) corresponding to the first position mentioned in the above step 101 can be adjusted accordingly according to the change of the face image in the first video frame and the second video frame when processing the second position, and the adjusted image processing range (second processing range) is obtained. Then, the target processing is performed on the image at the second position according to the adjusted image processing range. The corresponding steps are as follows:
[0162] Based on the positions of multiple facial feature points in the first video frame, a first face width of the face image in the first video frame is determined, and based on the positions of multiple facial feature points in the second video frame, a second face width of the face image in the second video frame is determined; the ratio of the second face width to the first face width is determined as a first scaling ratio; based on the area of the face image at the first position in the second video frame, and the ratio of the distance from the center point of the face image in the second video frame to the left edge of the face image to the distance from the center point of the face image to the right edge of the face image, a second scaling ratio is determined; based on the first scaling ratio and the second scaling ratio, an image processing range is adjusted to obtain an adjusted image processing range; and target processing is performed on an image within the adjusted image processing range corresponding to the second position in the second video frame.
[0163] In implementation, the first face width of the face image in the first video frame and the second face width of the face image in the second video frame can be determined according to the leftmost face feature point and the rightmost face feature point among the multiple face feature points, and the corresponding positions in the first video frame and the second video frame. Then, the scaling ratio of the face in the two video frames is determined by the ratio of the first face width and the second face width, that is, the corresponding first scaling ratio is obtained. Since the face image in the video frame may be rotated in addition to scaling, for example, after the face rotates to the left, the right face will become relatively larger. Therefore, the relative rotation angle of the face image in the second video frame can also be determined by the distance between the center point of the face image in the second video frame and the left edge of the face image and the distance between the center point of the face image and the right edge of the face image, that is, when the distance between the center point of the face image and the left edge of the face image is shorter, the face image in the current second video frame is relatively rotated to the left, and when the distance between the center point of the face image and the right edge of the face image is shorter, the face image in the current second video frame is relatively rotated to the right. Therefore, the second zoom ratio can be determined by the ratio of the distance from the center point of the face image in the second video frame to the left edge of the face image to the distance from the center point of the face image to the left edge of the face image. The center point of the face image can be the geometric center point of the face image determined based on the face contour in the face image, or it can be the center point set among the corresponding multiple facial feature points in the face image, such as the nose tip point. The distance from the center point of the face image to the left edge of the face image can be determined by the distance from the center point to the leftmost feature point among the multiple facial feature points in the second video frame, and the distance from the center point of the face image to the right edge of the face image can be determined by the distance from the center point to the rightmost feature point among the multiple facial feature points in the second video frame. Among them, if the second position is located in the left face of the face image, the ratio of the distance from the center point of the face image in the second video frame to the left edge of the face image to the distance from the center point of the face image to the right edge of the face image can be used as the second scaling ratio; if the second position is located in the right face of the face image, the inverse of the ratio of the distance from the center point of the face image in the second video frame to the right edge of the face image to the distance from the center point of the face image to the left edge of the face image can be used as the second scaling ratio.
[0164] After obtaining the first scaling ratio and the second scaling ratio, the first scaling ratio and the second scaling ratio may be multiplied, and the image processing range may be adjusted according to the obtained product to obtain the adjusted image processing range. For example, the image processing range is a circular area with the second position as the center, and the radius of the circular area corresponding to the second position may be obtained by multiplying the obtained product by the radius of the circular area corresponding to the first position. Then, target processing may be performed on the image within the adjusted image processing range corresponding to the second position in the second video frame.
[0165] Optionally, target processing of the image at the second position includes: determining an image processing range corresponding to the position where the target processing is performed; determining at least one triangular processing area divided by a rendering algorithm included in the image processing range; determining pixels to be processed in at least one triangular processing area based on positions of vertices of at least one triangular processing area, and performing target processing on the pixels to be processed.
[0166] In implementation, the image processing range can be an image covered by a circle with the second position as the dot, and the size of the corresponding radius can be preset by a technician or manually set by a user. Before performing target processing, the face image can be divided into multiple triangular facets (i.e., triangular processing areas) in advance according to the positions of the facial feature points in the face image of the second video frame by an OpenGL algorithm (rendering algorithm). When performing target processing, the positions of the vertices of at least one triangular facet covered by the image processing range in the second video frame can be determined to determine the pixels to be processed in the second video frame. The pixels included in the triangular facet. Then, according to the existing skin grinding algorithm or whitening algorithm, the pixels included in each triangular facet can be processed respectively to obtain the processed pixels, and then the processed pixels are rendered and displayed on the user's terminal screen by the OpenGL algorithm. The image displayed on the user's terminal screen is the image after processing, that is, the effect of eliminating or fading the spots and acnes selected by the user is achieved in the second video frame.
[0167] In the embodiment of the present application, the user inputs the first position of the spots, acnes, etc. in the first video frame, and then determines the relative position information between the first position and the target facial feature points in the first video frame, and then determines the second position of the spots, acnes, etc. in the second video frame based on the relative position information and the target facial feature points in the video frame after the first video frame (i.e., the second video frame), and processes the image at the second position. Since the first position of the acne and acne removal process in the video frame is obtained based on the position input of the spots, acnes, etc. in the first video frame, and the second position of the acne and acne removal process is determined based on the first position, the present application can be used to perform acne and acne removal processes on one or more specified spots and acnes, which can improve the flexibility of the acne and acne removal process.
[0168] Figure 3 is a flowchart of an image processing method provided by an embodiment of the present application. Figure 3 , the embodiment comprises:
[0169] Step 301: Display the first video frame.
[0170] During implementation, when processing spots, acne marks, etc. on the face in the video, the video to be processed can be displayed on the screen of the terminal first, and the user can determine the corresponding positions of spots, acne marks, etc. in the face image based on the face image in the currently displayed video frame (first video frame).
[0171] Step 302: When a selection operation on a first spot position corresponding to a face image in a first video frame is detected, target processing is performed on the image at the first spot position in response to the selection operation.
[0172] Among them, the selection operation can be a click operation, the target processing can be a skin resurfacing processing, and the target processing of the image at the first spot position can be a circular area with the first spot position as the center and determined according to a preset radius value, and the skin resurfacing processing is performed on the image within the circular area.
[0173] In implementation, after determining the area corresponding to the spots, acne marks, etc. in the face image in the currently displayed video frame, the user can perform a selection operation on the corresponding position to select the spots, acne marks, etc. that need to be processed, such as clicking on the spots, acne marks, etc. in the face image by means of a mouse or touch. After the terminal detects the user's selection operation on the currently displayed video frame, it can determine the position clicked by the user in the currently displayed video frame as the first spot position for skin resurfacing. After determining the first spot position, the terminal can perform skin resurfacing on the image of the circular area corresponding to the first spot position according to the existing skin resurfacing algorithm, that is, perform skin resurfacing on the spots and acne marks selected by the user in the face image in the currently displayed video frame, so as to achieve the effect of eliminating or fading the spots and acne marks selected by the user in the face image.
[0174] Optionally, the user can adjust the preset radius, that is, the radius of the circular area, and the corresponding processing is as follows: in response to the selection operation, a radius adjustment window is displayed, and a radius adjustment progress bar and a confirmation option are displayed in the radius adjustment window; when a drag operation of the radius adjustment progress bar is detected, in response to the drag operation of the radius adjustment progress bar, a circular area with the first spot position as the center and the radius value corresponding to the drag progress of the current radius adjustment progress bar is displayed at the first spot position; when a click operation of the confirmation option is detected, the radius value corresponding to the drag progress of the current radius adjustment progress bar is determined as the preset radius value.
[0175] In implementation, after the user selects the spots, acne marks, etc. that need to be smoothed in the face image of the currently displayed video frame, a radius adjustment window can be displayed in the display interface of the terminal, and the user can adjust the size of the preset radius through the radius adjustment window. A radius adjustment progress bar and a confirmation option can be set in the radius adjustment window. Figure 4As shown, when the user drags the radius adjustment progress bar, a circular area with the first spot position as the center and the radius value corresponding to the drag progress of the current radius adjustment progress bar as the radius can be displayed in the terminal. When the user drags the radius adjustment progress bar back and forth, the size of the corresponding circular area can change with the back and forth change of the drag progress of the radius adjustment progress bar. The user can adjust the size of the area to be resurfaced (i.e., the currently displayed circular area) to an appropriate size and click the OK option. After detecting that the user clicks the OK option, the terminal can determine the radius value corresponding to the drag progress of the current radius adjustment progress bar as the preset radius value.
[0176] Step 303: Acquire a second video frame to be displayed, perform target processing on an image at a second spot position in the second video frame that has moved relative to the first spot position, and display the second video frame after the target processing.
[0177] In implementation, when the terminal displays other video frames (i.e., the second video frame) after the first video frame, the spot position in the face image in the second video frame may move, and the second spot position in the second video frame can be determined based on the first spot position in the first video frame, that is, the position of the color spot, acne mark, etc. selected by the user in the second video frame is determined. Then, the image at the second spot position in the second video frame is subjected to skin smoothing processing, so as to achieve the effect of eliminating or fading the color spot, acne mark, etc. selected by the user in the face image in the video frame after the first video frame.
[0178] The process of determining the second spot position in the second video frame according to the first spot position in the first video frame is the same as the process of determining the second position according to the first position in the above step 103, and will not be repeated here.
[0179] In the embodiment of the present application, the user inputs the first position of the spots, acnes, etc. in the first video frame, and then determines the relative position information between the first position and the target facial feature points in the first video frame, and then determines the second position of the spots, acnes, etc. in the second video frame based on the relative position information and the target facial feature points in the video frame after the first video frame (i.e., the second video frame), and processes the image at the second position. Since the first position of the acne and acne removal process in the video frame is obtained based on the position input of the spots, acnes, etc. in the first video frame, and the second position of the acne and acne removal process is determined based on the first position, the present application can be used to perform acne and acne removal processes on one or more specified spots and acnes, which can improve the flexibility of the acne and acne removal process.
[0180] Figure 5 is a flowchart of an image processing method provided by an embodiment of the present application. Figure 5 , the embodiment comprises:
[0181] Step 501: Acquire a first video frame, perform spot recognition processing on the first video frame, and determine a spot area existing in a face image of the first video frame.
[0182] Step 502: Display the first video frame and the area mark corresponding to the spot area in the face image in the first video frame.
[0183] In implementation, when processing spots, acne marks, etc. on the face of a person in a video, the terminal can perform spot recognition processing on the first video frame currently displayed according to an existing recognition algorithm to determine that there is a spot area in the face image in the first video frame. Then, a region mark can be displayed at a position corresponding to the spot area, such as Figure 6 As shown, the area mark may be a circle covering the spot area to prompt the user the location of the currently identified spots, acne marks, etc. in the first video frame.
[0184] Step 503: when a selection operation on a target region mark corresponding to at least one region mark is detected, in response to the selection operation, a first spot position corresponding to the target region mark is acquired, and target processing is performed on an image at the first spot position in a first video frame.
[0185] In implementation, the user can perform a selection operation in the currently displayed area mark, and select at least one color spot, acne mark, etc. that needs to be processed in the face image. The selection operation can be to click on the area mark corresponding to the color spot or acne mark that needs to be processed in the face image. When the terminal detects the user's selection operation, the position of the target area mark selected by the user can be determined as the first spot position that needs to be resurfaced. After determining the first spot position, the terminal can perform resurfacing processing on the image at the first spot position according to the existing resurfacing algorithm, that is, resurfacing processing is performed on the color spot or acne mark selected by the user in the face image in the currently displayed video frame, so as to achieve the effect of eliminating or fading the color spot or acne mark selected by the user in the face image.
[0186] Step 504: Acquire a second video frame to be displayed, perform skin smoothing processing on an image at a second spot position in the second video frame that has moved relative to the first spot position, and display the second video frame after the target processing.
[0187] In implementation, when the terminal displays other video frames (i.e., the second video frame) after the first video frame, the spot position in the face image in the second video frame may move, and the second spot position in the second video frame can be determined based on the first spot position in the first video frame, that is, the position of the color spot, acne mark, etc. selected by the user in the second video frame is determined. Then, the image at the second spot position in the second video frame is subjected to skin smoothing processing, so as to achieve the effect of eliminating or fading the color spot, acne mark, etc. selected by the user in the face image in the video frame after the first video frame.
[0188] The process of determining the second spot position in the second video frame according to the first spot position in the first video frame is the same as the process of determining the second position according to the first position in the above step 103, and will not be repeated here.
[0189] In the embodiment of the present application, the user inputs the first position of the spots, acnes, etc. in the first video frame, and then determines the relative position information of the first position and the target facial feature points in the first video frame, and then determines the second position of the spots, acnes, etc. in the second video frame based on the relative position and the target facial feature points in the video frame after the first video frame (i.e., the second video frame), and processes the image at the second position. Since the first position of the acne and acne removal process in the video frame is obtained based on the position input of the spots, acnes, etc. in the first video frame, and the second position of the acne and acne removal process is determined based on the first position, the present application can be used to perform acne and acne removal processes on one or more specified spots and acnes, which can improve the flexibility of the acne and acne removal process.
[0190] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0191] Figure 7 An image processing device provided in an embodiment of the present application, which may be a terminal in the above embodiment, includes:
[0192] An acquisition module 710 is used to acquire a first position for target processing in an input first video frame;
[0193] A first determination module 720, configured to determine relative position information between a position of a target facial feature point in the first video frame and the first position;
[0194] A second determination module 730 is used to adjust the relative position information based on the positions of the facial feature points in the first video frame and the positions of the facial feature points in the second video frame to obtain adjusted relative position information, and determine a second position for performing the target processing in the second video frame based on the adjusted relative position information and the positions of the facial feature points in the second video frame;
[0195] The processing module 740 is used to perform the target processing on the image at the first position in the first video frame, and to perform the target processing on the image at the second position in the second video frame.
[0196] Optionally, the first determining module 720 is used to
[0197] Inputting the first video frame into a preset face recognition model to obtain positions of multiple facial feature points in the first video frame;
[0198] Determine the distances between the positions of the plurality of facial feature points and the first position, and determine a preset number of target facial feature points closest to the first position based on the distances between the positions of the plurality of facial feature points and the first position;
[0199] Determine the distance vectors between the positions of the preset number of target facial feature points in the first video frame and the first position respectively, and obtain relative position information.
[0200] Optionally, the second determining module 730 is configured to:
[0201] Inputting the second video frame into the preset face recognition model to obtain positions of multiple facial feature points in the second video frame;
[0202] Determining a scaling factor of the face image in the first video frame and the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame and the positions of the plurality of face feature points in the first video frame;
[0203] The scaling coefficients are multiplied by the distance vectors corresponding to the preset number of target facial feature points to obtain the distance vectors corresponding to the preset number of adjusted target facial feature points.
[0204] Optionally, the second determination module 730 is configured to: determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio;
[0205] Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image;
[0206] The product of the first scaling ratio and the second scaling ratio is determined as a scaling ratio coefficient of the face image in the first video frame and the face image in the second video frame.
[0207] Optionally, the second determination module 730 is used to: determine the position calculation weight of each target feature point according to the distances between the positions of the preset number of target facial feature points and the first position, wherein the farther the distance between each target feature point and the first position is, the smaller the corresponding position calculation weight is;
[0208] The distance vector corresponding to each adjusted target facial feature point is added to the position of the corresponding target facial feature point in the second video frame to obtain a preset number of initial second positions, and the preset number of initial second positions are multiplied and summed with the corresponding position calculation weights to obtain the second position for the target processing in the second video frame.
[0209] Optionally, the device further includes a third determining module, configured to:
[0210] Determine a first face rotation angle corresponding to the face image in the first video frame, a second face rotation angle corresponding to the face image in the second video frame, and a distance between the second position and a center point of the face image in the second video frame;
[0211] The processing module 740 is used to:
[0212] Determining a second position adjustment value based on the first face rotation angle, the second face rotation angle, and the distance from the center point of the face image in the second video frame;
[0213] Determining an adjusted second position based on the second position and the second position adjustment value;
[0214] The target processing is performed on the image at the second position after the adjustment in the second video frame.
[0215] Optionally, the acquisition module is further used to: acquire an image processing range corresponding to the input first position;
[0216] The processing module 740 is used to:
[0217] Perform the target processing on the image within the image processing range corresponding to the first position in the first video frame;
[0218] The processing module 740 is used to:
[0219] Determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio;
[0220] Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image;
[0221] Adjusting the image processing range based on the first scaling ratio and the second scaling ratio to obtain an adjusted image processing range;
[0222] The target processing is performed on the image within the adjusted image processing range corresponding to the second position in the second video frame.
[0223] Optionally, the processing module 740 is used to:
[0224] Determine an image processing range corresponding to a position where the target processing is performed;
[0225] Determine at least one triangle processing area included in the image processing range and divided by a rendering algorithm;
[0226] Based on the positions of the vertices of the at least one triangular processing area, pixels to be processed in the at least one triangular processing area are determined, and the target processing is performed on the pixels to be processed.
[0227] Figure 8 An image processing device provided in an embodiment of the present application, which may be a terminal in the above embodiment, includes:
[0228] A display module 810, configured to display a first video frame;
[0229] The processing module 820 is configured to, when a selection operation on a first spot position corresponding to the face image in the first video frame is detected, perform target processing on the image at the first spot position in response to the selection operation; obtain a second video frame to be displayed, and perform target processing on the image at a second spot position in the second video frame that has moved relative to the first spot position;
[0230] The display module 810 is used to display the second video frame after the target processing.
[0231] Optionally, the selection operation is a click operation, the target processing is a skin resurfacing processing, and the processing module 820 is used to:
[0232] A circular area is determined with the first spot position as the center and according to a preset radius value, and a skin resurfacing process is performed on the image within the circular area.
[0233] Optionally, the device further includes a determining module 830, configured to:
[0234] In response to the selected operation, displaying the radius adjustment window, and displaying a radius adjustment progress bar and a confirmation option in the radius adjustment window;
[0235] When a drag operation of the radius adjustment progress bar is detected, in response to the drag operation of the radius adjustment progress bar, a circular area with the first spot position as the center and a radius value corresponding to the drag progress of the current radius adjustment progress bar is displayed at the first spot position;
[0236] When a click operation of the confirmation option is detected, the radius value corresponding to the dragging progress of the current radius adjustment progress bar is determined as the preset radius value.
[0237] Fig. 9 An image processing device provided in an embodiment of the present application, which may be a terminal in the above embodiment, includes:
[0238] The processing module 910 is used to obtain a first video frame, perform spot recognition processing on the first video frame, and determine a spot area existing in the face image of the first video frame;
[0239] A display module 920, configured to display the first video frame and a region mark corresponding to a spot region in the face image in the first video frame;
[0240] The processing module 910 is configured to, when a selection operation of a target area mark corresponding to the at least one area mark is detected, obtain a first spot position corresponding to the target area mark in response to the selection operation, and perform target processing on an image at the first spot position in the first video frame; obtain a second video frame to be displayed, and perform skin resurfacing processing on an image at a second spot position in the second video frame that has moved relative to the first spot position;
[0241] The display module 920 is used to display the second video frame after the target processing.
[0242] It should be noted that: the image processing device provided in the above embodiment only uses the division of the above functional modules as an example for image processing. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the image processing device provided in the above embodiment and the image processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0243] Fig.10 The structure block diagram of a terminal 1000 provided by an exemplary embodiment of the present application is shown. The terminal 1000 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, a laptop computer or a desktop computer. The terminal 1000 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0244] Typically, the terminal 1000 includes a processor 1001 and a memory 1002 .
[0245] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0246] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one instruction, which is used to be executed by the processor 1001 to implement the image processing method provided in the method embodiment of the present application.
[0247] In some embodiments, the terminal 1000 may also optionally include: a peripheral device interface 1003 and at least one peripheral device. The processor 1001, the memory 1002 and the peripheral device interface 1003 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1003 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1004, a touch display screen 1005, a camera 1006, an audio circuit 1007, a positioning component 1008 and a power supply 1009.
[0248] The peripheral device interface 1003 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, and the peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, and the peripheral device interface 1003 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0249] The radio frequency circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1004 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1004 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 1004 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1004 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0250] The display screen 1005 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1005 is a touch display screen, the display screen 1005 also has the ability to collect touch signals on the surface or above the surface of the display screen 1005. The touch signal can be input to the processor 1001 as a control signal for processing. At this time, the display screen 1005 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1005 can be one, and the front panel of the terminal 1000 is set; in other embodiments, the display screen 1005 can be at least two, which are respectively set on different surfaces of the terminal 1000 or are folded; in some other embodiments, the display screen 1005 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 1000. Even, the display screen 1005 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1005 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0251] The camera assembly 1006 is used to capture images or videos. Optionally, the camera assembly 1006 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1006 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0252] The audio circuit 1007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1001 for processing, or input them into the radio frequency circuit 1004 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1000. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1007 may also include a headphone jack.
[0253] The positioning component 1008 is used to locate the current geographical location of the terminal 1000 to implement navigation or LBS (Location Based Service). The positioning component 1008 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0254] The power supply 1009 is used to power various components in the terminal 1000. The power supply 1009 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1009 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0255] In some embodiments, the terminal 1000 further includes one or more sensors 1010 , including but not limited to: an acceleration sensor 1011 , a gyroscope sensor 1012 , a pressure sensor 1013 , a fingerprint sensor 1014 , an optical sensor 1015 , and a proximity sensor 1016 .
[0256] The acceleration sensor 1011 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 1000. For example, the acceleration sensor 1011 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1001 can control the touch display screen 1005 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1011. The acceleration sensor 1011 can also be used for collecting game or user motion data.
[0257] The gyro sensor 1012 can detect the body direction and rotation angle of the terminal 1000, and the gyro sensor 1012 can cooperate with the acceleration sensor 1011 to collect the user's 3D actions on the terminal 1000. The processor 1001 can implement the following functions based on the data collected by the gyro sensor 1012: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0258] The pressure sensor 1013 can be set on the side frame of the terminal 1000 and / or the lower layer of the touch display screen 1005. When the pressure sensor 1013 is set on the side frame of the terminal 1000, the user's holding signal of the terminal 1000 can be detected, and the processor 1001 performs left and right hand recognition or shortcut operations according to the holding signal collected by the pressure sensor 1013. When the pressure sensor 1013 is set on the lower layer of the touch display screen 1005, the processor 1001 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 1005. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0259] The fingerprint sensor 1014 is used to collect the user's fingerprint, and the processor 1001 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 1014, or the fingerprint sensor 1014 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 1001 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 1014 can be set on the front, back, or side of the terminal 1000. When a physical button or a manufacturer logo is set on the terminal 1000, the fingerprint sensor 1014 can be integrated with the physical button or the manufacturer logo.
[0260] The optical sensor 1015 is used to collect the ambient light intensity. In one embodiment, the processor 1001 can control the display brightness of the touch display screen 1005 according to the ambient light intensity collected by the optical sensor 1015. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1005 is reduced. In another embodiment, the processor 1001 can also dynamically adjust the shooting parameters of the camera assembly 1006 according to the ambient light intensity collected by the optical sensor 1015.
[0261] The proximity sensor 1016, also called a distance sensor, is usually arranged on the front panel of the terminal 1000. The proximity sensor 1016 is used to collect the distance between the user and the front of the terminal 1000. In one embodiment, when the proximity sensor 1016 detects that the distance between the user and the front of the terminal 1000 is gradually decreasing, the processor 1001 controls the touch display screen 1005 to switch from the screen-on state to the screen-off state; when the proximity sensor 1016 detects that the distance between the user and the front of the terminal 1000 is gradually increasing, the processor 1001 controls the touch display screen 1005 to switch from the screen-off state to the screen-on state.
[0262] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the terminal 1000, and the terminal 1000 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0263] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal to complete the image processing method in the above embodiment. The computer-readable storage medium can be non-transitory. For example, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
[0264] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0265] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a first position for target processing in an input first video frame, and perform the target processing on an image at the first position in the first video frame; Determine relative position information between the position of the facial feature point in the first video frame and the first position; Based on the positions of facial feature points in the first video frame and the positions of facial feature points in the second video frame, the relative position information is adjusted to obtain adjusted relative position information, and based on the adjusted relative position information and the positions of facial feature points in the second video frame, a second position for performing the target processing is determined in the second video frame; The target processing is performed on the image at the second position in the second video frame.
2. The method according to claim 1, characterized in that The determining the relative position information between the position of the facial feature point in the first video frame and the first position includes: Inputting the first video frame into a preset face recognition model to obtain positions of multiple facial feature points in the first video frame; respectively determining the distances between the positions of the plurality of facial feature points and the first position, and determining a preset number of target facial feature points closest to the first position based on the distances between the positions of the plurality of facial feature points and the first position; Determine the distance vectors between the positions of the preset number of target facial feature points in the first video frame and the first position respectively to obtain relative position information.
3. The method according to claim 2, characterized in that The adjusting the relative position information based on the position of the facial feature point in the first video frame and the position of the facial feature point in the second video frame to obtain the adjusted relative position information includes: Inputting the second video frame into the preset face recognition model to obtain positions of multiple facial feature points in the second video frame; Determining a scaling factor of the face image in the first video frame and the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame and the positions of the plurality of face feature points in the first video frame; The scaling coefficients are multiplied by the distance vectors corresponding to the preset number of target facial feature points to obtain the distance vectors corresponding to the preset number of adjusted target facial feature points.
4. The method according to claim 3, characterized in that The determining, based on the positions of the plurality of facial feature points in the second video frame and the positions of the plurality of facial feature points in the first video frame, a scaling factor of the facial image in the first video frame and the facial image in the second video frame comprises: Determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio; Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image; The product of the first scaling ratio and the second scaling ratio is determined as a scaling ratio coefficient of the face image in the first video frame and the face image in the second video frame.
5. The method according to claim 3, characterized in that: The determining, based on the adjusted relative position information and the position of the facial feature point in the second video frame, a second position for performing the target processing in the second video frame comprises: Determine a position calculation weight of each target facial feature point according to the distances between the positions of the preset number of target facial feature points and the first position, wherein the farther the distance between each target facial feature point and the first position is, the smaller the corresponding position calculation weight is; The distance vector corresponding to each adjusted target facial feature point is added to the position of the corresponding target facial feature point in the second video frame to obtain a preset number of initial second positions, and the preset number of initial second positions are multiplied and summed with the corresponding position calculation weights to obtain the second position for the target processing in the second video frame.
6. The method according to claim 1, characterized in that The method further comprises: Determine a first face rotation angle corresponding to the face image in the first video frame, a second face rotation angle corresponding to the face image in the second video frame, and a distance between the second position and a center point of the face image in the second video frame; The performing the target processing on the image at the second position in the second video frame includes: Determining a second position adjustment value based on the first face rotation angle, the second face rotation angle, and the distance from the center point of the face image in the second video frame; Determining an adjusted second position based on the second position and the second position adjustment value; The target processing is performed on the image at the second position after the adjustment in the second video frame.
7. The method according to claim 1, characterized in that The method further includes: acquiring an image processing range corresponding to the input first position; The performing the target processing on the image at the first position in the first video frame comprises: Perform the target processing on the image within the image processing range corresponding to the first position in the first video frame; The performing the target processing on the image at the second position in the second video frame includes: Determine a first face width of the face image in the first video frame based on the positions of the plurality of face feature points in the first video frame, determine a second face width of the face image in the second video frame based on the positions of the plurality of face feature points in the second video frame, and determine a ratio of the second face width to the first face width as a first scaling ratio; Determine a second scaling ratio based on an area of the first position in the face image in the first video frame, and a ratio of a distance from a center point of the face image in the second video frame to a left edge of the face image and a distance from a center point of the face image in the second video frame to a right edge of the face image; Adjusting the image processing range based on the first scaling ratio and the second scaling ratio to obtain an adjusted image processing range; The target processing is performed on the image within the adjusted image processing range corresponding to the second position in the second video frame.
8. The method according to any one of claims 1 to 7, characterized in that: The target processing comprises: Determine an image processing range corresponding to a position where the target processing is performed; Determine at least one triangle processing area included in the image processing range and divided by a rendering algorithm; Based on the positions of the vertices of the at least one triangular processing area, pixels to be processed in the at least one triangular processing area are determined, and the target processing is performed on the pixels to be processed.
9. An image processing method, characterized in that: The method comprises: displaying a first video frame; When a selection operation on a first spot position corresponding to the face image in the first video frame is detected, in response to the selection operation, target processing is performed on the image at the first spot position; Determine relative position information between the position of the facial feature point in the first video frame and the position of the first spot; Acquire a second video frame to be displayed, adjust the relative position information based on the positions of facial feature points in the first video frame and the positions of facial feature points in the second video frame to obtain adjusted relative position information, determine in the second video frame, based on the adjusted relative position information and the positions of facial feature points in the second video frame, perform target processing on an image at a second spot position after movement relative to the first spot position, and display the second video frame after the target processing.
10. The method according to claim 9, characterized in that The selection operation is a click operation, the target processing is a skin resurfacing processing, and the target processing of the image at the first spot position includes: A circular area is determined with the first spot position as the center and according to a preset radius value, and a skin resurfacing process is performed on the image within the circular area.
11. The method according to claim 10, characterized in that Before performing skin resurfacing processing on the image within the circular area, the method includes: In response to the selected operation, displaying a radius adjustment window, in which a radius adjustment progress bar and a confirmation option are displayed; When a drag operation of the radius adjustment progress bar is detected, in response to the drag operation of the radius adjustment progress bar, a circular area with the first spot position as the center and a radius value corresponding to the drag progress of the current radius adjustment progress bar is displayed at the first spot position; When a click operation of the confirmation option is detected, the radius value corresponding to the dragging progress of the current radius adjustment progress bar is determined as the preset radius value.
12. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a first position for target processing in an input first video frame; A first determination module, used to determine relative position information between the position of the facial feature point in the first video frame and the first position; A second determination module is used to adjust the relative position information based on the position of the facial feature points in the first video frame and the position of the facial feature points in the second video frame to obtain adjusted relative position information, and determine a second position for performing the target processing in the second video frame based on the adjusted relative position information and the position of the facial feature points in the second video frame; A processing module is used to perform the target processing on the image at the first position in the first video frame, and to perform the target processing on the image at the second position in the second video frame.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the image processing method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the image processing method according to any one of claims 1 to 11.
