Search

CN-121982271-A - Image processing method and device

CN121982271ACN 121982271 ACN121982271 ACN 121982271ACN-121982271-A

Abstract

The application discloses an image processing method and device, belonging to the technical field of image processing, wherein the method comprises the steps of obtaining face three-dimensional data corresponding to a portrait in a first portrait image; the method comprises the steps of determining at least one first tone subarea image in a first portrait image based on face three-dimensional data, obtaining corresponding area boundary image information based on each first tone subarea image, and carrying out image processing on the first portrait image based on the area boundary image information corresponding to each first tone subarea image to obtain a second portrait image.

Inventors

  • YU JUNCHENG
  • Sun Xunlai

Assignees

  • 维沃移动通信有限公司

Dates

Publication Date
20260505
Application Date
20260129

Claims (10)

  1. 1. An image processing method, the method comprising: acquiring face three-dimensional data corresponding to a portrait in a first portrait image; Determining at least one first tonal partition image in the first portrait image based on the facial three-dimensional data; Acquiring corresponding region boundary image information based on each first tone partition image; And carrying out image processing on the first portrait image based on the region boundary image information corresponding to each first tone partition image to obtain a second portrait image.
  2. 2. The method of claim 1, wherein the acquiring facial three-dimensional data corresponding to the person in the first person image comprises: Performing face key point detection on the first human image to obtain key point information of at least one face key point, wherein each key point information comprises face key point characteristic information and coordinate information of the face key point; Based on the key point information of each face key point, constructing a face model to obtain a three-dimensional face model; And carrying out facial geometric feature extraction processing on the three-dimensional face model to obtain the facial three-dimensional data.
  3. 3. The method of claim 1, wherein the determining at least one first tone partition image of the first portrait image based on the facial three-dimensional data includes: acquiring illumination direction characteristic information and illumination intensity characteristic information in the first human image based on the face three-dimensional data; and determining the at least one first tone partition image based on the illumination direction characteristic information and the illumination intensity characteristic information.
  4. 4. The method of claim 3, wherein the facial three-dimensional data comprises facial geometry attribute information, facial geometry associated information, and facial topology information; the obtaining, based on the face three-dimensional data, illumination direction feature information and illumination intensity feature information in the first portrait image includes: Determining a highlight region and a shadow region in the first human image based on the facial geometry attribute information, the facial geometry associated information and the facial topology information, wherein the highlight region is an image region with a brightness value greater than or equal to a first preset brightness threshold value in the first human image, and the shadow region is an image region with a brightness value smaller than a second preset brightness threshold value in the first human image; determining the illumination direction characteristic information based on the spatial distribution information of the highlight region and the shadow region in the first human image; and carrying out data integration processing on a first included angle between the vertex normal vector of the highlight region and the illumination direction, an average brightness value corresponding to the highlight region and a gray level attenuation gradient value corresponding to the shadow region to obtain the illumination intensity characteristic information.
  5. 5. A method according to claim 3, wherein said determining the at least one first tone partition image based on the illumination direction feature information and illumination intensity feature information comprises: Based on the illumination direction characteristic information and the illumination intensity characteristic information, carrying out region clustering on the first human image to obtain at least one tone region; Extracting boundary characteristics of images in each tone region to obtain boundary image characteristic information corresponding to each tone region; performing texture analysis and light shadow processing on each boundary characteristic information to obtain light shadow distribution data corresponding to each boundary characteristic information; performing color correction on the light and shadow distribution data to obtain a color distribution map; And carrying out region segmentation on the first portrait image based on the color distribution map to obtain at least one first tone subarea image.
  6. 6. The method of claim 1, wherein the obtaining, based on each of the first tonal partition images, corresponding region boundary image information includes: Performing feature extraction processing on each first tone partition image to obtain skin color feature information and skeleton feature information corresponding to each first tone partition image; Carrying out quantization analysis on skin color characteristic information and skeleton characteristic information corresponding to each first tone partition image to generate personalized tone parameters corresponding to each first tone partition image, wherein the personalized tone parameters comprise a brightness reference value, a contrast threshold value and a saturation adjustment coefficient; And carrying out gradient fusion smoothing processing on brightness values of boundary pixel points of each first tone subarea image based on the personalized tone parameters corresponding to each first tone subarea image to obtain region boundary information corresponding to each first tone subarea image.
  7. 7. The method according to claim 1, wherein the performing image processing on the first portrait image based on the region boundary image information corresponding to each of the first tone region images to obtain a second portrait image includes: Performing curve fitting processing based on the region boundary image information corresponding to each first tone region image to obtain a light-dark change curve; And carrying out brightness adjustment processing on the first portrait image based on the brightness change curve to obtain the second portrait image.
  8. 8. The method of claim 7, wherein performing brightness adjustment processing on the first portrait image based on the shading profile to obtain the second portrait image includes: Under the condition that the curve slope of the light-dark change curve is larger than or equal to a preset slope threshold, performing cubic spline interpolation processing on the light-dark change curve to obtain the interpolated light-dark change curve; and carrying out brightness adjustment processing on the first portrait image based on the interpolated light-dark change curve to obtain the second portrait image.
  9. 9. The method of claim 8, wherein the performing brightness adjustment processing on the first portrait image based on the interpolated shading profile to obtain the second portrait image includes: Based on the interpolated light and shade change curve, performing brightness adjustment processing on the first portrait image to obtain an adjusted first portrait image; performing brightness enhancement processing based on the adjusted first portrait image to obtain a processed first portrait image; And carrying out edge sharpening processing on the processed first portrait image to obtain the second portrait image.
  10. 10. An image processing device is characterized by comprising an acquisition module, a determination module and a processing module; The acquisition module is used for acquiring face three-dimensional data corresponding to the portrait in the first portrait image; the determining module is used for determining at least one first tone partition image in the first portrait image based on the face three-dimensional data acquired by the acquiring module; The acquisition module is further used for acquiring corresponding area boundary image information based on each first tone partition image determined by the determination module; The processing module is configured to perform image processing on the first portrait image based on the region boundary image information corresponding to each of the first tone partition images acquired by the acquiring module, so as to obtain a second portrait image.

