Image processing method and device

By using the region and color parameter prediction module of the tone adjustment model, the problem of insufficient flexibility and quality in image processing in traditional and deep learning methods is solved, thereby improving the flexibility and quality of image processing.

CN120953152APending Publication Date: 2025-11-14VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511238837.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Traditional tone mapping methods are coarse and ineffective, while deep learning-based methods are prone to introducing detail blurring and contrast anomalies, resulting in poor flexibility of electronic devices in image processing and low image quality.

Method used

A tonal adjustment model is adopted, which obtains the regional adjustment weight information of the object through the regional parameter prediction module. Combined with brightness and color adjustment parameters, image processing is performed to isolate the direct interaction between the network and pixels and dynamically adjust parameters to adapt to complex scenes.

Benefits of technology

It improves the flexibility and quality of image processing in electronic devices, avoids image quality degradation, realizes the linkage between image processing and semantic content, and enhances the display effect of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953152A_ABST
    Figure CN120953152A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, and belongs to the technical field of image processing, and the method comprises the steps: inputting a first image into a first shadow adjustment model, and obtaining the image feature information of the first image; obtaining region adjustment weight information of the at least one object based on the image feature information through a region parameter prediction module in the first shadow adjustment model; acquiring a brightness adjustment parameter of at least one object based on the image feature information through a brightness adjustment parameter prediction module in the first shadow adjustment model; acquiring a color adjustment parameter of at least one object based on the image feature information through a color adjustment parameter prediction module in the first shadow adjustment model; and performing image processing on the first image based on the region adjustment weight information, the brightness adjustment parameter and the color adjustment parameter of the at least one object to obtain a second image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, specifically relating to an image processing method and apparatus. Background Technology

[0002] In the fields of digital image processing and computational photography, tone refers to the representation of light and dark levels in an image, and is a key factor affecting the atmosphere, realism, and visual aesthetics of an image. Tone mapping (TM) technology improves the visual dynamic range of an image by mapping its brightness or hue, making it adaptable to the capabilities of display devices or achieving specific visual effects. Generally, TM methods can be divided into traditional TM methods and deep learning-based TM methods.

[0003] However, while traditional TM methods are simple, their processing is coarse and ineffective. Deep learning-based TM methods, which process pixels one by one, while fully considering the relationships between adjacent pixels, are prone to introducing problems such as detail blurring, abnormal contrast, reduced resolution, and halo effects. This makes it difficult for electronic devices to understand image content and dynamically adjust algorithm parameters to adapt to complex and changing scenes. Consequently, electronic devices lack the flexibility to perform tonal mapping image processing, resulting in poor image quality. Summary of the Invention

[0004] The purpose of this application is to provide an image processing method and apparatus that can improve the flexibility of electronic devices in image processing and improve image processing quality.

[0005] In a first aspect, embodiments of this application provide an image processing method, which includes: inputting a first image into a first tone adjustment model to obtain image feature information of the first image, the first image including at least one object; obtaining region adjustment weight information of at least one object based on the image feature information using a region parameter prediction module in the first tone adjustment model; obtaining brightness adjustment parameters of at least one object based on the image feature information using a brightness adjustment parameter prediction module in the first tone adjustment model, and obtaining color adjustment parameters of at least one object based on the image feature information using a color adjustment parameter prediction module in the first tone adjustment model; and performing image processing on the first image based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object to obtain a second image.

[0006] Secondly, embodiments of this application provide an image processing apparatus, comprising: an acquisition module and a processing module; the acquisition module is configured to input a first image into a first tone adjustment model to obtain image feature information of the first image, the first image including at least one object; the acquisition module is further configured to acquire region adjustment weight information of at least one object based on the image feature information through a region parameter prediction module in the first tone adjustment model; the acquisition module is further configured to acquire brightness adjustment parameters of at least one object based on the image feature information through a brightness adjustment parameter prediction module in the first tone adjustment model, and acquire color adjustment parameters of at least one object based on the image feature information through a color adjustment parameter prediction module in the first tone adjustment model; the processing module is configured to perform image processing on the first image based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object acquired by the acquisition module to obtain a second image.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program / program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, a first image is input to a first tone adjustment model to obtain image feature information of the first image, which includes at least one object. Based on the image feature information, the region adjustment weight information of at least one object is obtained through the region parameter prediction module in the first tone adjustment model. Based on the image feature information, the brightness adjustment parameters of at least one object are obtained through the brightness adjustment parameter prediction module in the first tone adjustment model, and the color adjustment parameters of at least one object are obtained through the color adjustment parameter prediction module in the first tone adjustment model. Based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object, image processing is performed on the first image to obtain a second image. In this solution, since the first tone adjustment model can obtain the region adjustment weight parameter information, brightness adjustment parameters, and color adjustment parameters of each object in the first image based on the image feature information, during the image processing of the first image, the tone adjustment model can provide brightness and color adjustment parameters for each object based on the semantic content of the image, i.e., the objects contained in the image. This achieves the linkage between image processing and image semantic content, avoiding the situation where parameters cannot be dynamically adjusted due to the inability to understand the image content. Meanwhile, since the tone adjustment model adjusts the brightness and color of an image indirectly by incorporating weight information, it can isolate the direct interaction between the network and pixels, reducing the image quality degradation caused by the network directly modifying pixels. This improves the flexibility of image processing in electronic devices and enhances image processing quality. Attached Figure Description

[0012] Figure 1 This is one of the flowcharts of an image processing method provided in the embodiments of this application;

[0013] Figure 2 This is one of the structural schematic diagrams of a tone adjustment model provided in the embodiments of this application;

[0014] Figure 3 This is one of the schematic diagrams illustrating an example of image processing provided in this application embodiment;

[0015] Figure 4 This is a second flowchart of an image processing method provided in an embodiment of this application;

[0016] Figure 5 This is a second schematic diagram of the structure of a tone adjustment model provided in the embodiments of this application;

[0017] Figure 6A This is a second schematic diagram illustrating an example of image processing provided in this application embodiment;

[0018] Figure 6BThis is the third schematic diagram of an example of image processing provided in the embodiments of this application;

[0019] Figure 7A This is the third schematic diagram of the structure of a tone adjustment model provided in the embodiments of this application;

[0020] Figure 7B This is the fourth schematic diagram of the structure of a tone adjustment model provided in the embodiments of this application;

[0021] Figure 8 This is the fifth schematic diagram of the structure of a tone adjustment model provided in the embodiments of this application;

[0022] Figure 9 This is the third flowchart of an image processing method provided in the embodiments of this application;

[0023] Figure 10 This is the sixth schematic diagram of the structure of a tone adjustment model provided in the embodiments of this application;

[0024] Figure 11 This is the fourth flowchart of an image processing method provided in the embodiments of this application;

[0025] Figure 12 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application;

[0026] Figure 13 This is one of the hardware structure diagrams of an electronic device provided in the embodiments of this application;

[0027] Figure 14 This is a second schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0029] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects. For example, a first object can be one or more, where "more" means at least two. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0030] The terms "at least one," "at least one," etc., used in this application's specification refer to any one, any two, or a combination of two or more of the included objects. For example, "at least one of a, b, and c" can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple, and multiple means at least two. Similarly, "at least two" refers to two or more, and its meaning is similar to that of "at least one."

[0031] The terminology used in the implementation section of this application is only for explaining specific embodiments of this application and is not intended to limit this application. The terminology involved in the embodiments of this application is explained below.

[0032] In the fields of digital image processing and computational photography, tone refers to the representation of light and dark levels in an image, and is a key factor affecting the atmosphere, realism, and visual aesthetics of an image. Tone mapping technology refers to improving the visual dynamic range of an image by mapping its brightness or hue, making it adaptable to the capabilities of display devices or achieving specific visual effects. Tone mapping can be divided into: Global Tone Mapping (GTM) and Local Tone Mapping (LTM).

[0033] GTM (Gross Transformer) is an algorithm that applies a uniform mapping curve to the entire image, such as gamma correction, sigmoid curve, or logarithmic mapping. It boasts advantages such as computational simplicity and high efficiency, and is widely used in image stylization, automatic exposure adjustment, and image enhancement. However, GTM cannot flexibly adjust tonal values ​​based on local image features, potentially leading to overexposure in highlight areas or loss of detail in shadow areas, thus affecting the final image's visual appeal.

[0034] Light-to-momentum adjustment (LTM) is a method that dynamically adjusts the tonal range of an image based on the brightness information of local areas. It effectively enhances detail contrast and local structure perception, making it particularly suitable for image adjustment under complex lighting conditions. LTM typically relies on techniques such as image pyramids, wavelet transforms, guided filtering, or edge-preserving filters to compress and enhance the local dynamic range of an image. Common applications of LTM include: highlight suppression and shadow brightening, skin tone optimization in portraits, enhancement of atmosphere feeling, and automatic correction of uneven lighting in scenes.

[0035] Atmosphere is a crucial factor in the overall style of an image, resonating with human emotions. It is typically formed by the combined effects of factors such as color saturation, brightness, contrast, and hue. Local tonal adjustments are one of the core methods for achieving atmospheric control.

