CN-116977190-B - Image processing method, apparatus, device, storage medium, and program product
Abstract
The application discloses an image processing method, an image processing device, image processing equipment, a storage medium and a program product, and relates to the technical field of image processing. The method comprises the steps of obtaining a first image, obtaining a preset mapping curve, carrying out feature analysis on the first image to obtain a curve correction coefficient corresponding to the first image, correcting curve parameters of the preset mapping curve by the curve correction coefficient to obtain a target mapping curve, and carrying out color parameter adjustment on the first image based on the target mapping curve to obtain a second image corresponding to the first image. When the color parameters of the first image are adjusted, only the correction coefficient is needed to be calculated instead of the whole mapping curve, so that the calculated amount is greatly reduced, and the efficiency of the image color enhancement processing is improved.
Inventors
- ZENG XIANFANG
- FU CHEN
- CHENG PEI
- YU GANG
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220415
Claims (12)
- 1. An image processing method, the method comprising: inputting a first image into a curve correction model to generate an image feature representation of the first image, wherein the image feature representation comprises at least one of texture feature representation, global feature representation, local feature representation and semantic feature representation; the curve correction model is a neural network model obtained by training based on training loss by taking a sample image pair as a training sample, wherein the training loss comprises at least one of pixel consistency loss and noise robustness loss; Performing feature analysis on the image feature representation through the curve correction model to obtain a curve correction coefficient corresponding to the first image; Correcting curve parameters of a preset mapping curve through the curve correction coefficient to obtain a target mapping curve; and carrying out color parameter adjustment on the first image based on the target mapping curve to obtain a second image.
- 2. The method of claim 1, wherein the inputting the first image into the curve modification model generates an image feature representation of the first image comprises: Inputting the first image into the curve correction model, and generating a texture feature representation of the first image, wherein the texture feature representation is used for indicating the image texture feature of the first image; Generating a global feature representation of the first image based on the texture feature representation, the global feature representation being indicative of global image features of the first image; Generating a local feature representation of the first image based on the texture feature representation, the local feature representation being indicative of image features of sub-regions in the first image; Generating a semantic feature representation of the first image based on the textural feature representation, the semantic feature representation being used to indicate semantic content contained by the first image; And fusing the texture feature representation, the global feature representation, the local feature representation and the semantic feature representation to obtain an image feature representation of the first image.
- 3. The method of claim 1 or 2, wherein the inputting the first image into the curve modification model generates an image feature representation of the first image, comprising: partitioning the first image to obtain at least two image blocks; inputting the at least two image blocks into the curve correction model, and generating image block characteristic representations corresponding to each of the at least two image blocks; Performing feature analysis on the image feature representation through the curve correction model to obtain a curve correction coefficient corresponding to the first image, including: And carrying out feature analysis on the image block feature representations corresponding to the at least two image blocks respectively to obtain block correction coefficients corresponding to the at least two image blocks respectively, wherein the curve correction coefficients are sets of at least two block correction coefficients.
- 4. A method according to claim 3, wherein said blocking the first image to obtain at least two image blocks comprises: the first image is divided into at least two image blocks according to the preset dividing number, or And randomly partitioning the first image to obtain the at least two image blocks.
- 5. The method according to claim 1 or 2, wherein the correcting the curve parameter of the preset mapping curve by the curve correction coefficient to obtain the target mapping curve includes: and carrying out weighted summation on the curve correction coefficient and the preset mapping curve to obtain the target mapping curve.
- 6. The method according to claim 1 or 2, wherein the curve modification coefficients comprise n sub-coefficients, n being an integer greater than 1; correcting curve parameters of a preset mapping curve through the curve correction coefficient to obtain a target mapping curve, wherein the method comprises the following steps: Carrying out segmentation processing on the preset mapping curve to obtain n segmented mapping curves; And correcting the n segmented mapping curves through n sub-coefficients to obtain the target mapping curve, wherein the kth segmented mapping curve is corrected through the kth sub-coefficient, k is a positive integer and k is less than or equal to n.
- 7. The method of claim 6, wherein the segmenting the preset mapping curve to obtain n segmented mapping curves comprises: carrying out average segmentation processing on the preset mapping curve according to the abscissa of the coordinate axis where the preset mapping curve is located to obtain n segmented mapping curves; Or alternatively And carrying out average segmentation processing on the preset mapping curve according to the ordinate of the coordinate axis where the preset mapping curve is located, so as to obtain n segmentation mapping curves.
- 8. The method according to claim 1 or 2, wherein said performing color parameter adjustment on the first image based on the target mapping curve to obtain a second image comprises: performing pixel-level feature transformation on the first image to obtain a full-resolution feature map corresponding to the first image; The target mapping curve is acted on the full-resolution feature map, and a pixel-level mapping coefficient is obtained through linear interpolation; and applying the pixel-level mapping coefficient to the first image to obtain the second image.
- 9. An image processing apparatus, characterized in that the apparatus comprises: The analysis module is used for inputting a first image into a curve correction model to generate an image characteristic representation of the first image, wherein the image characteristic representation comprises at least one of texture characteristic representation, global characteristic representation, local characteristic representation and semantic characteristic representation, the curve correction model is a neural network model which is obtained by training a sample image pair as a training sample based on training loss, and the training loss comprises at least one of pixel consistency loss and noise robust loss; The correction module is used for correcting curve parameters of a preset mapping curve through the curve correction coefficient to obtain a target mapping curve; And the adjusting module is used for adjusting the color parameters of the first image based on the target mapping curve to obtain a second image.
- 10. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one program that is loaded and executed by the processor to implement the image processing method of any of claims 1 to 8.
- 11. A computer readable storage medium having stored therein at least one program code loaded and executed by a processor to implement the image processing method of any one of claims 1 to 8.
- 12. A computer program product comprising a computer program which, when executed by a processor, implements the image processing method according to any one of claims 1 to 8.
Description
Image processing method, apparatus, device, storage medium, and program product Technical Field Embodiments of the present application relate to the field of image processing technologies, and in particular, to an image processing method, apparatus, device, storage medium, and program product. Background When an image is shot through a mobile terminal, the shot image is affected by factors such as equipment, environment, shooting technology and the like, the problems of local exposure, picture gray, color oligose and the like can occur, and the image is often required to be subjected to color enhancement processing to obtain an optimized image. In the related art, a mapping curve between images can be fitted directly by training a depth neural network in a depth bilateral learning algorithm, and a target image to be subjected to color enhancement is input into the trained depth bilateral learning algorithm to obtain an optimized image. However, the difficulty of the fitting process of the mapping curve in the algorithm is high, the deep neural network is required to contain more parameters, the calculation amount of the algorithm is high, the speed of the target image color enhancement processing is low, and the efficiency of the color enhancement processing is low. Disclosure of Invention The embodiment of the application provides an image processing method, an image processing device, a storage medium and a program product, which can improve the efficiency of color enhancement processing. The technical scheme is as follows: in one aspect, there is provided an image processing method, the method including: acquiring a first image, wherein the first image is an image to be subjected to color parameter adjustment; acquiring a preset mapping curve, wherein the preset mapping curve corresponds to preset curve parameters; performing feature analysis on the first image to obtain a curve correction coefficient corresponding to the first image; Correcting curve parameters of the preset mapping curve by the curve correction coefficient to obtain a target mapping curve; And carrying out color parameter adjustment on the first image based on the target mapping curve to obtain a second image corresponding to the first image, wherein the second image is an image subjected to color parameter adjustment on the basis of the first image. In another aspect, there is provided an image processing apparatus including: The acquisition module is used for acquiring a first image, wherein the first image is an image to be subjected to color parameter adjustment; The acquisition module is further used for acquiring a preset mapping curve, wherein the preset mapping curve corresponds to preset curve parameters; the analysis module is used for carrying out feature analysis on the first image to obtain a curve correction coefficient corresponding to the first image; The correction module is used for correcting the curve parameters of the preset mapping curve by the curve correction coefficient to obtain a target mapping curve; and the adjusting module is used for adjusting the color parameters of the first image based on the target mapping curve to obtain a second image corresponding to the first image, wherein the second image is an image after the color parameters are adjusted on the basis of the first image. In another aspect, a computer device is provided, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, where the at least one instruction, the at least one program, the set of codes, or the set of instructions are loaded and executed by the processor to implement the image processing method according to any one of the embodiments of the present application. In another aspect, a computer readable storage medium is provided, where at least one program code is stored, where the at least one program code is loaded and executed by a processor to implement an image processing method according to any one of the embodiments of the present application. In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the image processing method according to any one of the embodiments of the present application. The technical scheme provided by the embodiment of the application has the beneficial effects that at least: The curve correction coefficient is obtained through characteristic analysis of the first image (the image to be subjected to color parameter adjustment), the preset mapping curve (the mapping curve of the preset curve parameter) is corrected based on the curve corr