WO2025107751A1 - 图像处理方法、设备及存储介质 - Google Patents

图像处理方法、设备及存储介质 Download PDF

Info

Publication number
WO2025107751A1
WO2025107751A1 PCT/CN2024/112204 CN2024112204W WO2025107751A1 WO 2025107751 A1 WO2025107751 A1 WO 2025107751A1 CN 2024112204 W CN2024112204 W CN 2024112204W WO 2025107751 A1 WO2025107751 A1 WO 2025107751A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
portrait
image
facial
shape
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/112204
Other languages
English (en)
French (fr)
Other versions
WO2025107751A9 (zh
Inventor
张孟达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of WO2025107751A1 publication Critical patent/WO2025107751A1/zh
Publication of WO2025107751A9 publication Critical patent/WO2025107751A9/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/169Holistic features and representations, i.e. based on the facial image taken as a whole
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present application relates to the field of terminal technology, and in particular to image processing methods, devices and storage media.
  • the beautification function is usually presented to users in the form of beauty templates. Users can select their favorite beauty templates from the beauty template library to take an image with a beauty effect.
  • the parameters in the beauty template such as facial deformation parameters and makeup parameters, are a set of fixed configuration parameters, it is impossible to adapt to the different beauty needs of different users.
  • the embodiments of the present application provide an image processing method, device, and storage medium, which can meet the personalized beauty needs of different users and improve the portrait beauty effect.
  • the embodiment of the present application proposes an image processing method, which is applied to an electronic device, and the method includes: in response to the operation of turning on the beauty function of the camera application, obtaining a first image including a portrait face captured by the camera; displaying a third image in the shooting interface of the camera application, the third image is the image after the first image is superimposed with a retouching mask image, the retouching mask image is a mask image that matches the face shape of the portrait face, and the retouching mask image is used to indicate the position, shape and degree of the highlight area and shadow area of the portrait face.
  • the first image is the original image captured by the camera.
  • the above method takes into account the differences in different portrait face shapes, and superimposes a retouching mask image that matches the face shape of the portrait face on the original image to meet the personalized beauty needs of different users and improve the portrait beauty effect.
  • the method before the shooting interface of the camera application displays the third image, the method further includes: obtaining feature information of the face of the portrait in the first image; determining the face shape of the portrait based on the feature information of the face of the portrait; obtaining a retouching mask image that matches the face shape of the portrait from a database, the database including retouching mask images corresponding to different face shapes; and superimposing the first image and the retouching mask image to obtain the third image.
  • the above method determines the face shape of the portrait by obtaining the features of the face of the portrait, obtains the retouching mask image corresponding to the face shape of the portrait, and enhances the facial contour of the portrait in the image.
  • obtaining feature information of a portrait face in a first image includes: determining an image region where the portrait face in the first image is located; identifying key points of various parts of the portrait face in the first image through a preset facial key point detection model to obtain key point information of the portrait face in the first image.
  • the key point information includes position information of key points of various parts of the portrait face.
  • the face shape of the portrait face is determined, including In summary: based on the key point information of the portrait face in the first image, determine the facial contour information of the portrait; determine the face shape of the portrait face based on the facial contour information; or, through a preset portrait similarity model, determine the face shape similarity and facial features similarity between the portrait face in the first image and multiple standard faces, determine the total similarity between the portrait face and multiple standard faces, and use the face shape of the standard face with the largest total similarity as the face shape of the portrait face in the first image.
  • the above-mentioned first method for determining the face shape of a portrait is to determine the facial contour through the key points of the portrait, and match the corresponding face shape based on the facial contour.
  • the above-mentioned second method for determining the face shape of a portrait is based on the portrait facial similarity model, calculates the similarity between the face shape of the portrait and different standard face shapes, and then determines the face shape of the portrait.
  • the positions of the highlight area and the shadow area of the portrait face in the retouching mask image corresponding to different face shapes are different, and the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image corresponding to different face shapes are different.
  • the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image corresponding to different face shapes are different, including: if the face shape of the portrait face is an oval face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are water drop shapes; or, if the face shape of the portrait face is a round face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are lightning shapes; or, if the face shape of the portrait face is a rectangular face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are comb shapes; or, if the face shape of the portrait face is a diamond face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are semi-arc shapes; or, if the face shape of the portrait face is an elliptical face, the shapes of the highlight area and the shadow area of the portrait face in the retouching
  • the above two embodiments show the difference between the contouring mask images corresponding to different face shapes. After determining the face shape of a portrait, by matching the contouring mask image corresponding to the face shape of the portrait, differentiated contouring of the face of the portrait can be achieved, thereby improving the portrait beautification effect.
  • the method further includes: determining deformation parameters of various parts of the face based on feature information of the portrait face; adjusting the structure of the portrait face in the first image by region based on the deformation parameters of various parts of the face to obtain a second image; superimposing the first image and the retouching mask image to obtain a third image, including: superimposing the second image and the retouching mask image to obtain a third image.
  • the above method first optimizes the facial structure of the portrait, and then, based on the optimization of the facial structure, retouches the portrait face to enhance the portrait beauty effect. It is worth noting that when optimizing the facial structure of the portrait, the structure of various parts of the portrait face is adjusted by region to avoid affecting adjacent parts.
  • the deformation parameters of each part of the face are determined, including: based on the characteristic information of the portrait face and the facial characteristic information of the standard face, the structure of the portrait face in the first image is adaptively adjusted within a preset value range to determine the deformation parameters of each part of the portrait face.
  • the deformation parameters of each part of the face should be set within a reasonable value range, that is, the deformation parameters of each part should be set within the preset value range corresponding to each part. It can be understood that if the deformation parameters are too large, facial distortion may occur, and if the deformation parameters are too small, the optimization of the facial structure is not obvious.
  • Reasonable facial deformation parameters are generated by adaptive parameter adjustment to optimize the facial structure of the portrait.
  • the standard face includes a plurality of standard faces of different face shapes; based on the feature information of the portrait face and the facial feature information of the standard face, the structure of the portrait face in the first image is adaptively adjusted within a preset value range to determine the deformation parameters of each part of the portrait face, including: determining the face shape of the portrait face based on the feature information of the portrait face; obtaining the facial feature information of the standard face corresponding to the face shape of the portrait face; based on the feature information of the portrait face The method is to adaptively adjust the parameters of various parts of the portrait face in combination with the facial features of the standard face corresponding to the face shape of the portrait face, so as to generate reasonable facial deformation parameters and optimize the face structure of the portrait face.
  • the method further includes: in response to a first operation of turning on a portrait shooting mode of a camera application, turning on a beauty function.
  • the shooting interface displays a first control, the first control is used to trigger turning on or off the beauty function; in response to a second operation acting on the first control, turning on the beauty function.
  • the first operation may be an operation in which a user selects a portrait shooting mode in the shooting mode selection area 105 of the camera application shooting interface 101.
  • the electronic device in response to the first operation, directly turns on the beauty function.
  • the camera application switches to the portrait shooting mode, and the beauty function is not turned on at this time.
  • the first control may be the beauty function switch 103 in the preview area 102 of the camera application shooting interface 101
  • the second operation may be an operation of clicking the beauty function switch 103.
  • the electronic device turns on the beauty function. Unlike the previous example, the beauty function needs to be turned on by the user.
  • the above method shows two methods of turning on the beauty function. After turning on the beauty function, the electronic device can execute the above image processing method to meet the personalized beauty needs of different users.
  • an embodiment of the present application provides an image processing device, including: an acquisition module, used to respond to the operation of turning on the beauty function of a camera application, to acquire a first image including a portrait face captured by a camera; a display module, used to display a third image on the shooting interface of the camera application, the third image is an image after the first image is superimposed with a retouching mask image, the retouching mask image is a mask image that matches the facial shape of the portrait face, and the retouching mask image is used to indicate the position, shape and degree of highlight areas and shadow areas of the portrait face.
  • an embodiment of the present application provides an electronic device, the electronic device comprising: a memory and a processor, the processor being used to call a computer program in the memory to execute any method described in the first aspect.
  • an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute any method as described in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, which stores a computer program.
  • the computer program runs on an electronic device, the electronic device executes the method described in any one of the first aspects.
  • a computer program product comprises a computer program, and when the computer program is executed, the computer is caused to execute the method as described in any one of the first aspect.
  • FIG1 is a schematic diagram of interface changes of an electronic device provided in an embodiment of the present application.
  • FIG2 is a general flow chart of an image processing method provided in an embodiment of the present application.
  • FIG3 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG4 is a schematic diagram of facial key points provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of setting facial structure deformation parameters of a portrait provided in an embodiment of the present application.
  • FIG6 is a second flow chart of the image processing method provided in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of contouring masks corresponding to different face shapes provided by an embodiment of the present application.
  • FIG8a is a schematic diagram of a contouring method for an oval face provided in an embodiment of the present application.
  • FIG8b is a schematic diagram of a contouring method for a round face provided in an embodiment of the present application.
  • FIG8c is a schematic diagram of a contouring method for a rectangular face provided in an embodiment of the present application.
  • FIG8d is a schematic diagram of a contouring method for a diamond-shaped face provided in an embodiment of the present application.
  • FIG8e is a schematic diagram of a contouring method for an oval face provided in an embodiment of the present application.
  • FIG8f is a schematic diagram of a contouring method for a square face provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of the present application.
  • FIG. 11 is a third flow chart of the image processing method provided in an embodiment of the present application.
  • words such as “first” and “second” are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit the difference.
  • “at least one” refers to one or more, and “plurality” refers to two or more.
  • “And/or” describes the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
  • the character “/” generally indicates that the previous and next associated objects are in an “or” relationship.
  • “At least one of the following (kind/piece)” or similar expressions refers to any combination of these items, including any combination of single items (kind/piece) or plural items (kind/piece).
  • At least one of a, b or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple.
  • the user information including but not limited to user device information, user personal information, user facial information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • user information including but not limited to user device information, user personal information, user facial information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
  • the application When users use the application to take photos or shoot, the application provides users with beauty functions.
  • the existing beauty functions include filters of different styles, different degrees of skin smoothing, whitening, makeup, face thinning, big eyes, thin nose, small head, etc.
  • the user After the user opens the application, for example, taking the short video application as an example, the user wants to beautify when shooting a short video.
  • the user can click on the different beauty templates provided at the bottom of the screen to optimize the user's facial features and overall shooting style.
  • the parameters in the beauty template are usually fixed configuration parameters, it is not possible to adapt to the different beauty needs of different users. For example, if a user has large eyes, and the eye deformation parameters in the beauty template are large, the user will experience severe eye distortion after using the beauty template. For another example, if a user has a round face, and the chin contouring area in the beauty template is small, the user will not experience a good face-slimming effect after using the beauty template.
  • an embodiment of the present application shows an image processing method.
  • the electronic device obtains the facial feature information of the user in the image captured by the camera, and determines the deformation parameters of each part of the user's face based on the facial feature information to achieve accurate facial structure optimization.
  • the electronic device can also determine the user's face shape based on the facial feature information. After completing the structural optimization of the user's face, it can also match the contouring parameters corresponding to the face shape based on the face shape to improve the beautification effect.
  • the above method performs personalized beautification based on the facial features of different users. Different users use different beauty parameters, which will not cause beauty distortion.
  • the beautification parameters include deformation parameters of various parts of the user's face, makeup parameters, etc.
  • the deformation parameters of various parts of the user's face include but are not limited to thin face parameters, large eye parameters, thin nose parameters, small head parameters, etc.
  • the makeup parameters include contouring parameters, which include the position, shape, and degree of facial highlights and shadows.
  • the beauty parameters also include skin resurfacing parameters, whitening parameters, and skin color parameters.
  • the makeup parameters also include lip parameters, blush parameters, eyebrow dyeing parameters, eye bags parameters, eye light parameters, eye highlight parameters, eye shadow parameters, eyelash parameters, etc.
  • the portrait shooting mode can determine the background based on the portrait in the image and blur the background to make the background appear blurred, that is, background blur.
  • FIG1 is a schematic diagram of the interface change of the electronic device provided by the embodiment of the present application.
  • the user turns on the camera application in the mobile phone and can select the portrait shooting mode in the shooting mode selection area 104.
  • the preview area 102 of the shooting interface 101 can display the switch 103 of the beauty function.
  • the portrait in the preview area 102 is the original portrait taken by the camera.
  • the image processing method provided by the embodiment of the present application can be executed to realize the personalized beauty of the portrait face in the image.
  • the portrait in the preview area 105 is the portrait after beauty processing, such as thinning the nose, enlarging the lips, and retouching the face.
  • FIG. 1 merely illustrates a possible interface style of an electronic device taking a mobile phone as an example, and should not constitute a limitation on the embodiments of the present application.
  • FIG. 2 shows the overall flow of the image processing method provided in an embodiment of the present application.
  • the image processing process includes the following two processing processes:
  • the first processing process The electronic device performs facial recognition on the image captured by the camera to obtain the facial feature information of the user in the image, and determines the deformation parameters of each part of the face based on the facial feature information to adjust the facial structure of the user.
  • the user in Figure 2 has a wider nose base and a thinner upper lip.
  • the first processing process mainly fine-tunes the nose base and upper lip of the user. It should be understood that different users have different facial features, and local parts of the user's face can be adaptively adjusted in a targeted manner to avoid distortion of the facial structure and meet the beauty needs of different users.
  • the electronic device determines the user's face shape based on the facial feature information, matches the corresponding retouching parameters based on the user's face shape, and performs retouching on the user's face based on the retouching parameters to obtain a beautified image.
  • the retouching of the user's face is mainly to add shadows and highlights to the user's face. It should be understood that different users have different face shapes, and the user's face can be retouched in a targeted manner to enhance the retouching effect of the user's face.
  • the first processing procedure and the second processing procedure are described in detail below.
  • FIG3 is a flowchart of an image processing method provided in an embodiment of the present application.
  • the image processing method shown in FIG3 mainly involves the first processing process described above, and the method includes:
  • the camera of the electronic device can collect images in real time, and the images collected by the camera are also called original images. At a certain moment, the image collected by the camera is the first image.
  • the electronic device After receiving the first image captured by the camera, the electronic device can perform facial recognition on the first image through a preset facial recognition model to determine whether the first image contains a portrait face. If the first image contains a portrait face, the electronic device confirms the image area where the portrait face is located and executes S303.
  • the electronic device can identify the key points of various parts of the portrait face in the first image through a preset facial key point detection model to obtain facial feature information of the portrait in the first image, where the facial feature information includes key point information of the portrait face.
  • the input of the facial key point detection model can be the image area where the portrait face is located determined by the facial recognition model. Since the model input eliminates the background area in the first image, the processing speed of the facial key point detection model can be improved.
  • FIG4 is a schematic diagram of facial key points provided in an embodiment of the present application.
  • the number of facial key points shown in FIG4 is 33, 28 of the 33 key points appear on both sides of the face, a total of 14 groups of symmetrical points, and the remaining 5 head key points (1, 2, 33, 19, 20) are located on the vertical center line of the face.
  • the 28 key points include: 6 key points of eyebrows (7, 3, 5 and 6, 4, 8), 10 key points of eyes (13, 9, 15, 17, 11 and 16, 10, 14, 18, 12), 6 key points of nose (21, 22, 23, 24, 25, 26,) and 6 key points of mouth (27, 28, 29, 30, 31, 32).
  • the facial key points shown in FIG. 4 are only used as an example.
  • the facial key point detection model can detect more or fewer facial key points.
  • the jaw key point, the ear bottom key point, etc. can be added.
  • the electronic device can determine the size of the head and the size of each part of the face according to the above key points. For example, the head height is determined according to key points 1 and 33, the head width of the ear is determined according to key points 19 and 22, the left eye width is determined according to key points 13 and 15, the right eye width is determined according to key points 14 and 16, the nose base width is determined according to key points 23 and 24, the nose tip width is determined according to key points 21 and 22, and the mouth width is determined according to key points 29 and 30.
  • the facial feature information includes size information of various parts of the portrait face.
  • the electronic device After acquiring the facial feature information of the portrait in the first image, the electronic device can adaptively adjust the facial structure of the portrait in the first image within a preset value range based on the facial feature information of the standard face to determine the deformation parameters of various parts of the portrait's face.
  • the facial feature information of a standard face includes facial key point information of the standard face and standard size information of various facial parts.
  • the electronic device can pre-store the facial feature information of the standard face for facial structure optimization.
  • the preset numerical range includes the numerical range of deformation parameters of various parts of the face, for example, the preset numerical range of deformation parameters of nose width, the preset numerical range of deformation parameters of eye width, and the preset numerical range of deformation parameters of mouth thickness.
  • the preset numerical range limits the adjustment range of deformation parameters of various parts of the face. It should be understood that too large deformation parameters may cause facial distortion, and too small deformation parameters cannot achieve the optimization effect of facial structure.
  • the electronic device can pre-store facial feature information of multiple standard faces for facial structure optimization.
  • the embodiment of the present application does not limit the data source of the standard face.
  • Multiple standard faces can be generated based on an artificial intelligence AI model, or multiple standard faces can be obtained from a cloud database.
  • the facial feature information also includes facial contour information
  • the facial contour information can be determined based on facial key points.
  • the electronic device can confirm the face shape based on the facial contour information in the facial feature information of the portrait in the first image, and then obtain the facial feature information of the standard face corresponding to the face shape, and then based on the facial feature information of the standard face, adaptively adjust the facial structure of the portrait in the first image within a preset value range to determine the deformation parameters of each part of the face of the portrait.
  • the electronic device may determine the face shape of the portrait in the first image based on a portrait similarity model, and then obtain facial feature information of a standard face corresponding to the face shape, and then based on the facial feature information of the standard face, adaptively adjust the facial structure of the portrait in the first image within a preset numerical range to determine the deformation parameters of various parts of the portrait's face.
  • the portrait similarity model can determine the face shape similarity value and facial feature similarity between the portrait face in the first image and multiple standard faces, and then determine the total similarity between the portrait face and multiple standard faces, and use the face shape of the standard face with the largest total similarity as the face shape of the portrait in the first image.
  • the facial feature similarity includes eye similarity, mouth similarity, nose similarity, eyebrow similarity and ear similarity, and the facial feature similarity can be the average value of the similarities of the above facial parts.
  • the total similarity can be the average value of the face shape similarity and the facial feature similarity.
  • the electronic device can determine the deformation parameters of all or part of the face based on the differences between the portrait and the standard face. Compared with the existing beauty templates that use a fixed set of deformation parameters, this method can achieve differentiated parameter adjustment of the portrait facial structure and achieve better facial structure optimization effects.
  • FIG5 is a schematic diagram of setting the deformation parameters of the facial structure of a portrait provided by an embodiment of the present application. Based on the key point information of the facial portrait in the image, the size information of each part of the face can be determined. As shown in FIG5, x1 represents the width of the left eye, x2 represents the distance between the center of the left eye and the center of the right eye, x3 represents the width of the nose base, x4 represents the width of the mouth, y1 represents the height of the head, and y2 represents the distance between the chin and the horizontal center line of the mouth, which is recorded as the chin distance. FIG5 is only an example and does not show all the dimensions of the face.
  • the deformation parameter of the nose base width can be set to a negative value to shorten the nose base width of the portrait.
  • the nose base width of the portrait can be shortened based on the deformation parameter of the nose base width in the nose base region. This example adjusts the nose base width of the portrait in the nose base region to avoid affecting the adjacent parts.
  • the deformation parameter of the single eye width can be set to a positive value to lengthen the width of the single eye of the portrait.
  • the width of the left eye of the portrait can be lengthened based on the deformation parameter of the single eye width in the left eye region.
  • the width of the right eye of the portrait can be lengthened in the same way to make the left and right eyes symmetrical. This example adjusts the width of the left eye in the left eye region and the width of the right eye in the right eye region to avoid affecting the adjacent parts. It should be understood that while adjusting the width of the left and right eyes, the distance between the left and right eyes (such as x2) should also be considered so that the eyes are naturally distributed on the face of the portrait.
  • the deformation parameter of the chin height may be set to 0, where 0 indicates that the chin height of the portrait is not adjusted.
  • the deformation parameters of the part of the face to be adjusted can be determined. Based on the deformation parameters of each part of the face, the electronic device can adjust the structure of each part of the face of the portrait in the first image in different regions to obtain a second image.
  • the first image is the image shown in a of FIG2
  • the second image is the image shown in c of FIG2.
  • the second image is an image after the facial structure of the portrait in the first image is optimized.
  • the image area of the nose base width is first determined, and then the deformation parameters of the nose base width are applied in the image area.
  • this adjustment method will not affect other parts near the nose base. For example, if there are nasolabial folds near the nose base, if the deformation parameters of the nose base width are applied to the entire facial area, the nasolabial folds will be deformed, causing facial distortion.
  • the image processing method shown in the above embodiment identifies the facial feature information of the portrait in the image captured by the camera, determines the deformation parameters of each part of the face based on the facial feature information of the portrait in the image and the facial feature information of the standard face, and optimizes the facial structure of the portrait in different regions based on the deformation parameters of each part.
  • this method can make targeted adaptive adjustments to the portrait face to avoid distortion of the facial structure, so as to meet the personalized beauty needs of different users.
  • makeup parameters can be configured on the optimized facial structure, and the makeup parameters include contouring parameters, etc.
  • contouring parameters can be configured based on the type of face shape, that is, different face shapes correspond to different contouring parameters.
  • the electronic device can determine the face shape based on the facial feature information of the portrait, and match the contouring parameters corresponding to the face shape to enhance the portrait beauty effect.
  • FIG6 is a second flow chart of the image processing method provided in an embodiment of the present application.
  • the image processing method shown in FIG6 mainly involves the second processing process described above, and the method includes:
  • facial contour information of the portrait is determined based on key point information of the face of the portrait in the first image; and the face shape of the portrait face is determined based on the facial contour information.
  • face shape similarity and facial feature similarity of the portrait face in the first image with multiple standard faces are determined through a portrait similarity model, and the total similarity of the portrait face with multiple standard faces is determined, and the face shape of the standard face with the greatest total similarity is used as the face shape of the portrait face in the first image.
  • the electronic device has a database pre-stored with contouring parameters corresponding to different face shapes, and the electronic device obtains contouring parameters corresponding to the face shape of the portrait in the first image from the database.
  • the contouring parameters include the position, shape and degree of facial highlights and shadows.
  • the retouching parameter may be a retouching mask, which may indicate the position, shape, and degree of highlights and shadows on the face of the portrait.
  • the retouching mask may be regarded as a layer template, which may be superimposed on the face region of the portrait in the image to achieve retouching of the face of the portrait.
  • the retouching mask may also be referred to as a retouching mask map.
  • a database of the electronic device pre-stores retouching mask images corresponding to different face shapes, and the electronic device obtains the retouching mask image corresponding to the face shape of the portrait in the first image from the database.
  • Figure 7 is a schematic diagram of contouring masks corresponding to different face shapes provided in an embodiment of the present application.
  • Figure 7 a to f respectively show contouring masks for a square face, an oval face, a diamond face, an oval face, a round face and a rectangular face. It can be seen from Figure 7 that the facial highlight and shadow areas of different face shapes are different.
  • contouring masks corresponding to different face shapes can be generated to optimize the makeup of the portrait face and enhance the portrait beautification effect.
  • the contour mask is used to indicate the position, shape, and degree of the highlight area and shadow area of the face.
  • the shape includes but is not limited to a water drop shape, a lightning shape, a comb shape, a semi-arc shape, a "Z" shape, a "L” shape, etc.
  • Figures 8a to 8f show schematic diagrams of contouring methods corresponding to different face shapes.
  • the face shape of the portrait is an oval face
  • highlight lines can be drawn at positions 3 to 6 on the face
  • shadow lines can be drawn at positions 1 and 2 on the face.
  • the highlight lines and shadow lines can be in the shape of water drops.
  • the shadow area can be generated by blending outwards in the shape of water drops from both sides of the forehead.
  • highlight lines can be drawn at positions 5, 6, and 7 on the face
  • shadow lines can be drawn at positions 1, 2, 3, and 4 on the face.
  • the highlight lines and shadow lines can be in the shape of lightning. For example, from the cheekbones to the sides of the face to the jaw, the lightning shape is blended outward to generate a shadow area.
  • highlight lines can be drawn at positions 3 and 4 on the face
  • shadow lines can be drawn at positions 1, 2, 5, 6, 7, and 8 on the face.
  • the highlight lines and shadow lines can be in a comb shape "E".
  • the sides of the cheekbones, the sides of the jaw, and the sides of the forehead can be blended outward in a comb shape to generate a shadow area.
  • highlight lines can be drawn at positions 3, 4, 7, and 8 on the face
  • shadow lines can be drawn at positions 1, 2, 5, and 6 on the face according to the characteristics of the diamond-shaped face.
  • the highlight lines and shadow lines can be in a semi-arc shape "C".
  • the cheekbones are blended inward from the edge in a semi-arc shape to generate a shadow area.
  • highlight lines can be drawn at positions 7 to 10 on the face and shadow lines can be drawn at positions 1 to 6 on the face according to the features of the oval face.
  • the highlight lines and shadow lines can be in a "Z" shape.
  • the shadow area can be generated by blending outwards in a "Z" shape from both sides of the cheekbones, both sides of the jaw, and both sides of the forehead.
  • highlight lines can be drawn at positions 7, 8, 11 to 14 on the face
  • shadow lines can be drawn at positions 1 to 6, 9, 10, 15, and 16 on the face
  • the highlight lines and shadow lines can be in an "L" shape.
  • the sides of the cheekbones, the sides of the jaw, and the sides of the forehead can be blended outward in an "L" shape to generate a shadow area.
  • the electronic device obtains retouching parameters corresponding to the portrait face shape, and based on the facial highlight position and degree in the retouching parameters, superimposes a highlight area on the portrait face in the second image, and based on the facial shadow position and degree in the retouching parameters, superimposes a shadow area on the portrait face in the second image, to obtain a third image, in which highlights and shadows are superimposed on the portrait face.
  • the second image is the image shown in c in FIG. 2
  • the third image is the image shown in d in FIG. 2 .
  • the contouring parameter corresponding to the portrait face shape may be a contouring mask.
  • the electronic device may obtain a third image by performing image operation on the contouring mask and the second image.
  • the electronic device determines that each pixel in the contouring mask corresponds to a pixel of the portrait face in the second image, and performs an AND operation on each pixel in the contouring mask and the pixel corresponding to the pixel in the second image to obtain the third image.
  • the image processing method shown in the above embodiment recognizes the facial feature information of the portrait in the image captured by the camera. Determine the face shape of the portrait, obtain the retouching parameters corresponding to the face shape of the portrait, and retouch the face of the portrait based on the retouching parameters corresponding to the face shape of the portrait to improve the portrait beautification effect.
  • This method can retouch the face of the portrait in a targeted manner, with different retouching areas and degrees for different face shapes, which can meet the personalized beautification needs of users with different face shapes.
  • the electronic device may perform beauty processing on the facial parts of the portrait in the third image based on the features of the facial parts of the portrait to obtain a fourth image.
  • the fourth image may be obtained by executing at least one of the following examples:
  • the electronic device obtains makeup parameters corresponding to the portrait eye features, such as eye bags parameters, catch light parameters, eye highlight parameters, eye shadow parameters, eyelash parameters, etc., based on the makeup parameters corresponding to the portrait eye features, and performs beauty makeup on the eyes of the portrait in the third image.
  • makeup parameters corresponding to the portrait eye features such as eye bags parameters, catch light parameters, eye highlight parameters, eye shadow parameters, eyelash parameters, etc.
  • the electronic device obtains makeup parameters corresponding to the eyebrow features of the portrait, such as eyebrow dyeing parameters, based on the eyebrow features of the portrait, and performs beauty makeup processing on the eyebrows of the portrait in the third image based on the makeup parameters corresponding to the eyebrow features of the portrait.
  • makeup parameters corresponding to the eyebrow features of the portrait such as eyebrow dyeing parameters
  • the electronic device obtains makeup parameters corresponding to the lip features of the portrait, such as red lip parameters, based on the lip features of the portrait, and performs beauty makeup processing on the lips of the portrait in the third image based on the makeup parameters corresponding to the lip features of the portrait.
  • makeup parameters corresponding to the lip features of the portrait such as red lip parameters
  • the electronic device obtains makeup parameters corresponding to the facial features of the portrait, such as blush parameters, based on the facial features of the portrait, and performs beauty makeup processing on the face of the portrait in the third image based on the makeup parameters corresponding to the facial features of the portrait.
  • makeup parameters corresponding to the facial features of the portrait such as blush parameters
  • the image processing method shown in the above embodiment recognizes the features of various parts of the face of the portrait and performs targeted beauty processing on each part of the face of the portrait to achieve a better beauty effect.
  • the above-mentioned electronic device may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc.
  • the electronic device may be a mobile phone with shooting and display functions, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), etc.
  • the embodiments of the present application do not limit the specific technology and specific device form adopted by the electronic device.
  • FIG9 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the electronic device 100 includes: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor 180, a button 190, a camera 193, and a display screen 194.
  • a processor 110 an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor 180, a button 190, a camera 193, and a display screen 194.
  • USB universal serial bus
  • the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the interface connection relationship between the modules shown in the embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 100.
  • the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 may be used to connect a charger to charge an electronic device, may be used to transmit data between an electronic device and a peripheral device, or may be used to connect an earphone to play audio through the earphone.
  • the charging management module 140 is used to receive charging input from a charger.
  • the power management module 141 is used to connect the battery 142 , the charging management module 140 and the processor 110 .
  • the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor and the baseband processor.
  • the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G applied to the electronic device 100.
  • the wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), NFC, infrared technology (IR), etc. applied to the electronic device 100.
  • WLAN wireless local area networks
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC infrared technology
  • IR infrared technology
  • the electronic device 100 can realize the display function through the GPU, the display screen 194, and the application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, etc.
  • the display screen 194 includes a display panel.
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through an image signal processing (ISP) module, one or more cameras 193, a video codec, a GPU, one or more display screens 194 and an application processor.
  • ISP image signal processing
  • the camera 193 is used to capture still images or videos.
  • the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
  • the camera 193 includes a lens, an image sensor (such as a CMOS image sensor (complementary metal oxide semiconductor image sensor, CIS for short)), a motor, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, data files such as music, photos, and videos are stored in the external memory card.
  • the internal memory 121 may be used to store one or more computer programs, which include instructions.
  • the processor 110 may execute the instructions stored in the internal memory 121, thereby enabling the electronic device 100 to perform various functional applications and data processing.
  • the sensor 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor 180K, an ambient light sensor, a bone conduction sensor, and the like.
  • the touch sensor 180K may also be called a touch panel.
  • the touch sensor 180K may be disposed on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, also called a touch screen.
  • the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K, and transmit the detected touch operation to the application processor to determine the type of the touch event.
  • the buttons 190 include a power button, a volume button, etc.
  • the buttons 190 may be mechanical buttons or touch buttons.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100. For example, when the camera application is turned on, the user may trigger the camera to take photos or record videos by pressing the power button.
  • the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present application takes the Android system as an example to illustrate the software system of the layered architecture.
  • the software structure of the sub-device is not limited to, a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
  • FIG10 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of the present application.
  • the layered architecture divides the software system of the electronic device into several layers, each layer having a clear role and division of labor.
  • the layers communicate with each other through software interfaces.
  • the electronic device includes an application layer, an application framework layer, a hardware abstraction layer, a driver layer, and a system service layer.
  • the application layer includes camera applications and third-party applications.
  • the camera application is a system application.
  • the third-party applications include but are not limited to short video applications, camera applications, image processing applications, etc. Users can use the camera application to take images or videos, and users can also use third-party applications to call the camera to take images or videos.
  • the application package may also include applications such as gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, etc.
  • the application framework layer can provide an application programming interface (API) and a programming framework for the application of the application layer.
  • the application framework layer includes a camera management module and a window management module.
  • the camera management module is responsible for managing the camera device information, and the camera application can obtain the camera characteristics, such as the number of cameras, shooting capabilities and other parameters through the camera management module.
  • the camera management module can also be used to transmit data between the camera application and the camera hardware abstraction layer.
  • the camera application transmits a notification message to turn on the beauty function to the camera hardware abstraction layer through the camera management module, so that the camera hardware abstraction layer can retrieve the camera algorithm module after receiving the original image taken by the camera, and perform beauty processing on the portrait in the original image.
  • the window management module is responsible for managing the windows in the application and the interaction with the user interface. For example, it is responsible for managing the camera application window and sending the window content (including the original image taken by the camera or the image after beauty processing) to the display driver for display.
  • the hardware abstraction layer is an interface layer located between the kernel layer and the hardware circuit.
  • the hardware abstraction layer includes a camera hardware abstraction layer and a camera algorithm module.
  • the camera hardware abstraction layer can call the camera algorithm module to optimize the image or video taken by the camera.
  • the camera algorithm module includes a first image processing module and a second image processing module.
  • the first image processing module is used to detect the image captured by the camera, obtain the facial feature information of the portrait in the image, such as the key point information of the portrait face, and determine the deformation parameters of each part of the face based on the facial feature information of the portrait, adjust the facial structure of the user in the image based on the deformation parameters, and transmit the image with the adjusted facial structure to the second image processing module.
  • the second image processing module is used to obtain the facial feature information of the portrait in the image from the first image processing module, determine the face shape based on the facial feature information of the portrait, match the corresponding retouching parameters, and perform retouching processing on the portrait face based on the retouching parameters to obtain the image after beauty processing.
  • the first image processing module and the second image processing module are processed in parallel, which can improve the image processing speed.
  • first image processing module and the second image processing module are not limited to the hardware abstraction layer.
  • the first image processing module and the second image processing module may also be located in the application layer.
  • the first image processing module and the second image processing module may be integrated into a camera application or a third-party application, or the camera application or the third-party application may call the first image processing module and the second image processing module of the application layer to implement the beauty function.
  • the first image processing module and the second image processing module may also be integrated into one image processing module, which has the functions of the first image processing module and the second image processing module.
  • the driver layer provides drivers for different hardware devices.
  • the driver layer may include a camera driver and a display driver.
  • the camera driver may be used to drive the camera of the electronic device to collect raw images.
  • the display driver is used to drive the display screen of the electronic device to display the raw images collected by the camera or the images after beauty processing.
  • FIG11 is a flowchart of the image processing method provided in the embodiment of the present application.
  • FIG11 takes the case where the portrait shooting mode is turned on and the camera application does not automatically turn on the beauty function as an example to illustrate the solution.
  • the image processing method may include the following steps:
  • the camera application In response to an operation of turning on the portrait shooting mode, the camera application sends a notification message of the portrait shooting mode to the camera management module.
  • the camera application of the application layer in response to the user selecting the portrait shooting mode in the shooting mode selection area 105 of the shooting interface 101, the camera application of the application layer sends a notification message of the portrait shooting mode to the camera management module of the application framework layer, and the camera management module can query the camera shooting parameters of the portrait shooting mode.
  • the camera management module sends control information of the portrait shooting mode to the camera driver through the camera hardware abstraction layer.
  • the control information of the portrait shooting mode may include camera shooting parameters of the portrait shooting mode, such as an identifier of a camera corresponding to the portrait shooting mode and a focal length value of the camera, etc.
  • the camera corresponding to the portrait shooting mode includes a telephoto camera.
  • the camera driver drives the corresponding camera to work and obtains a first image from the camera.
  • the camera driver drives the corresponding camera to work based on the camera shooting parameters in the control information of the portrait shooting mode.
  • the first image is an original image shot by the camera, and the original image can be understood as an unprocessed image.
  • the camera driver sends the first image to the camera hardware abstraction layer.
  • the camera hardware abstraction layer When the camera application does not enable the beauty function, after receiving the first image sent by the camera driver, the camera hardware abstraction layer will not call the first image processing module and the second image processing module, that is, it will not perform image processing (such as beauty processing) on the first image.
  • the camera hardware abstraction layer directly transmits the first image to the camera application through the camera management module, so that the camera application sends the first image to the display driver for display through the window management module.
  • This process is the normal process of the portrait shooting mode, and the preview interface of the camera application displays the original image captured by the camera.
  • the above image processing method further includes:
  • the camera application sends a notification message of turning on the beauty function to the camera management module.
  • the camera application sends a notification message of turning on the beauty function to the camera management module.
  • the camera management module sends a notification message to the camera hardware abstraction layer to enable the beauty function.
  • the camera hardware abstraction layer executes S1107 .
  • the camera hardware abstraction layer sends an image processing request to the first image processing module, where the image processing request includes the first image.
  • the image processing request is used to trigger the first image processing module to perform facial structure adjustment on the first image.
  • the first image processing module identifies facial feature information in the first image.
  • the first image processing module may be pre-installed with a facial recognition model and a facial key point detection model.
  • the first image processing module identifies whether the first image contains a portrait face through the facial recognition model. If it is identified that the first image contains a portrait face, the first image processing module further identifies key points of various parts of the portrait face through the facial key point detection model to obtain facial feature information of the portrait in the first image, and the facial feature information includes key point information of the portrait face.
  • the facial feature information may also include facial contour information, and the facial contour information may be determined based on facial key points.
  • the first image processing module determines the deformation parameters of each facial part based on the facial feature information.
  • the first image processing module optimizes the facial structure based on the deformation parameters to obtain a second image.
  • the second image is an image obtained by optimizing the facial structure of the portrait in the first image.
  • S1109 and S1110 can refer to S304 and S305 of the previous embodiment respectively, and their implementation principles and effects are similar, which will not be elaborated here.
  • the first image processing module sends the second image to the second image processing module.
  • the first image processing module sends facial feature information to the second image processing module.
  • the second image processing module determines the face shape based on the facial feature information.
  • the second image processing module obtains contouring parameters corresponding to the face shape from the database.
  • the second image processing module performs face-retouching processing on the face of the second image based on the face-retouching parameters to obtain a third image.
  • the third image is an image after the face-retouching processing is performed on the portrait face in the second image.
  • S1113 to S1115 can refer to S601 to S603 of the previous embodiment respectively, and their implementation principles and effects are similar, which will not be elaborated here.
  • the second image processing module sends the third image to the camera application.
  • the second image processing module sends the third image to the camera hardware abstraction layer
  • the camera hardware abstraction layer sends the third image to the camera management module
  • the camera management module sends the third image to the camera application.
  • the camera application sends the third image to the display driver to display the third image.
  • the camera application sends the third image to the window management module, and the window management module sends the third image to the display driver to display the third image.
  • the image after beauty processing i.e., the third image
  • the image after beauty processing is displayed in the preview area 108 of the shooting interface of the camera application.
  • the image processing method of this embodiment shows the interaction of various modules inside the electronic device when the beauty function is turned on.
  • the camera application optimizes and retouches the facial structure of the original image portrait by calling the underlying image processing modules of the electronic device, namely the first image processing module and the second image processing module, and presents the beautified portrait in the preview screen to meet the personalized beauty needs of different users.
  • the camera application when the portrait shooting mode is turned on, can also automatically turn on the beauty function.
  • the camera management module can query whether the automatic turning on of the beauty function is configured in the portrait shooting mode. If the automatic turning on of the beauty function is configured in the portrait shooting mode, the control information of the portrait shooting mode can also include a notification message for turning on the beauty function, so that the camera hardware abstraction layer calls the first image processing module and the second image processing module to perform portrait detection and beauty processing (the aforementioned S1107 to S1115).
  • the embodiments of the present application propose an image processing method, which is applied to electronic devices, and the method includes: in response to the operation of turning on the beauty function of the camera application, obtaining a first image including a portrait face captured by the camera; displaying a third image in the shooting interface of the camera application, the third image is the image after the first image is superimposed with a retouching mask image, the retouching mask image is a mask image that matches the face shape of the portrait face, and the retouching mask image is used to indicate the position, shape and degree of the highlight area and shadow area of the portrait face.
  • the first image is the original image captured by the camera, and the above method takes into account the differences in different portrait face shapes, and superimposes a retouching mask image that matches the face shape of the portrait face on the original image to meet the personalized beauty needs of different users and improve the portrait beauty effect.
  • the method before the shooting interface of the camera application displays the third image, the method further includes: obtaining feature information of the face of the portrait in the first image; determining the face shape of the portrait based on the feature information of the face of the portrait; obtaining a retouching mask image matching the face shape of the portrait from a database, the database including retouching mask images corresponding to different face shapes; and superimposing the first image and the retouching mask image to obtain the third image.
  • the above method determines the face shape of the portrait by obtaining the features of the face of the portrait, obtains the retouching mask image corresponding to the face shape of the portrait, and enhances the facial contour of the portrait in the image.
  • obtaining feature information of the face of the portrait in the first image includes: determining the image area where the face of the portrait in the first image is located; identifying key points of various parts of the face of the portrait in the first image through a preset facial key point detection model to obtain key point information of the face of the portrait in the first image.
  • the key point information includes position information of key points of various parts of the face of the portrait. The above method obtains key point information of various parts of the face of the portrait through detection of the facial key point detection model, providing data support for face shape analysis, matching and face adjustment.
  • the face shape of the portrait face is determined based on the feature information of the portrait face, including: determining the facial contour information of the portrait based on the key point information of the portrait face in the first image; determining the face shape of the portrait face based on the facial contour information; or, determining the face shape similarity and facial features similarity between the portrait face in the first image and multiple standard faces through a preset portrait similarity model, determining the total similarity between the portrait face and multiple standard faces, and taking the face shape of the standard face with the largest total similarity as the face shape of the portrait face in the first image.
  • the above-mentioned first method for determining the face shape of a portrait is to determine the facial contour through the key points of the portrait, and match the corresponding face shape based on the facial contour.
  • the above-mentioned second method for determining the face shape of a portrait is based on the portrait facial similarity model, calculating the similarity between the face shape of the portrait and different standard face shapes, and then determining the face shape of the portrait.
  • the positions of the highlight area and the shadow area of the portrait face in the retouching mask images corresponding to different face shapes are different, and the shapes of the highlight area and the shadow area of the portrait face in the retouching mask images corresponding to different face shapes are different.
  • the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image corresponding to different face shapes are different, including: if the face shape of the portrait face is an oval face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are water drop shapes; or, if the face shape of the portrait face is a round face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are lightning shapes; or, if the face shape of the portrait face is a rectangular face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are comb shapes; or, if the face shape of the portrait face is a diamond face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are semi-arc shapes; or, if the face shape of the portrait face is an elliptical face, the shapes of the highlight area and the shadow area of the portrait face in the retouching mask image are Z
  • the above two embodiments show the difference between the contouring mask images corresponding to different face shapes. After determining the face shape of a portrait, by matching the contouring mask image corresponding to the face shape of the portrait, differentiated contouring of the face of the portrait can be achieved, thereby improving the portrait beautification effect.
  • the method further includes: determining deformation parameters of various facial parts based on feature information of the portrait face; adjusting the structure of the portrait face in the first image by region based on the deformation parameters of various facial parts to obtain a second image; and superimposing the first image and the retouching mask image to obtain a third image, including: superimposing the second image and the retouching mask image to obtain a third image.
  • the above method first optimizes the facial structure of the portrait, and then, based on the optimized facial structure, retouches the portrait face to enhance the portrait beauty effect. It is worth noting that when optimizing the facial structure of the portrait, the structure of various facial parts of the portrait is adjusted by region to avoid affecting adjacent parts.
  • the deformation parameters of each part of the face are determined, including: based on the characteristic information of the portrait face and the facial characteristic information of the standard face, the structure of the portrait face in the first image is adaptively adjusted within a preset value range to determine the deformation parameters of each part of the portrait face.
  • the deformation parameters of each part of the face should be set within a reasonable value range, that is, the deformation parameters of each part should be set within the preset value range corresponding to each part. It can be understood that if the deformation parameters are too large, facial distortion may occur, and if the deformation parameters are too small, the optimization of the facial structure is not obvious.
  • Reasonable facial deformation parameters are generated by adaptive parameter adjustment to optimize the facial structure of the portrait.
  • the standard face includes a plurality of standard faces of different face shapes; based on the feature information of the portrait face and the facial feature information of the standard face, the structure of the portrait face in the first image is adaptively adjusted within a preset value range to determine the deformation parameters of each part of the portrait face, including: determining the portrait face based on the feature information of the portrait face The face shape of the portrait face; obtaining facial feature information of a standard face corresponding to the face shape of the portrait face; based on the feature information of the portrait face and the facial feature information of the standard face corresponding to the face shape of the portrait face, adaptively adjusting the parameters of the structure of the portrait face in the first image within a preset value range to determine the deformation parameters of each part of the portrait face.
  • the above method is to adaptively adjust the parameters of each part of the portrait face in combination with the facial features of the standard face corresponding to the face shape of the portrait face, so as to generate reasonable facial deformation parameters and optimize the face structure of the portrait face.
  • the method further includes: in response to a first operation of turning on a portrait shooting mode of a camera application, turning on a beauty function.
  • a first control is displayed on the shooting interface, and the first control is used to trigger turning on or off the beauty function; in response to a second operation acting on the first control, the beauty function is turned on.
  • the first operation may be an operation in which a user selects a portrait shooting mode in the shooting mode selection area 105 of the camera application shooting interface 101.
  • the electronic device in response to the first operation, directly turns on the beauty function.
  • the camera application switches to the portrait shooting mode, and the beauty function is not turned on at this time.
  • the first control may be the beauty function switch 103 in the preview area 102 of the camera application shooting interface 101
  • the second operation may be an operation of clicking the beauty function switch 103.
  • the electronic device turns on the beauty function. Unlike the previous example, the beauty function needs to be turned on by the user.
  • the above method shows two methods of turning on the beauty function. After turning on the beauty function, the electronic device can execute the above image processing method to meet the personalized beauty needs of different users.
  • the embodiments of the present application do not particularly limit the specific structure of the execution subject of an image processing method, as long as the code storing the image processing method of the embodiments of the present application can be run to perform processing according to the image processing method provided by the embodiments of the present application.
  • the execution subject of an image processing method provided by the embodiments of the present application may be a functional module in an electronic device that can call and execute a program, or a processing device applied to an electronic device, for example, the processing device is a chip.
  • a “module” may be a software program, a hardware circuit, or a combination of the two that implements the above functions.
  • the hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and/or other suitable components that support the described functions.
  • ASIC application specific integrated circuit
  • processor such as a shared processor, a dedicated processor, or a group processor, etc.
  • memory for executing one or more software or firmware programs, a combined logic circuit, and/or other suitable components that support the described functions.
  • modules of each example described in the embodiments of the present application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
  • An embodiment of the present application provides an electronic device, including: a memory and a processor, wherein the processor is used to call a computer program in the memory to execute a technical solution as described in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar to those of the aforementioned related embodiments, and will not be repeated here.
  • the memory may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • CD-ROM compact disc read-only memory
  • optical disc storage including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.
  • the memory can be independent and connected to the processor through a communication line, or it can be integrated with the processor.
  • the processor can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • An embodiment of the present application provides a computer-readable storage medium, which stores a computer program.
  • the computer program runs on an electronic device, the electronic device executes the technical solution of any of the above embodiments.
  • the implementation principle and technical effect are similar to those of the above-mentioned related embodiments and will not be repeated here.
  • An embodiment of the present application provides a chip, which includes a processor.
  • the processor is used to call a computer program in a memory to execute the technical solution in any of the above embodiments. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments and will not be repeated here.
  • An embodiment of the present application provides a computer program product.
  • the computer program product When the computer program product is run on an electronic device, the electronic device executes the technical solution in any of the above embodiments.
  • the implementation principle and technical effect are similar to those of the above-mentioned related embodiments and will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Library & Information Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)