[0036] For example, in landscape photography, enhancing shadow details and suppressing highlights can create a rich visual effect; in portrait photography, brightening facial areas can improve focus and approachability; and in terms of color, the highly saturated warm yellow of sunset scenes can evoke a warm and relaxing emotional resonance, while the clear blue sky at noon can make people feel more relaxed.

[0037] U-Net is a convolutional neural network used for image segmentation, particularly suitable for biomedical image processing. Its network structure resembles a U-shape, hence the name UNet. A key feature of UNet is its ability to maintain high segmentation accuracy with relatively little training data.

[0038] MobileNetV4 is the latest generation of lightweight neural network models, optimized for mobile devices, featuring an efficient architecture and cross-platform versatility. It significantly improves model performance and hardware compatibility by introducing two main modules: the Universal Inverted Bottleneck (UIB) structure and a new attention module (Mobile MQA), coupled with an optimized Neural Architecture Search (NAS) formula.

[0039] A convolutional block (ConvBlock) is a fundamental module in a convolutional neural network (CNN). It typically consists of convolutional layers (Conv), activation functions (such as ReLU), and batch normalization (BN). Sometimes it may also include pooling layers or Dropout. Its core function is to extract local features from the input data.

[0040] The Mobile Inverted Bottleneck Convolution Block (MBConvBlock) is a highly efficient convolutional module widely used in lightweight neural networks such as EfficientNet and MobileNetV3. Its core design goal is to significantly reduce computation and parameter count while maintaining model accuracy, making it particularly suitable for mobile devices or resource-constrained scenarios. MBConvBlock employs an inverted residual structure, combined with depthwise separable convolution and a squeeze-and-excitation (SE) mechanism, aiming to balance model accuracy and computational efficiency, achieving a balance between high computational efficiency and feature enhancement. Its flexibility makes it a core component of lightweight model design, widely used in tasks such as image classification, object detection, and semantic segmentation, and driving the fusion and innovation of visual Transformers and convolutional networks.

[0041] Upsampling is a key technique in deep learning used to increase the spatial resolution of feature maps or images (i.e., increase the height and width dimensions), and is widely used in tasks such as image segmentation, super-resolution reconstruction, and generative adversarial networks (GANs). Its core objective is to recover or generate high-resolution details through specific methods while maintaining semantic consistency.

[0042] Height (H) is the number of pixels in the vertical direction of the image; Width (W) is the number of pixels in the horizontal direction of the image; Number of channels (C) is the color information per pixel.

[0043] The Gaussian kernel, also known as the radial basis function kernel (RBF kernel), is a commonly used kernel function in machine learning.

[0044] Normalization and denormalization (or inverse normalization) are crucial steps in data preprocessing and post-processing, especially in deep learning and machine learning. Normalization is the process of scaling data proportionally to fit it into a specific, smaller range (such as [0,1] or [-1,1]). Denormalization is the process of restoring the normalized data to its original form, facilitating the interpretation of model outputs or comparison with actual values.

[0045] The non-equilateral two-dimensional Gaussian function, also known as the anisotropic two-dimensional Gaussian function, is an extension of the standard two-dimensional Gaussian function. Its core feature is that it allows different degrees of broadening in the x-axis and y-axis directions, i.e. different standard deviations, thus enabling it to describe directional or asymmetric data distributions.

[0046] In mathematics, physics, and engineering, omnidirectional rotation refers to the rotation of an object or coordinate system around any axis in three-dimensional space. Unlike rotations that only revolve around fixed x, y, and z axes, omnidirectional rotation allows rotation around axes in any direction in space, offering greater flexibility.

[0047] The Rectified Linear Unit (ReLU) is a commonly used activation function in artificial neural networks. It acts on the output of a single neuron (or a single element on a feature map) in the neural network and usually refers to a nonlinear function represented by the ramp function and its variants, such as ReLU(x)max(0, x).

[0048] Global Average Pooling (GAP) is a commonly used pooling operation in deep learning, typically used at the end of convolutional neural networks (CNNs) to replace traditional fully connected layers. It can calculate the average value of all spatial locations, such as height and width, for each input feature map (channel / dimension).

[0049] Fully connected layers (FC) are one of the most basic and common layer types in neural networks, also known as dense layers.

[0050] The gamma curve is a power function used in image processing, primarily for adjusting image brightness. Designed based on the non-linear perception of brightness by the human eye, it corrects image display to better reflect human observation. The gamma value determines the image's contrast and detail. During gamma correction, adjusting the gamma value calibrates the image's brightness, making it appear more natural and closer to human perception in the real world.

[0051] The Structural Similarity Index (SSIM) is a perception-based model used to measure the visual similarity between two images. Its core structure revolves around similarity measures in three dimensions: luminance, contrast, and structure.

[0052] With the development of image sensor technology, modern imaging systems such as mobile phone cameras or high-end cameras can capture High Dynamic Range (HDR) image data. However, display devices, such as ordinary LCD screens, can typically only display a limited dynamic range. Therefore, HDR images need to be compressed to Low Dynamic Range (LDR) for display. The technology used in this process is tone mapping. Color and brightness are generally adjusted simultaneously during tone adjustment or mapping because tone adjustment also affects saturation, hue, and other aspects. Achieving superior color and tone style requires balancing adjustments to both. In the future, regardless of how display devices are upgraded, tone mapping will remain a crucial bridge connecting the true brightness of a scene with the human eye's visual experience.

[0053] Generally, tonal adjustment methods are divided into traditional TM methods and deep learning-based TM methods. Traditional TM methods are often ineffective due to their simple algorithms and coarse processing. Specifically, traditional TM methods typically rely on sliding windows in fixed local regions or high-low frequency decomposition, which fails to understand key semantics in the image, such as people, light sources, and backgrounds, and is prone to introducing problems such as halo and resolution degradation.

[0054] Deep learning's TM methods are basically pixel-by-pixel processing. Although they fully consider the relationship between adjacent pixels, they are very prone to introducing problems such as detail blurring, abnormal contrast, reduced resolution, and halo. This makes it impossible for electronic devices to understand the image content and dynamically adjust the relevant algorithm parameters to adapt to complex and changing scenarios.

[0055] In addition, color adjustment techniques are mostly based on overall image color adjustment techniques, such as Auto White Balance (AWB), Color Correction Matrix (CCM), and 3D Look-Up Table (3D LUT). Local color adjustment techniques, on the other hand, rely heavily on the calculation of information from adjacent local pixels, which can easily lead to problems such as color banding and color overflow.

[0056] This results in electronic devices having poor flexibility in tonal mapping of images, leading to poor display quality of the tonal-mapped images.

[0057] The image processing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0058] The image processing method provided in this application can be applied to any possible scenario, such as performing tone mapping processing on images. For example, a user may want to apply different tone adjustments to each object or image region in an image.

[0059] Based on the above-described scenario applied in the embodiments of this application, the image processing method provided in the embodiments of this application inputs a first image into a first tone adjustment model to obtain image feature information of the first image, the first image including at least one object; through the region parameter prediction module in the first tone adjustment model, based on the image feature information, obtains region adjustment weight information of at least one object; through the brightness adjustment parameter prediction module in the first tone adjustment model, based on the image feature information, obtains brightness adjustment parameters of at least one object, and through the color adjustment parameter prediction module in the first tone adjustment model, based on the image feature information, obtains color adjustment parameters of at least one object; based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object, the first image is processed to obtain a second image. In this scheme, since the first tone adjustment model can obtain the region adjustment weight parameters, brightness adjustment parameters, and color adjustment parameters for each object in the first image based on the image feature information, during image processing of the first image, the tone adjustment model can provide brightness and color adjustment parameters for each object based on the semantic content of the image, i.e., the objects contained in the image. This achieves linkage between image processing and image semantic content, avoiding the inability to dynamically adjust parameters due to a lack of understanding of the image content. Furthermore, since the tone adjustment model adjusts the brightness and color of the image indirectly by combining weight information, it can isolate the direct interaction between the network and pixels, reducing the image quality degradation caused by the network directly modifying pixels. Thus, it can improve the flexibility of image processing in electronic devices and enhance image processing quality.

[0060] The image processing method provided in this application is executed by an image processing device, which can be an electronic device, or a functional module or entity within an electronic device. This application does not limit the specific implementation of this method. The following will use an electronic device as an example to illustrate the image processing method provided in this application.

[0061] This application provides an image processing method. Figure 1 A flowchart illustrating an image processing method provided in an embodiment of this application is shown. Figure 1 As shown, the image processing method provided in this application embodiment may include the following steps 201 to 205.

[0062] Step 201: The electronic device inputs the first image into the first tone adjustment model to obtain the image feature information of the first image.

[0063] In this embodiment of the application, the first image may include at least one object.

[0064] In some embodiments of this application, the objects described above may include, but are not limited to, at least one of the following: people, animals, plants, natural objects, and man-made objects.

[0065] In some embodiments of this application, the first tone adjustment model described above can be used to perform tone mapping processing on the input image to output the tone-mapped image.

[0066] In some embodiments of this application, the first tone adjustment model described above can be a network model obtained by training a regression network using a dual-branch network structure designed for tone mapping tasks, which combines the structural features and components of the UNet network and the MobileNet V4 network.