Description

Image processing method and device Technical Field The application belongs to the technical field of image processing, and particularly relates to an image processing method and device. Background At present, with the development of electronic devices, functions in the electronic devices are increasing, for example, the electronic devices can process a portrait tone on a picture, and the portrait tone refers to a picture effect of different brightness and color levels formed by controlling factors such as light, background, clothing and the like in portrait photography. In the related art, the portrait session processing method generally performs overall brightness adjustment based on information such as pixel brightness and contrast of an image. For example, the image shading effect is improved by tone adjustment of the global luminance histogram, i.e. by stretching or compressing the global luminance histogram distribution. However, in the above method, the adjustment of the tone is performed by the image information, so that the facial protrusion of the face part in the picture, such as nose, eyebrow and depression, such as eye socket and nose bottom, cannot be reflected, and the judgment of the highlight and shadow areas is inaccurate, and the image processing effect is inconsistent with the real illumination law. Thus, the accuracy of the electronic equipment for optimizing the portrait tone is poor. Disclosure of Invention The embodiment of the application aims to provide an image processing method and device, which can improve the accuracy of image tone optimization of electronic equipment. In a first aspect, an embodiment of the present application provides an image processing method, where the image processing method includes obtaining face three-dimensional data corresponding to a person in a first person image, determining at least one first tone partition image in the first person image based on the face three-dimensional data, obtaining corresponding region boundary image information based on each first tone partition image, and performing image processing on the first person image based on the region boundary image information corresponding to each first tone partition image to obtain a second person image. In a second aspect, an embodiment of the present application provides an image processing apparatus, including an acquisition module, a determination module, and a processing module. And the acquisition module is used for acquiring the face three-dimensional data corresponding to the portrait in the first portrait image. And the determining module is used for determining at least one first tone subarea image in the first human image based on the face three-dimensional data acquired by the acquiring module. The acquisition module is further used for acquiring corresponding region boundary image information based on each first tone partition image determined by the determination module. And the processing module is used for carrying out image processing on the first portrait image based on the region boundary image information corresponding to each first tone partition image acquired by the acquisition module to acquire a second portrait image. In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect. In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect. In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect. In a sixth aspect, embodiments of the present application provide a computer program/program product stored in a storage medium, the program/program product being executable by at least one processor to implement the method according to the first aspect. In the embodiment of the application, the light and shadow characteristics of the convex or concave area of the face of the person in the first person image can be truly restored through the three-dimensional data of the face, so that the recognition of the highlight and shadow areas is more in accordance with the physical illumination rule, and the problem of light and shadow judgment distortion in the traditional method is solved. Therefore, the accuracy of the electronic equipment in carrying out the portrait tone optimization is improved. Drawings FIG. 1 is one of the flowcharts of an image processing method according to an embodiment of the pres