Abstract

本申请提供一种图像处理方法、设备及存储介质,应用于终端技术领域。该方法包括:在电子设备开启相机应用的美颜功能的情况下,电子设备获取摄像头采集的包括人像面部的原始图像,经图像处理后,在相机应用的拍摄界面显示美颜处理后的图像,美颜处理后的图像是原始图像叠加修容掩膜图后的图像,修容掩膜图是与人像面部的脸型匹配的掩膜图,修容掩膜图用于指示人像面部高光区域和阴影区域的位置、形状和程度。上述方法考虑不同人像脸型差异,在原始图像上叠加与人像面部的脸型匹配的修容掩膜图,以满足不同用户的个性化美颜需求,提升人像美颜效果。

Description

图像处理方法、设备及存储介质
本申请要求于2023年11月22日提交中国专利局、申请号为202311578854.3、申请名称为“图像处理方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及图像处理方法、设备及存储介质。
背景技术
随着智能电子设备的普及,用户使用电子设备如手机、平板电脑等进行拍照,一部分用户会使用美颜功能,以优化脸型、调整肤色、设置妆容等。
现阶段,美颜功能通常以美颜模板形式呈现给用户,用户可以从美颜模板库中选择喜欢的美颜模板,即可拍摄一张具有美颜效果的图像。
由于美颜模板中的参数,如面部的各项形变参数、妆容参数等,都是一套固定的配置参数,对于不同用户的不同美颜需求,无法做到千人千变。
发明内容
本申请实施例提供一种图像处理方法、设备及存储介质,可满足不同用户的个性化美颜需求,提升人像美颜效果。
第一方面,本申请实施例提出一种图像处理方法,应用于电子设备,该方法包括:响应于开启相机应用的美颜功能的操作,获取摄像头采集的包括人像面部的第一图像;在相机应用的拍摄界面显示第三图像,第三图像是第一图像叠加修容掩膜图后的图像,修容掩膜图是与人像面部的脸型匹配的掩膜图,修容掩膜图用于指示人像面部高光区域和阴影区域的位置、形状和程度。第一图像为摄像头采集的原始图像,上述方法考虑不同人像脸型差异,在原始图像上叠加与人像面部的脸型匹配的修容掩膜图,以满足不同用户的个性化美颜需求,提升人像美颜效果。
第一方面的一个可选实施例中,在相机应用的拍摄界面显示第三图像之前,方法还包括:获取第一图像中人像面部的特征信息;基于人像面部的特征信息,确定人像面部的脸型;从数据库中获取与人像面部的脸型匹配的修容掩膜图,数据库包括不同脸型对应的修容掩膜图;将第一图像和修容掩膜图进行叠加处理,得到第三图像。上述方法通过获取人像面部特征,以确定人像脸型,获取人像脸型对应的修容掩膜图,提升图像中人像面部轮廓。
第一方面的一个可选实施例中,获取第一图像中人像面部的特征信息,包括:确定第一图像中人像面部所在的图像区域;通过预置的面部关键点检测模型,识别第一图像中人像面部各部位的关键点,以获取第一图像中人像面部的关键点信息。关键点信息包括人像面部各部位的关键点的位置信息。上述方法通过面部关键点检测模型的检测,以获取人像面部各部位的关键点信息,为脸型分析、匹配和面部调整等提供数据支撑。
第一方面的一个可选实施例中,基于人像面部的特征信息,确定人像面部的脸型,包 括:基于第一图像中人像面部的关键点信息,确定人像的面部轮廓信息;基于面部轮廓信息确定人像面部的脸型;或者,通过预置的人像相似度模型,确定第一图像中人像面部与多种标准脸的脸型相似度和五官相似度,确定人像面部与多种标准脸的总相似度,将总相似度最大的标准脸的脸型作为第一图像中人像面部的脸型。上述第一种确定人像脸型的方法是通过人像关键点确定面部轮廓,基于面部轮廓匹配对应的脸型。上述第二种确定人像脸型的方法是基于人像面部相似度模型,计算人像脸型与不同标准脸型的相似度,进而确定人像脸型。
第一方面的一个可选实施例中,不同脸型对应的修容掩膜图中人像面部的高光区域和阴影区域的位置不同,不同脸型对应的修容掩膜图中人像面部的高光区域和阴影区域的形状不同。
第一方面的一个可选实施例中,不同脸型对应的修容掩膜图中人像面部的高光区域和阴影区域的形状不同,包括:若人像面部的脸型为瓜子脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为水滴形状;或者,若人像面部的脸型为圆形脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为闪电形状;或者,若人像面部的脸型为长方脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为梳子形状;或者,若人像面部的脸型为菱形脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为半弧形状;或者,若人像面部的脸型为椭圆脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为Z形状;或者,若人像面部的脸型为方形脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为L形状。
上述两个实施例示出了不同脸型对应的修容掩膜图的差异,在确定人像脸型后,通过匹配人像脸型对应的修容掩膜图,可实现对人像面部的差异化修容,提升人像美颜效果。
第一方面的一个可选实施例中,该方法还包括:基于人像面部的特征信息,确定面部各部位的形变参数;基于面部各部位的形变参数,分区域调整第一图像中人像面部的结构,得到第二图像;将第一图像和修容掩膜图进行叠加处理,得到第三图像,包括:将第二图像和修容掩膜图进行叠加处理,得到第三图像。上述方法先对人像面部结构进行优化,在面部结构优化的基础上,对人像面部进行修容,以提升人像美颜效果。值得注意的是,在对人像面部结构进行优化时,是分区域调整人像面部各部位的结构,以避免对邻近部位的影响。
第一方面的一个可选实施例中,基于人像面部的特征信息,确定面部各部位的形变参数,包括:基于人像面部的特征信息以及标准脸的面部特征信息,在预设数值范围内,对第一图像中人像面部的结构进行自适应调参,以确定人像面部的各部位的形变参数。面部各部位的形变参数应设置在一个合理的数值范围内,即各部位的形变参数应设置在各部位对应的预设数值范围内。可以理解,形变参数过大,可能导致面部失真,形变参数过小,面部结构优化不明显。通过自适应调参的方式,生成合理的面部形变参数,以优化人像面部结构。
第一方面的一个可选实施例中,标准脸包括多种不同脸型的标准脸;基于人像面部的特征信息以及标准脸的面部特征信息,在预设数值范围内,对第一图像中人像面部的结构进行自适应调参,以确定人像面部的各部位的形变参数,包括:基于人像面部的特征信息,确定人像面部的脸型;获取人像面部的脸型对应的标准脸的面部特征信息;基于人像面部 的特征信息,以及人像面部的脸型对应的标准脸的面部特征信息,在预设数值范围内,对第一图像中人像面部的结构进行自适应调参,以确定人像面部的各部位的形变参数。上述方法是结合人像脸型对应的标准脸的面部特征,对人像面部各部位进行自适应调参,以生成合理的面部形变参数,优化人像面部结构。
第一方面的一个可选实施例中,该方法还包括:响应于开启相机应用的人像拍摄模式的第一操作,开启美颜功能。或者,响应于开启人像拍摄模式的第一操作,拍摄界面显示第一控件,第一控件用于触发开启或关闭美颜功能;响应于作用于第一控件的第二操作,开启美颜功能。
示例性的,参照图1,第一操作可以是用户在相机应用拍摄界面101的拍摄模式选择区域105选择人像拍摄模式的操作。一种示例,响应于该第一操作,电子设备直接开启美颜功能。另一种示例,响应于该第一操作,相机应用切换到人像拍摄模式,此时美颜功能并未开启。继续参照图1,第一控件可以是相机应用拍摄界面101的预览区域102的美颜功能开关103,第二操作可以是点击美颜功能开关103的操作,响应于该第二操作,电子设备开启美颜功能,与前一个示例不同的是,美颜功能需要用户自主打开。
上述方法示出了两种开启美颜功能的方法,在开启美颜功能后,电子设备可执行上述图像处理方法,以满足不同用户的个性化美颜需求。
第二方面,本申请实施例提供了一种图像处理装置,包括:获取模块,用于响应于开启相机应用的美颜功能的操作,获取摄像头采集的包括人像面部的第一图像;显示模块,用于在相机应用的拍摄界面显示第三图像,第三图像是第一图像叠加修容掩膜图后的图像,修容掩膜图是与人像面部的脸型匹配的掩膜图,修容掩膜图用于指示人像面部高光区域和阴影区域的位置、形状和程度。
第三方面,本申请实施例提供了一种电子设备,电子设备包括:存储器和处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面任一项所述的方法。
第四方面,本申请实施例提供了一种芯片,芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面任一项所述的方法。
第五方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行如第一方面任一项所述的方法。
第六方面,一种计算机程序产品,包括计算机程序,当计算机程序被运行时,使得计算机执行如第一方面任一项所述的方法。
应当理解的是,本申请的第二方面至第六方面与本申请的第一方面的技术方案相对应,各方面及对应的可选实施例所取得的有益效果相似,不再赘述。
附图说明
图1为本申请实施例提供的电子设备的界面变化示意图;
图2为本申请实施例提供的图像处理方法的总流程图;
图3为本申请实施例提供的图像处理方法的流程示意图一;
图4为本申请实施例提供的面部关键点的示意图;
图5为本申请实施例提供的设置人像面部结构形变参数的示意图;
图6为本申请实施例提供的图像处理方法的流程示意图二;
图7为本申请实施例提供的不同脸型对应的修容掩膜的示意图;
图8a为本申请实施例提供的瓜子脸对应的修容方法的示意图;
图8b为本申请实施例提供的圆形脸对应的修容方法的示意图;
图8c为本申请实施例提供的长方脸对应的修容方法的示意图;
图8d为本申请实施例提供的菱形脸对应的修容方法的示意图;
图8e为本申请实施例提供的椭圆脸对应的修容方法的示意图;
图8f为本申请实施例提供的方形脸对应的修容方法的示意图;
图9为本申请实施例提供的一种电子设备的结构示意图;
图10为本申请实施例提供的电子设备的软件架构示意图;
图11为本申请实施例提供的图像处理方法的流程示意图三。
具体实施方式
为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(种/个)”或其类似表达,是指的这些项中的任意组合,包括单项(种/个)或复数项(种/个)的任意组合。例如,a,b或c中的至少一项(种/个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息、用户的面部信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择授权或者拒绝。
用户在使用应用程序拍照或拍摄时,应用程序为用户提供美颜功能,现有的美颜功能包括不同风格的滤镜,不同程度的磨皮、美白、妆感、瘦脸、大眼、瘦鼻、小头等。用户在打开应用程序后,例如以短视频应用为例,用户在拍摄短视频时想要进行美颜,用户可以点击屏幕下方提供的不同美颜模板,以此来优化用户面部特征和整体拍摄风格。
然而,由于美颜模板中的参数通常是固定的配置参数,对于不同用户的不同美颜需求,无法做到千人千变。例如,某用户的眼睛较大,若美颜模板中眼部形变参数较大,该用户使用该美颜模板后,会出现眼部严重失真的问题。又例如,某用户的脸型为圆形脸,若美颜模板中下巴的修容区域较小,该用户使用该美颜模板后,瘦脸效果不佳。
针对上述问题,本申请实施例示出一种图像处理方法,在启动美颜功能的情况下,电子设备获取摄像头采集的图像中用户的面部特征信息,基于面部特征信息确定用户面部的各部位的形变参数,实现精准的面部结构优化。此外,电子设备基于面部特征信息还可以确定用户脸型,在完成对用户面部的结构优化后,还可以基于用脸型,匹配脸型对应的修容参数,以提升美颜效果。上述方法基于不同用户的面部特征进行个性化美颜,不同用户使用的美颜参数不同,不会导致美颜失真。
本申请实施例中,美颜参数包括用户面部的各部位的形变参数,妆容参数等。用户面部的各部位的形变参数包括但不限于瘦脸参数、大眼参数、瘦鼻参数、小头参数等。妆容参数包括修容参数,修容参数包括面部高光和阴影的位置、形状和程度。
在一些实施例中,美颜参数还包括磨皮参数、美白参数、肤色参数。
在一些实施例中,妆容参数还包括红唇参数、腮红参数、染眉参数、卧蚕参数、眼神光参数、亮眼参数、眼影参数、睫毛参数等。
用户可以在相机应用的拍摄界面手动打开美颜功能的开关,以启动美颜功能。或者,用户在相机应用的拍摄界面选择人像拍摄模式后,相机应用自动开启美颜功能。本申请实施例对开启美颜功能的方式不作限定。
人像拍摄模式可以根据图像中的人像确定背景,并对背景进行模糊处理,使背景呈现虚化效果,即背景虚化。
示例性的,图1为本申请实施例提供的电子设备的界面变化示意图,以电子设备为手机为例,如图1中的a所示,用户开启手机中的相机应用,可在拍摄模式选择区域104选择人像拍摄模式,拍摄界面101的预览区域102可显示美颜功能的开关103,此时预览区域102的人像为相机拍摄的原始人像。用户点击开关103,以开启美颜功能,手机检测到摄像头采集的图像中有人像面部时,可执行本申请实施例提供的图像处理方法,实现对图像中人像面部的个性化美颜,如图1中的b所示,预览区域105的人像为美颜处理后的人像,如对人像作瘦鼻、肥唇、修容等处理。
可以理解,图1所示的界面仅示例性示出了以手机为例的电子设备的一种可能的界面样式,不应构成对本申请实施例的限定。
结合图1示例,图2示出了本申请实施例提供的图像处理方法的总流程,在电子设备启动美颜功能的情况下,如图2所示,图像处理过程包括以下两个处理过程:
第一处理过程:电子设备对摄像头采集的图像进行面部识别,以获取图像中用户的面部特征信息,基于面部特征信息,确定面部各部位的形变参数,以调整用户面部结构。例如,图2中用户的鼻基底宽度较宽,且上唇厚度较薄,第一处理过程主要该用户的鼻基底和上唇进行了微调。应理解,不同用户的面部特征不同,可有针对性地对用户面部的局部部位进行适应性调整,避免面部结构失真,以满足不同用户的美颜需求。
第二处理过程:电子设备基于面部特征信息,确定用户的脸型,基于用户的脸型匹配相应的修容参数,基于修容参数对用户面部进行修容处理,以获得美颜处理后的图像。例如,图2中的d所示,对用户面部进行修容处理主要是为用户面部增加阴影和高光。应理解,不同用户的脸型不同,可有针对性地对用户面部进行修容处理,以提升用户面部的修容效果。
下面分别对第一处理过程和第二处理过程进行详细说明。
示例性的,图3为本申请实施例提供的图像处理方法的流程示意图一。图3所示的图像处理方法主要涉及上述的第一处理过程,该方法,包括:
S301.获取摄像头采集的第一图像。
在开启相机应用之后,电子设备的摄像头可实时地采集图像,摄像头采集的图像也称为原始图像。某一时刻,摄像头采集的图像为第一图像。
S302.对第一图像进行面部识别,确定第一图像中是否包含人像面部。
在接收到摄像头采集的第一图像之后,电子设备可通过预置的面部识别模型对第一图像进行面部识别,确定第一图像中是否包含人像面部,若第一图像中包含人像面部,确认人像面部所在的图像区域,执行S303。
S303.获取第一图像中人像的面部特征信息。
在确定第一图像中人像面部所在的图像区域后,电子设备可通过预置的面部关键点检测模型,识别第一图像中人像面部各部位的关键点,以获取第一图像中人像的面部特征信息,面部特征信息包括人像面部的关键点信息。
面部关键点检测模型的输入可以是面部识别模型确定的人像面部所在的图像区域,由于模型输入剔除了第一图像中的背景区域,可提升面部关键点检测模型的处理速度。
示例性的,图4为本申请实施例提供的面部关键点的示意图。图4所示的面部关键点的数量为33个,33个关键点中的28个关键点出现在面部两侧,共计14组对称点,其余5个头部关键点(1,2,33,19,20)位于面部的垂直中心线上。28个关键点包括:眉毛的6个关键点(7,3,5和6,4,8),眼睛的10个关键点(13,9,15,17,11和16,10,14,18,12),鼻子的6个关键点(21,22,23,24,25,26,)以及嘴巴的6个关键点(27,28,29,30,31,32)。
需要说明的是,图4示出的面部关键点仅作为一种示例,在一些实施例中,面部关键点检测模型可以检测更多或更少的面部关键点,例如,可增加下颌关键点、耳朵底部关键点等。
在一些实施例中,电子设备根据上述关键点可确定头部尺寸和面部各部位尺寸。例如,根据关键点1和33确定头部高度,根据关键点19和22确定耳朵的头部宽度,根据关键点13和15确定左眼宽度,根据关键点14和16确定右眼宽度,根据关键点23和24确定鼻基底宽度,根据关键点21和22确定鼻头宽度,根据关键点29和30确定嘴巴宽度等。
在一些实施例中,面部特征信息包括人像面部各部位的尺寸信息。
S304.基于第一图像中人像的面部特征信息,确定面部各部位的形变参数。
在获取第一图像中人像的面部特征信息后,电子设备可基于标准脸的面部特征信息,在预设数值范围内,对第一图像中人像的面部结构进行自适应调参,以确定人像面部的各部位的形变参数。
标准脸的面部特征信息包括标准脸的面部关键点信息以及面部各部位的标准尺寸信息,电子设备可预存标准脸的面部特征信息,用于面部机构优化。
预设数值范围包括面部各部位的形变参数调整的数值范围,例如,鼻头宽度的形变参数的预设数值范围,眼部宽度的形变参数的预设数值范围,嘴巴厚度的形变参数的预设数值范围。预设数值范围限定了面部各部位的形变参数的调整范围,应理解,形变参数过大可能导致面部失真,形变参数过小无法达到面部结构的优化效果。
标准脸可以有一种或多种。标准脸有多种,例如方形脸、瓜子脸、菱形脸、椭圆脸、 圆形脸、长形脸等,不同标准脸的面部特征信息不同,电子设备可预存多种标准脸的面部特征信息,用于面部结构优化。本申请实施例对标准脸的数据来源不作限定,可以基于人工智能AI模型生成多种标准脸,也可以从云端数据库中获取多种标准脸。
应理解,基于不同标准脸的面部特征信息,确定第一图像中人像面部各部位的形变参数,面部结构的优化效果不同。
在一些实施例中,面部特征信息还包括面部轮廓信息,面部轮廓信息可基于面部关键点确定。电子设备可基于第一图像中人像的面部特征信息中的面部轮廓信息确认脸型,进而获取脸型对应的标准脸的面部特征信息,再基于该标准脸的面部特征信息,在预设数值范围内,对第一图像中人像的面部结构进行自适应调参,以确定人像面部的各部位的形变参数。
在一些实施例中,电子设备可基于人像相似度模型确定第一图像中人像脸型,进而获取脸型对应的标准脸的面部特征信息,再基于该标准脸的面部特征信息,在预设数值范围内,对第一图像中人像的面部结构进行自适应调参,以确定人像面部的各部位的形变参数。
人像相似度模型可确定第一图像中人像面部与多种标准脸的脸型相似度值和五官相似度,进而确定人像面部与多种标准脸的总相似度,并将总相似度最大的标准脸的脸型作为第一图像中人像脸型。五官相似度包括眼睛相似度、嘴巴相似度、鼻子相似度、眉毛相似度和耳朵相似度,五官相似度可以是上述面部各部位的相似度的平均值。总相似度可以是脸型相似度和五官相似度的平均值。
不同人像与标准脸的差异部位不同,电子设备可基于人像与标准脸的差异,确定面部全部或部分部位的形变参数,相较于现有的美颜模板使用固定的一套形变参数,该方式可实现人像面部结构的差异化调参,面部结构优化效果更好。
示例性的,图5为本申请实施例提供的设置人像面部结构形变参数的示意图。基于图像中人像面部关键点信息,可确定面部各部位的尺寸信息,如图5中,x1表示左眼宽度,x2表示左眼中心与右眼中心的距离,x3表示鼻基底宽度,x4表示嘴部宽度,y1表示头部高度,y2表示下巴距离嘴部水平中心线的距离,记为下巴距离。图5仅为示例,未示出面部全部尺寸。
一种示例中,若人像的鼻基底宽度大于标准脸的鼻基底宽度,可设置鼻基底宽度的形变参数为一负值,以人像的缩短鼻基底宽度,如图5中,可在鼻基底区域内,基于鼻基底宽度的形变参数缩短人像的鼻基底宽度。本示例是在鼻基底区域内调整人像鼻基底宽度,避免对邻近部位的影响。
一种示例中,若人像的单眼宽度小于标准脸的单眼宽度,可设置单眼宽度的形变参数为一正值,以拉长人像的单眼宽度,如图5中,可在左眼区域内,基于单眼宽度的形变参数拉长人像的左眼宽度,同样方式可对应拉长人像的右眼宽度,使得左右眼对称。本示例是在左眼区域内调整左眼宽度,以及在右眼区域内调整右眼宽度,避免对邻近部位的影响。应理解,在调整左右眼宽度的同时,还应考虑左右眼眼距(如x2),使得双眼在人像面部自然分布。
一种示例中,若人像的下巴高度与标准脸的下巴高度基本一致,可设置下巴高度的形变参数为0,0表示不对人像的下巴高度进行调整。
应理解,人像面部其他部位的形变参数的调整原理与上述几个示例类似。
S305.基于面部各部位的形变参数,调整第一图像中人像的面部结构,得到第二图像。
通过比对人像与标准脸,可确定面部待调整的部位的形变参数。电子设备可基于面部各部位的形变参数,分区域调整第一图像中人像面部的各部位的结构,得到第二图像,例如第一图像为图2中a所示的图像,第二图像为图2中c所示的图像。第二图像是对第一图像中的人像进行面部结构优化后的图像。在调整人像面部的某部位时,可在该部位所在的区域内进行调整,这样可以避免对邻近部位的影响。
示例性的,在调整人像的鼻基底宽度时,首先确定出鼻基底宽度的图像区域,随后在该图像区域内施加鼻基底宽度的形变参数,相较于在人像的整个面部区域上施加鼻基底宽度的形变参数,该调整方式不会对鼻基底附近的其他部位产生影响,如鼻基底附近有法令纹,若在整个面部区域上施加鼻基底宽度的形变参数,会导致法令纹的形变,使得面部失真。
上述实施例示出的图像处理方法,通过识别摄像头采集的图像中人像的面部特征信息,基于图像中人像的面部特征信息以及标准脸的面部特征信息,确定面部各部位的形变参数,基于各部位的形变参数,分区域优化人像面部结构。相较于使用包含固定形变参数的美颜模板,该方法可有针对性地对人像面部进行适应性调整,避免面部结构失真,以满足不同用户的个性化美颜需求。
在完成人像面部结构优化后,可在优化后的面部结构上配置妆容参数,妆容参数包括修容参数等。考虑到不同人像的脸型差异,可以基于脸型的类别,配置修容参数,即不同脸型对应不同的修容参数。电子设备可基于人像的面部特征信息确定脸型,匹配脸型对应的修容参数,以提升人像美颜效果。
示例性的,图6为本申请实施例提供的图像处理方法的流程示意图二。图6所示的图像处理方法主要涉及上述的第二处理过程,该方法,包括:
S601.基于第一图像中人像的面部特征信息,确定人像脸型。
一种示例中,基于第一图像中人像面部的关键点信息,确定人像的面部轮廓信息;基于面部轮廓信息确定人像面部的脸型。另一种示例中,通过人像相似度模型,确定第一图像中人像面部与多种标准脸的脸型相似度和五官相似度,确定人像面部与多种标准脸的总相似度,将总相似度最大的标准脸的脸型作为第一图像中人像面部的脸型。
上述两个示例与前述实施例类似,具体参见前述实施例的S304部分,此处不再赘述。
S602.从数据库中获取人像脸型对应的修容参数。
电子设备的数据库预存有不同脸型对应的修容参数,电子设备从数据库中获取第一图像中人像脸型对应的修容参数。修容参数包括面部高光和阴影的位置、形状和程度。
在一些实施例中,修容参数可以是修容掩膜(mask),修容掩膜可指示人像面部高光和阴影的位置、形状和程度。修容掩膜可以看作是图层模板,可在图像中的人像面部区域叠加该图层模板,实现人像面部修容。修容掩膜也可称为修容掩膜图。
在一些实施例中,电子设备的数据库预存有不同脸型对应的修容掩膜图,电子设备从数据库中获取第一图像中人像脸型对应的修容掩膜图。
示例性的,图7为本申请实施例提供的不同脸型对应的修容掩膜的示意图,图7中a至f依次示出了方形脸、瓜子脸、菱形脸、椭圆形脸、圆形脸和长方脸的修容掩膜,由图7可知,不同脸型的面部高光和阴影区域不同。
在一些实施例中,基于不同脸型对应的修容方法,可生成不同脸型对应的修容掩膜,以优化人像面部的妆容,提升人像美颜效果。
在一些实施例中,修容掩膜用于指示面部高光区域和阴影区域的位置、形状和程度。形状包括但不限于水滴形状、闪电形状、梳子形状、半弧形状,“Z”形状,“L”形状等。
下面结合图1示例中的人像,对不同脸型对应的修容方法进行详细说明。示例性的,图8a至图8f示出了不同脸型对应的修容方法的示意图。
如图8a所示,若人像脸型为瓜子脸,可根据瓜子脸特征,在面部的位置3至6描绘高光线,在面部的位置1和2描绘阴影线,高光线和阴影线可以为水滴形状。例如,从额角两侧以水滴形状向外晕染,以生成阴影区域。
如图8b所示,若人像脸型为圆形脸,可根据圆形脸特征,在面部的位置5、6、7描绘高光线,在面部的位置1、2、3、4描绘阴影线,高光线和阴影线可以为闪电形状。例如,从颧骨至脸侧至下颌处以闪电形状向外晕染,以生成阴影区域。
如图8c所示,若人像脸型为长方脸,可根据长方脸特征,在面部的位置3和4描绘高光线,在面部的位置1、2、5、6、7、8描绘阴影线,高光线和阴影线可以为梳子形状“E”。例如,从颧骨两侧、下颌两侧、额角两侧以梳子形状向外晕染,以生成阴影区域。
如图8d所示,若人像脸型为菱形脸,可根据菱形脸特征,在面部的位置3、4、7、8描绘高光线,在面部的位置1、2、5、6描绘阴影线,高光线和阴影线可以为半弧形状“C”。例如,颧骨处从边缘以半弧形状向内晕染,以生成阴影区域。
如图8e所示,若人像脸型为椭圆脸,可根据椭圆脸特征,在面部的位置7至10描绘高光线,在面部的位置1至6描绘阴影线,高光线和阴影线可以为“Z”形状。例如,从颧骨两侧、下颌两侧、额角两侧以“Z”形状向外晕染,以生成阴影区域。
如图8f所示,若人像脸型为方形脸,可根据方形脸特征,在面部的位置7、8、11至14描绘高光线,在面部的位置1至6、9、10、15、16描绘阴影线,高光线和阴影线可以为“L”形状。例如,从颧骨两侧、下颌两侧、额角两侧以“L”形状向外晕染,以生成阴影区域。
需要说明的是,图8a至图8f中,若修容区域被其他物体遮挡,如被头发遮挡,该修容区域不叠加对应的高光区域或阴影区域。
S603.基于人像脸型对应的修容参数,对第二图像中的人像面部进行修容处理,得到第三图像。
电子设备获取人像脸型对应的修容参数,基于修容参数中的面部高光位置和程度,在第二图像中的人像面部叠加高光区域,以及基于修容参数中的面部阴影位置和程度,在第二图像中的人像面部叠加阴影区域,得到第三图像,第三图像中人像面部叠加了高光和阴影。
例如,第二图像为图2中c所示的图像,第三图像为图2中d所示的图像。
在一些实施例中,人像脸型对应的修容参数可以是修容掩膜。电子设备可通过对修容掩膜和第二图像进行图像运算,得到第三图像。一种示例中,电子设备确定修容掩膜中每个像素对应至第二图像中人像面部的像素,对修容掩膜中每个像素和第二图像中该像素对应的像素进行与运算,得到第三图像。
上述实施例示出的图像处理方法,通过识别摄像头采集的图像中人像的面部特征信息, 确定人像脸型,获取人像脸型对应的修容参数,基于人像脸型对应的修容参数对人像面部进行修容,以提升人像美颜效果。该方法可有针对性地对人像面部进行修容,不同脸型修容区域和程度不同,可满足不同脸型用户的个性化美颜需求。
在一些实施例中,电子设备可基于人像面部各部位的特征,对第三图像中的人像面部各部位进行美妆处理,得到第四图像。可通过执行以下至少一个示例,得到第四图像:
一种示例中,电子设备基于人像眼部特征,获取人像眼部特征对应的妆容参数,例如卧蚕参数、眼神光参数、亮眼参数、眼影参数、睫毛参数等,基于人像眼部特征对应的妆容参数,对第三图像中人像眼部进行美妆处理。
一种示例中,电子设备基于人像眉部特征,获取人像眉部特征对应的妆容参数,例如染眉参数,基于人像眉部特征对应的妆容参数,对第三图像中人像眉部进行美妆处理。
一种示例中,电子设备基于人像唇部特征,获取人像唇部特征对应的妆容参数,例如红唇参数,基于人像唇部特征对应的妆容参数,对第三图像中人像唇部进行美妆处理。
一种示例中,电子设备基于人像脸部特征,获取人像脸部特征对应的妆容参数,如腮红参数,基于人像脸部特征对应的妆容参数,对第三图像中人像脸部进行美妆处理。
上述实施例示出的图像处理方法,通过识别人像面部各部位的特征,针对人像面部各部位进行有针对性的美妆处理,以达到更好的美颜效果。
上述电子设备也可以称为终端(terminal)、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等。电子设备可以为具有拍摄和显示功能的手机(mobile phone)、智能电视、穿戴式设备、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)电子设备、增强现实(augmented reality,AR)电子设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等。本申请实施例对电子设备所采用的具体技术和具体设备形态不做限定。
示例性的,图9为本申请实施例提供的一种电子设备的结构示意图。如图9所示,电子设备100包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,传感器180,按键190,摄像头193,显示屏194。
可以理解,本实施例示意的结构并不构成对电子设备100的具体限定。在一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件,或软件和硬件的组合实现。
可以理解,实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
处理器110可以包括一个或多个处理单元。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器110中还可以设置存储器,用于存储指令和数据。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备充电,也可以用于电子设备与外围设备之间传输数据,也可以用于连接耳机,通过耳机播放音频。
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN),蓝牙,全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),NFC,红外技术(infrared,IR)等无线通信的解决方案。
电子设备100通过GPU,显示屏194,以及应用处理器等可以实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过图像信号处理(image signal process,ISP)模块,一个或多个摄像头193,视频编解码器,GPU,一个或多个显示屏194以及应用处理器等实现拍摄功能。
摄像头193用于捕获静态图像或视频。在一些实施例中,电子设备100可以包括一个或N个摄像头193,N为大于1的正整数。摄像头193包括镜头、图像传感器(如CMOS图像传感器(complementary metal oxide semiconductor image sensor,简称CIS))、马达等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐、照片、视频等数据文件保存在外部存储卡中。
内部存储器121可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器110可以通过运行存储在内部存储器121的上述指令,从而使得电子设备100执行各种功能应用以及数据处理等。
传感器180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器180K,环境光传感器,骨传导传感器等。
触摸传感器180K,也可称触控面板。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称触控屏。触摸传感器180K用于检测作用于其上或附近的触摸操作,并将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。
按键190包括开机键,音量键等。按键190可以是机械按键,也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入,例如,在开启相机应用的情况下,用户可通过按压开机键触发相机拍照或录像。
电子设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的软件系统为安卓(Android)系统为例,示例性说明电 子设备的软件结构。
图10为本申请实施例提供的电子设备的软件架构示意图。分层架构将电子设备的软件系统分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。如图10所示,电子设备包括应用程序层,应用程序框架层,硬件抽象层和驱动层和系统服务层。
应用程序层包括相机应用和第三方应用,相机应用为系统应用,第三方应用包括但不限于短视频应用,摄像类应用,图像处理类应用等。用户可以使用相机应用拍摄图像或视频,用户也可以使用第三方应用调取相机拍摄图像或视频。在一些实施例中,应用程序包还可以包括图库,日历,通话,地图,导航,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层可为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。本申请实施例中,应用程序框架层包括相机管理模块和窗口管理模块。相机管理模块负责管理相机设备信息,相机应用可通过相机管理模块获取相机特性,如摄像头个数、拍摄能力等参数。在一些实施例中,相机管理模块还可用于在相机应用与相机硬件抽象层之间传输数据,例如,相机应用通过相机管理模块向相机硬件抽象层传输开启美颜功能的通知消息,以便相机硬件抽象层在接收到相机拍摄的原始图像后,调取相机算法模块,对原始图像中的人像进行美颜处理。窗口管理模块负责管理应用程序中的窗口以及与用户界面的交互,例如负责管理相机应用窗口,将窗口内容(包括相机拍摄的原始图像或美颜处理后的图像)送至显示驱动显示。
硬件抽象层是位于内核层与硬件电路之间的接口层。本申请实施例中,硬件抽象层包括相机硬件抽象层和相机算法模块,相机硬件抽象层可调用相机算法模块,以优化相机拍摄的图像或视频。在一些实施例中,相机算法模块包括第一图像处理模块和第二图像处理模块,第一图像处理模块用于检测摄像头采集的图像,获取图像中人像面部特征信息,如人像面部关键点信息,并基于人像面部特征信息,确定面部各部位的形变参数,基于形变参数调整图像中用户面部结构,将面部结构调整后的图像传输至第二图像处理模块。第二图像处理模块用于从第一图像处理模块获取图像中人像面部特征信息,基于人像面部特征信息确定脸型,匹配相应的修容参数,基于修容参数对人像面部进行修容处理,以获得美颜处理后的图像。第一图像处理模块和第二图像处理模块并行处理,可提升图像处理速度。
需要说明的是,第一图像处理模块和第二图像处理模块并不限定于硬件抽象层,在一些实施例中,第一图像处理模块和第二图像处理模块也可以位于应用程序层。例如,可以将第一图像处理模块和第二图像处理模块集成到相机应用或第三方应用中,或者,相机应用或第三方应用通过调用应用程序层的第一图像处理模块和第二图像处理模块,以实现美颜功能。
在一些实施例中,第一图像处理模块和第二图像处理模块还可以集成在一个图像处理模块,具有第一图像模块和第二图像处理模块的功能。
驱动层为不同硬件设备提供驱动。本申请实施例中,驱动层可以包括相机驱动和显示驱动。相机驱动可用于驱动电子设备的摄像头工作,以采集原始图像。显示驱动用于驱动电子设备的显示屏工作,以显示摄像头采集的原始图像或者经美颜处理后的图像。
在上述所示的电子设备软硬件架构的基础上,下面结合一个具体实施例对本申请实施例提供的图像处理方法的设备内部执行过程进行说明。
示例性的,图11为本申请实施例提供的图像处理方法的流程示意图三。图11以开启人像拍摄模式,相机应用不自动开启美颜功能为例进行方案说明。如图11所示,该图像处理方法,可以包括以下步骤:
S1101.响应于开启人像拍摄模式的操作,相机应用向相机管理模块发送人像拍摄模式的通知消息。
示例性的,如图1所示,响应于用户在拍摄界面101的拍摄模式选择区域105选择人像拍摄模式的操作,应用程序层的相机应用向应用程序框架层的相机管理模块发送人像拍摄模式的通知消息,相机管理模块可查询人像拍摄模式的相机拍摄参数。
S1102.相机管理模块通过相机硬件抽象层,向相机驱动发送人像拍摄模式的控制信息。
人像拍摄模式的控制信息可以包括人像拍摄模式的相机拍摄参数,例如人像拍摄模式对应的摄像头的标识,以及摄像头的焦距值等,人像拍摄模式对应的摄像头包括长焦摄像头。
S1103.相机驱动驱动对应的摄像头工作,从摄像头获取第一图像。
相机驱动基于人像拍摄模式的控制信息中的相机拍摄参数,驱动对应的摄像头工作。第一图像为摄像头拍摄的原始图像,原始图像可以理解为未经处理的图像。
S1104.相机驱动将第一图像发送至相机硬件抽象层。
在相机应用未开启美颜功能的情况下,相机硬件抽象层在接收到相机驱动发送的第一图像后,相机硬件抽象层不会调用第一图像处理模块和第二图像处理模块,即不对第一图像进行图像处理(如,美颜处理)。相机硬件抽象层直接将第一图像通过相机管理模块传输至相机应用,以便相机应用通过窗口管理模块,将第一图像送至显示驱动显示,该过程为人像拍摄模式的常规流程,相机应用的预览界面显示的是摄像头采集的原始图像。
在一些实施例中,上述图像处理方法,还包括:
S1105.响应于开启美颜功能的操作,相机应用向相机管理模块发送开启美颜功能的通知消息。示例性的,如图1所示,响应于用户在拍摄界面101的预览区域102点击美颜功能开关103的操作,相机应用向相机管理模块发送启动美颜功能的通知消息。
S1106.相机管理模块向相机硬件抽象层发送开启美颜功能的通知消息。
相机硬件抽象层在接收到相机驱动发送的第一图像(S1104)后,执行S1107。
S1107.相机硬件抽象层向第一图像处理模块发送图像处理请求,图像处理请求包括第一图像。图像处理请求用于触发第一图像处理模块对第一图像进行面部结构调整。
S1108.第一图像处理模块识别第一图像中的面部特征信息。
第一图像处理模块中可预置有面部识别模型和面部关键点检测模型。第一图像处理模块通过面部识别模型,识别第一图像中是否包含人像面部,若识别到第一图像中包含人像面部,第一图像处理模块通过面部关键点检测模型,进一步识别人像面部各部位的关键点,以获取第一图像中人像的面部特征信息,面部特征信息包括人像面部的关键点信息。
在一些实施例中,面部特征信息还可以包括面部轮廓信息,面部轮廓信息可基于面部关键点确定。
S1109.第一图像处理模块基于面部特征信息,确定面部各部位的形变参数。
S1110.第一图像处理模块基于形变参数优化面部结构,得到第二图像。第二图像是对第一图像中的人像进行面部结构优化后的图像。
本实施例中,S1109和S1110可分别参照前文实施例的S304和S305,其实现原理和效果类似,此处不再展开。
S1111.第一图像处理模块向第二图像处理模块发送第二图像。
在S1108之后,还包括:
S1112.第一图像处理模块向第二图像处理模块发送面部特征信息。
S1113.第二图像处理模块基于面部特征信息确定脸型。
S1114.第二图像处理模块从数据库获取脸型对应的修容参数。
S1115.第二图像处理模块基于修容参数,对第二图像的面部进行修容处理,得到第三图像。第三图像是对第二图像中人像面部进行修容处理后的图像。
本实施例中,S1113至S1115可分别参照前文实施例的S601至S603,其实现原理和效果类似,此处不再展开。
S1116.第二图像处理模块向相机应用发送第三图像。
第二图像处理模块向相机硬件抽象层发送第三图像,相机硬件抽象层向相机管理模块发送第三图像,相机管理模块向相机应用发送第三图像。
S1117.相机应用将第三图像送至显示驱动,以显示第三图像。
相机应用向窗口管理模块发送第三图像,由窗口管理模块将第三图像送至显示驱动,以显示第三图像。示例性的,如图1中的b所示,在相机应用的拍摄界面的预览区域108显示美颜处理后的图像,即第三图像。
本实施例的图像处理方法示出了开启美颜功能时,电子设备内部各模块的交互情况,相机应用通过调用电子设备底层图像处理模块,即第一图像处理模块和第二图像处理模块,实现对原始图像人像面部结构优化与修容,并将美颜后的人像呈现在预览画面中,满足不同用户的个性化美颜需求。
在一些实施例中,开启人像拍摄模式的同时,相机应用也可自动开启美颜功能。相机管理模块可以在接收到相机应用的人像拍摄模式的通知消息后,查询人像拍摄模式下是否配置了自动开启美颜功能。若人像拍摄模式下配置了自动开启美颜功能,人像拍摄模式的控制信息还可以包括开启美颜功能的通知消息,以便相机硬件抽象层调用第一图像处理模块和第二图像处理模块进行人像检测和美颜处理(前述S1107至S1115)。
基于前述几个实施例,本申请实施例提出一种图像处理方法,应用于电子设备,该方法包括:响应于开启相机应用的美颜功能的操作,获取摄像头采集的包括人像面部的第一图像;在相机应用的拍摄界面显示第三图像,第三图像是第一图像叠加修容掩膜图后的图像,修容掩膜图是与人像面部的脸型匹配的掩膜图,修容掩膜图用于指示人像面部高光区域和阴影区域的位置、形状和程度。第一图像为摄像头采集的原始图像,上述方法考虑不同人像脸型差异,在原始图像上叠加与人像面部的脸型匹配的修容掩膜图,以满足不同用户的个性化美颜需求,提升人像美颜效果。
一个可选实施例中,在相机应用的拍摄界面显示第三图像之前,方法还包括:获取第一图像中人像面部的特征信息;基于人像面部的特征信息,确定人像面部的脸型;从数据库中获取与人像面部的脸型匹配的修容掩膜图,数据库包括不同脸型对应的修容掩膜图;将第一图像和修容掩膜图进行叠加处理,得到第三图像。上述方法通过获取人像面部特征,以确定人像脸型,获取人像脸型对应的修容掩膜图,提升图像中人像面部轮廓。
一个可选实施例中,获取第一图像中人像面部的特征信息,包括:确定第一图像中人像面部所在的图像区域;通过预置的面部关键点检测模型,识别第一图像中人像面部各部位的关键点,以获取第一图像中人像面部的关键点信息。关键点信息包括人像面部各部位的关键点的位置信息。上述方法通过面部关键点检测模型的检测,以获取人像面部各部位的关键点信息,为脸型分析、匹配和面部调整等提供数据支撑。
一个可选实施例中,基于人像面部的特征信息,确定人像面部的脸型,包括:基于第一图像中人像面部的关键点信息,确定人像的面部轮廓信息;基于面部轮廓信息确定人像面部的脸型;或者,通过预置的人像相似度模型,确定第一图像中人像面部与多种标准脸的脸型相似度和五官相似度,确定人像面部与多种标准脸的总相似度,将总相似度最大的标准脸的脸型作为第一图像中人像面部的脸型。上述第一种确定人像脸型的方法是通过人像关键点确定面部轮廓,基于面部轮廓匹配对应的脸型。上述第二种确定人像脸型的方法是基于人像面部相似度模型,计算人像脸型与不同标准脸型的相似度,进而确定人像脸型。
一个可选实施例中,不同脸型对应的修容掩膜图中人像面部的高光区域和阴影区域的位置不同,不同脸型对应的修容掩膜图中人像面部的高光区域和阴影区域的形状不同。
一个可选实施例中,不同脸型对应的修容掩膜图中人像面部的高光区域和阴影区域的形状不同,包括:若人像面部的脸型为瓜子脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为水滴形状;或者,若人像面部的脸型为圆形脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为闪电形状;或者,若人像面部的脸型为长方脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为梳子形状;或者,若人像面部的脸型为菱形脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为半弧形状;或者,若人像面部的脸型为椭圆脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为Z形状;或者,若人像面部的脸型为方形脸,修容掩膜图中人像面部的高光区域和阴影区域的形状为L形状。
上述两个实施例示出了不同脸型对应的修容掩膜图的差异,在确定人像脸型后,通过匹配人像脸型对应的修容掩膜图,可实现对人像面部的差异化修容,提升人像美颜效果。
一个可选实施例中,该方法还包括:基于人像面部的特征信息,确定面部各部位的形变参数;基于面部各部位的形变参数,分区域调整第一图像中人像面部的结构,得到第二图像;将第一图像和修容掩膜图进行叠加处理,得到第三图像,包括:将第二图像和修容掩膜图进行叠加处理,得到第三图像。上述方法先对人像面部结构进行优化,在面部结构优化的基础上,对人像面部进行修容,以提升人像美颜效果。值得注意的是,在对人像面部结构进行优化时,是分区域调整人像面部各部位的结构,以避免对邻近部位的影响。
一个可选实施例中,基于人像面部的特征信息,确定面部各部位的形变参数,包括:基于人像面部的特征信息以及标准脸的面部特征信息,在预设数值范围内,对第一图像中人像面部的结构进行自适应调参,以确定人像面部的各部位的形变参数。面部各部位的形变参数应设置在一个合理的数值范围内,即各部位的形变参数应设置在各部位对应的预设数值范围内。可以理解,形变参数过大,可能导致面部失真,形变参数过小,面部结构优化不明显。通过自适应调参的方式,生成合理的面部形变参数,以优化人像面部结构。
一个可选实施例中,标准脸包括多种不同脸型的标准脸;基于人像面部的特征信息以及标准脸的面部特征信息,在预设数值范围内,对第一图像中人像面部的结构进行自适应调参,以确定人像面部的各部位的形变参数,包括:基于人像面部的特征信息,确定人像 面部的脸型;获取人像面部的脸型对应的标准脸的面部特征信息;基于人像面部的特征信息,以及人像面部的脸型对应的标准脸的面部特征信息,在预设数值范围内,对第一图像中人像面部的结构进行自适应调参,以确定人像面部的各部位的形变参数。上述方法是结合人像脸型对应的标准脸的面部特征,对人像面部各部位进行自适应调参,以生成合理的面部形变参数,优化人像面部结构。
一个可选实施例中,该方法还包括:响应于开启相机应用的人像拍摄模式的第一操作,开启美颜功能。或者,响应于开启人像拍摄模式的第一操作,拍摄界面显示第一控件,第一控件用于触发开启或关闭美颜功能;响应于作用于第一控件的第二操作,开启美颜功能。
示例性的,参照图1,第一操作可以是用户在相机应用拍摄界面101的拍摄模式选择区域105选择人像拍摄模式的操作。一种示例,响应于该第一操作,电子设备直接开启美颜功能。另一种示例,响应于该第一操作,相机应用切换到人像拍摄模式,此时美颜功能并未开启。继续参照图1,第一控件可以是相机应用拍摄界面101的预览区域102的美颜功能开关103,第二操作可以是点击美颜功能开关103的操作,响应于该第二操作,电子设备开启美颜功能,与前一个示例不同的是,美颜功能需要用户自主打开。
上述方法示出了两种开启美颜功能的方法,在开启美颜功能后,电子设备可执行上述图像处理方法,以满足不同用户的个性化美颜需求。
需要说明的是,本申请实施例并未特别限定一种图像处理方法的执行主体的具体结构,只要可以通过运行存储有本申请实施例的一种图像处理方法的代码,以根据本申请实施例提供的一种图像处理方法进行处理即可。例如,本申请实施例提供的一种图像处理方法的执行主体可以是电子设备中能够调用程序并执行程序的功能模块,或者为应用于电子设备中的处理装置,例如,该处理装置为芯片。
上述实施例中,“模块”可以是实现上述功能的软件程序、硬件电路或二者结合。硬件电路可能包括应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其他支持所描述的功能的合适组件。
因此,在本申请实施例中描述的各示例的模块,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件形式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例提供一种电子设备,包括:存储器和处理器,所述处理器用于调用所述存储器中的计算机程序,以执行如前述任一方法实施例的技术方案,其实现原理和技术效果与上述相关实施例类似,此处不再赘述。
存储器可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
存储器可以是独立存在,通过通信线路与处理器相连接。存储器也可以和处理器集成在一起。
处理器可以是通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行上述任一实施例的技术方案,其实现原理和技术效果与上述相关实施例类似,此处不再赘述。
本申请实施例提供一种芯片,芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行上述任一实施例中的技术方案,其实现原理和技术效果与上述相关实施例类似,此处不再赘述。
本申请实施例提供一种计算机程序产品,当所述计算机程序产品在电子设备运行时,使得所述电子设备执行上述任一实施例中的技术方案,其实现原理和技术效果与上述相关实施例类似,此处不再赘述。
以上的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。