[0067] In some embodiments of this application, the first tone adjustment model may include, but is not limited to, at least one of the following modules: ConvBlock, MBConvBlock, and UpSample. Thus, the electronic device can obtain the image feature information of the first image through this first tone adjustment model.

[0068] For example, such as Figure 2As shown, the electronic device can input an H×W×3 image, i.e., the first image mentioned above, into the first tone adjustment model. This first tone adjustment model can then increase the number of channels of the first image from 3 to 16 using ConvBlock. Then, through multiple MBConvBlocks, the feature map is processed multiple times, increasing the number of channels from 16 to 24, from 24 to 40, from 40 to 80, from 80 to 160, and from 160 to 320, ultimately obtaining a 320-channel feature map. Specifically, after each MBConvBlock extracts features from the image, while transmitting the image to the next MBConvBlock, the processed feature map can also be skipped and transmitted to the corresponding upsampling module. Then, the first tone adjustment model can upsample the 320-channel feature map through the first UpSample module. While increasing the resolution of the feature map, the number of channels of the feature map is reduced from 320 to 160. It is then fused with the 160-channel feature map of its corresponding MBConvBlock and then transmitted to the next UpSample module. Similarly, the first tone adjustment model can upsample the received 160-channel feature map using the second UpSample module, increasing the resolution of the feature map while reducing the number of channels from 160 to 80. It then fuses the feature map with the corresponding 80-channel feature map of the MBConvBlock before transmitting it to the next UpSample module. The first tone adjustment model can also upsample the received 80-channel feature map using the third UpSample module, increasing the resolution while reducing the number of channels from 80 to 40. It then fuses the feature map with the corresponding 40-channel feature map of the MBConvBlock before transmitting it to the next UpSample module. Finally, the first tone adjustment model can upsample the received 40-channel feature map using the fourth UpSample module, increasing the resolution while reducing the number of channels from 40 to 24. It then fuses the feature map with the corresponding 24-channel feature map of the MBConvBlock to obtain the image feature information of the first image.

[0069] It should be noted that the image feature information of the first image mentioned above can be a feature map, and the resolution of the feature map is usually the same as the resolution of the image before feature extraction, that is, the feature map of the first image has the same resolution as the first image.

[0070] In some embodiments of this application, the first tone adjustment model may further include, but is not limited to, at least one of the following modules: a region parameter prediction module, a brightness adjustment parameter prediction module, and a brightness adjustment parameter prediction module. Thus, the first tone adjustment model can process the image feature information of the acquired first image to implement subsequent image processing steps for the first image.

[0071] Step 202: The electronic device obtains the region adjustment weight information of at least one object based on image feature information through the region parameter prediction module in the first tone adjustment model.

[0072] In some embodiments of this application, each of the at least one of the above objects may correspond to a set of region adjustment weight information.

[0073] It is understood that at least one of the objects mentioned above is a region in the first image that requires image processing for tonal enhancement.

[0074] In some embodiments of this application, the at least one object may include all objects in the first image or only some objects in the first image.

[0075] For example, when the first image contains 10 objects, the region parameter prediction module in the first tone adjustment model can obtain the region adjustment weight information of each of the 10 objects, or it can obtain the region adjustment weight information of some of the 10 objects, such as the region adjustment weight information of 5 of the 10 objects. Thus, the image processing speed can be improved while ensuring image processing quality.

[0076] It should be noted that the above description of the number of objects is only for illustrative purposes. Whether the number of objects to be processed in the image is limited in the actual implementation process, and the specific value of the number of objects, can be determined according to actual needs. This application does not limit this.

[0077] In some embodiments of this application, where the at least one object includes a portion of the objects in the first image, the method for determining the at least one object may include, but is not limited to, any of the following:

[0078] Sort the objects from largest to smallest according to the proportion of the image they occupy, in order to identify at least one of the aforementioned objects;

[0079] The objects are sorted from closest to farthest from the center region of the first image to identify at least one of the aforementioned objects.

[0080] In some embodiments of this application, the aforementioned region adjustment weight information can be a weight value table with the same size as the first image.

[0081] In some embodiments of this application, the region parameter prediction module can divide the first image or the feature map of the first image into regions according to 1 / 20 to 1 / 100 of the original image resolution.

[0082] It should be noted that the above-mentioned area division is only an example, and the specific area division ratio can be determined according to actual needs. This application does not limit this.

[0083] For example, such as Figure 3 As shown, assuming the resolution of the first image is 4096×3072, since the feature map has the same resolution as the first image, its resolution is also 4096×3072. Therefore, the region parameter prediction module can divide the region into 1 / 50 regions. Thus, the divided first image or feature map can contain 50×50 regions, and each region can contain 81×61 pixels. The weight value table can then be 50×50 pixels. Each of these 50×50 regions corresponds to a weight value, and the weight of each region is equal to the weight of the Gaussian parameter-generated region. If there is no Gaussian weight region covering the region, the weight is 0. The first image can contain a tree, two people, and a star, with the two people from left to right being a little girl and a little boy. That is, the first image can contain three objects: a tree, people, and a star.

[0084] It should be noted that the above Figure 3 The 10×12 area presented in the image can be understood as merely representing the idea of ​​region division. Figure 3 The image in the image is essentially still a single image containing a 50x50 region; or, it can be understood as... Figure 3 It only presents a portion of a 50x50 image.

[0085] It should be noted that the relevant description of the weights of the Gaussian parameter generation region mentioned above can be found in the relevant descriptions of steps 202a and 202b below, and will not be repeated here in the embodiments of this application.

[0086] For example, for an object in the first image, in the weight value table corresponding to the object, the weight in the region where the object is located is greater than 0, and the weight in other regions other than the region where the object is located can be 0.

[0087] In some embodiments of this application, after dividing the first image or the feature map of the first image into regions, an image coordinate system can be established based on the divided regions to unify the expression form of relevant data of at least one object in the first image.

[0088] In some embodiments of this application, the origin of the image coordinate system may include, but is not limited to, any one of the top left corner, bottom left corner, or center position of the image.

[0089] It should be noted that the original position settings of the specific coordinate axes can be determined according to actual needs, and this application embodiment does not limit them here.

[0090] In some embodiments of this application, the above-mentioned image coordinate system can be defined with the horizontal direction as the x-axis and the vertical direction as the y-axis.

[0091] In some embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, step 202 above can be implemented through steps 202a and 202b below.

[0092] Step 202a: The electronic device obtains the image region size and Gaussian function parameters of each object in at least one object based on image feature information through the region parameter prediction module.

[0093] In some embodiments of this application, the region parameter prediction module may use MBConvBlock to obtain the image region size and Gaussian function parameters of each object.

[0094] In some embodiments of this application, since the Gaussian function requires an image coordinate system to take effect, which is a fixed coordinate system, the coordinate system corresponding to the first image can be used to obtain the parameters of that coordinate system.

[0095] In some embodiments of this application, the image region size of each object can be the pixel size corresponding to each object, or it can be the image region size after normalizing the pixel size.

[0096] In some embodiments of this application, each of the above objects may correspond to an elliptical selection area. The lengths of the major and minor axes of the ellipse corresponding to the ellipse selection area may correspond to the length and width of the image region of the object, respectively.

[0097] In some embodiments of this application, the Gaussian function parameters may include, but are not limited to, at least one of the following: the center position μ of the image region corresponding to the object. x and μ y Horizontal diffusion parameter σ x Vertical diffusion parameter σ y , Gaussian kernel rotation angle θ, amplitude A.

[0098] It should be noted that the above center position parameter μ x and μ yThis can be a value calculated based on the image region size; the aforementioned horizontal diffusion parameter σ x and vertical diffusion parameter σ y It can be determined based on the size of the Gaussian kernel; the unit of the rotation angle θ of the Gaussian kernel can be radians (rad); the amplitude A can usually be set to 1.

[0099] In some embodiments of this application, the Gaussian kernel size and the corresponding sigma(σ) value can be as shown in Table 1 below. For example, a smooth Gaussian kernel of size 31×31 can be used as a basis, with σ scaled down or up proportionally. x and σ y Size.

[0100] Table 1

