CN-121981916-A - Image display processing method and electronic equipment
Abstract
The embodiment of the application discloses an image display processing method and electronic equipment. According to the method, the face of the target person in the original image is redrawn through the image local redrawing model based on the two prompting information to generate a second image, and then the second image is subjected to image segmentation to obtain a normal eye image of the target person and attached to the original image, so that the eye repair of the target person in the original image can be realized. The application can reduce the possibility of image distortion caused by repairing eyes by using the eye generation method and improve the user experience.
Inventors
- LU JIAXIN
- LIU WEN
- REN HAITAO
- YAO WEINA
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241030
Claims (15)
- 1. An image display processing method, comprising: Acquiring a first image corresponding to an original image, wherein the original image comprises one or more persons, eyes of at least one target person in the one or more persons are in an abnormal eye state, and the first image comprises the target person, and the eyes of the target person are in a normal eye state; extracting facial features of the first image to obtain first feature information, and extracting facial features of the original image to obtain second feature information; Redrawing the face of the target person in the original image through an image local redrawing model based on the first characteristic information and the second characteristic information to generate a second image; And performing image segmentation on the second image based on the original image to acquire a normal eye image of the target person, and pasting the normal eye image back to the original image.
- 2. The method of claim 1, wherein the extracting facial features from the first image to obtain first feature information comprises: Inputting the first image to an image generation hint adapter; and carrying out face detection and face feature extraction on the first image through the image generation prompt adapter to generate the first feature information.
- 3. The method of claim 1, wherein the extracting facial features from the original image to obtain second feature information includes: performing face detection on the original image, determining the target person in the original image, and extracting face key points of the target person to obtain first face key points; inputting the first facial key points and the first feature information into an image feature extraction network; and processing the first facial key points and the first characteristic information through the image characteristic extraction network to generate the second characteristic information.
- 4. A method according to any of claims 1-3, wherein the first characteristic information comprises one or more of a facial texture, color, shape, and expression of the target person in the first image.
- 5. A method according to any of claims 1-3, wherein the second characteristic information comprises one or more of a facial shape, a pose, an expression of the target person in the original image.
- 6. The method of claim 5, wherein redrawing the face of the target person in the original image with an image local redrawing model based on the first feature information and the second feature information to generate a second image comprises: inputting the first characteristic information and the second characteristic information into the image local redrawing model; positioning the face of the target person in the original image based on the first characteristic information through the image local redrawing model; And redrawing the face of the target person in the original image based on the image features provided by the first feature information and the second feature information through the image local redrawing model so as to generate a second image.
- 7. The method of claim 1, wherein the ocular abnormal state comprises one or more of eye closure, squinting, ocular deformation, ocular asymmetry, redeye effect, eye relief.
- 8. The method of claim 1, wherein the image segmentation of the second image based on the original image comprises: Performing face key point detection on the original image to obtain a second face key point, and performing face key point detection on the second image to obtain a third face key point, wherein the second face key point comprises a first eye key point, and the third face key point comprises a second eye key point; Aligning the original image and the second image based on the second face key point and the third face key point, and generating an eye mask image based on the first eye key point and the second eye key point; and acquiring the normal eye image through a graph cut algorithm based on the eye mask image, the original image and the second image.
- 9. The method of claim 7, wherein the generating an eye mask image based on the first eye keypoints and the second eye keypoints comprises: Constructing a minimum convex set containing the first eye key point and the second eye key point; And generating an eye mask image based on the second image and the minimum convex set, wherein the eye mask image and the second image have the same size, and in the eye mask image, the pixel points in the mask region formed by key points contained in the minimum convex set are all first pixel values, and the rest pixel points are all second pixel values.
- 10. The method of claim 7, wherein the acquiring the normal eye image by a graph cut algorithm comprises: determining a closed pixel point set which is most similar to the eyes of the target person in the original image and the second image based on the eye mask image, wherein the closed pixel point set which is most similar comprises pixel points in the mask area and pixel points which meet preset conditions in the rest pixel points; and performing image segmentation on the second image based on the most similar closed pixel point set to determine the normal eye image.
- 11. The method of claim 1, wherein said pasting back the normal eye image to the original image comprises: determining a sticking position based on the pixel value of the original image and the pixel value of the normal eye image; and pasting the normal eye image back to the pasting position in the original image.
- 12. An electronic device comprising a memory, one or more processors; the memory is coupled to the one or more processors, the memory for storing computer program code comprising computer instructions that the one or more processors invoke to cause the electronic device to perform the method of any of claims 1-11.
- 13. A chip system for application to an electronic device, the chip system comprising one or more processors configured to invoke computer instructions to cause the electronic device to perform the method of any of claims 1-11.
- 14. A computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-11.
- 15. A computer program product comprising instructions which, when executed by a computer, cause the computer to perform the method of any of claims 1-11.
Description
Image display processing method and electronic equipment Technical Field The present application relates to the field of image processing, and in particular, to an image display processing method and an electronic device. Background Taking pictures is a very important function of electronic devices, and is also very important for users. With the development of image processing technology and electronic devices, the electronic devices can complete many processes on pictures shot by themselves, including the process of eye abnormalities such as closed eyes of people in shot images. When the existing electronic device processes the image with abnormal eyes, the image is usually regenerated by using a generating model or the local area of the original image is replaced by the local area of the reference image, so that the image with normal eyes can be obtained based on the original image. However, the current image regenerated based on the model usually causes distortion of the surrounding areas of eyes and other areas of the person, and the replacement flexibility of the local areas of the image is poor. Disclosure of Invention The embodiment of the invention provides an image display processing method and electronic equipment, which are used for obtaining an eye image by using a graph cut algorithm and pasting back the eye image to an original image after carrying out facial redrawing through an image local redrawing model, and finally obtaining an eye repair picture with smaller eye distortion degree of a user. In a first aspect, an embodiment of the present invention provides an image display processing method, including obtaining a first image corresponding to an original image, where the original image includes one or more persons, eyes of at least one target person included in the one or more persons are in an eye abnormal state, the first image includes the target person, eyes of the target person are in an eye normal state, face feature extraction is performed on the first image to obtain first feature information, face feature extraction is performed on the original image to obtain second feature information, based on the first feature information and the second feature information, a face of the target person in the original image is redrawn through an image local redrawn model to generate a second image, image segmentation is performed on the second image based on the original image to obtain a normal eye image of the target person, and the normal eye image is pasted back to the original image. According to the embodiment of the application, the face redrawing of the target person in the original image can be carried out through the image local redrawing model, the normal eye image of the redrawn target person is obtained through image segmentation so as to be pasted back to the original image, and finally the normal original image of the eyes of the target person is obtained. The image local redrawing model not only redraws the face of the target person based on the original image, but also redraws the face of the target person based on the first characteristic information and the second characteristic information, so that the face redrawing is more accurate and more consistent with the style of the original image, wherein the first image is subjected to characteristic extraction, the characteristics of the face, especially the eyes, of the target person in the original image can be extracted, the image local redrawing model can be guided to redraw the face of the target person more accurately, the original image is subjected to characteristic extraction, the second information containing the face posture information of the target person in the original image can be obtained, the input image local redrawing model is guided to redraw the face, the redrawn target person can be enabled to be more consistent with the face posture of the target person in the original image, the second image obtained by the redrawing is subjected to eye image segmentation based on the original image, the normal eye image of the target person can be accurately obtained, the normal eye image of the target person can be accurately prevented from being pasted to the original image, and the natural eye region can be prevented from being pasted outside the original image, and the natural eye region can be prevented from being restored. In a possible implementation manner of the first aspect, performing face feature extraction on the first image to obtain first feature information includes inputting the first image to an image generation prompt adapter, and performing face detection and face feature extraction on the first image through the image generation prompt adapter to generate the first feature information. By implementing the embodiment of the application, the first image can be subjected to feature extraction through the image generation prompt adapter, the target person corresponding to the original image in the first