Claims (13)

  1. 一种图像处理方法,其特征在于,应用于电子设备,所述方法包括:
    响应于开启相机应用的美颜功能的操作,获取摄像头采集的包括人像面部的第一图像;
    在所述相机应用的拍摄界面显示第三图像,所述第三图像是所述第一图像叠加修容掩膜图后的图像,所述修容掩膜图是与所述人像面部的脸型匹配的掩膜图,所述修容掩膜图用于指示人像面部高光区域和阴影区域的位置、形状和程度。
  2. 根据权利要求1所述的方法,其特征在于,在所述相机应用的拍摄界面显示所述第三图像之前,所述方法还包括:
    获取所述第一图像中所述人像面部的特征信息;
    基于所述人像面部的特征信息,确定所述人像面部的脸型;
    从数据库中获取与所述人像面部的脸型匹配的修容掩膜图,所述数据库包括不同脸型对应的修容掩膜图;
    将所述第一图像和所述修容掩膜图进行叠加处理,得到所述第三图像。
  3. 根据权利要求2所述的方法,其特征在于,获取所述第一图像中所述人像面部的特征信息,包括:
    确定所述第一图像中所述人像面部所在的图像区域;
    通过预置的面部关键点检测模型,识别所述第一图像中所述人像面部各部位的关键点,以获取所述第一图像中所述人像面部的关键点信息。
  4. 根据权利要求2或3所述的方法,其特征在于,基于所述人像面部的特征信息,确定所述人像面部的脸型,包括:
    基于所述第一图像中所述人像面部的关键点信息,确定所述人像的面部轮廓信息;基于所述面部轮廓信息确定所述人像面部的脸型;或者
    通过预置的人像相似度模型,确定所述第一图像中所述人像面部与多种标准脸的脸型相似度和五官相似度,确定所述人像面部与所述多种标准脸的总相似度,将所述总相似度最大的标准脸的脸型作为所述第一图像中所述人像面部的脸型。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,不同脸型对应的所述修容掩膜图中所述人像面部的高光区域和阴影区域的位置不同,不同脸型对应的所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状不同。
  6. 根据权利要求5所述的方法,其特征在于,不同脸型对应的所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状不同,包括:
    若所述人像面部的脸型为瓜子脸,所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状为水滴形状;或者
    若所述人像面部的脸型为圆形脸,所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状为闪电形状;或者
    若所述人像面部的脸型为长方脸,所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状为梳子形状;或者
    若所述人像面部的脸型为菱形脸,所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状为半弧形状;或者
    若所述人像面部的脸型为椭圆脸,所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状为Z形状;或者
    若所述人像面部的脸型为方形脸,所述修容掩膜图中所述人像面部的高光区域和阴影区域的形状为L形状。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述方法还包括:
    基于所述人像面部的特征信息,确定面部各部位的形变参数;
    基于所述面部各部位的形变参数,分区域调整所述第一图像中所述人像面部的结构,得到第二图像;
    将所述第一图像和所述修容掩膜图进行叠加处理,得到所述第三图像,包括:
    将所述第二图像和所述修容掩膜图进行叠加处理,得到所述第三图像。
  8. 根据权利要求7所述的方法,其特征在于,基于所述人像面部的特征信息,确定面部各部位的形变参数,包括:
    基于所述人像面部的特征信息以及标准脸的面部特征信息,在预设数值范围内,对所述第一图像中所述人像面部的结构进行自适应调参,以确定所述人像面部的各部位的形变参数。
  9. 根据权利要求8所述的方法,其特征在于,
    所述标准脸包括多种不同脸型的标准脸;基于所述人像面部的特征信息以及标准脸的面部特征信息,在预设数值范围内,对所述第一图像中所述人像面部的结构进行自适应调参,以确定所述人像面部的各部位的形变参数,包括:
    基于所述人像面部的特征信息,确定所述人像面部的脸型;
    获取所述人像面部的脸型对应的标准脸的面部特征信息;
    基于所述人像面部的特征信息,以及所述人像面部的脸型对应的标准脸的面部特征信息,在所述预设数值范围内,对所述第一图像中所述人像面部的结构进行自适应调参,以确定所述人像面部的各部位的形变参数。
  10. 根据权利要求1至9任一项所述的方法,其特征在于,所述方法还包括:
    响应于开启相机应用的人像拍摄模式的第一操作,开启所述美颜功能;或者
    响应于开启所述人像拍摄模式的第一操作,所述拍摄界面显示第一控件,所述第一控件用于触发开启或关闭美颜功能;响应于作用于所述第一控件的第二操作,开启所述美颜功能。
  11. 一种电子设备,其特征在于,所述电子设备包括:存储器和处理器,所述处理器用于调用所述存储器中的计算机程序,以执行如权利要求1至10任一项所述的方法。
  12. 一种芯片,其特征在于,所述芯片包括处理器,所述处理器用于调用存储器中的计算机程序,以执行如权利要求1至10任一项所述的方法。
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求1至10任一项所述的方法。
PCT/CN2024/112204 2023-11-22 2024-08-14 图像处理方法、设备及存储介质 Pending WO2025107751A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311578854.3 2023-11-22
CN202311578854.3A CN120070154A (zh) 2023-11-22 2023-11-22 图像处理方法、设备及存储介质