[0101] Core size (h×w) <![CDATA[σ x Recommendation <![CDATA[σ y Recommendation illustrate 7×15 4.0 1.5 Horizontal elongation, with a gradual change in the horizontal direction. 15×7 1.5 4.0 Vertically elongated, with a vertical gradient area. 17×17 3.5 5.0 Elliptic nucleus, not strongly directional 33×17 8.0 3.0 Horizontally flattened ellipse, stronger directionality 31×31 10.0 10.0 Approximately circular, very smooth

[0102] Where h×w can represent the size of the Gaussian kernel, specifically, h can represent the height of the Gaussian kernel and w can represent the width of the Gaussian kernel.

[0103] It should be noted that the amplitude A in the Gaussian function parameters above can usually be set to 1.

[0104] In some embodiments of this application, after obtaining the image region size and Gaussian function parameters, all the obtained data can be normalized so that the normalized data are all in the range of 0-1, so that the network model, such as the region parameter prediction module in the first tone adjustment model, can regress. Then, in the specific application process, it can be restored to the image coordinate system.

[0105] Step 202b: Based on the image region size and Gaussian function parameters of each object, the electronic device calculates the region adjustment weight information of each object using a two-dimensional Gaussian function.

[0106] In some embodiments of this application, when the region parameter prediction module obtains the image region size and Gaussian function parameters corresponding to each object through MBConvBlock, the region parameter prediction module can calculate the region adjustment weight information of each object, i.e., the Gaussian weight table, based on the obtained data and using a two-dimensional Gaussian function. Then, based on the Gaussian weight table of each object's region, a weight table with the same size as the first image corresponding to each object is obtained. Thus, subsequent processing such as data superposition can be performed based on the weight table corresponding to each object to determine the specific parameter adjustment ratio corresponding to the first image.

[0107] For example, such as Figure 5As shown, MBConvBlock outputs seven parameters for each of the K objects in the first image, corresponding to one channel, such as the region sizes size_x and size_y, μ... x μ y σ x σ y And θ, and then finally obtain the weight table of M×N with the same size as the first image for each of the K objects, or it can be understood as each of the K objects corresponding to a weight table of a layer, the first image corresponding to the weight table of K layers, and each layer does not affect each other.

[0108] In some embodiments of this application, the above-mentioned two-dimensional Gaussian function can be a non-equisional two-dimensional Gaussian function, i.e., the formula described in formula (1) below.

[0109]

[0110] Where x and y represent the coordinates of any point within the elliptical selection area; A is the amplitude, which can take a value of 1; μ x and μ y It can represent the center position of an elliptical selection area, and can be determined based on the size of the elliptical selection area, such as μ. x =size_x / 2, μ x =size_y / 2, size_x∈(10,40), size_y∈(10,40); θ is the Gaussian kernel rotation angle, in radians, and can represent the angle between the major axis of the ellipse corresponding to the elliptical selection area and the x-axis of the coordinate system corresponding to the elliptical selection area; σ x The standard deviation along the x-axis controls the degree of broadening of the function in the horizontal direction, i.e., the horizontal diffusion parameter; σ y The standard deviation in the y-axis direction can be used to control the degree of function broadening in the vertical direction, i.e., the vertical diffusion parameter; exp() can represent the natural exponential function.

[0111] It should be noted that the above size_x∈(10,40) and size_y∈(10,40) can be understood as follows: when the size of the elliptical selection area corresponding to a certain object is too large or too small, it can be used as the selection area corresponding to the object and processed in the above manner.

[0112] It should be noted that the above elliptical selection area supports omnidirectional rotation.

[0113] For example, combined Figure 3 ,like Figure 6AAs shown, for an image containing a person, assuming the size of the person image obtained through regression occupies 0.42 × 0.62 of the total image size, after inverse normalization, this person image can correspond to 21 × 31 regions. Here, the size of 21 × 31 represents the lengths of the two axes of the elliptical selection region. Simultaneously, the region parameter prediction module can obtain the two-dimensional Gaussian parameters, such as [μ...]. x μ y , σ x , σ y ,θ,A]=[0.66,0.6,10,7,1.107,1], therefore, the region parameter prediction module can obtain the region adjustment weight information of the image region of the person through the above formula (1), such as a 21×31 Gaussian weight table, that is, as Figure 6B The rectangular Gaussian weight table corresponding to the elliptical selection area is shown, meaning the long side of the Gaussian weight table is aligned with the major axis of the elliptical region. In this Gaussian weight table, the sum of all weight values ​​is 1, with the highest weight value in the central region, gradually decreasing as it expands outwards. Alternatively, when using color to represent the weight values, the central region can be set to red, and the color can gradually change to orange, yellow, and green towards the edges to indicate a gradual decrease in weight value. Therefore, the region parameter prediction module can use the intersection of the Gaussian weight table and the region of the first image to generate a 50×50 weight table for the final application of the labeled region.

[0114] It should be noted that the above Figure 6A The solid-line elliptical region in the image represents the main area to be enhanced, i.e., the main area of ​​the object, while the outer dashed-line elliptical region represents the image portion affected by the Gaussian weighting table. Figure 6A The image only shows the elliptical selection area corresponding to the person in the image. In actual operation, the tree and stars in the image will also each correspond to an elliptical selection area. Figure 6A It is not shown in the middle.

[0115] It should be noted that in the process of determining the final weight table for the labeled regions based on the intersection of the Gaussian weight table and the regions of the first image, if region A in the first image corresponds to a single value in the Gaussian weight table, then the weight value of region A is equal to that single value; if region B in the first image corresponds to multiple values ​​in the Gaussian weight table, then the weight value of region B can be a value calculated based on those multiple values, such as the average of those values; if region C in the first image does not correspond to any value in the Gaussian weight table, then the weight value of region C can be 0, for example... Figure 6B The first region in the upper left corner of the first image does not correspond to the Gaussian weight table of the rectangle of the person image, so its weight value is 0.

[0116] In this embodiment, the first tone adjustment model can use a region parameter prediction module, employing simple nonlinear region segmentation and a weight table, to adjust and generate a highly complex and varied atmosphere in the entire image. Theoretically, it can mimic the effects of any related technology through infinite subdivision, possessing unparalleled flexibility and thus enhancing the flexibility of image processing. Simultaneously, by generating region adjustment weight information, i.e., a weight table, the network's pixel-level operations can be isolated, preventing image quality degradation caused by pixel-level operations and ensuring the quality of the processed image.

[0117] Step 203: The electronic device obtains the brightness adjustment parameters of at least one object based on image feature information through the brightness adjustment parameter prediction module in the first tone adjustment model.

[0118] For example, the structure of the brightness adjustment parameter prediction module described above can be as follows: Figure 7A The structure of Brightnessbranch is shown.

[0119] Specifically, such as Figure 7A As shown, after the brightness adjustment parameter prediction module obtains the image feature information of the first image, it can increase the number of channels of the feature map from 24 to 128 through Conv and process it through the ReLU activation function; then, it can reduce the number of channels of the feature map from 128 to 64 through Conv again and process it through the ReLU activation function again; then, it can compress the spatial information of each channel into an average value through the global averaging layer to obtain a low-dimensional feature vector, which is then input into the FC layer for classification prediction to obtain the brightness adjustment parameters of each object in the first image.

[0120] In some embodiments of this application, step 203 can be specifically implemented by the following steps 203a and 203b.

[0121] Step 203a: The electronic device obtains the brightness curve adjustment parameters of each object in at least one object based on image feature information through the brightness adjustment parameter prediction module.

[0122] In some embodiments of this application, the above-mentioned brightness curve adjustment parameters can be the coordinates of some control points in the brightness curve. That is, it can be understood that the brightness curve control parameters can be used to move the position of the brightness curve control points in order to adjust the brightness of the image.

[0123] In some embodiments of this application, the initial brightness curve of the first image may include five control points, such as [0, 0], [0.25, 0.25], [0.5, 0.5], [0.75, 0.75], and [1.0, 1.0], and these five control points may correspond to four regions: dark area, mid-gray area, mid-bright area, and bright area, respectively. Specifically, these five control points can be connected by a cubic spline curve to form an initial linear curve, through which the brightness of the image will not change. Alternatively, the control points of the initial brightness curve can be represented by a 2×5 matrix, such as...

[0124] In some embodiments of this application, when the brightness adjustment parameter prediction module obtains the brightness curve adjustment parameters of each object, the coordinates of the three middle control points of the above five control points can be changed, and the two edge control points can be used as fixed points. Its working principle is similar to that of the Gamma curve.

[0125] Step 203b: The electronic device adjusts the parameters based on the brightness curve of each object to determine the brightness adjustment parameters for each object.

[0126] In some embodiments of this application, the method for determining the brightness adjustment parameters of each object based on the brightness curve adjustment parameters can be found in the usage of the Gamma curve in related technologies, and will not be described in detail in the embodiments of this application.

[0127] In some embodiments of this application, the brightness adjustment parameters of each object in at least one object of the first image may be different.

[0128] For example, assuming the first image contains two objects, the brightness adjustment parameter of one object can be +50, and the brightness adjustment parameter of the other object can be -25.

[0129] In this embodiment, the first tone adjustment model can obtain brightness adjustment parameters for each object in the image, focusing on the objects themselves. This means that the acquisition of brightness adjustment parameters is linked to the image content, thus avoiding the impact on image quality caused by the model's inability to access the image content. Simultaneously, it reduces the sensitivity of convolutional neural networks to pixel-level detail features, a common feature in related technologies, preventing resolution degradation, halo effects, and other problems. This improves the accuracy of brightness adjustment for objects, ensuring that the brightness of different objects or regions in the adjusted image meets the user's needs, thereby improving image processing quality.

[0130] Step 204: The electronic device obtains the color adjustment parameters of at least one object based on image feature information through the color adjustment parameter prediction module in the first tone adjustment model.

[0131] In some embodiments of this application, the structures of the color adjustment parameter prediction module and the brightness adjustment parameter prediction module may be the same or similar, or they may be different.

[0132] For example, the structure of the color adjustment parameter prediction module described above can be as follows: Figure 7B The structure of the Color branch is shown.

[0133] Specifically, such as Figure 7B As shown, after the color adjustment parameter prediction module obtains the image feature information of the first image, it can increase the number of channels of the feature map from 24 to 128 through Conv and process it through the ReLU activation function; then, it can reduce the number of channels of the feature map from 128 to 64 through Conv again and process it through the ReLU activation function again; then, it can compress the spatial information of each channel into an average value through the global averaging layer to obtain a low-dimensional feature vector, which is then input into the FC layer for classification prediction to obtain the color adjustment parameters of each object in the first image.

[0134] In some embodiments of this application, the above-mentioned color adjustment parameters may include, but are not limited to, at least one of the following: saturation, vibrance, color temperature adjustment coefficient, and hue adjustment parameters.

[0135] For example, the color adjustment parameter prediction module can provide a set of color adjustment parameters based on an object in the first image: saturation +15, vibrance +3, color temperature +300k, and hue +0.

[0136] It should be noted that the value range of the above saturation can be [-1, 1], and after inverse normalization it can be expressed as [-100, 100]; the value range of the above vibrance can be [-1, 1], and after inverse normalization it can be expressed as [-100, 100]; the value range of the above color temperature can be [-1, 1], and after inverse normalization it can be expressed as [-10000k, 10000k]; the value range of the above hue can be [-1, 1].

[0137] It is understandable that each object in the first image can correspond to a set of color adjustment parameters, and the specific number and value of the color adjustment parameters for each object can be different.

[0138] It should be noted that the execution order of the above steps 202, 203 and 204 may include, but is not limited to, any of the following: steps 202, 203 and 204; steps 203, 204 and 202; or steps 202, 203 and 204 are executed simultaneously. Figure 1This is merely one possible execution order; the specific execution order is not limited in this embodiment.

[0139] Step 205: The electronic device performs image processing on the first image based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object to obtain the second image.

[0140] In some embodiments of this application, the above image processing can be tonal processing, that is, adjusting the brightness and color of the first image.

[0141] In some embodiments of this application, the second image described above may be an image after adjusting at least one parameter of brightness and color.

[0142] In some embodiments of this application, the second image described above may be an RGB image, or may be an image of other possible image types.

[0143] It is understandable that an electronic device can input a first image into a first tone adjustment model, so that the model can adjust each object in the first image accordingly to obtain the final processed second image. The structure of the first tone adjustment model can be as follows: Figure 8 The model structure shown.

[0144] In some embodiments of this application, combined with Figure 1 ,like Figure 9 As shown, step 205 can be implemented through steps 205a to 205c.

[0145] Step 205a: The electronic device determines the first brightness adjustment parameter and the first color adjustment parameter of an image region corresponding to each object in the first image based on the region adjustment weight information, brightness adjustment parameter and color adjustment parameter of each object in at least one object.

[0146] In some embodiments of this application, for each object, the first tone adjustment model can numerically allocate the brightness adjustment parameters and color adjustment parameters according to the regional adjustment weight information of the object to determine the actual adjustment parameters of each object in the region of the first image.

[0147] For example, suppose object A corresponds to four regions in the first image, such as regions 1 to 4, and the region adjustment weights for these four regions are 0.1, 0.3, 0.4, and 0.2, respectively. When the brightness adjustment parameter for object A is +50, the actual brightness adjustment values ​​for the four regions corresponding to object A can be +5, +15, +20, and +10; that is, the first brightness adjustment parameter for object A. Meanwhile, the brightness adjustment parameters for all other regions in the first image besides regions 1 to 4 where object A is located are all 0. In other words, it can be understood that object A corresponds to the brightness adjustment parameter of a layer.

[0148] Similarly, with the color adjustment parameters for object A set to saturation +15, vibrance +3, color temperature +300k, and hue +0, the actual color adjustment values ​​for the four regions of object A can be: Region 1: saturation +1.5, vibrance +0.3, color temperature +30k, hue +0; Region 2: saturation +4.5, vibrance +0.9, color temperature +90k, hue +0; Region 3: saturation +6, vibrance +1.2, color temperature +120k, hue +0; Region 4: saturation +3, vibrance +0.6, color temperature +60k, hue +0; these are the first color adjustment parameters for object A. Meanwhile, the color adjustment parameters for all regions in the first image other than region 1 to region 4 (where object A is located) are all 0. In other words, object A can be understood as corresponding to the color adjustment parameters of a single layer.

[0149] Step 205b: The electronic device determines the second brightness adjustment parameters of the first image based on the first brightness adjustment parameters corresponding to at least one object, and obtains the second color adjustment parameters of the first image based on the first color adjustment parameters corresponding to at least one object.

[0150] It is understandable that, since each object corresponds to a brightness adjustment parameter of a layer and a color adjustment parameter of an image, and the first image corresponds to at least one object, the first tone adjustment model can be superimposed based on at least one first brightness adjustment parameter corresponding to at least one object, that is, the brightness adjustment parameter of at least one layer corresponding to at least one object, to obtain the brightness adjustment parameter of a layer directly corresponding to the first image, that is, the aforementioned second brightness adjustment parameter.

[0151] Similarly, the first tone adjustment model can overlay the color adjustment parameters of at least one first color adjustment parameter corresponding to at least one object, that is, the color adjustment parameters of at least one layer corresponding to at least one object, to obtain the color adjustment parameters of a layer directly corresponding to the first image, that is, the aforementioned second color adjustment parameters.

[0152] In some embodiments of this application, for image regions corresponding to at least one of the above objects that do not overlap, the first tone adjustment model can determine the brightness adjustment parameters and color adjustment parameters corresponding to the non-overlapping region by directly superimposing the brightness or color values.

[0153] For example, suppose the first image contains 10 regions, such as regions 1 to 10; and the first image contains two objects, such as object A and object B. If object A is located in regions 1 to 4 of the first image, and object B is located in regions 5 to 8 of the first image, meaning there is no regional overlap between object A and object B, the first tone adjustment model can directly overlay the brightness adjustment parameter layers corresponding to object A and object B to obtain the aforementioned second brightness adjustment parameters. That is, for the first image, the brightness adjustment parameters for regions 1 to 4 are the same as those for object A, and the brightness adjustment parameters for regions 5 to 8 are the same as those for object B. Then, since regions 9 and 10 do not contain any objects, the brightness adjustment parameters for regions 9 and 10 are 0. Similarly, the first tone adjustment model can be directly superimposed based on the color adjustment parameter layers corresponding to object A and object B to obtain the aforementioned second color adjustment parameters. That is, for the first image, the color adjustment parameters of regions 1 to 4 are the same as those corresponding to object A, and the color adjustment parameters of regions 5 to 8 are the same as those corresponding to object B. Then, since regions 9 and 10 do not contain objects, the color adjustment parameters corresponding to regions 9 and 10 are 0.

[0154] In some embodiments of this application, the image processing method provided in this application may further include the following steps 301 to 303.

[0155] Step 301: When there is regional overlap between the first image region corresponding to the first object and the second image region corresponding to the second object, the electronic device obtains the first distance between the center position of the first image region and the center position of the first image, and obtains the second distance between the center position of the second image region and the center position of the first image.

[0156] In this embodiment of the application, the above-mentioned at least one object includes a first object and a second object.

[0157] In some embodiments of this application, the first distance and the second distance described above can be Euclidean distances.

[0158] Understandably, the electronic device can acquire the coordinates of the center position of the first image region, and combine them with the coordinates of the center position of the first image to calculate the distance between the two points, i.e., the aforementioned first distance. Similarly, the electronic device can acquire the coordinates of the center position of the second image region, and combine them with the coordinates of the center position of the first image to calculate the distance between the two points, i.e., the aforementioned second distance.

[0159] Step 302: The electronic device determines the parameter adjustment ratio based on the first distance and the second distance.

[0160] For example, if the difference between the first distance and the second distance is less than a preset threshold, the electronic device can determine that the first object and the second object are at the same distance from the center position of the first image. In this case, the parameter adjustment ratio can be 0.5:0.5.

[0161] It should be noted that the above-mentioned preset threshold can be determined according to actual needs, and this application embodiment does not limit it.

[0162] Understandably, when multiple enhancement regions overlap, i.e., when the image regions of multiple objects overlap, electronic devices can use the Euclidean distance from the physical center of the image as a criterion, with the closer to the center, the higher the priority of image adjustment, and the parameters take effect first.

[0163] Step 303: The electronic device determines the actual adjustment parameters of the overlapping area of ​​the first image area and the second image area based on the parameter adjustment ratio, the first brightness adjustment parameter and the first color adjustment parameter of the first image area, and the first brightness adjustment parameter and the first color adjustment parameter of the second image area.

[0164] For example, suppose the first image contains 10 regions, such as regions 1 to 10; and the first image contains two objects, such as object A and object B. When object A is located in regions 1 to 4 of the first image, and object B is located in regions 4 to 8 of the first image, i.e., object A and object B overlap in region 4, the first tone adjustment model can determine the brightness adjustment parameters for regions 1 to 3 based on the brightness adjustment parameters of object A; and determine the brightness adjustment parameters for regions 5 to 8 based on the brightness adjustment parameters of object B; and set the brightness adjustment parameters for regions 9 and 10 to 0. For region 4, the first tone adjustment model obtains the first distance corresponding to object A and the second distance corresponding to object B to determine the parameter adjustment ratio, such as 0.6:0.4. Then, when the brightness adjustment parameter for region 4 of object A is +5 and the brightness adjustment parameter for region 4 of object B is +10, the brightness adjustment parameter for region 4 is +7, i.e., 0.6×(+5)+0.4×(+10). Similarly, if the color adjustment parameter for region 4 of object A is +90k and the color adjustment parameter for region 4 of object B is -20k, the brightness adjustment parameter for region 4 is +46, which is 0.6×(+90)+0.4×(-20).

[0165] In this embodiment, the electronic device can determine the adjustment parameters corresponding to the overlapping area by adjusting the adjustment parameters of multiple objects, thereby enabling the brightness and color adjustment of multiple objects to have a smooth transition in the overlapping area. This avoids the sudden changes in image brightness or color caused by excessive differences in the adjustment parameters of the overlapping area, thus improving image quality.

[0166] Step 205c: The electronic device performs image processing on the first image based on the second brightness adjustment parameter and the second color adjustment parameter to obtain the second image.

[0167] Understandably, when the first tone adjustment model obtains the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters corresponding to at least one object, the first tone adjustment model can perform classification matching based on the obtained data to determine the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters corresponding to each object, thereby processing each object separately. Then, after determining the adjustment parameters of the layer corresponding to each object, at least one of the brightness and color of the first image is adjusted based on the adjustment parameters of the at least one layer to obtain the final second image.

[0168] In this embodiment, the tone adjustment model can bind multi-layer weight map parameters with adjustment parameters, thereby enabling end-to-end automatic adjustment through AI. At the same time, it can support the adjustment of any number of regions, making the color tone atmosphere of the second image more in line with user needs and improving the flexibility of image processing.

[0169] In the image processing method provided in this application embodiment, since the first tone adjustment model can obtain the region adjustment weight parameters, brightness adjustment parameters, and color adjustment parameters of each object in the first image based on the image feature information of the first image, during the image processing of the first image, the tone adjustment model can provide the brightness and color adjustment parameters for each object based on the semantic content of the image, that is, the objects contained in the image. This achieves the linkage between image processing and the semantic content of the image, avoiding the situation where parameters cannot be dynamically adjusted due to the inability to understand the image content. Simultaneously, since the tone adjustment model adjusts the brightness and color of the image indirectly by combining weight information, it can isolate the direct interaction between the network and pixels, reducing the image quality degradation caused by the network directly modifying pixels. Thus, it can improve the flexibility of image processing in electronic devices and improve image processing quality.

[0170] In some embodiments of this application, before step 201 above, the image processing method provided in the embodiments of this application may further include steps 401 to 406 below.

[0171] Step 401: The electronic device inputs the training image set into the second tone adjustment model to obtain the image feature information of each image in the training image set.

[0172] In some embodiments of this application, the training image set can be the fiveK open-source dataset, or other feasible open-source datasets, or a dataset that includes data on existing datasets with customized effect optimization of the result data.

[0173] It should be noted that the fiveK open-source dataset contains 25,000 Origin images in DNG format and their corresponding high-quality Target images in TIFF or JPG format. That is, 25,000 Origin_Img and Target_Img image pairs. The high-quality images can be understood as those with excellent atmospheric effects.

[0174] Among them, the dng image is an image that has only undergone bad pixel correction and lens shading correction, and it is essentially Bayer format data.

[0175] In some embodiments of this application, before the electronic device inputs the training image set into the second tone adjustment model, the images in the training image set can be preprocessed, and then the preprocessed image pairs can be input into the second tone adjustment model.

[0176] In some embodiments of this application, the preprocessing described above may involve using a professional tool to convert a dng image into a jpg image. The professional tool may include, but is not limited to, at least one of the following: Adobe Lightroom, RawTherapee, and Darktable.

[0177] It should be noted that the converted JPG images above only produce a basic effect, lacking atmosphere and excellent color and tonal style.

[0178] In some embodiments of this application, the electronic device may use two or three different tools to perform image type conversion to obtain Origin images in different JPG formats, thereby enhancing the generalization ability of subsequent network training results.

[0179] For example, an electronic device can use Adobe Lightroom and RawTherapee to convert 25,000 DNG format Origin_Img images into 2 × 25,000 JPG format Origin_Img images. At this point, the electronic device contains 50,000 image pairs of Origin_Img and Target_Img.

[0180] In some embodiments of this application, the open-source dataset that the electronic device can access is divided into a training image set and a test image set, so as to train the second tone adjustment model using the training image set and test the trained tone adjustment model using the test image set after training.

[0181] For example, an electronic device can use 45,000 image pairs out of 50,000 images as a training image set and the remaining 5,000 image pairs as a test image set.

[0182] In some embodiments of this application, the model results of the second tone adjustment model described above may have the same structure as the first tone adjustment model described above. That is, as follows: Figure 10 The model structure shown.

[0183] Step 402: The electronic device obtains the region adjustment weight information of at least one object in each image through the region parameter prediction module in the second tone adjustment model.

[0184] It should be noted that the specific steps of the electronic device to obtain the region adjustment weight information of the object in the image through the second tone adjustment model can be found in the relevant description of step 202 above, and will not be repeated here in the embodiments of this application.

[0185] Step 403: The electronic device obtains the brightness adjustment parameters of at least one object in each image through the brightness adjustment parameter prediction module in the second tone adjustment model.

[0186] It should be noted that the specific steps of the electronic device to obtain the brightness adjustment parameters of the object in the image through the second tone adjustment model can be found in the relevant description of step 203 above, and will not be repeated here in the embodiments of this application.

[0187] Step 404: The electronic device obtains the color adjustment parameters of at least one object in each image through the color adjustment parameter prediction module in the second tone adjustment model.

[0188] It should be noted that the specific steps of the electronic device to obtain the color adjustment parameters of the object in the image through the second tone adjustment model can be found in the relevant description of step 204 above, and will not be repeated here in the embodiments of this application.

[0189] Step 405: The electronic device performs image processing on each image based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object in each image, to obtain the processed image corresponding to each image.

[0190] It should be noted that the specific steps for the electronic device to perform image processing on the image to obtain the processed image can be found in the relevant description of step 205 above, and will not be repeated here in the embodiments of this application.

[0191] Step 406: The electronic device calculates the loss function based on the processed image corresponding to each image and the target image corresponding to each image in the training image set.

[0192] In some embodiments of this application, the loss function described above can be a function constructed based on at least one of the following: brightness adjustment loss (pixel brightness difference L_brightness), color perception loss (L_color), smoothing regularization term of the weight map (L_smooth), and structure preservation loss (L_structure).

[0193] For example, the loss function described above can be: L_total=λ1×L_brightness+λ2×L_color+λ3×L_smooth+λ4×L_structure.

[0194] In some embodiments of this application, the aforementioned brightness adjustment loss pixel brightness difference L_brightness=α1×L_luminance+α2×L_curve_param. Wherein, L_luminance=L1(Y_pred,Y_gt), which can represent the brightness loss corresponding to the conversion of the Y channel to YUV space, or the brightness loss when converting a gray image to a black and white image; L_curve_param=MSE(pred_params,gt_params), which represents the brightness curve loss, where the brightness curve is a one-dimensional curve with 256 points.

[0195] It should be noted that the sum of α1 and α2 is 1, and a higher value for one parameter indicates a greater intolerance for that type of prediction error. For example, both α1 and α2 can be 0.5. The specific values ​​of α1 and α2 can be adjusted according to actual needs, and this application does not impose any restrictions on them.

[0196] In some embodiments of this application, the color perception loss L_color = β1×L_deltaE + β2×L_lpips + β3×L_saturation.

[0197] Among them, the color perception error L_deltaE = mean(DeltaE2000(Lab_pred, Lab_gt)), is used as the color difference index when converting to Lab space; the LPIPS perception loss L_lpips = LPIPS(I_pred, I_gt), can guide the sense of realism; the saturation error term L_saturation = L1(S_pred, S_gt), that is, the image can be converted from RGB space to HSV space, the S component is extracted from the HSV image, and the difference is calculated.

[0198] It should be noted that the sum of β1, β2, and β3 is 1, and a higher value for one parameter indicates a greater intolerance for that type of prediction error. For example, β1, β2, and β3 can all be 1 / 3. The specific values ​​of β1, β2, and β3 can be adjusted according to actual needs, and this application does not impose any restrictions on them.

[0199] In some embodiments of this application, for the smoothing regularization term L_smooth of the above-mentioned weight map, in order to avoid noise or abrupt changes in the output mask weight map, a variable variation (TV) regularization, such as L_smooth = TV_loss, is used to regularize the output part of the multi-layer weight map.

[0200] In some embodiments of this application, to avoid halo or structural distortion, the structure-preserving loss L_structure described above can be achieved using SSIM structural similarity loss, such as L_structure = SSIM(I_pred, I_gt). Here, I_pred refers to the original image in the training dataset, and I_gt refers to the target image in the training dataset.

[0201] It should be noted that the aforementioned structure preservation loss can also be referred to as full image fidelity.

[0202] In some embodiments of this application, the sum of λ1, λ2, λ3 and λ4 is 1. For example, λ1 = 0.3, λ2 = 0.4, λ3 = 0.1, λ4 = 0.2, that is, L_total = 0.3 × L_brightness + 0.4 × L_color + 0.1 × L_smooth + 0.2 × L_structure.

[0203] Step 407: The electronic device adjusts the model parameters of the second tone adjustment model based on the loss function until convergence, and trains the first tone adjustment model.

[0204] In some embodiments of this application, the electronic device can train three prediction heads simultaneously, namely the aforementioned region parameter prediction module, brightness adjustment parameter prediction module, and color adjustment parameter prediction module; or it can train each of the three prediction heads separately.

[0205] For example, an electronic device can first train the network model parameters of the weight prediction head, that is, lock the brightness adjustment parameter prediction module and the color adjustment parameter prediction module to train the region parameter prediction module; then lock the brightness adjustment parameter prediction module to train the color adjustment parameter prediction module; finally, lock the color adjustment parameter prediction module to train the brightness adjustment parameter prediction module. That is, the brightness adjustment parameter prediction module and the color adjustment parameter prediction module are trained separately so that the model can converge faster, thereby making the trained model perform better.

[0206] In this embodiment, the electronic device can use an open-source dataset to achieve excellent atmospheric effects through master-level semantic guidance. This distinguishes it from traditional window-sliding LTM, enabling image enhancement that supports subject-perception and human-level region semantic relevance. Furthermore, by using paired datasets consisting of the original image and images with excellent atmospheric effects, a regression network is trained on a dual-branch network structure for brightness and color to obtain trained network model parameters. This allows for interpretable Gaussian and parameter-adjusted predictions to indirectly enhance the input image. It supports combined enhancement of any number of regions instead of traditional pixel-related enhancement, isolating the network from pixel-level operations, reducing issues affecting image quality, avoiding halo and fragmentation, and minimizing the impact on image quality. This results in superior image color, tone, atmosphere, flexibility, and overall effect compared to traditional methods.

[0207] This application provides an image processing method. Figure 11 A flowchart of an image processing method provided by an embodiment of this application is shown. The image processing method provided by this application will be described exemplarily below. Figure 11 As shown, the image processing method provided in this application embodiment may include the following steps S1 to S16.

[0208] Step S1: The electronic device inputs the training image set into the second tone adjustment model to obtain the image feature information of each image in the training image set;

[0209] Step S2: The electronic device obtains the region adjustment weight information of at least one object in each image through the region parameter prediction module in the second tone adjustment model;

[0210] Step S3: The electronic device obtains the brightness adjustment parameters of at least one object in each image through the brightness adjustment parameter prediction module in the second tone adjustment model;

[0211] Step S4: The electronic device obtains the color adjustment parameters of at least one object in each image through the color adjustment parameter prediction module in the second tone adjustment model;

[0212] Step S5: The electronic device performs image processing on each image based on the region adjustment weight information, brightness adjustment parameters and color adjustment parameters of at least one object in each image, to obtain the processed image corresponding to each image.

[0213] Step S6: The electronic device calculates the loss function based on the processed image corresponding to each image and the target image corresponding to each image in the training image set;

[0214] Step S7: Based on the loss function, the electronic device adjusts the model parameters of the second tone adjustment model until convergence, and trains the first tone adjustment model.

[0215] Step S8: The electronic device inputs the first image into the first tone adjustment model to obtain the image feature information of the first image, wherein the first image includes at least one object;

[0216] Step S9: The electronic device obtains the image region size and Gaussian function parameters of each object in at least one object based on image feature information through the region parameter prediction module.

[0217] Step S10: The electronic device calculates the region adjustment weight information for each object based on the image region size and Gaussian function parameters of each object using a two-dimensional Gaussian function;

[0218] Step S11: The electronic device obtains the brightness curve adjustment parameters for each object based on image feature information through the brightness adjustment parameter prediction module.

[0219] Step S12: The electronic device determines the brightness adjustment parameters for each object based on the brightness curve adjustment parameters of each object in at least one object;

[0220] Step S13: The electronic device obtains the color adjustment parameters of at least one object based on image feature information through the color adjustment parameter prediction module in the first tone adjustment model.

[0221] Step S14: The electronic device determines the first brightness adjustment parameter and the first color adjustment parameter of an image region corresponding to each object in the first image based on the region adjustment weight information, brightness adjustment parameter and color adjustment parameter of each object in at least one object;

[0222] Step S15: The electronic device determines the second brightness adjustment parameters of the first image based on the first brightness adjustment parameters corresponding to at least one object, and obtains the second color adjustment parameters of the first image based on the first color adjustment parameters corresponding to at least one object.

[0223] Step S16: The electronic device performs image processing on the first image based on the second brightness adjustment parameter and the second color adjustment parameter to obtain the second image.

[0224] It should be noted that the above-described method embodiments, or the various possible implementations of the method embodiments, can be executed individually, or, provided there are no contradictions, they can be combined with each other. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.

[0225] It should be noted that the image processing method provided in this application embodiment can be executed by an image processing device. This application embodiment uses an image processing device executing the image processing method as an example to illustrate the image processing device provided in this application embodiment.

[0226] Figure 12 A schematic diagram of a possible structure of the image processing apparatus involved in an embodiment of this application is shown. For example... Figure 12 As shown, the image processing device 70 may include: an acquisition module 71 and a processing module 72;

[0227] The acquisition module 71 is configured to input a first image into a first tone adjustment model to obtain image feature information of the first image, the first image including at least one object; and, based on the image feature information, obtain region adjustment weight information of at least one object through a region parameter prediction module in the first tone adjustment model; and, based on the image feature information, obtain brightness adjustment parameters of at least one object through a brightness adjustment parameter prediction module in the first tone adjustment model; and, based on the image feature information, obtain color adjustment parameters of at least one object through a color adjustment parameter prediction module in the first tone adjustment model.

[0228] The processing module 72 is used to perform image processing on the first image based on the region adjustment weight information, brightness adjustment parameters and color adjustment parameters of at least one object obtained by the acquisition module 71, to obtain the second image.

[0229] In one possible implementation, the acquisition module 71 is specifically used to: obtain the image region size and Gaussian function parameters of each object in at least one object based on image feature information through the region parameter prediction module; and calculate the region adjustment weight information of each object based on the image region size and Gaussian function parameters of each object through a two-dimensional Gaussian function.

[0230] In one possible implementation, the acquisition module 71 is specifically used to: acquire the brightness curve adjustment parameters of each object in at least one object based on image feature information through the brightness adjustment parameter prediction module; and determine the brightness adjustment parameters of each object based on the brightness curve adjustment parameters of each object.

[0231] In one possible implementation, the image processing apparatus 70 provided in this application embodiment further includes: a determining module; the determining module is configured to determine a first brightness adjustment parameter and a first color adjustment parameter for an image region corresponding to each object in the first image based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of each object in at least one object acquired by the acquiring module 71; the acquiring module 71 is further configured to determine a second brightness adjustment parameter for the first image based on the first brightness adjustment parameter corresponding to at least one object, and obtain a second color adjustment parameter for the first image based on the first color adjustment parameter corresponding to at least one object; the processing module 72 is specifically configured to perform image processing on the first image based on the second brightness adjustment parameter and the second color adjustment parameter acquired by the acquiring module 71 to obtain a second image.

[0232] In one possible implementation, the acquisition module 71 is further configured to, when there is regional overlap between the first image region corresponding to the first object and the second image region corresponding to the second object, acquire a first distance between the center position of the first image region and the center position of the first image, and acquire a second distance between the second image region and the center position of the first image, wherein the at least one object includes the first object and the second object; the determination module is further configured to, based on the first distance and the second distance, determine a parameter adjustment ratio; and, based on the parameter adjustment ratio, the first brightness adjustment parameter and the first color adjustment parameter of the first image region, and the first brightness adjustment parameter and the first color adjustment parameter of the second image region, determine the actual adjustment parameters of the overlapping area of ​​the first image region and the second image region.

[0233] In the image processing apparatus provided in this application embodiment, since the first tone adjustment model can obtain the region adjustment weight parameters, brightness adjustment parameters, and color adjustment parameters of each object in the first image based on the image feature information of the first image, during the image processing of the first image, the tone adjustment model can provide the brightness and color adjustment parameters for each object based on the semantic content of the image, i.e., the objects contained in the image. This achieves the linkage between image processing and the semantic content of the image, avoiding the situation where parameters cannot be dynamically adjusted due to the inability to understand the image content. Simultaneously, since the tone adjustment model adjusts the brightness and color of the image indirectly by combining weight information, it can isolate the direct interaction between the network and pixels, reducing the image quality degradation caused by the network directly modifying pixels. Thus, the flexibility of image processing in the image processing apparatus can be improved, and the image processing quality can be enhanced.

[0234] The image processing device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0235] The image processing device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0236] The image processing apparatus provided in this application embodiment can implement the various processes implemented in the above method embodiments, and will not be described again here to avoid repetition.

[0237] Optionally, such as Figure 13 As shown, this application embodiment also provides an electronic device 90, including a processor 91 and a memory 92. The memory 92 stores a program or instructions that can run on the processor 91. When the program or instructions are executed by the processor 91, they implement the various steps of the above-described image processing method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0238] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0239] Figure 14 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0240] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0241] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 14 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0242] The processor 110 is configured to input a first image into a first tone adjustment model to obtain image feature information of the first image, the first image including at least one object; and, through a region parameter prediction module in the first tone adjustment model, obtain region adjustment weight information of at least one object based on the image feature information; and, through a brightness adjustment parameter prediction module in the first tone adjustment model, obtain brightness adjustment parameters of at least one object based on the image feature information; and, through a color adjustment parameter prediction module in the first tone adjustment model, obtain color adjustment parameters of at least one object based on the image feature information; and, based on the region adjustment weight information, brightness adjustment parameters, and color adjustment parameters of at least one object, perform image processing on the first image to obtain a second image.

