Search

CN-121981933-A - Image processing method and device and electronic equipment

CN121981933ACN 121981933 ACN121981933 ACN 121981933ACN-121981933-A

Abstract

The application discloses an image processing method, an image processing device and electronic equipment, and belongs to the technical field of image processing; and performing light and shadow adjustment processing on the second image based on the light and shadow mapping information of the first image to obtain a third image, wherein the light and shadow mapping information comprises at least one of light and shadow distribution information and light and shadow change information.

Inventors

  • MA GUODONG
  • YU JUNCHENG

Assignees

  • 维沃移动通信有限公司

Dates

Publication Date
20260505
Application Date
20260120

Claims (10)

  1. 1. An image processing method, the method comprising: Performing region segmentation processing on the first human image to obtain N image regions, wherein N is a positive integer; according to the characteristic information of each image area, carrying out corresponding first brightness adjustment processing on each image area to obtain a second portrait image; And performing light and shadow adjustment processing on the second image based on the light and shadow mapping information of the first image to obtain a third image, wherein the light and shadow mapping information comprises at least one of light and shadow distribution information and light and shadow change information.
  2. 2. The method of claim 1, wherein prior to performing the region segmentation process on the first image to obtain N image regions, the method further comprises: converting an RGB color space of the first portrait image into an LAB color space; acquiring data of a brightness channel of the first portrait image in the LAB color space; and performing corresponding first brightness adjustment processing on each image area according to the characteristic information of each image area to obtain a second portrait image, wherein the method comprises the following steps: And carrying out corresponding first brightness adjustment processing on the data of the brightness channels of each image area in the LAB color space according to the characteristic information of each image area to obtain the second portrait image.
  3. 3. The method according to claim 1 or 2, wherein the performing the region segmentation process on the first image to obtain N image regions includes: And carrying out region segmentation processing on the first human image based on the image characteristic information of the first human image to obtain the N image regions, wherein the image characteristic information comprises at least one of color characteristic information, texture characteristic information and shape characteristic information.
  4. 4. The method according to claim 1 or 2, wherein the performing the region segmentation process on the first image to obtain N image regions includes: dividing the first portrait image into M image areas, wherein M is an integer greater than N; and merging the image areas matched with the characteristic information in the M image areas based on the characteristic information of the M image areas to obtain the N image areas.
  5. 5. The method of claim 1, wherein after performing the region segmentation process on the first image to obtain N image regions, the method further comprises: And performing first image processing on the N image areas based on the texture characteristic information of each image area, wherein the first image processing comprises at least one of second brightness adjustment processing, color correction processing and contrast enhancement processing.
  6. 6. The method according to claim 1, wherein the performing the corresponding first brightness adjustment process on each image area according to the feature information of each image area to obtain the second portrait image includes: And carrying out corresponding first brightness adjustment processing on the highlight region and the shadow region according to the characteristic information of the highlight region and the shadow region in the N image regions to obtain the second portrait image.
  7. 7. The method according to claim 1 or 6, wherein the performing a shading adjustment process on the second portrait image based on the shading mapping information of the first portrait image, before obtaining a third portrait image, the method further includes: performing image blurring processing on the first image to obtain a blurred first image; And carrying out gradient calculation on the first image after the blurring processing to obtain the shadow mapping information of the first image.
  8. 8. The method according to claim 1, wherein performing a shading adjustment process on the second portrait image based on the shading mapping information of the first portrait image, to obtain a third portrait image, includes: And carrying out weighted fusion on the light and shadow mapping information of the first human image and the second human image based on the assigned weight value corresponding to each pixel of the second human image to obtain the third human image, wherein the assigned weight value of each pixel is determined based on the gray value of the corresponding pixel in the light and shadow mapping information.
  9. 9. An image processing apparatus, characterized in that the image processing apparatus includes a processing module; The processing module is used for carrying out region segmentation processing on the first portrait image to obtain N image regions, wherein N is a positive integer; the processing module is further used for carrying out corresponding first brightness adjustment processing on each image area according to the characteristic information of each image area to obtain a second portrait image; The processing module is further configured to perform a light and shadow adjustment process on the second image based on the light and shadow mapping information of the first image to obtain a third image, where the light and shadow mapping information includes at least one of light and shadow distribution information and light and shadow variation information.
  10. 10. 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 image processing method of any one of claims 1 to 8.

Description

Image processing method and device and electronic equipment Technical Field The application belongs to the technical field of image processing, and particularly relates to an image processing method, an image processing device and electronic equipment. Background In the present digital age, the application scene of the image is increasingly wide, and the quality requirement of the user on the portrait image is also increasingly high. However, in the actual photographing process, various problems such as noise interference, color deviation, uneven light and shadow, and loss of detail often exist in the portrait image due to the influence of various factors such as ambient light, camera equipment, photographing skill, etc., and these problems seriously affect the visual effect of the image. Thus, the user can sequentially adjust the questions in the image by the image processing application according to the need. However, in the above method, various problems existing in the portrait image cannot be solved comprehensively and systematically, so that the display effect of the processed portrait image is not ideal, and the image quality is poor. Disclosure of Invention An object of an embodiment of the present application is to provide an image processing method, an apparatus, an electronic device, a storage medium, and a program product, which can improve the light and shadow display effect and the image quality of a processed portrait image. In a first aspect, an embodiment of the present application provides an image processing method, where the image processing method includes performing region segmentation processing on a first image to obtain N image regions, where N is a positive integer, performing corresponding first brightness adjustment processing on each image region according to feature information of each image region to obtain a second image, and performing light and shadow adjustment processing on the second image based on light and shadow mapping information of the first image to obtain a third image, where the light and shadow mapping information includes at least one of light and shadow distribution information and light and shadow variation information. In a second aspect, an embodiment of the present application provides an image processing apparatus, where the image processing apparatus includes a processing module, and a processing module, where the processing module is configured to perform region segmentation processing on a first image to obtain N image regions, where N is a positive integer, the processing module is further configured to perform corresponding first brightness adjustment processing on each image region according to feature information of each image region to obtain a second image, and the processing module is further configured to perform light and shadow adjustment processing on the second image based on light and shadow mapping information of the first image to obtain a third image, where the light and shadow mapping information includes at least one of light and shadow distribution information and light and shadow change information. 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 electronic device may perform the region division processing on the first image to obtain N image regions, so the electronic device may perform the corresponding first brightness adjustment processing on each image region according to the feature information of each image region in the N image regions of the first image, that is, each image region may perform the first brightness adjustment processing with different degrees, that is, the electronic device may perform more accurate processing on each image region, so as to improve the image quality. Then, the electronic device may perform the light and shadow adjustment processing on the second image according to the light and shadow mapping in