Brightness enhancement model determination method and device and brightness enhancement method and device
By using the Transformer module and the lighting information processing module in the brightness enhancement model to extract features and add lighting to the color map, the problem of low accuracy of the brightness enhancement model in the existing technology is solved, and the images under low light conditions are significantly improved. quality.
Patent Information
- Application Number
- CN202310171801.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2024-08-23
AI Technical Summary
The processing accuracy of the brightness enhancement model in the existing technology is low, resulting in poor quality of pictures taken under low light conditions.
The Transformer module and the lighting information processing module are used to improve the accuracy of the brightness enhancement model through feature extraction and lighting processing of the color map.
Significantly improves the processing accuracy of the brightness enhancement model, improves the quality of images under low-light conditions, and makes it closer to the effect seen by the human eye.
Smart Images

Figure CN118537240A
Abstract
Description
Background Art
[0002] Dark light enhancement technology is to enhance the image quality of pictures taken under low light conditions (under complex light conditions) to make them clear or close to what the human eye sees. It is usually achieved using a brightness enhancement model.
[0003] However, the processing accuracy of the brightness enhancement model in the related art is poor, so that the quality of the obtained image is poor.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method for determining an image brightness enhancement model, a device for determining an image brightness enhancement model, a method for brightness enhancement of a dark-light image, a computer-readable medium and an electronic device for brightness enhancement of a dark-light image, thereby improving the processing accuracy of the brightness enhancement model at least to a certain extent.
[0006] According to a first aspect of the present disclosure, a method for determining an image brightness enhancement model is provided, comprising: obtaining training data and an initial model, wherein the training data comprises a plurality of dark-light images and a reference image adapted to the dark-light images, and the initial model comprises at least one Transformer module and an illumination information processing module; performing feature extraction on the dark-light image using at least one of the Transformer modules to obtain a dark-light feature map; obtaining an input color map corresponding to the dark-light image; based on the dark-light feature map, obtaining a reference color map of the reference image using the illumination information processing module; and training the initial model based on the reference color map and the input color map to obtain the brightness enhancement model.
[0007] According to a second aspect of the present disclosure, a method for enhancing brightness of a dark-light image is provided, comprising: obtaining a dark-light image to be enhanced and a pre-trained brightness enhancement model, wherein the brightness enhancement model comprises at least one Transformer module and an illumination information processing module; performing feature extraction on the dark-light image to be enhanced using at least one of the Transformer modules to obtain a feature map to be enhanced; obtaining an initial color mapping map of the dark-light image to be enhanced; and performing illumination processing on the initial color mapping map based on the feature map to be enhanced using the illumination information processing module to obtain a target image.
[0008] According to a third aspect of the present disclosure, a device for determining an image brightness enhancement model is provided, comprising: a first acquisition module, used to acquire training data and an initial model, wherein the training data comprises a plurality of dark-light images and a reference image adapted to the dark-light images, and the initial model comprises at least one Transformer module and an illumination information processing module; a first extraction module, used to perform feature extraction on the dark-light image using at least one of the Transformer modules to obtain a dark-light feature map; a second acquisition module, used to acquire an input color map corresponding to the dark-light image; a third acquisition module, used to acquire a reference color map of the reference image using the illumination information processing module based on the dark-light feature map; and a model training module, used to train the initial model based on the reference color map and the input color map to obtain the brightness enhancement model.
[0009] According to a fourth aspect of the present disclosure, a brightness enhancement device for a dark-light image is provided, comprising: a fourth acquisition module, used to acquire a dark-light image to be enhanced and a brightness enhancement model, wherein the brightness enhancement model comprises at least one Transformer module and an illumination information processing module; a second extraction module, used to perform feature extraction on the dark-light image to be enhanced using at least one of the Transformer modules to obtain a feature map to be enhanced; a fifth acquisition module, used to acquire an initial color mapping map of the dark-light image to be enhanced; and a brightness enhancement module, used to perform illumination processing on the initial color mapping map using the illumination information processing module based on the feature map to be enhanced to obtain a target image.
[0010] According to a fifth aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.
[0011] According to a sixth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a memory for storing one or more programs, which enables the one or more processors to implement the above method when the one or more programs are executed by the one or more processors.
[0012] An embodiment of the present disclosure provides a method for determining an image brightness enhancement model, which obtains training data and an initial model, wherein the training data includes multiple dark-light images and reference images adapted to the dark-light images, and the initial model includes at least one Transformer module and an illumination information processing module; at least one Transformer module is used to extract features from the dark-light image to obtain a dark-light feature map; an input color map corresponding to the dark-light image is obtained; based on the dark-light feature map, a reference color map of the reference image is obtained by using the illumination information processing module; the initial model is trained based on the reference color map and the input color map to obtain a brightness enhancement model. Compared with the prior art, on the one hand, feature extraction is performed through the Transformer module, which enhances the amount of information obtained by feature extraction of the input image, and can increase the accuracy of the brightness enhancement model obtained by training; on the other hand, based on the dark-light feature map, a reference color map of the reference image is obtained by using the illumination information processing module, and the dark-light feature map is used to enhance the association between the obtained reference color map and the input image, thereby enhancing the richness of the training data and further enhancing the processing accuracy of the obtained brightness enhancement model.
[0013] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0015] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
[0016] Figure 2 A flowchart schematically illustrates a method for determining an image brightness enhancement model in an exemplary embodiment of the present disclosure;
[0017] Figure 3 A data flow diagram of a Transformer layer in an exemplary embodiment of the present disclosure is schematically shown;
[0018] Figure 4 A data flow diagram of a submodule in an exemplary embodiment of the present disclosure is schematically shown;
[0019] Figure 5 A flowchart for processing training data in an exemplary embodiment of the present disclosure is schematically shown;
[0020] Figure 6 A data flow diagram for obtaining a dark light characteristic map in an exemplary embodiment of the present disclosure is schematically shown;
[0021] Figure 7 A flowchart for obtaining a dark light characteristic map in an exemplary embodiment of the present disclosure is schematically shown;
[0022] Figure 8 A flowchart for obtaining a reference color map in an exemplary embodiment of the present disclosure is schematically shown;
[0023] Fig. 9 A data flow diagram for model training in an exemplary embodiment of the present disclosure is schematically shown;
[0024] Fig.10 Schematically showing another flow chart for obtaining a reference color map in an exemplary embodiment of the present disclosure;
[0025] Fig.11 A flowchart for obtaining a brightness enhancement model in an exemplary embodiment of the present disclosure is schematically shown;
[0026] Fig.12 A flowchart schematically illustrates a method for enhancing brightness of a dark light image in an exemplary embodiment of the present disclosure;
[0027] Fig.13 A data flow diagram for brightness enhancement of a dark light image in an exemplary embodiment of the present disclosure is schematically shown;
[0028] Fig.14 Schematically showing a flow chart of acquiring an intermediate image in an exemplary embodiment of the present disclosure;
[0029] Fig.15 A schematic diagram schematically illustrates the composition of a device for determining an image brightness enhancement model in an exemplary embodiment of the present disclosure;
[0030] Fig.16 A schematic diagram schematically shows the composition of a device for enhancing the brightness of a dark light image in an exemplary embodiment of the present disclosure;
[0031] Fig.17 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0033] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams described in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0034] In related technologies, low-light enhancement technology is to enhance the image quality of pictures taken under low-light conditions, making them clear or close to what the human eye sees. In scenarios such as surveillance cameras, car security cameras, and real-time streaming video conferencing, low-light enhancement is a technology that is in high demand.
[0035] As an important function of smartphones, photography can randomly capture and record meaningful and valuable clips. More and more users are demanding to capture high-quality pictures and videos in extreme lighting environments. Often, many low-light enhancement modules deployed on mobile phones have certain hardware requirements or require continuous shooting of multiple photos with different exposures.
[0036] In the related technology, there are two main algorithms for using a single image to enhance dark light: algorithms based on traditional image processing or algorithms based on deep learning. For example:
[0037] (1) Using the image histogram for dark light enhancement: Count the histogram of the image to be processed, and then use the preset brightness threshold to judge and adjust the image brightness. The biggest disadvantage of this solution is that it requires human participation in setting the brightness threshold, which is not robust and adaptive enough.
[0038] (2) Use the network to learn the mapping relationship between the brightness of the dark light picture and the reference picture, and then connect a target perception module to improve the target perception ability of the network; the dark light enhancement part is a forced fitting process. Or use multiple pictures with different exposures to obtain the illumination coding matrix, and use the illumination coding matrix and CNN to form a light feature extraction network and an image feature extraction network, and fuse the two parts of the features to obtain the final enhanced picture. The above method has high requirements for training data and requires multiple pictures with different exposures. The collection will increase costs such as manpower and time; using synthetic pictures will have certain differences from real pictures.
[0039] Based on the above shortcomings, the present disclosure provides a method for determining an image brightness enhancement model. Figure 1 A schematic diagram of a system architecture that can implement the above-mentioned method for determining an image brightness enhancement model is shown, and the system architecture 100 may include a terminal 110 and a server 120. The terminal 110 may be a terminal device such as a smart phone, a tablet computer, a desktop computer, a laptop computer, etc. The server 120 generally refers to a background system that provides services related to the method for determining an image brightness enhancement model in this exemplary embodiment, and may be a server or a cluster formed by multiple servers. The terminal 110 and the server 120 may be connected via a wired or wireless communication link to perform data exchange.
[0040] In one implementation, the method for determining the image brightness enhancement model may be performed by the terminal 110. For example, the user uses the terminal 110 to obtain training data and an initial model, and the terminal 110 performs training using the training data and the initial model to output a brightness enhancement model.
[0041] In one implementation, the method for determining the image brightness enhancement model may be performed by the server 120. For example, after the user uses the terminal 110 to obtain the training data and the initial model, the terminal 110 uploads the training data and the initial model to the server 120, and the server 120 performs training using the training data and the initial model, and returns the brightness enhancement model to the terminal 110.
[0042] As can be seen from the above, the execution entity of the method for determining the image brightness enhancement model in this exemplary embodiment may be the terminal 110 or the server 120 , and this disclosure does not limit this.
[0043] Combine the following Figure 2 The method for determining the image brightness enhancement model in this exemplary embodiment is described. Figure 2 An exemplary process of the method for determining the image brightness enhancement model is shown, which may include:
[0044] Step S210, acquiring training data and an initial model, wherein the training data includes a plurality of dark-light images and reference images adapted to the dark-light images, and the initial model includes at least one Transformer module and an illumination information processing module;
[0045] Step S220, using at least one of the Transformer modules to extract features from the dark-light image to obtain a dark-light feature map;
[0046] Step S230, obtaining an input color mapping image corresponding to the dark-light image;
[0047] Step S240, based on the dark-light feature map, using the illumination information processing module to obtain a reference color map of the reference image;
[0048] Step S250: training the initial model based on the reference color map and the input color map to obtain the brightness enhancement model.
[0049] Based on the above method, feature extraction is performed through the Transformer module, which enhances the amount of information obtained by extracting features from the input image and can increase the accuracy of the trained brightness enhancement model. On the other hand, based on the dark-light feature map, the illumination information processing module is used to obtain the reference color map of the reference image, and the dark-light feature map is used to enhance the association between the reference color map and the input image, thereby enhancing the richness of the training data and further enhancing the processing accuracy of the brightness enhancement model.
[0050] Below Figure 2 Each step in the procedure is described in detail.
[0051] refer to Figure 2 In step S210, training data and an initial model are obtained, wherein the training data includes a plurality of dark-light images and reference images adapted to the dark-light images, and the initial model includes at least one Transformer module and a light information processing module.
[0052] In an example implementation of the present disclosure, training data may be first obtained, the training data including a dark light image and a reference image corresponding to the dark light image, wherein the dark light image may be taken in the same scene as the reference image, and the reference image is an image under normal lighting. A specific acquisition method may be to take the dark light image and the reference image under different lighting conditions, and to obtain the dark light image and the reference image using different devices.
[0053] For example, you can use a mobile phone to take dark-light images in poor lighting conditions, and use a SLR camera to get a reference image.
[0054] It should be noted that there are many ways to obtain the reference image and the dark light image, and the above is an exemplary description and is not specifically limited in this example implementation.
[0055] The above initial model may include at least one Transformer module and an illumination information processing module, wherein the number of the Transformer modules may be the same as or different from the number of the illumination information processing modules.
[0056] In this example implementation, the Transformer module may include a Transformer layer and a downsampling layer, wherein, Figure 3 As shown, the above Transformer layer may include a first normalization layer, a self-attention mechanism layer, a second normalization layer and a perception layer.
[0057] Reference Figure 4 As shown, the illumination information processing module may include multiple sub-modules, each of which may include a size change layer and multiple illumination information processing layers arranged in series, wherein the number of illumination information processing layers may be 12, or 8, 10, etc., and may also be customized according to user needs, which is not specifically limited in this example implementation.
[0058] In an exemplary embodiment of the present disclosure, after obtaining the above training data and initial model, refer to Figure 5 As shown, the above training data may be processed, which may specifically include steps S510 to S530.
[0059] In step S510, feature points of the dark-light image and the reference image are extracted, and the dark-light image and the reference image are registered according to a radiation transformation matrix between the dark-light image and the reference image.
[0060] In this example implementation, feature points may be extracted from the dark-light image and the reference image, and a radial transformation matrix between the dark-light image and the reference image may be calculated based on the obtained feature points, and then the dark-light image and the reference image may be aligned based on the radial transformation matrix.
[0061] In step S520, the dark-light image and the reference image are decomposed into image block pairs of preset sizes using non-overlapping sliding windows.
[0062] After completing the registration, a non-overlapping sliding window can be used to decompose the dark light image and the reference image into image block pairs of preset sizes, where the preset size can be 224*224 or 256*256, and can also be customized according to user needs. This is a powerful release and there is no specific limitation.
[0063] In step S530, the similarities between the image block pairs are calculated, and the image block pairs with similarities less than a preset coefficient are deleted.
[0064] In this example implementation, after obtaining the above-mentioned image block pairs, the correlation coefficient between the dark light image in the above-mentioned image block pairs and the reference image is determined, wherein the correlation coefficient may include similarity, and then the image block pairs whose similarity is less than a preset coefficient are deleted to improve the quality of the training data.
[0065] The preset coefficient may be 0.9, 0.85, 0.88, etc., and may also be customized according to user needs, which is not specifically limited in this example implementation.
[0066] In step S220, at least one of the Transformer modules is used to extract features from the dark-light image to obtain a dark-light feature map.
[0067] In an exemplary implementation of the present disclosure, the number of the above-mentioned Transformer modules may include multiple, and the multiple Transformer modules are arranged in series.
[0068] Specifically, multiple Transformer modules can be used to perform feature mapping on the above dark-light image to obtain a dark-light feature map. Figure 6 As shown, the first convolutional layer can be used to first perform feature extraction on the dark-light image to obtain a first feature vector, wherein the dark-light image can be a 12-channel image, which can be specifically composed of three RGB channels, a histogram equalization result of the dark-light image (3 channels), a color map of the dark-light image (3 channels), and a noise map of the dark-light image.
[0069] The color map of the dark-light image is calculated as follows:
[0070]
[0071] Among them, mean c Calculates the average value of each pixel in the RGB channel of the dark light image.
[0072] The noise map of the dark light image is to remove the influence of the noise color mapping in the original image. The calculation method is as follows:
[0073]
[0074] in and They are the gradient images in the x and y directions respectively.
[0075] After obtaining the input image corresponding to the dark-light image, the first convolutional layer is used to extract features of the dark-light image to obtain a first feature vector. For example, Figure 6 As shown, the size of the dark light image can be H*W*12, the size of the first eigenvector can be H / 2*W / 2*D, and the size of the convolution kernel of the first convolution layer can be customized according to user needs, that is, the number of channels D of the first eigenvector can also be customized according to user needs, which is not specifically limited in this example implementation.
[0076] At this time, refer to Figure 7 As shown, the above steps may include step S710 to step S720.
[0077] In step S710, the first normalization layer and the attention mechanism layer are used to perform a first-level processing on the first feature vector to obtain an intermediate feature image.
[0078] In step S720, the second normalization layer and the perception layer are used to perform a second-level processing on the intermediate feature image and the dark-light feature map is obtained through the convolution layer.
[0079] In this example implementation, refer to Figure 6 Assume that there are three Transformer modules, namely the first Transformer module, the second Transformer module and the third Transformer module. After the Transformer layer in the first Transformer module is converted, the first scale dark light feature map is obtained through the convolution layer of the first Transformer module. The size of the first scale dark light feature map is H / 2*W / 2*D. Then, the first scale dark light feature is transmitted to the Transformer layer of the second Transformer module. After the second Transformer module is converted, the dark light feature map is obtained through the convolution layer of the first Transformer module. The convolution layer of the module outputs a dark light feature map of the second scale, wherein the convolution layer of the second Transformer module downsamples the dark light feature map, so the size of the dark light feature map of the second scale is H / 4*W / 4*D, and then the dark light features of the second scale are transmitted to the Transformer layer of the third Transformer module, and after passing through the convolution layer of the third Transformer module, the dark light feature map of the third scale is output, wherein the convolution layer of the third Transformer module downsamples the dark light feature map, so the size of the dark light feature map of the third scale is H / 8*W / 8*D.
[0080] After obtaining the above-mentioned dark light characteristic map, step S230 may be executed.
[0081] In step S230, an input color map corresponding to the dark-light image is obtained.
[0082] In an exemplary implementation of the present disclosure, the input color map of the dark light image can be obtained by using the above formula, specifically:
[0083] The color map for a dark-light image is calculated as follows:
[0084]
[0085] Among them, mean c Calculates the average value of each pixel in the RGB channel of the dark light image.
[0086] In step S240, based on the dark-light feature map, the illumination information processing module is used to acquire a reference color map of the reference image.
[0087] In an exemplary embodiment of the present disclosure, the dark light feature maps of M scales extracted by the above-mentioned Transformer module can be used, and the above-mentioned illumination information processing module can include M sub-modules, referring to Figure 8 As shown, based on the dark light feature map, using the illumination information processing module to obtain the reference color mapping map of the reference image may include steps S810 to S820.
[0088] In step S810, the first submodule is used to perform deillumination processing on the reference image based on the dark-light feature map of the first scale to obtain a reference color map of the first scale;
[0089] In an exemplary embodiment of the present disclosure, referring to Fig. 9 As shown, the above-mentioned submodule may include a size change layer and multiple illumination information processing layers arranged in series. The above-mentioned reference image may be output to the above-mentioned size change layer, and the dark light feature map of the first scale may be input to the illumination information processing layer, and finally the reference color mapping map of the above-mentioned first scale may be obtained.
[0090] When the dark light feature map of the first scale is input into the illumination information layer, the first feature vector can be superimposed on the dark light feature map of the first scale, and the superimposed image can be convolved through a merged convolution layer to update the dark light feature map of the first scale.
[0091] In step S820, based on the dark-light feature map of the Nth scale, the Nth submodule is used to perform de-illumination processing on the reference color map of the N-1th scale to obtain the reference color map of the Nth scale.
[0092] In an exemplary embodiment of the present disclosure, referring to Fig.10 As shown, the above steps may include step S1010 to step S1020.
[0093] In step S1010, the N-1th scale reference color map is downsampled using a size change layer to obtain an Nth scale intermediate color map.
[0094] In this example implementation, N is greater than or equal to 1 and less than or equal to M. Assuming that M is equal to 2, refer to Fig. 9 As shown, it includes three submodules. At this time, the scale change layer is used to downsample the first scale reference color map to obtain a second scale intermediate color map.
[0095] In step S1020, the intermediate color map of the Nth scale and the dark-light feature map of the Nth scale are input into the plurality of illumination information processing layers to obtain a reference color map of the Nth scale.
[0096] In this example implementation, after obtaining the above-mentioned intermediate color map of the second scale, the intermediate color map of the second scale and the dark-light feature map of the second scale can be input into the plurality of illumination information processing layers to obtain a reference color map of the second scale.
[0097] Then, the second scale reference color map is downsampled by using the size change layer to obtain an intermediate color map of the third scale, and the intermediate color map of the third scale and the dark-light feature map of the third scale are input into the plurality of illumination information processing layers to obtain a reference color map of the third scale. The reference map of the third scale can be used as the reference color map.
[0098] In this example implementation, before the second-scale dark-light feature map is input into the illumination information processing layer, the first-scale dark-light feature map may be downsampled by a factor of 2 and then superimposed with the second-scale dark-light feature map, and the superimposed dark-light feature map may be convolved to update the second-scale dark-light feature map.
[0099] Similarly, before the dark light feature map of the third scale is input into the illumination information processing layer, the dark light feature map of the second scale can be downsampled by 2 times, and then superimposed with the dark light feature map of the third scale, and the superimposed dark light feature map can be convolved to update the dark light feature map of the third scale.
[0100] It should be noted that, in an example implementation, when obtaining the input color mapping map corresponding to the dark-light image, the first eigenvector can be used for acquisition. Specifically, the first eigenvector can be convolutionally upsampled, and then the input color mapping map corresponding to the dark-light image can be calculated for the image after convolutional upsampling.
[0101] In step S250, the initial model is trained based on the reference color map and the input color map to obtain the brightness enhancement model.
[0102] In an exemplary embodiment of the present disclosure, referring to Fig.11 As shown, the above steps may include step S1110 to step S1120.
[0103] In step S1110, a standard color map of the reference image is obtained.
[0104] The specific calculation method can refer to the above-mentioned method of calculating the input color map, which will not be repeated here.
[0105] In step S1120, the standard color map is used as a reference, and the initial model is trained based on the dark-light feature map, the reference color map, and the input color map to obtain the brightness enhancement model.
[0106] In this example implementation, it is assumed that the conditional distribution of the reference image can be expressed as f flow (x| l Specifically, the normalization flow θ takes the dark-light feature map as input and maps the reference image x to a latent code z with the same dimension as x, and z = θ(x; x l ). The latent code z can be understood as the color component generated by the reference image. Using the variable change quantification, we can get f flow (x| l ) and f z The relationship between (z) is:
[0107]
[0108] in, is the inverse of the Jacobian matrix. x is the normal reference image, x l It is a dark light image.
[0109] The maximum likelihood estimation is used to estimate the mapping distribution θ of the flow, and the loss function of the network is calculated as follows:
[0110]
[0111] Specifically, the latent code z is a feature with the same dimension as the reference image x. Consider that the reference image x can be obtained by transforming z. The conditional distribution of the reference image is simply denoted as p(y), and the distribution of the latent code z is denoted as p(z). Changes in z will cause changes in y, that is, p(z)dz=p(y)dy, that is Taking the absolute value does not consider the direction of the variable change. is a simple linear relationship. The actual transformation function is mostly nonlinear. A high-dimensional variant of |det(J(f -1 (z)))|,J(f -1 (z)) is the inverse of the Jacobian matrix. det represents the determinant. Substitute the above formula into the content expressed here: p(y) is the conditional distribution of the normal light image, that is, f flow (x| l ), the distribution of latent code z is f z (z), where z = θ(x; x l ), so we can get f flow (x| l ) and f z The relationship between (z) is:
[0112]
[0113] Taking the logarithm at the same time, we get the maximum likelihood loss:
[0114]
[0115] in, is the inverse of the Jacobian matrix. x is the normal reference image, x l It is a dark light image.
[0116] In this example implementation, after the loss function is calculated, the initial model may be trained based on the loss function using the reference color map and the input color map to obtain the brightness enhancement model.
[0117] In an example implementation of the present disclosure, the standard color map of the reference image can be used as a reference, and the initial model can be trained using the reference color map and the input color map based on the loss function to obtain the brightness enhancement model. Specifically, when adjusting the parameters of the initial network, the standard color map of the reference image is considered at the same time, so that the error between the input result and the standard color map is as small as possible, thereby improving the accuracy of model training.
[0118] In an example implementation, an attention mechanism between image blocks can be added to the Transformer layer. When training the model, the reference image can also be divided into image blocks. The way the image blocks are divided can be customized according to the user. That is, when training the model, the brightness enhancement model can learn the light relationship between the image blocks, thereby enhancing the processing accuracy of the brightness enhancement model.
[0119] In summary, in this exemplary embodiment, feature extraction is performed through the Transformer module, which enhances the amount of information obtained by extracting input image features, and can increase the accuracy of the brightness enhancement model obtained through training; on the other hand, based on the dark light feature map, the reference color map of the reference image is obtained using the illumination information processing module, and the dark light feature map is used to enhance the association between the obtained reference color map and the input image, thereby enhancing the richness of the training data and further enhancing the processing accuracy of the obtained brightness enhancement model. On the other hand, during training, the standard color map of the reference image is used as a reference, so that the error between the input result and the standard color map is as small as possible, thereby improving the accuracy of model training.
[0120] The present disclosure also provides a new method for enhancing the brightness of a dark light image, referring to Fig.12 As shown, the brightness enhancement method of the dark light image may include the following steps:
[0121] Step S1210, obtaining a dark-light image to be enhanced and a pre-trained brightness enhancement model, wherein the brightness enhancement model includes at least one Transformer module and a light information processing module;
[0122] Step S1220, using at least one of the Transformer modules to extract features from the dark-light image to be enhanced to obtain a feature map to be enhanced;
[0123] Step S1230, obtaining an initial color mapping image of the dark-light image to be enhanced;
[0124] Step S1240: Based on the feature map to be enhanced, the illumination information processing module is used to perform illumination processing on the initial color map to obtain a target image.
[0125] The above steps are defined in detail below.
[0126] In step S1210, a dark-light image to be enhanced and a pre-trained brightness enhancement model are obtained, wherein the brightness enhancement model includes at least one Transformer module and a light information processing module.
[0127] In this example implementation, an image to be enhanced and a brightness enhancement model may be obtained from a database, wherein the brightness enhancement model is trained by the above-mentioned method for determining the image brightness enhancement model.
[0128] In step S1220, at least one of the Transformer modules is used to extract features of the dark-light image to be enhanced to obtain a feature map to be enhanced.
[0129] In this example implementation, the number of Transformer modules includes multiple, and multiple series-arranged Transformer modules can be used to extract M scales of feature maps to be enhanced from the dark-light image to be enhanced; wherein M is a positive integer greater than or equal to 2.
[0130] The specific structure of the Transformer module can refer to the above-mentioned method for determining the image brightness enhancement model, and will not be repeated in this example implementation.
[0131] The first convolutional layer can be used to first perform feature extraction on the dark light image to be enhanced to obtain a second feature vector, wherein the dark light image can be a 12-channel image, specifically composed of three RGB channels, the histogram equalization result of the dark light image to be enhanced (3 channels), the color mapping map of the dark light image to be enhanced (3 channels), and the noise mapping map of the dark light image to be enhanced.
[0132] The color map of the dark light image to be enhanced is calculated as follows:
[0133]
[0134] Among them, mean c Calculates the average value of each pixel in the RGB channel of the dark light image.
[0135] The noise map of the dark light image is to remove the influence of the noise color mapping in the original image. The calculation method is as follows:
[0136]
[0137] in and They are the gradient images in the x and y directions respectively.
[0138] After obtaining the input image corresponding to the dark-light image, the first convolutional layer is used to perform feature extraction on the dark-light image to obtain a first feature vector. For example, the size of the dark-light image may be H*W*12, and the size of the first feature vector may be H / 2*W / 2*D. The size of the convolution kernel of the first convolutional layer may be customized according to user needs, that is, the number of channels D of the first feature vector may also be customized according to user needs, which is not specifically limited in this example implementation.
[0139] Assume that there are three Transformer modules, namely the first Transformer module, the second Transformer module and the third Transformer module. After the Transformer layer in the first Transformer module is converted, it passes through the convolution layer of the first Transformer module to obtain the dark light feature map of the first scale, where the size of the dark light feature map of the first scale is H / 2*W / 2*D. Then, the dark light feature of the first scale is transmitted to the Transformer layer of the second Transformer module and passes through the second Transformer module. After the convolution layer, a dark light feature map of the second scale is output, wherein the convolution layer of the second Transformer module downsamples the dark light feature map, so the size of the dark light feature map of the second scale is H / 4*W / 4*D, and then the dark light features of the second scale are transmitted to the Transformer layer of the third Transformer module, and after the convolution layer of the third Transformer module, a dark light feature map of the third scale is output, wherein the convolution layer of the third Transformer module downsamples the dark light feature map, so the size of the dark light feature map of the third scale is H / 8*W / 8*D.
[0140] Step S1230, obtaining an initial color mapping image of the dark-light image to be enhanced.
[0141] In this example implementation, refer to Fig.13 As shown, when obtaining the input color mapping image corresponding to the dark-light image, the second eigenvector can be used for acquisition. Specifically, the first eigenvector can be convolutionally upsampled, and then the input color mapping image corresponding to the dark-light image can be calculated for the image after convolutional upsampling.
[0142] Step S1240: Based on the feature map to be enhanced, the illumination information processing module is used to perform illumination processing on the initial color map to obtain a target image.
[0143] In this exemplary embodiment, the illumination information processing module includes M submodules connected in series. Fig.14 As shown, the above steps may include step S1410 to step S1420.
[0144] In step S1410, based on the feature map to be enhanced at the Mth scale, the initial color map is illuminated by using the Mth submodule to obtain an intermediate image at the M-1th scale.
[0145] In this example implementation, assuming that M is equal to 3, refer to Fig.13 As shown, based on the feature map to be enhanced at the third scale, the third submodule is used to perform illumination processing on the initial color map to obtain an intermediate image at the third scale.
[0146] In this example implementation, the method for acquiring the feature map to be enhanced at the third scale can refer to the method for acquiring the dark light feature map at the third scale in the method for determining the image brightness enhancement model, and is not specifically limited in this example implementation.
[0147] In step S1420, based on the feature map to be enhanced at the Nth scale, the Nth submodule is used to perform illumination processing on the intermediate image at the N+1th scale to obtain the intermediate image at the Nth scale.
[0148] In this example implementation, refer to Fig.13 As shown, the feature map to be enhanced at the second scale and the intermediate images at the three scales can be input into the plurality of illumination information processing layers to obtain the image to be enlarged at the second scale, and the image to be enlarged at the second scale can be upsampled using the upsampling layer to obtain the intermediate image at the second scale. The feature map to be enhanced at the first scale and the intermediate images at the two scales can be input into the plurality of illumination information processing layers to obtain the image to be enlarged at the first scale, and the image to be enlarged at the first scale can be upsampled using the upsampling layer to obtain the intermediate image at the first scale. The intermediate image at the first scale is used as the target image.
[0149] Among them, the acquisition method of the above-mentioned first scale to be enhanced feature map and the second scale to be enhanced feature map can refer to the acquisition method of the third scale dark light feature map in the above-mentioned method for determining the image brightness enhancement model, and is not specifically limited in this example implementation.
[0150] In an example implementation of the present disclosure, when the brightness of a dark light image to be enhanced is enhanced, the size of the dark light image to be enhanced can be adjusted first. For example, if the input of the brightness enhancement model is a fixed-size image of 224*224, the length and width of the dark light image to be enhanced can be padded to multiples of 224, and then the sliding window (with an overlap ratio of 0.2) can be used to segment the padded image to obtain N 224*224 image sub-blocks. Using batch=N, the N images are sent to the brightness enhancement model for reasoning. Finally, the reasoning results are merged into the original image size to obtain the target image.
[0151] It should be noted that the above-mentioned overlap ratio can be 0.2, or can also be 0.3, 0.4, etc., and can also be customized according to user needs, and is not specifically limited in this example implementation.
[0152] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes described in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0153] For further reference, Fig.15 As described above, the implementation of this example also provides a device 1500 for determining an image brightness enhancement model, including a first acquisition module 1510 , a first extraction module 1520 , a second acquisition module 1530 , a third acquisition module 1540 and a model training module 1550 .
[0154] in:
[0155] The first acquisition module 1510 can be used to acquire training data and an initial model, wherein the training data includes a plurality of dark-light images and reference images adapted to the dark-light images, and the initial model includes at least one Transformer module and an illumination information processing module.
[0156] In an example implementation, after obtaining the above-mentioned training data, the image brightness enhancement model determination device 1500 can also be used to extract feature points of the dark light image and the reference image, and align the dark light image and the reference image according to the radial transformation matrix between the dark light image and the reference image; use a non-overlapping sliding window to decompose the dark light image and the reference image into image block pairs of preset sizes; calculate the similarity between each of the image block pairs, and delete the image block pairs whose similarity is less than a preset coefficient.
[0157] The first extraction module 1520 can be used to use at least one of the Transformer modules to perform feature extraction on the dark-light image to obtain a dark-light feature map.
[0158] In an example implementation, the first extraction module 1520 may be configured to extract M scales of dark-light feature maps from the dark-light image using a plurality of the transformer modules arranged in series; wherein M is a positive integer greater than or equal to 2.
[0159] In an example implementation, the Transformer module may include a Transformer layer and a convolution layer, wherein the Transformer layer includes a first normalization layer, a self-attention mechanism layer, a second normalization layer and a perception layer; before using at least one of the Transformer modules to perform feature extraction on the dark-light image to obtain a dark-light feature map, the method further includes: using a first convolution module to perform feature extraction on the dark-light image to obtain a first feature vector; using at least one of the Transformer modules to perform feature extraction on the dark-light image to obtain a dark-light feature map includes: using the first normalization layer and the attention mechanism layer to perform a first-level processing on the first feature vector to obtain an intermediate feature image; using the second normalization layer and the perception layer to perform a second-level processing on the intermediate feature image and obtain the dark-light feature map through the convolution layer.
[0160] The second acquisition module 1530 may be configured to acquire an input color map corresponding to the dark-light image.
[0161] The third acquisition module 1540 may be configured to acquire a reference color map of the reference image using the illumination information processing module based on the dark-light feature map.
[0162] In an example implementation, in an example implementation, the illumination information processing module includes M sub-modules, and the third acquisition module 1540 can be configured to use the first sub-module to de-illuminate the reference image based on the dark light feature map of the first scale to obtain a reference color map of the first scale; and use the Nth sub-module to de-illuminate the N-1th scale reference color map based on the dark light feature map of the Nth scale to obtain a reference color map of the Nth scale; wherein, when N is a positive integer greater than 1 and less than or equal to M. Among them, the submodule includes a size change layer and multiple illumination information processing layers arranged in series; the N-1-th scale reference color map is de-illuminated using the N-th submodule based on the dark light feature map of the N-th scale to obtain the N-th scale reference color map, including: using the size change layer to downsample the N-1-th scale reference color map to obtain an intermediate color map of the N-th scale; the intermediate color map of the N-th scale and the dark light feature map of the N-th scale are input into the multiple illumination information processing layers to obtain the reference color map of the N-th scale.
[0163] The model training module 1550 may be configured to train the initial model based on the reference color map and the input color map to obtain the brightness enhancement model.
[0164] In an example embodiment, the model training module 1550 can be configured to obtain a standard color map of the reference image; using the standard color map as a reference, training the initial model based on the dark-light feature map, the reference color map and the input color map to obtain the brightness enhancement model.
[0165] For further reference, Fig.16 In the embodiment of this example, a device 1600 for enhancing brightness of a dark light image is also provided, comprising a fourth acquisition module 1610, a second extraction module 1620, a fifth acquisition module 1630 and a brightness enhancement module 1640. Among them:
[0166] The fourth acquisition module 1610 can be used to acquire a dark-light image to be enhanced and a brightness enhancement model, wherein the brightness enhancement model includes at least one Transformer module and a light information processing module.
[0167] The second extraction module 1620 can be used to use at least one of the Transformer modules to perform feature extraction on the dark-light image to be enhanced to obtain a feature map to be enhanced.
[0168] In an example implementation, the second extraction module 1620 may be configured to use a plurality of the transformer modules arranged in series to extract M scales of feature maps to be enhanced from the dark light image to be enhanced; wherein M is a positive integer greater than or equal to 2.
[0169] The fifth acquisition module 1630 may be configured to acquire an initial color mapping diagram of the dark-light image to be enhanced.
[0170] The brightness enhancement module 1640 may be configured to perform illumination processing on the initial color map using the illumination information processing module based on the feature map to be enhanced to obtain a target image.
[0171] In an example implementation of the present disclosure, the illumination information processing module includes M sub-modules connected in series, and the brightness enhancement module 1640 can be configured to use the Mth sub-module to perform illumination processing on the initial color mapping image based on the feature map to be enhanced at the Mth scale to obtain the intermediate image of the Mth scale; use the Nth sub-module to perform illumination processing on the intermediate image of the N+1th scale based on the feature map to be enhanced at the Nth scale to obtain the intermediate image of the Nth scale, wherein N is a positive integer greater than or equal to 1 and less than or equal to M; and use the intermediate image of the 1st scale as the target image.
[0172] Among them, the submodule includes an upsampling layer and multiple illumination information processing layers arranged in series, and based on the feature map to be enhanced at the Nth scale, the Nth submodule is used to perform illumination processing on the N+1th scale intermediate image to obtain the Nth scale intermediate image, wherein, when N is a positive integer greater than or equal to 1 and less than or equal to M, it includes: inputting the Nth scale feature map to be enhanced and the N+1 scale intermediate image into the multiple illumination information processing layers to obtain the Nth scale image to be enlarged; using the upsampling layer to upsample the Nth scale image to be enlarged to obtain the Nth scale intermediate image.
[0173] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0174] The exemplary embodiments of the present disclosure also provide an electronic device for executing the above-mentioned method for determining the image brightness enhancement model, and the electronic device may be the above-mentioned terminal 110 or the server 120. Generally, the electronic device may include a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the above-mentioned method for determining the image brightness enhancement model by executing the executable instructions.
[0175] Below Fig.17The mobile terminal 1700 in FIG. 1 is taken as an example to exemplify the structure of the electronic device. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Fig.17 The construction in can also be applied to fixed type equipment.
[0176] like Fig.17 The mobile terminal 1700 may specifically include: a processor 1701, a memory 1702, a bus 1703, a mobile communication module 1704, an antenna 1, a wireless communication module 1705, an antenna 2, a display screen 1706, a camera module 1707, an audio module 1708, a power module 1709 and a sensor module 1710.
[0177] The processor 1701 may include one or more processing units, for example, the processor 1701 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc. The method for determining the image brightness enhancement model in this exemplary embodiment may be executed by an AP, a GPU or a DSP, and when the method involves processing related to a neural network, it may be executed by an NPU.
[0178] The processor 1701 may be connected to the memory 1702 or other components via a bus 1703 .
[0179] The memory 1702 may be used to store computer executable program codes, which include instructions. The processor 1701 executes various functional applications and data processing of the mobile terminal 1700 by running the instructions stored in the memory 1702. The memory 1702 may also store application data, such as images, videos, and other files.
[0180] The communication function of the mobile terminal 1700 can be implemented through the mobile communication module 1704, antenna 1, wireless communication module 1705, antenna 2, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 1704 can provide 2G, 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 1700. The wireless communication module 1705 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 1700.
[0181] The display screen 1706 is used to implement display functions, such as displaying user interfaces, images, and videos. The camera module 1707 is used to implement shooting functions, such as shooting images and videos. The audio module 208 is used to implement audio functions, such as playing audio and collecting voice. The power module 209 is used to implement power management functions, such as charging the battery, powering the device, and monitoring the battery status. The sensor module 1710 may include a depth sensor 17101, a pressure sensor 17102, a gyroscope sensor 17103, an air pressure sensor 17104, etc., to implement corresponding sensing detection functions.
[0182] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0183] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.
[0184] It should be noted that the computer-readable medium described in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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.
[0185] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0186] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, 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. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0187] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0188] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for determining an image brightness enhancement model, characterized in that: include: Acquire training data and an initial model, wherein the training data includes a plurality of dark-light images and reference images adapted to the dark-light images, and the initial model includes at least one Transformer module and a light information processing module; Using at least one of the Transformer modules to extract features from the dark-light image to obtain a dark-light feature map; Obtaining an input color map corresponding to the dark-light image; Based on the dark-light feature map, using the illumination information processing module to obtain a reference color mapping map of the reference image; The brightness enhancement model is obtained by training the initial model based on the reference color map and the input color map.
2. The method according to claim 1, characterized in that The training of the initial model based on the reference color map and the input color map to obtain the brightness enhancement model comprises: Obtaining a standard color map of the reference image; The standard color map is used as a reference, and the initial model is trained based on the dark-light feature map, the reference color map, and the input color map to obtain the brightness enhancement model.
3. The method according to claim 1, characterized in that Before extracting features from the dark-light image using at least one of the Transformer modules to obtain a dark-light feature map, the method further includes: Extracting feature points of the dark-light image and the reference image, and registering the dark-light image and the reference image according to a radiation transformation matrix between the dark-light image and the reference image; Decomposing the dark-light image and the reference image into image block pairs of preset sizes by using non-overlapping sliding windows; The similarities between the image block pairs are calculated, and the image block pairs whose similarities are less than a preset coefficient are deleted.
4. The method according to claim 1, characterized in that The number of the Transformer modules includes a plurality, and the step of extracting features from the dark-light image using at least one of the Transformer modules to obtain a dark-light feature map includes: A plurality of the transformer modules arranged in series are used to extract M scales of dark light feature maps from the dark light image; Wherein, M is a positive integer greater than or equal to 2.
5. The method according to claim 4, characterized in that The illumination information processing module includes M submodules: Based on the dark light feature map, using the illumination information processing module to obtain a reference color map of the reference image includes: Based on the dark-light feature map of the first scale, the first submodule is used to perform de-illumination processing on the reference image to obtain a reference color map of the first scale; Based on the dark-light feature map of the Nth scale, the Nth submodule is used to perform de-illumination processing on the N-1th scale reference color map to obtain the Nth scale reference color map; Wherein, N is a positive integer greater than 1 and less than or equal to M.
6. The method according to claim 5, characterized in that The submodule includes a size-changing layer and a plurality of illumination information processing layers arranged in series; The method of performing de-illumination processing on the N-1th scale reference color map using the Nth submodule based on the dark-light feature map of the Nth scale to obtain the Nth scale reference color map includes: Downsampling the reference color map of the N-1th scale using a size change layer to obtain an intermediate color map of the Nth scale; The intermediate color map of the Nth scale and the dark-light feature map of the Nth scale are input into the plurality of illumination information processing layers to obtain a reference color map of the Nth scale.
7. The method according to claim 1, characterized in that The Transformer module may include a Transformer layer and a convolutional layer, wherein the Transformer layer includes a first normalization layer, a self-attention mechanism layer, a second normalization layer and a perception layer; before using at least one of the Transformer modules to extract features from the dark-light image to obtain a dark-light feature map, the method further includes: Using a first convolution module to extract features from the dark-light image to obtain a first feature vector; The extracting features of the dark-light image using at least one of the Transformer modules to obtain a dark-light feature map comprises: Using the first normalization layer and the attention mechanism layer to perform a first-level processing on the first feature vector to obtain an intermediate feature image; The second normalization layer and the perception layer are used to perform a second-level processing on the intermediate feature image and the dark-light feature map is obtained through the convolution layer.
8. A method for enhancing the brightness of a dark light image, characterized in that: include: Acquire a dark-light image to be enhanced and a pre-trained brightness enhancement model, wherein the brightness enhancement model includes at least one Transformer module and a light information processing module; Using at least one of the Transformer modules to extract features from the dark-light image to be enhanced to obtain a feature map to be enhanced; Acquire an initial color mapping image of the dark-light image to be enhanced; Based on the feature map to be enhanced, the illumination information processing module is used to perform illumination processing on the initial color map to obtain a target image.
9. The method according to claim 8, characterized in that The number of the Transformer modules includes a plurality, and the step of extracting features from the dark-light image to be enhanced by using at least one of the Transformer modules to obtain a feature map to be enhanced includes: Using a plurality of the Transformer modules arranged in series to extract features of the dark-light image to be enhanced, M scales of feature maps to be enhanced; Wherein, M is a positive integer greater than or equal to 2.
10. The method according to claim 9, characterized in that The illumination information processing module includes M submodules connected in series: Based on the feature map to be enhanced, the illumination information processing module is used to perform illumination processing on the initial color map to obtain a target image, which includes: Based on the feature map to be enhanced at the Mth scale, the initial color map is illuminated using the Mth submodule to obtain an intermediate image at the Mth scale; Based on the feature map to be enhanced at the Nth scale, the Nth submodule is used to perform illumination processing on the intermediate image at the N+1th scale to obtain the intermediate image at the Nth scale, wherein N is a positive integer greater than or equal to 1 and less than or equal to M; The intermediate image at the first scale is used as the target image.
11. The method according to claim 10, characterized in that The submodule includes an upsampling layer and a plurality of illumination information processing layers arranged in series; Based on the feature map to be enhanced at the Nth scale, the Nth submodule is used to perform illumination processing on the N+1th scale intermediate image to obtain the Nth scale intermediate image, wherein when N is a positive integer greater than or equal to 1 and less than or equal to M, including: Inputting the feature map to be enhanced at the Nth scale and the intermediate images at the N+1th scale into the plurality of illumination information processing layers to obtain the image to be enlarged at the Nth scale; The image to be enlarged at the Nth scale is upsampled by using an upsampling layer to obtain an intermediate image at the Nth scale.
12. A device for determining an image brightness enhancement model, characterized in that: include: A first acquisition module, used to acquire training data and an initial model, wherein the training data includes a plurality of dark-light images and reference images adapted to the dark-light images, and the initial model includes at least one Transformer module and a light information processing module; A first extraction module, configured to extract features from the dark-light image using at least one of the Transformer modules to obtain a dark-light feature map; A second acquisition module is used to acquire an input color mapping image corresponding to the dark light image; A third acquisition module, configured to acquire a reference color map of the reference image using the illumination information processing module based on the dark-light feature map; A model training module is used to train the initial model based on the reference color map and the input color map to obtain the brightness enhancement model.
13. A device for enhancing brightness of a dark light image, characterized in that: include: A fourth acquisition module, used to acquire a dark-light image to be enhanced and a brightness enhancement model, wherein the brightness enhancement model includes at least one Transformer module and a light information processing module; A second extraction module, configured to extract features of the dark-light image to be enhanced by using at least one of the Transformer modules to obtain a feature map to be enhanced; A fifth acquisition module, used to acquire an initial color mapping image of the dark-light image to be enhanced; The brightness enhancement module is used to perform illumination processing on the initial color mapping image using the illumination information processing module based on the feature image to be enhanced to obtain a target image.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
15. An electronic device, characterized in that: include: one or more processors; as well as A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Low-illumination adjustable brightness enhancement method based on reference brightness index guidance
CN112465726A
Transform-based multi-scale optimization low-illumination image enhancement method
CN115205147A
Dark light video enhancement method and system based on multi-scale spatial-temporal feature fusion
CN115345785A