[0243] Optionally, the processor 110 is specifically configured to obtain the image region size and Gaussian function parameters of each object in at least one object based on image feature information through the region parameter prediction module; and calculate the region adjustment weight information of each object through a two-dimensional Gaussian function based on the image region size and Gaussian function parameters of each object.

[0244] Optionally, the processor 110 is specifically configured to obtain the brightness curve adjustment parameters of each object in at least one object based on image feature information through the brightness adjustment parameter prediction module; and determine the brightness adjustment parameters of each object based on the brightness curve adjustment parameters of each object.

[0245] Optionally, the processor 110 is specifically configured to: determine a first brightness adjustment parameter and a first color adjustment parameter for an image region corresponding to each object in the first image based on region adjustment weight information, brightness adjustment parameters, and color adjustment parameters for each object in at least one object; determine a second brightness adjustment parameter for the first image based on the first brightness adjustment parameter corresponding to at least one object; obtain a second color adjustment parameter for the first image based on the first color adjustment parameter corresponding to at least one object; and perform image processing on the first image based on the second brightness adjustment parameter and the second color adjustment parameter to obtain a second image.

[0246] Optionally, the processor 110 is further configured to, when there is regional overlap between the first image region corresponding to the first object and the second image region corresponding to the second object, obtain a first distance between the center position of the first image region and the center position of the first image, and obtain a second distance between the second image region and the center position of the first image, wherein the at least one object includes the first object and the second object; and determine a parameter adjustment ratio based on the first distance and the second distance; and determine the actual adjustment parameters of the overlapping area of ​​the first image region and the second image region based on the parameter adjustment ratio, the first brightness adjustment parameter and the first color adjustment parameter of the first image region, and the first brightness adjustment parameter and the first color adjustment parameter of the second image region.