Publications (2)

Publication Number Publication Date
WO2025107751A1 true WO2025107751A1 (zh) 2025-05-30
WO2025107751A9 WO2025107751A9 (zh) 2025-09-04

Family

ID=95788361

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/112204 Pending WO2025107751A1 (zh) 2023-11-22 2024-08-14 图像处理方法、设备及存储介质

Country Status (2)

Country Link
CN (1) CN120070154A (zh)
WO (1) WO2025107751A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107730445A (zh) * 2017-10-31 2018-02-23 广东欧珀移动通信有限公司 图像处理方法、装置、存储介质和电子设备
CN109167914A (zh) * 2018-09-25 2019-01-08 维沃移动通信有限公司 一种图像处理方法及移动终端
KR101948040B1 (ko) * 2018-03-23 2019-02-14 주식회사 트위니 얼굴형 구분에 따른 메이크업 추천 방법, 이를 구현하기 위한 프로그램이 저장된 기록매체 및 이를 구현하기 위해 매체에 저장된 컴퓨터프로그램
CN112508777A (zh) * 2020-12-18 2021-03-16 咪咕文化科技有限公司 一种美颜方法、电子设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110070493A (zh) * 2018-05-09 2019-07-30 深圳天珑无线科技有限公司 图像处理方法、装置、存储介质以及电子设备
CN109584151B (zh) * 2018-11-30 2022-12-13 腾讯科技(深圳)有限公司 人脸美化方法、装置、终端及存储介质
CN110992276A (zh) * 2019-11-18 2020-04-10 北京字节跳动网络技术有限公司 一种图像处理方法、装置、介质和电子设备
CN113487489A (zh) * 2020-07-14 2021-10-08 青岛海信电子产业控股股份有限公司 一种脸部修容显示及关键点检测模型训练方法及终端
CN112784773B (zh) * 2021-01-27 2022-09-27 展讯通信(上海)有限公司 图像处理方法及装置、存储介质、终端
CN113591562B (zh) * 2021-06-23 2024-09-24 北京旷视科技有限公司 图像处理方法、装置、电子设备及计算机可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107730445A (zh) * 2017-10-31 2018-02-23 广东欧珀移动通信有限公司 图像处理方法、装置、存储介质和电子设备
KR101948040B1 (ko) * 2018-03-23 2019-02-14 주식회사 트위니 얼굴형 구분에 따른 메이크업 추천 방법, 이를 구현하기 위한 프로그램이 저장된 기록매체 및 이를 구현하기 위해 매체에 저장된 컴퓨터프로그램
CN109167914A (zh) * 2018-09-25 2019-01-08 维沃移动通信有限公司 一种图像处理方法及移动终端
CN112508777A (zh) * 2020-12-18 2021-03-16 咪咕文化科技有限公司 一种美颜方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN120070154A (zh) 2025-05-30
WO2025107751A9 (zh) 2025-09-04

