Image enhancement method, and training method and device of brightness curve prediction model
The image is processed through the brightness curve prediction model to generate a brightness curve map for image enhancement, which solves the problems of information distortion and loss in traditional image signal processing, improves image clarity and data quality, and is suitable for assisted driving and automatic driving systems. .
Patent Information
- Application Number
- CN202410799838.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-11
AI Technical Summary
Traditional image signal processing methods have problems with information distortion and loss in assisted driving and autonomous driving systems, which limits the algorithm performance of downstream perception tasks.
The brightness curve prediction model is used to process the image, generate multiple brightness curve maps, and perform image enhancement based on these maps to improve the clarity of the image while maintaining the integrity of the image information.
Through the enhancement of image brightness, the image clarity is improved, information distortion and loss are avoided, data collection and training costs are reduced, and the data quality of vehicle environment perception is improved.
Smart Images

Figure CN118761944A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to an image enhancement method, a training method and a device for a brightness curve prediction model. Background Art
[0002] In recent years, with the rapid development of artificial intelligence, machine vision and other fields, assisted driving and autonomous driving have become important research areas in academia and industry. Environmental perception technology is one of the key technologies in assisted driving and autonomous driving systems, and it is also the most basic module. Environmental perception technology perceives and analyzes the acquired visual data, so that the vehicle can understand and identify roads, obstacles, traffic signals, etc.
[0003] Therefore, image signal processing of the RAW images output by the sensor is a key link in whether the vehicle environment perception module can obtain high-quality visual data. Summary of the invention
[0004] Generally, the image quality enhancement results corresponding to traditional image signal processing have information distortion and loss problems, which restricts the algorithm performance of downstream perception tasks at the source of the data. In order to solve the above technical problems, the present disclosure provides an image enhancement method, a training method and a device for a brightness curve prediction model, which can solve the information distortion and loss problems existing in traditional image signal processing.
[0005] The first aspect of the present disclosure provides an image enhancement method, including: determining a first image to be processed; processing the first image based on a brightness curve prediction model to obtain a plurality of brightness curve mapping diagrams corresponding to the first image; performing image enhancement processing on the first image based on the plurality of brightness curve mapping diagrams to obtain an enhanced brightness component; and determining an enhanced first image based on the enhanced brightness component and the first image.
[0006] The second aspect of the present disclosure provides a training method for a brightness curve prediction model, including: determining a first image sample; determining an enhanced image sample based on the first image sample; processing the first image sample based on an initial brightness curve prediction model to obtain a plurality of predicted brightness curve mapping diagrams corresponding to the first image sample; performing image enhancement processing on the first image sample based on the plurality of predicted brightness curve mapping diagrams to obtain a predicted enhanced brightness component, and obtaining a predicted enhanced image based on the predicted enhanced brightness component and the first image sample; using the predicted enhanced image as output information of the initial brightness curve prediction model and the enhanced image sample as target information, iteratively training the initial brightness curve prediction model to obtain a trained brightness curve prediction model.
[0007] According to a third aspect of the present disclosure, an image enhancement device is provided, comprising: a first determination module, used to determine a first image to be processed; a first processing module, used to process the first image based on a brightness curve prediction model to obtain a plurality of brightness curve mapping graphs corresponding to the first image; a second processing module, used to perform image enhancement processing on the first image based on the plurality of brightness curve mapping graphs to obtain an enhanced brightness component; and a second determination module, used to determine the enhanced first image based on the enhanced brightness component and the first image.
[0008] According to a fourth aspect of the present disclosure, a training device for a brightness curve prediction model is provided, comprising: a sample determination module for determining a first image sample; a true value determination module for determining an enhanced image sample based on the first image sample; a processing module for processing the first image sample based on an initial brightness curve prediction model to obtain a plurality of predicted brightness curve mapping diagrams corresponding to the first image sample; a prediction module for performing image enhancement processing on the first image sample based on the plurality of predicted brightness curve mapping diagrams to obtain a predicted enhanced brightness component, and obtaining a predicted enhanced image based on the predicted enhanced brightness component and the first image sample; and a training module for iteratively training the initial brightness curve prediction model using the predicted enhanced image as output information of the initial brightness curve prediction model and the enhanced image sample as target information to obtain a trained brightness curve prediction model.
[0009] A fifth aspect of the present disclosure provides a computer-readable storage medium storing a computer program for executing the image enhancement method provided in the first aspect or the brightness curve prediction model training method provided in the second aspect.
[0010] The sixth aspect of the present disclosure provides an electronic device, which includes: a processor; a memory for storing processor executable instructions; a processor, configured to read executable instructions from the memory and execute the instructions to implement the image enhancement method provided in the first aspect above, or the brightness curve prediction model training method provided in the second aspect.
[0011] The seventh aspect of the present disclosure provides a computer program product. When the instructions in the computer program product are executed by a processor, the image enhancement method provided in the first aspect or the training method of the brightness curve prediction model provided in the second aspect is executed.
[0012] Based on the image enhancement method provided by the present invention, the first image is processed by a brightness curve prediction model to obtain multiple brightness curve mapping graphs, and then the first image is enhanced based on the brightness curve mapping graphs, so that the image clarity can be enhanced by enhancing the image brightness; since other image information except the image brightness does not change during the image enhancement process, the image clarity can be improved while keeping the image information intact. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a schematic diagram of a scene to which the image enhancement method provided by an exemplary embodiment of the present disclosure is applicable.
[0014] Figure 2 A flowchart of an image enhancement method provided by an exemplary embodiment of the present disclosure.
[0015] Figure 3 It is a flowchart of an image enhancement method provided by another exemplary embodiment of the present disclosure.
[0016] Figure 4 It is a flowchart of an image enhancement method provided by yet another exemplary embodiment of the present disclosure.
[0017] Figure 5 It is a flowchart of an image enhancement method provided by yet another exemplary embodiment of the present disclosure.
[0018] Figure 6 It is a flowchart of an image enhancement method provided by yet another exemplary embodiment of the present disclosure.
[0019] Figure 7 A schematic flow chart of a method for training a brightness curve prediction model provided by an exemplary embodiment of the present disclosure.
[0020] Figure 8 A schematic flow chart of a method for training a brightness curve prediction model provided by another exemplary embodiment of the present disclosure.
[0021] Fig. 9 A schematic flowchart of a method for training a brightness curve prediction model is provided for yet another exemplary embodiment of the present disclosure.
[0022] Fig.10 A schematic diagram of the structure of an image enhancement device provided by an exemplary embodiment of the present disclosure.
[0023] Fig.11 A schematic structural diagram of an image enhancement device provided by another exemplary embodiment of the present disclosure.
[0024] Fig.12 A schematic structural diagram of an image enhancement device provided by yet another exemplary embodiment of the present disclosure.
[0025] Fig.13 A schematic diagram of the structure of a training device for a brightness curve prediction model provided by an exemplary embodiment of the present disclosure.
[0026] Fig.14 A schematic diagram of the structure of a training device for a brightness curve prediction model provided by another exemplary embodiment of the present disclosure.
[0027] Fig.15 A schematic diagram of the structure of a training device for a brightness curve prediction model provided by yet another exemplary embodiment of the present disclosure.
[0028] Fig.16 It is a structural schematic diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] To explain the present disclosure, example embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. It should be understood that the present disclosure is not limited to the example embodiments.
[0030] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
[0031] Application Overview
[0032] The image enhancement method provided by the embodiments of the present disclosure can be applied to, for example, the front end of a vehicle's environmental perception scenario, and any other feasible scenario.
[0033] like Figure 1 As shown, at least a plurality of image sensors 11 are provided on the vehicle 10, and the image output by the image sensor 11 is the original image without any processing, that is, the RAW domain image. The image enhancement method provided in the embodiment of the present disclosure is based on the image enhancement performed on the RAW domain image, thereby obtaining an enhanced image. Exemplarily, the enhanced image can be directly used as input data for vehicle environment perception; of course, the enhanced image can be further subjected to relevant image signal processing (Image Signal Process, ISP) processing, and the processed image can be used as input data for vehicle environment perception. It should be noted that Figure 1 This is only an example, and the embodiments of the present disclosure are Figure 1There is no limit to the number and position of the multiple image sensors 11. In actual use, the image sensor 11 may be an image sensor corresponding to the vehicle's forward wide-angle camera, the image sensor 11 may be an image sensor corresponding to the vehicle's forward narrow-angle camera, the image sensor 11 may also be an image sensor corresponding to a side view camera, etc.
[0034] Generally, there are three methods to obtain visual data in vehicle environment perception scenes: the first is the image signal processing method of traditional vehicle-mounted cameras. The image quality enhancement results obtained by this method have information distortion and loss problems, which restricts the algorithm performance of downstream perception tasks at the source of the data. The second is a supervised image enhancement method. This method requires the collection of large-scale paired data, which has a high cost for data collection and consumes a lot of data storage resources. The third is an unsupervised image enhancement method. Although this method alleviates the problem of information loss, it is limited by the modeling capability without reference loss, and the image clarity enhancement effect is not obvious, making it difficult to improve the low clarity problem of RAW domain images.
[0035] In order to solve the above problems, the embodiment of the present disclosure provides an image enhancement method, which processes a first image through a brightness curve prediction model to obtain multiple brightness curve mapping graphs, and then enhances the first image based on the brightness curve mapping graphs, so that the image clarity can be enhanced by enhancing the image brightness; since other image information except the image brightness does not change during the image enhancement process, the image clarity can be improved while maintaining the image information intact. In addition, the training process of the brightness curve prediction model in the image enhancement method does not require large-scale paired data, and the training cost is low.
[0036] Exemplary Methods
[0037] Figure 2 The following is a flow chart of an image enhancement method provided by an embodiment of the present disclosure. This embodiment can be applied to electronic devices, such as Figure 2 As shown, the method includes the following steps S201-S204.
[0038] Step S201: Determine a first image to be processed.
[0039] For example, Figure 1 As shown, the RAW domain image captured by the image sensor 11 can be first obtained, and then the RAW domain image can be preprocessed, for example, the RAW domain image can be de-mosaiced, and the preprocessed image is a three-channel image, that is, an RGB image. Then, the RGB image can be used as the first image to be processed.
[0040] Step S202: Process the first image based on the brightness curve prediction model to obtain a plurality of brightness curve mapping graphs corresponding to the first image.
[0041] Exemplarily, the brightness curve prediction model is a trained neural network model for predicting brightness curve mapping graphs. After the first image to be processed is input into the brightness curve prediction model, multiple brightness curve mapping graphs corresponding to the first image can be output. Exemplarily, the brightness curve prediction model may include a feature extraction layer and a nonlinear transformation layer. The feature extraction layer is used to extract features from the first image to obtain multiple feature graphs; and the nonlinear transformation layer is used to perform nonlinear transformation on the multiple feature graphs to obtain brightness curve mapping graphs corresponding to each feature graph.
[0042] Exemplarily, the brightness curve mapping diagram is used to map the pixel brightness values in the first range to the second range, thereby achieving brightness value enhancement. For example, the pixel brightness value of [0,1] is mapped to the range [-1,1] to stretch the brightness of the pixel. In some examples, if the size of the first image or feature map is W*H, and the brightness curve mapping diagram is used to map the brightness of each pixel to the range of [-1,1], then the brightness curve mapping diagram is a mapping diagram with a size of W*H and brightness values between -1 and 1.
[0043] Furthermore, the brightness curve mapping diagram obtained by the brightness curve prediction model in the embodiment of the present disclosure can ensure that the brightness stretching meets the requirement of monotony and no overflow.
[0044] Step S203: performing image enhancement processing on the first image based on the multiple brightness curve mapping graphs to obtain an enhanced brightness component.
[0045] Exemplarily, the first image is an RGB image. When performing image enhancement processing on the first image, the first image may be converted from the RGB color space to the HSV color space to obtain a hue H component corresponding to the first image, a saturation S component corresponding to the first image, and a brightness V component corresponding to the first image. Further, brightness enhancement processing is performed on the brightness V component corresponding to the first image based on a plurality of brightness curve mapping graphs to obtain an enhanced brightness component.
[0046] For example, taking the example of obtaining 12 brightness curve mapping graphs after inputting the first image into the brightness curve prediction model, the 12 brightness curve mapping graphs can be used to perform pixel-by-pixel curve stretching processing on the brightness V component corresponding to the first image in turn. After 12 rounds of pixel-by-pixel curve stretching processing, the enhanced brightness component corresponding to the first image is obtained.
[0047] Step S204: Determine an enhanced first image based on the enhanced brightness component and the first image.
[0048] Exemplarily, the enhanced first image can be an image in the RGB color space. After performing image enhancement processing on the first image to obtain an enhanced brightness component, the enhanced first image can be determined based on the enhanced brightness component and the image corresponding to the first image in the HSV color space (i.e., the second image).
[0049] For example, after converting the first image from the RGB color space to the HSV color space, other components of the first image except the brightness V component in the HSV color space may be further determined, namely, the hue H component and the saturation S component. Then, based on enhancing the brightness component, the hue H component and the saturation S component, the enhanced first image may be obtained.
[0050] The image enhancement method provided by the embodiment of the present disclosure processes the first image through a brightness curve prediction model to obtain multiple brightness curve mapping graphs, and then performs image enhancement on the first image based on the brightness curve mapping graphs, so that the image clarity can be enhanced by enhancing the image brightness; since other image information except the image brightness does not change during the image enhancement process, the image clarity can be improved while keeping the image information intact.
[0051] like Figure 3 As shown in the above Figure 2 Based on the illustrated embodiment, step S202 may include the following steps S2021 and S2022.
[0052] Step S2021: extract features of the first image based on the feature extraction layer in the brightness curve prediction model to obtain image features of the first image in multiple preset channels.
[0053] Exemplarily, the brightness curve prediction model includes at least a feature extraction layer, which can be used to extract features from the first image to be processed to obtain image features of multiple preset channels. It should be noted that the embodiment of the present disclosure does not limit the specific method of feature extraction. For example, a convolutional neural network (CNN) can be used to extract features from the first image.
[0054] For example, the convolution kernel size of the feature extraction layer can be set to 3*3, and the first image is first downsampled by the convolution kernel to obtain the downsampled features. The downsampled features are then upsampled to obtain the final image features. Among them, the number of channels corresponding to the multiple preset channels is a hyperparameter in the brightness curve prediction model, and its value is related to the image sensor module. In the actual application process, the number of channels corresponding to the multiple preset channels can be set based on the relevant characteristics of the sensor module and the empirical value. The embodiments of the present disclosure do not limit this. The following embodiments take the number of channels of the multiple preset channels as 12 as an example for illustrative explanation.
[0055] In some embodiments, a feature extraction network with shared weights may be used to extract features from the first image to be processed, so as to obtain image features of the first image in multiple preset channels.
[0056] Step S2022: Based on the activation function layer in the brightness curve prediction model, nonlinear transformation is performed on the image features of multiple preset channels respectively to obtain brightness curve mapping diagrams corresponding to the multiple preset channels.
[0057] Exemplarily, the brightness curve prediction model includes at least an activation function layer, and the activation function in the activation function layer can be used to map the image features of multiple preset channels to the corresponding interval range, and obtain the brightness curve mapping diagrams corresponding to the multiple preset channels. For example, in order to ensure that the brightness stretching meets the requirement of monotony and no overflow, the tanh (·) activation function can be used to map the image features of multiple preset channels to the interval [-1, 1], and generate the brightness curve stretching diagram C corresponding to each pixel of the channel number k i ,i=1,…,k;wherein, k is the number of channels of the plurality of preset channels. The brightness curve stretching graph C i It is a multi-segment quadratic monotonic curve stretching diagram of the image in the [0, 1] interval. This can ensure the stability of brightness stretching and prevent pixel value overexposure.
[0058] The image enhancement method provided by the embodiment of the present disclosure extracts features of the first image to be processed, performs nonlinear transformation on the extracted image features to obtain a corresponding brightness curve mapping map, and performs image enhancement on the first image based on the brightness curve mapping map, thereby enhancing the image clarity by enhancing the image brightness; at the same time, since the brightness curve mapping map is obtained by performing nonlinear transformation on the image features, using the brightness curve mapping map for brightness enhancement has a good enhancement effect.
[0059] like Figure 4 As shown in the above Figure 2 Based on the illustrated embodiment, step S203 may include the following steps S2031 and S2032.
[0060] Step S2031: convert the first image from the first color space to the second color space to obtain a second image.
[0061] Exemplarily, the first image may be converted from the RGB color space to the HSV color space to obtain a second image, which is an image of the first image in the HSV color space.
[0062] Step S2032: performing image enhancement processing on the original brightness component of the second image based on the brightness curve mapping map corresponding to each preset channel in the plurality of brightness curve mapping maps to obtain an enhanced brightness component.
[0063] Exemplarily, after converting the first image from the RGB color space to the HSV color space, a second image is obtained, which consists of a hue H component, a saturation S component, and a brightness V component. Then, the brightness V component can be enhanced using the brightness curve mapping maps corresponding to each preset channel in the multiple brightness curve mapping maps to obtain an enhanced brightness component. For example, the brightness curve mapping maps corresponding to the multiple preset channels include brightness curve mapping maps corresponding to 12 preset channels, which are respectively the brightness curve mapping maps corresponding to the first preset channel to the brightness curve mapping maps corresponding to the twelfth preset channel. The brightness component V can be first enhanced using the brightness curve mapping map corresponding to the first preset channel to obtain a first enhanced result; then the first enhanced result is enhanced using the brightness curve mapping map corresponding to the second preset channel to obtain a second enhanced result, and so on, and finally the eleventh enhanced result is enhanced using the brightness curve mapping map corresponding to the twelfth preset channel to obtain the final enhanced brightness component.
[0064] The image enhancement method provided by the embodiment of the present disclosure processes the original brightness component of the first image in the second color space through the brightness curve mapping map corresponding to each preset channel in multiple preset channels to obtain an enhanced brightness component. Since the original brightness component corresponding to the first image is enhanced by using multiple brightness curve mapping maps, a better enhancement effect can be obtained.
[0065] like Figure 5 As shown in the above Figure 4 Based on the illustrated embodiment, step S2032 may include the following steps S21 and S22.
[0066] Step S21: Perform pixel-by-pixel brightness stretching processing on the original brightness component of the second image based on the brightness curve mapping map corresponding to the first preset channel in the plurality of brightness curve mapping maps to obtain the brightness component corresponding to the first preset channel.
[0067] For example, the plurality of brightness curve mapping graphs include brightness curve mapping graphs corresponding to 12 preset channels, which are brightness curve mapping graph C1 corresponding to the first preset channel and brightness curve mapping graphs C2 to C3 corresponding to 11 second preset channels. 12 Furthermore, based on the brightness curve mapping map C1 corresponding to the first preset channel, the original brightness component V0 of the second image is subjected to pixel-by-pixel brightness stretching processing to obtain the brightness component V1 corresponding to the first preset channel.
[0068] Step S22, based on the brightness curve mapping map corresponding to each second preset channel in at least one second preset channel in the plurality of brightness curve mapping maps, sequentially perform pixel-by-pixel brightness stretching processing on the brightness component corresponding to the previous preset channel of each second preset channel to obtain an enhanced brightness component;
[0069] The brightness component corresponding to the previous preset channel of the second preset channel at least includes the brightness component corresponding to the first preset channel.
[0070] For example, the plurality of brightness curve mapping graphs include brightness curve mapping graphs corresponding to 12 preset channels, which are brightness curve mapping graph C1 corresponding to the first preset channel and brightness curve mapping graphs C2 to C3 corresponding to 11 second preset channels. 12 Then, based on the brightness curve mapping map C2 corresponding to the second preset channel, the brightness component V1 corresponding to the first preset channel is subjected to pixel-by-pixel brightness stretching processing to obtain the brightness component V2 corresponding to the second preset channel; then, based on the brightness curve mapping map C3 corresponding to the second preset channel, the brightness component V2 corresponding to the second preset channel is subjected to pixel-by-pixel brightness stretching processing to obtain the brightness component V3 corresponding to the second preset channel; then, based on the brightness curve mapping map C4 corresponding to the second preset channel, the brightness component V3 corresponding to the second preset channel is subjected to pixel-by-pixel brightness stretching processing to obtain the brightness component V4 corresponding to the second preset channel, and so on. Finally, based on the brightness curve mapping map C 12 The brightness component V corresponding to the second preset channel 11 Perform pixel-by-pixel brightness stretching to obtain the enhanced brightness component V 12 .
[0071] In some examples, the brightness curve mapping diagram C corresponding to each preset channel can be used i , i=1,…,k performs k rounds of pixel-by-pixel curve stretching on the original brightness component V0 in the HSV color space to obtain the brightness component V with enhanced clarity k , the enhanced brightness component V can be determined by the following formula (1): k :
[0072] V i =V i-1 +C i *Vi-1 *(V i-1 -1), i=1,…,k (Formula 1);
[0073] Wherein, k is the number of channels of the plurality of preset channels.
[0074] The image enhancement method provided by the embodiment of the present disclosure performs multiple rounds of pixel-by-pixel curve stretching on the original brightness components corresponding to the first image in the second color space through the brightness curve mapping diagrams corresponding to each preset channel, so as to obtain the enhanced brightness components corresponding to the first image. Since multiple rounds of pixel-level curve stretching are performed, a better clarity enhancement effect can be obtained.
[0075] like Figure 6 As shown in the above Figure 2 Based on the illustrated embodiment, step S204 may include the following steps S2041 to S2043.
[0076] Step S2041, determining the hue component and saturation component of the second image corresponding to the first image; wherein the second image is an image obtained by converting the first image from the first color space to the second color space.
[0077] Exemplarily, the first image is an RGB image, and the second image is an image obtained by converting the first image from the RGB color space to the HSV color space. The second image includes a hue H component, a saturation S component, and a brightness V component. In the disclosed embodiment, after obtaining the enhanced brightness component corresponding to the first image, it is necessary to determine the hue H component and the saturation S component of the first image in the HSV color space.
[0078] Step S2042: Combine the enhanced brightness component, hue component and saturation component to obtain an enhanced second image.
[0079] Exemplarily, in the HSV color space, the enhanced brightness component, the hue H component of the second image (i.e., the hue H component of the first image in the HSV color space), and the saturation S component (i.e., the saturation S component of the first image in the HSV color space) are recombined to obtain an enhanced second image.
[0080] Step S2043: convert the enhanced second image from the second color space to the first color space to obtain the enhanced first image.
[0081] Exemplarily, after obtaining the enhanced second image, it is necessary to convert the enhanced second image from the HSV color space to the RGB color space to obtain the enhanced RGB image. It should be noted that the enhanced second image can be directly used for subsequent environmental perception processing, or the enhanced first image can be used for subsequent environmental perception processing, and the embodiments of the present disclosure do not limit this.
[0082] The image enhancement method provided by the embodiment of the present disclosure obtains an enhanced first image by recombining the enhanced brightness component, the original hue component and the original saturation component, thereby enhancing the clarity of the image while ensuring the integrity of the image quality (hue and saturation).
[0083] Figure 7 The present invention provides a flow chart of a method for training a brightness curve prediction model. The present invention can be applied to electronic devices, such as Figure 7 As shown, the method includes the following steps S701-S705.
[0084] Step S701: Determine a first image sample.
[0085] For example, Figure 1 As shown, the RAW domain image sample collected by the image sensor 11 can be obtained first, and then the RAW domain image sample can be preprocessed, for example, the RAW domain image sample can be de-mosaiced, and the preprocessed image sample is a three-channel image, that is, an RGB image sample. Then, the RGB image sample can be used as the first image sample.
[0086] Step S702: Determine an enhanced image sample based on the first image sample.
[0087] Exemplarily, the first image sample may be subjected to histogram equalization processing to obtain an enhanced image sample corresponding to the first image sample. That is, the embodiment of the present disclosure uses the enhanced image sample as the true value of the brightness curve prediction model, that is, the label information of the brightness curve prediction model.
[0088] Step S703: Process the first image sample based on the initial brightness curve prediction model to obtain a plurality of predicted brightness curve mapping graphs corresponding to the first image sample.
[0089] It can be understood that the specific implementation method of obtaining multiple predicted brightness curve mapping diagrams corresponding to the first image sample using the initial brightness curve prediction model can refer to the implementation method of the aforementioned step S202, which will not be repeated here.
[0090] Step S704: perform image enhancement processing on the first image sample based on the multiple predicted brightness curve mappings to obtain a predicted enhanced brightness component, and obtain a predicted enhanced image based on the predicted enhanced brightness component and the first image sample.
[0091] It can be understood that the specific implementation method of performing image enhancement processing on the first image sample based on multiple predicted brightness curve mapping diagrams can refer to the implementation method of the aforementioned step S203, which will not be repeated here.
[0092] Similarly, the specific implementation method of obtaining the predicted enhanced image based on the predicted enhanced brightness component and the first image sample can refer to the implementation method of the aforementioned step S204, which will not be repeated here.
[0093] Step S705: using the predicted enhanced image as output information of the initial brightness curve prediction model and the enhanced image sample as target information, iteratively training the initial brightness curve prediction model to obtain a trained brightness curve prediction model.
[0094] For example, the predicted enhanced image can be used as the output of the initial brightness curve prediction model, and the enhanced image sample can be used as the supervision information to iteratively train the initial brightness curve prediction model to obtain a trained brightness curve prediction model. Furthermore, the trained brightness curve prediction model can be used in practical applications to determine a brightness curve mapping diagram of the image to be processed, and image enhancement can be performed on the image to be processed based on the brightness curve mapping diagram.
[0095] In some examples, a loss value may be determined based on the predicted enhanced image and the enhanced image sample, and then the network parameters in the initial brightness curve prediction model may be updated using the loss value until the updated model meets the convergence condition. If the updated model meets the convergence condition, a trained brightness curve prediction model is obtained.
[0096] Among them, the updated model meets the convergence conditions, which can be achieved in the following three ways: the first is that the loss of the model output is less than a preset value; the second is that the change in weights between two iterations is less than a preset value; the third is that the number of iterations reaches a preset number.
[0097] The training method of the brightness curve prediction model provided by the embodiment of the present disclosure processes the first image sample through the initial brightness curve prediction model to obtain multiple predicted brightness curve mapping diagrams, and then performs image enhancement on the first image sample based on the predicted brightness curve mapping diagram to obtain a predicted enhanced image, and then uses the predicted enhanced image to iteratively train the initial brightness curve prediction model to obtain a trained brightness curve prediction model, so that the trained model has a good image enhancement effect; at the same time, since the corresponding label information can be directly obtained based on the first image sample, there is no need to obtain large-scale paired data in the model training stage, and the data collection cost is low.
[0098] In some embodiments, the first image sample is processed based on the initial brightness curve prediction model to obtain multiple predicted brightness curve mapping diagrams corresponding to the first image sample, including: performing feature extraction on the first image sample based on the feature extraction layer in the initial brightness curve prediction model to obtain image features of the first image sample in multiple preset channels; performing nonlinear transformation on the image features of multiple preset channels based on the activation function layer in the initial brightness curve prediction model to obtain predicted brightness curve mapping diagrams corresponding to each of the multiple preset channels.
[0099] It can be understood that the specific implementation method of processing the first image sample based on the initial brightness curve prediction model to obtain multiple predicted brightness curve mapping diagrams corresponding to the first image sample can refer to the implementation method of the aforementioned steps S2021 to S2022, which will not be repeated here.
[0100] In some embodiments, image enhancement processing is performed on the first image sample based on multiple predicted brightness curve mapping maps to obtain a predicted enhanced brightness component, including: converting the first image sample from a first color space to a second color space to obtain a second image sample; performing image enhancement processing on the original brightness component of the second image sample based on the predicted brightness curve mapping maps corresponding to each preset channel in the multiple predicted brightness curve mapping maps to obtain a predicted enhanced brightness component.
[0101] It can be understood that the specific implementation method of performing image enhancement processing on the first image sample based on multiple predicted brightness curve mapping diagrams to obtain the predicted enhanced brightness component can refer to the implementation method of the aforementioned steps S2031 to S2032, which will not be repeated here.
[0102] In some embodiments, image enhancement processing is performed on the original brightness component of the second image sample based on the predicted brightness curve mapping map corresponding to each preset channel in multiple predicted brightness curve mapping maps to obtain the predicted enhanced brightness component, including: performing pixel-by-pixel brightness stretching processing on the original brightness component of the second image sample based on the predicted brightness curve mapping map corresponding to the first preset channel in the multiple predicted brightness curve mapping maps to obtain the predicted brightness component corresponding to the first preset channel; performing pixel-by-pixel brightness stretching processing on the predicted brightness component corresponding to the previous preset channel of each second preset channel based on the predicted brightness curve mapping map corresponding to each second preset channel in at least one second preset channel in the multiple predicted brightness curve mapping maps to obtain the predicted enhanced brightness component; wherein the predicted brightness component corresponding to the previous preset channel of the second preset channel includes at least the predicted brightness component corresponding to the first preset channel.
[0103] It can be understood that the specific implementation method of performing image enhancement processing on the original brightness component of the second image sample based on the predicted brightness curve mapping maps corresponding to each preset channel in the multiple predicted brightness curve mapping maps to obtain the predicted enhanced brightness component can refer to the implementation method of the aforementioned steps S21 to S22, which will not be repeated here.
[0104] In some embodiments, a predicted enhanced image is obtained based on a predicted enhanced brightness component and a first image sample, including: determining a hue component and a saturation component of a second image sample corresponding to the first image sample; wherein the second image sample is an image sample after converting the first image sample from a first color space to a second color space; and combining the predicted enhanced brightness component, hue component and saturation component to obtain a predicted enhanced image.
[0105] It can be understood that the specific implementation method of obtaining the predicted enhanced image based on the predicted enhanced brightness component and the first image sample can refer to the implementation method of the aforementioned steps S2041 to S2043, which will not be repeated here.
[0106] like Figure 8 As shown in the above Figure 7 Based on the illustrated embodiment, step S702 may include the following steps S7021 and S7022.
[0107] Step S7021: Convert the first image sample from the first color space to the second color space to obtain a second image sample.
[0108] Exemplarily, the first image sample may be converted from the RGB color space to the HSV color space to obtain a second image sample, where the second image sample is an image sample of the first image sample in the HSV color space.
[0109] Step S7022: Perform histogram equalization processing on the original brightness component of the second image sample to obtain an enhanced image sample.
[0110] Exemplarily, the second image sample includes an original hue H component, an original saturation S component, and an original brightness V component. The original brightness V component may be subjected to histogram equalization processing to obtain an enhanced image sample.
[0111] It should be noted that the histogram equalization in the histogram equalization processing of the original brightness component of the second image sample includes but is not limited to: histogram equalization (Histogram Equalization, HE), adaptive histogram equalization (Adaptive Histogram Equalization, AHE), and contrast-limited adaptive histogram equalization (contrastlimited adaptive histogram equalization, CLAHE).
[0112] In some examples, the RAW domain image sample I captured by the image sensor may be rgb Convert from RGB color space to HSV color space, denoted as I hsv Then use the CLAHE algorithm to hsv The brightness attribute V in the image is used to enhance the clarity. After enhancement, the image is converted from the HSV space back to the RGB space to obtain the image sample I rgb The supervised truth value This process can be expressed by the following formula (2):
[0113]
[0114] Among them, H and S are I hsv The hue component and saturation component in CLAHE(V) are hs The result of clarity enhancement of the luminance component V in .
[0115] The training method of the brightness curve prediction model provided by the embodiment of the present disclosure generates true values by performing histogram equalization processing on image samples of the transformed color space, so that true value data can be collected efficiently and at low cost. At the same time, the true value generation method is an unsupervised method, and the parameter scale of the model is small, so that the model has strong robustness.
[0116] like Fig. 9 As shown in the above Figure 7 Based on the illustrated embodiment, step S705 may include the following steps S7051 to S7054.
[0117] Step S7051: Determine the loss value corresponding to each pixel based on the brightness component of each pixel in the predicted enhanced image and the brightness component of each pixel in the enhanced image sample.
[0118] Exemplarily, in order to ensure the stability of training, only the brightness component is constrained by loss in the HSV color space, and the loss value of the model output and the true value produced on the brightness component is determined by pixel-by-pixel loss. It is possible to first ensure that the predicted enhanced image and the enhanced image sample are in the HSV color space, and then determine the loss value corresponding to each pixel based on the brightness V component of each pixel in the predicted enhanced image and the brightness V component of each pixel in the enhanced image sample, thereby performing pixel-level constraints on the brightness component of the brightness curve prediction model. Since the multiple predicted brightness curve mappings output by the initial brightness curve prediction model are mappings of pixel arrangements, the constraints also use pixel-level constraints. The advantage of loss training in the HSV color space is that the gradient is stable, and during the training process, the two components of hue H and saturation S are decoupled and only the brightness component is constrained at the pixel level, which can reduce the interference generated during gradient backpropagation.
[0119] In some examples, the loss value L corresponding to each pixel can be determined by the following formula (3): pixel :
[0120]
[0121] Where N is W*H, i.e., the number of pixels in the feature map, V′(j) is the brightness component of each pixel in the predicted enhanced image, and V gt (j) is the brightness component of each pixel in the enhanced image sample.
[0122] Step S7052: Determine a structural similarity loss value based on the predicted enhanced image and the enhanced image sample.
[0123] Exemplarily, since pixel-by-pixel loss lacks the ability to perceive the brightness of image structures, the present disclosure also uses structural similarity loss to jointly determine the loss of the brightness curve prediction model. For example, similarity (Structure Similarity, SSIM) loss can be used. SSIM loss is used to measure the similarity between two images. SSIM loss imitates human perception by focusing on edge and texture similarity. SSIM loss mainly considers three key features of the image: brightness, contrast, and structure. The calculation of SSIM loss is based on a sliding window. Each calculation takes a window of a specific size from the image, calculates the SSIM index based on the window, and then takes the average of the values of all windows after traversing the entire image as the SSIM index of the entire image.
[0124] In some examples, it is possible to first ensure that the predicted enhanced image and the enhanced image samples are in the RGB color space, and then determine the structural similarity loss based on the predicted enhanced image and the enhanced image samples. For example, the structural similarity loss value L of the model can be determined by the following formula (4): ssim :
[0125]
[0126] Among them, I r , gb is the predicted enhanced image in RGB color space, is an enhanced image sample in RGB color space.
[0127] Step S7053: Based on the loss value corresponding to each pixel and the structural similarity loss value, determine the loss value corresponding to the initial brightness curve prediction model.
[0128] Exemplarily, a corresponding weight may be set for the loss value corresponding to each pixel, and a corresponding weight may be set for the structural similarity loss value; then, based on the loss value corresponding to each pixel, the structural similarity loss value, and their respective corresponding weights, the loss value corresponding to the initial brightness curve prediction model is determined. Of course, the weight of the loss value corresponding to each pixel and the weight of the structural similarity loss value may be the same or different, and may be determined according to the actual usage scenario and is not limited to the embodiments of the present disclosure.
[0129] Step S7054: Use the loss value to iteratively update the initial brightness curve prediction model to obtain a trained brightness curve prediction model.
[0130] For example, the network parameters in the initial brightness curve prediction model can be updated using the model loss value determined by the loss value corresponding to each pixel and the structural similarity loss value until the updated model meets the convergence condition. If the updated model meets the convergence condition, the trained brightness curve prediction model is obtained.
[0131] The training method of the brightness curve prediction model provided in the embodiment of the present disclosure jointly trains the model through the pixel-level loss of the image and the structural similarity loss of the image, which can improve the training effect of the initial brightness curve prediction model, thereby improving the image enhancement capability of the trained brightness curve prediction model.
[0132] Exemplary Devices
[0133] Fig.10 An image enhancement device provided in an embodiment of the present disclosure, such as Fig.10 As shown, the image enhancement device 100 includes a first determination module 101 , a first processing module 102 , a second processing module 103 and a second determination module 104 .
[0134] A first determining module 101, used to determine a first image to be processed;
[0135] A first processing module 102 is used to process the first image based on a brightness curve prediction model to obtain a plurality of brightness curve mapping graphs corresponding to the first image;
[0136] The second processing module 103 is used to perform image enhancement processing on the first image based on a plurality of brightness curve mapping diagrams to obtain an enhanced brightness component;
[0137] The second determining module 104 is configured to determine an enhanced first image based on the enhanced brightness component and the first image.
[0138] In some embodiments, Fig.11 As shown, the first processing module 102 includes a feature extraction unit 1021 and a nonlinear transformation unit 1022 .
[0139] A feature extraction unit 1021 is used to extract features of the first image based on the feature extraction layer in the brightness curve prediction model to obtain image features of the first image in multiple preset channels;
[0140] The nonlinear transformation unit 1022 is used to perform nonlinear transformation on the image features of multiple preset channels based on the activation function layer in the brightness curve prediction model to obtain brightness curve mapping diagrams corresponding to the multiple preset channels.
[0141] In some embodiments, Fig.12 As shown, the second processing module 103 includes a space conversion unit 1031 and an image enhancement unit 1032 .
[0142] The space conversion unit 1031 is used to convert the first image from the first color space to the second color space to obtain a second image;
[0143] The image enhancement unit 1032 is used to perform image enhancement processing on the original brightness component of the second image based on the brightness curve mapping map corresponding to each preset channel in the multiple brightness curve mapping maps to obtain an enhanced brightness component.
[0144] In some embodiments, the image enhancement unit 1032 is specifically used to perform pixel-by-pixel brightness stretching processing on the original brightness component of the second image based on the brightness curve mapping map corresponding to the first preset channel in multiple brightness curve mapping maps to obtain the brightness component corresponding to the first preset channel; based on the brightness curve mapping map corresponding to each second preset channel in at least one second preset channel in the multiple brightness curve mapping maps, perform pixel-by-pixel brightness stretching processing on the brightness component corresponding to the previous preset channel of each second preset channel in turn to obtain an enhanced brightness component; wherein the brightness component corresponding to the previous preset channel of the second preset channel includes at least the brightness component corresponding to the first preset channel.
[0145] In some embodiments, the second determination module 104 is specifically used to determine the hue component and saturation component of the second image corresponding to the first image; wherein the second image is an image obtained by converting the first image from the first color space to the second color space; the enhanced brightness component, hue component and saturation component are combined to obtain an enhanced second image; and the enhanced second image is converted from the second color space to the first color space to obtain an enhanced first image.
[0146] The beneficial technical effects corresponding to the exemplary embodiment of the above-mentioned image enhancement device 100 can refer to the corresponding beneficial technical effects of the above-mentioned exemplary method part, which will not be repeated here.
[0147] Fig.13 A training device for a brightness curve prediction model provided in an embodiment of the present disclosure, such as Fig.13 As shown, the training device 130 of the brightness curve prediction model includes a sample determination module 131 , a true value determination module 132 , a processing module 133 , a prediction module 134 and a training module 135 .
[0148] A sample determination module 131, configured to determine a first image sample;
[0149] A true value determination module 132, configured to determine an enhanced image sample based on the first image sample;
[0150] A processing module 133, configured to process the first image sample based on the initial brightness curve prediction model to obtain a plurality of predicted brightness curve mapping graphs corresponding to the first image sample;
[0151] The prediction module 134 is used to perform image enhancement processing on the first image sample based on the multiple predicted brightness curve maps to obtain a predicted enhanced brightness component, and obtain a predicted enhanced image based on the predicted enhanced brightness component and the first image sample;
[0152] The training module 135 is used to iteratively train the initial brightness curve prediction model using the predicted enhanced image as output information of the initial brightness curve prediction model and the enhanced image sample as target information to obtain a trained brightness curve prediction model.
[0153] In some embodiments, the processing module 133 is specifically used to perform feature extraction on the first image sample based on the feature extraction layer in the initial brightness curve prediction model to obtain image features of the first image sample in multiple preset channels; based on the activation function layer in the initial brightness curve prediction model, perform nonlinear transformation on the image features of multiple preset channels respectively to obtain predicted brightness curve mapping diagrams corresponding to each of the multiple preset channels.
[0154] In some embodiments, the prediction module 134 is used to convert the first image sample from the first color space to the second color space to obtain the second image sample; perform image enhancement processing on the original brightness component of the second image sample based on the predicted brightness curve mapping map corresponding to each preset channel in a plurality of predicted brightness curve mapping maps to obtain a predicted enhanced brightness component; and obtain a predicted enhanced image based on the predicted enhanced brightness component and the first image sample.
[0155] In some embodiments, the prediction module 134 is specifically used to convert the first image sample from the first color space to the second color space to obtain the second image sample; based on the predicted brightness curve mapping map corresponding to the first preset channel in multiple predicted brightness curve mapping maps, the original brightness component of the second image sample is subjected to pixel-by-pixel brightness stretching processing to obtain the predicted brightness component corresponding to the first preset channel; based on the predicted brightness curve mapping map corresponding to each second preset channel in at least one second preset channel in the multiple predicted brightness curve mapping maps, the predicted brightness component corresponding to the previous preset channel of each second preset channel is subjected to pixel-by-pixel brightness stretching processing in sequence to obtain the predicted enhanced brightness component; wherein, the predicted brightness component corresponding to the previous preset channel of the second preset channel includes at least the predicted brightness component corresponding to the first preset channel; and based on the predicted enhanced brightness component and the first image sample, a predicted enhanced image is obtained.
[0156] In some embodiments, the prediction module 134 is specifically used to perform image enhancement processing on the first image sample based on multiple predicted brightness curve mapping diagrams to obtain a predicted enhanced brightness component, and determine the hue component and saturation component of the second image sample corresponding to the first image sample; wherein the second image sample is an image sample after the first image sample is converted from a first color space to a second color space; the predicted enhanced brightness component, hue component and saturation component are combined to obtain a predicted enhanced image.
[0157] In some embodiments, Fig.14 As shown, the true value determination module 132 includes a space conversion unit 1321 and an image processing unit 1322 .
[0158] The space conversion unit 1321 is used to convert the first image sample from the first color space to the second color space to obtain a second image sample;
[0159] The image processing unit 1322 is used to perform histogram equalization processing on the original brightness component of the second image sample to obtain an enhanced image sample.
[0160] In some embodiments, Fig.15 As shown, the training module 135 includes a pixel-level loss determination unit 1351 , a similarity loss determination unit 1352 , a total loss determination unit 1353 and a model training unit 1354 .
[0161] A pixel-level loss determination unit 1351, configured to determine a loss value corresponding to each pixel based on a brightness component of each pixel in the predicted enhanced image and a brightness component of each pixel in the enhanced image sample;
[0162] A similarity loss determining unit 1352 is used to determine a structural similarity loss value based on the predicted enhanced image and the enhanced image sample;
[0163] A total loss determination unit 1353, configured to determine a loss value corresponding to the initial brightness curve prediction model based on the loss value corresponding to each pixel and the structural similarity loss value;
[0164] The model training unit 1354 is used to iteratively update the initial brightness curve prediction model using the loss value to obtain a trained brightness curve prediction model.
[0165] The beneficial technical effects corresponding to the exemplary embodiment of the training device 130 for the brightness curve prediction model mentioned above can be found in the corresponding beneficial technical effects of the exemplary method part mentioned above, which will not be repeated here.
[0166] Exemplary Electronic Devices
[0167] Fig.16 A structural diagram of an electronic device 160 provided in an embodiment of the present disclosure includes at least one processor 161 and a memory 162 .
[0168] The processor 161 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 160 to perform desired functions.
[0169] The memory 162 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on a computer-readable storage medium, and the processor 161 may execute one or more computer program instructions to implement the image enhancement method and / or the training method of the brightness curve prediction model and / or other desired functions of the various embodiments of the present disclosure described above.
[0170] In one example, the electronic device 160 may further include: an input device 163 and an output device 164 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0171] The input device 163 may also include, for example, a keyboard, a mouse, etc.
[0172] The output device 164 can output various information to the outside, and may include, for example, a display, a speaker, a printer, a communication network and its connected remote output device, etc.
[0173] Of course, to simplify, Fig.16 Only some of the components related to the present disclosure in the electronic device 160 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 160 may also include any other appropriate components.
[0174] Exemplary computer program products and computer-readable storage media
[0175] In addition to the above-mentioned methods and devices, embodiments of the present disclosure may also provide a computer program product, including computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the image enhancement method and / or the steps in the training method of the brightness curve prediction model of various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section.
[0176] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0177] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor executes the steps in the image enhancement method and / or the steps in the training method of the brightness curve prediction model of the various embodiments of the present disclosure described in the above “Exemplary Method” section.
[0178] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium is, for example, but not limited to, a system, device or device including electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0179] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and cannot be considered as necessary for each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, rather than limitation, and the above details do not limit the present disclosure to being implemented by adopting the above specific details.
[0180] Those skilled in the art may make various changes and modifications to the present disclosure without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present disclosure claims and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. An image enhancement method, comprising: determining a first image to be processed; Processing the first image based on a brightness curve prediction model to obtain a plurality of brightness curve mapping graphs corresponding to the first image; Performing image enhancement processing on the first image based on the multiple brightness curve mappings to obtain an enhanced brightness component; An enhanced first image is determined based on the enhanced brightness component and the first image.
2. The method according to claim 1, wherein: The step of processing the first image based on the brightness curve prediction model to obtain a plurality of brightness curve mapping graphs corresponding to the first image includes: Performing feature extraction on the first image based on the feature extraction layer in the brightness curve prediction model to obtain image features of the first image in multiple preset channels; Based on the activation function layer in the brightness curve prediction model, nonlinear transformation is performed on the image features of the multiple preset channels respectively to obtain brightness curve mapping diagrams corresponding to the multiple preset channels respectively.
3. The method according to claim 1, wherein: The performing image enhancement processing on the first image based on the multiple brightness curve mapping graphs to obtain an enhanced brightness component includes: Convert the first image from a first color space to a second color space to obtain a second image; The original brightness component of the second image is subjected to image enhancement processing based on the brightness curve mapping map corresponding to each preset channel in the plurality of brightness curve mapping maps to obtain the enhanced brightness component.
4. The method according to claim 3, wherein: The performing image enhancement processing on the original brightness component of the second image based on the brightness curve mapping maps corresponding to each preset channel in the plurality of brightness curve mapping maps to obtain the enhanced brightness component includes: Performing pixel-by-pixel brightness stretching processing on the original brightness component of the second image based on the brightness curve mapping map corresponding to the first preset channel in the multiple brightness curve mapping maps to obtain the brightness component corresponding to the first preset channel; Based on the brightness curve mapping map corresponding to each of the second preset channels in at least one of the plurality of brightness curve mapping maps, sequentially performing pixel-by-pixel brightness stretching processing on the brightness components corresponding to the previous preset channels of each of the second preset channels, to obtain the enhanced brightness component; Among them, the brightness component corresponding to the previous preset channel of the second preset channel at least includes the brightness component corresponding to the first preset channel.
5. The method according to claim 1, wherein: The step of determining the enhanced first image based on the enhanced brightness component and the first image includes: Determine a hue component and a saturation component of a second image corresponding to the first image; wherein the second image is an image obtained by converting the first image from a first color space to a second color space; combining the enhanced brightness component, the hue component and the saturation component to obtain an enhanced second image; The enhanced second image is converted from the second color space to the first color space to obtain the enhanced first image.
6. A method for training a brightness curve prediction model, comprising: determining a first image sample; Determining an enhanced image sample based on the first image sample; Processing the first image sample based on an initial brightness curve prediction model to obtain a plurality of predicted brightness curve mapping graphs corresponding to the first image sample; Performing image enhancement processing on the first image sample based on the multiple predicted brightness curve maps to obtain a predicted enhanced brightness component, and obtaining a predicted enhanced image based on the predicted enhanced brightness component and the first image sample; The predicted enhanced image is used as output information of the initial brightness curve prediction model, and the enhanced image sample is used as target information, and the initial brightness curve prediction model is iteratively trained to obtain a trained brightness curve prediction model.
7. The method according to claim 6, wherein: The step of determining an enhanced image sample based on the first image sample comprises: Convert the first image sample from the first color space to the second color space to obtain a second image sample; A histogram equalization process is performed on the original brightness component of the second image sample to obtain an enhanced image sample.
8. The method according to claim 6, wherein: The method of taking the predicted enhanced image as output information of the initial brightness curve prediction model and the enhanced image sample as target information, iteratively training the initial brightness curve prediction model to obtain a trained brightness curve prediction model includes: Determining a loss value corresponding to each pixel based on a brightness component of each pixel in the predicted enhanced image and a brightness component of each pixel in the enhanced image sample; Determining a structural similarity loss value based on the predicted enhanced image and the enhanced image sample; Determining a loss value corresponding to the initial brightness curve prediction model based on the loss value corresponding to each pixel and the structural similarity loss value; The initial brightness curve prediction model is iteratively updated using the loss value to obtain a trained brightness curve prediction model.
9. An image enhancement device, comprising: A first determining module, used to determine a first image to be processed; A first processing module, configured to process the first image based on a brightness curve prediction model to obtain a plurality of brightness curve mapping graphs corresponding to the first image; A second processing module, configured to perform image enhancement processing on the first image based on the plurality of brightness curve mapping graphs to obtain an enhanced brightness component; The second determining module is used to determine the enhanced first image based on the enhanced brightness component and the first image.
10. A training device for a brightness curve prediction model, comprising: A sample determination module, used to determine a first image sample; A true value determination module, used to determine an enhanced image sample based on the first image sample; A processing module, configured to process the first image sample based on an initial brightness curve prediction model to obtain a plurality of predicted brightness curve mapping graphs corresponding to the first image sample; A prediction module, configured to perform image enhancement processing on the first image sample based on the plurality of predicted brightness curve maps to obtain a predicted enhanced brightness component, and obtain a predicted enhanced image based on the predicted enhanced brightness component and the first image sample; The training module is used to iteratively train the initial brightness curve prediction model using the predicted enhanced image as output information of the initial brightness curve prediction model and the enhanced image sample as target information to obtain a trained brightness curve prediction model.
11. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the image enhancement method described in any one of claims 1 to 5, or the training method of the brightness curve prediction model described in any one of claims 6 to 8.
12. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the image enhancement method described in any one of claims 1-5, or the training method of the brightness curve prediction model described in any one of claims 6-8.