[0247] In the electronic device provided in this application embodiment, since the first tone adjustment model can obtain the region adjustment weight parameters, brightness adjustment parameters, and color adjustment parameters of each object in the first image based on the image feature information of the first image, during image processing of the first image, the tone adjustment model can provide brightness and color adjustment parameters for each object based on the semantic content of the image, i.e., the objects contained in the image. This achieves the linkage between image processing and image semantic content, avoiding the situation where parameters cannot be dynamically adjusted due to the inability to understand the image content. Simultaneously, since the tone adjustment model adjusts the brightness and color of the image indirectly by combining weight information, it can isolate the direct interaction between the network and pixels, reducing the image quality degradation caused by the network directly modifying pixels. Thus, the flexibility of image processing in electronic devices can be improved, and the image processing quality can be enhanced.

[0248] The electronic device provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0249] For details on the beneficial effects of the various implementation methods in this embodiment, please refer to the beneficial effects of the corresponding implementation methods in the above method embodiments. To avoid repetition, these will not be repeated here.

[0250] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0251] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0252] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0253] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0254] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0255] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0256] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0257] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.

[0258] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0259] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0260] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An image processing method, characterized in that, The method includes: The first image is input into the first tone adjustment model to obtain the image feature information of the first image, wherein the first image includes at least one object; Based on the image feature information, the region adjustment weight information of the at least one object is obtained through the region parameter prediction module in the first tone adjustment model. The brightness adjustment parameters of the at least one object are obtained based on the image feature information through the brightness adjustment parameter prediction module in the first tone adjustment model. The color adjustment parameters of the at least one object are obtained based on the image feature information through the color adjustment parameter prediction module in the first tone adjustment model. Based on the region adjustment weight information, the brightness adjustment parameters, and the color adjustment parameters of the at least one object, the first image is processed to obtain the second image.