Similar Documents

Publication Publication Date Title
US11114130B2 (en) Method and device for processing video
CN109903217B (zh) 图像变形方法和装置
CN113850726B (zh) 图像变换方法和装置
CN106570110B (zh) 图像去重方法及装置
TW202008216A (zh) 人臉影像處理方法、裝置及儲存介質
CN113112505A (zh) 一种图像处理方法、装置与设备
CN108898546A (zh) 人脸图像处理方法、装置及设备、可读存储介质
JP6622289B2 (ja) 写真合成方法、装置、プログラム、及び記録媒体
KR20160118001A (ko) 촬영 장치, 그 제어 방법 및 컴퓨터로 판독 가능한 기록매체.
KR20160142742A (ko) 메이크업 거울을 제공하는 디바이스 및 방법
CN112351188A (zh) 根据对象显示图形元素的装置和方法
WO2021120626A1 (zh) 一种图像处理方法、终端及计算机存储介质
KR20220092771A (ko) 촬영 방법 및 장치, 단말기, 저장 매체
CN114187166A (zh) 图像处理方法、智能终端及存储介质
CN107395957A (zh) 拍照方法、装置、存储介质及电子设备
CN106997281A (zh) 共享虚拟对象的方法及智能设备
CN118488311A (zh) 变焦响应方法、电子设备及存储介质
CN108898650A (zh) 人形素材创建方法及相关装置
CN114416237B (zh) 显示状态切换方法、装置及系统、电子设备、存储介质
CN112399078B (zh) 拍摄方法、装置及电子设备
WO2022042160A1 (zh) 图像处理方法及装置
WO2025107751A9 (zh) 图像处理方法、设备及存储介质
CN117177052B (zh) 图像获取方法、电子设备及计算机可读存储介质
CN112990020A (zh) Ar效果的处理方法、移动终端及可读存储介质
TWI743413B (zh) 獨照生成裝置和方法及其非揮發性電腦可讀媒體

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24892913

Country of ref document: EP

Kind code of ref document: A1