2. The method according to claim 1, characterized in that, Based on the image feature information, the region adjustment weight information of the at least one object is obtained through the region parameter prediction module in the first tone adjustment model, including: Based on the image feature information, the region parameter prediction module obtains the image region size and Gaussian function parameters for each of the at least one objects. Based on the image region size and Gaussian function parameters of each object, the region adjustment weight information of each object is calculated using a two-dimensional Gaussian function.

3. The method according to claim 1, characterized in that, The step of obtaining the brightness adjustment parameters of at least one object based on the image feature information through the brightness adjustment parameter prediction module in the first tone adjustment model includes: The brightness adjustment parameter prediction module obtains the brightness curve adjustment parameters for each of the at least one objects based on the image feature information. The brightness adjustment parameters for each object are determined based on the brightness curve adjustment parameters for each object.

4. The method according to claim 1, characterized in that, The method of performing image processing on the first image based on the region adjustment weight information, the brightness adjustment parameters, and the color adjustment parameters of the at least one object to obtain the second image includes: Based on the region adjustment weight information, the brightness adjustment parameters and the color adjustment parameters of each of the at least one object, a first brightness adjustment parameter and a first color adjustment parameter of an image region corresponding to each object in the first image are determined. Based on the first brightness adjustment parameter corresponding to the at least one object, determine the second brightness adjustment parameter of the first image, and based on the first color adjustment parameter corresponding to the at least one object, obtain the second color adjustment parameter of the first image; Based on the second brightness adjustment parameter and the second color adjustment parameter, the first image is processed to obtain the second image.

5. The method according to claim 4, characterized in that, The method further includes: In the case where there is regional overlap between the first image region corresponding to the first object and the second image region corresponding to the second object, a first distance between the first image region and the center position of the first image is obtained, and a second distance between the second image region and the center position of the first image is obtained, wherein the at least one object includes the first object and the second object; Based on the first distance and the second distance, determine the parameter adjustment ratio; Based on the parameter adjustment ratio, the first brightness adjustment parameter and the first color adjustment parameter of the first image region, and the first brightness adjustment parameter and the first color adjustment parameter of the second image region, the actual adjustment parameters of the overlapping area of ​​the first image region and the second image region are determined.

6. An image processing apparatus, characterized in that, The image processing device includes: an acquisition module and a processing module; The acquisition module is configured to input a first image into a first tone adjustment model to obtain image feature information of the first image, wherein the first image includes at least one object; and, based on the image feature information, obtain region adjustment weight information of the at least one object through a region parameter prediction module in the first tone adjustment model; and, based on the image feature information, obtain brightness adjustment parameters of the at least one object through a brightness adjustment parameter prediction module in the first tone adjustment model; and, based on the image feature information, obtain color adjustment parameters of the at least one object through a color adjustment parameter prediction module in the first tone adjustment model. The processing module is used to perform image processing on the first image based on the region adjustment weight information, brightness adjustment parameters and color adjustment parameters of the at least one object obtained by the acquisition module, to obtain a second image.

7. The apparatus according to claim 6, characterized in that, The acquisition module is specifically used for: The region parameter prediction module obtains the image region size and Gaussian function parameters of each of the at least one objects based on the image feature information. Based on the image region size and Gaussian function parameters of each object, the region adjustment weight information of each object is calculated using a two-dimensional Gaussian function.

8. The apparatus according to claim 6, characterized in that, The acquisition module is specifically used for: The brightness adjustment parameter prediction module obtains the brightness curve adjustment parameters for each of the at least one objects based on the image feature information. The brightness adjustment parameters for each object are determined based on the brightness curve adjustment parameters for each object.

9. The apparatus according to claim 6, characterized in that, The device further includes: a determining module; The determining module is used to determine the first brightness adjustment parameter and the first color adjustment parameter of an image region corresponding to each object in the first image based on the region adjustment weight information, the brightness adjustment parameter and the color adjustment parameter of each object in the at least one object obtained by the obtaining module; The acquisition module is further configured to determine the second brightness adjustment parameters of the first image based on the first brightness adjustment parameters corresponding to the at least one object, and to obtain the second color adjustment parameters of the first image based on the first color adjustment parameters corresponding to the at least one object; The processing module is specifically used to perform image processing on the first image based on the second brightness adjustment parameters and the second color adjustment parameters obtained by the acquisition module, so as to obtain the second image.

10. The apparatus according to claim 9, characterized in that, The acquisition module is further configured to, when there is regional overlap between the first image region corresponding to the first object and the second image region corresponding to the second object, acquire a first distance between the center position of the first image region and the center position of the first image region, and acquire a second distance between the second image region and the center position of the first image region, wherein the at least one object includes the first object and the second object; The determining module is further configured to determine a parameter adjustment ratio based on the first distance and the second distance; and to determine the actual adjustment parameters of the overlapping area of ​​the first image area and the second image area based on the parameter adjustment ratio, the first brightness adjustment parameter and the first color adjustment parameter of the first image area, and the first brightness adjustment parameter and the first color adjustment parameter of the second image area.