Weak light image enhancement method based on self-adaptive illumination initialization
Technical Field
The invention relates to a dim light image enhancement method based on self-adaptive illumination initialization, belonging to the technical fields of computer vision, digital image processing, signal processing, image enhancement and the like.
Background
As an important carrier tool for modern information resource communication and delivery, digital images play an increasingly important role in today's society. It can be said that people have been exposed to the related computer vision intentionally and unintentionally in the careless daily activities such as daily clothing and eating activities. For example, fingerprint locks used for going out, face recognition used for going into office buildings, photographing functions of smartphones and the like all have the body and the shadow. The method plays a role in medical imaging diagnosis, satellite remote sensing, military reconnaissance, underwater image shooting, electronic video monitoring and other fields. It follows that computer vision as well as digital images occupy an absolutely important place in our human lives. In recent years, the living standard of people is improved comprehensively, and photographic electronic devices such as digital single-lens reflex cameras and smart phones are also gradually moved into the field of view of the public, and are widely used. People can thus more easily and conveniently capture, share and spread images. The life style of people is greatly enriched, and meanwhile, the digital image is brought to an unprecedented exponential growth age, so that computer vision faces various serious tests and challenges. In the face of such a huge number of digital images, there is no shortage of imaging environment with dark outside or insufficient performance of hardware devices (aperture size, exposure time), resulting in low overall brightness of the resulting image, and much content information in the image is submerged in darkness. The poor-vision quality low-light image not only affects subjective vision observation of people, but also affects subsequent computer vision tasks to different degrees, including image segmentation, image classification, target detection and the like.
As a classical task in computer vision, image enhancement involves many directions including image restoration, image deblurring, and low-light image enhancement, and there has been a popular problem in the field of vision. Weak light image enhancement is one of the most important branches in the field of image enhancement, and a large number of researchers have conducted intensive analysis and discussion in recent years. In brief summary, the core of the task of enhancing a low-light image is to enhance brightness information of the image, so that content hidden in darkness can be displayed, and structural information and texture details of the image are enhanced, so as to improve visual quality of the image, and facilitate subsequent related image processing operations.
In order to solve the above-mentioned problems of low-light images, many excellent enhancement methods have been proposed in the past decades. Here we roughly divide these methods into a conventional theoretical model-based method and a deep learning-based method. The conventional weak light image enhancement method can be specifically classified into an algorithm based on histogram equalization, an algorithm based on image defogging, an algorithm based on image fusion and an algorithm based on a Retinex theoretical model. However, considering that image decomposition estimation is a highly singular problem, for low-light image enhancement based on the Retinex model, how to accurately estimate the illumination component of the image has always been a critical issue to be solved. In the prior art, the optimization estimation of the illumination component is mostly constrained through various hypothesis conditions and priori knowledge, but the initialization problem of the image illumination component is rarely considered, however, the initial illumination component directly determines the accuracy of the subsequent optimization estimation operation, and meanwhile, the quality of the final enhanced result is related.
CN111292257A is an image enhancement method in a scotopic vision environment based on Retinex, and comprises the steps of obtaining image data, dividing the image data into a global illumination image and a local illumination image, carrying out weighted average on corresponding pixel points of the two images to obtain a preliminary estimated illumination image, carrying out edge-preserving smooth filtering on the preliminary estimated illumination image by adopting improved weighted guide filtering, carrying out improved self-adaptive Gamma correction on the filtered illumination image to obtain a corrected estimated illumination image, calculating reflection images of an R channel, a G channel and a B channel by adopting a Retinex algorithm by utilizing the original image and the corrected estimated illumination image, and synthesizing the reflection images of the three channels to obtain an enhanced image.
Although this patent proposes a partial illumination map, it is simply a pixel-by-pixel weighted average of the two illumination components, and does not take into account the content correlation between the pixels of the partial block of the image, so that the enhancement result is overexposed/underexposed. In the invention, the 3X 3 local blocks are designed to traverse each channel of the input image, so that the associated sensing of the adjacent pixel content of the image is truly realized, the illumination component is more accurately initialized, and the image enhancement task is finally realized in a self-adaptive manner aiming at the exposure levels of different areas of the image.
Disclosure of Invention
The present invention is directed to solving the above problems of the prior art. A weak light image enhancement method based on self-adaptive illumination initialization is provided. The technical scheme of the invention is as follows:
a weak light image enhancement method based on adaptive illumination initialization comprises the following steps:
(1) Collecting and sorting the existing disclosed dim light image data set on the internet;
(2) According to different input images, based on a proposed illumination self-adaptive initialization module, the illumination self-adaptive initialization module refers to taking the relevance of local content information of the image into consideration by traversing the image pixel by pixel and taking the maximum value in a local 3×3 block, and an illumination weight matrix of the input image is adaptively obtained, so that the initial illumination component of the image is accurately estimated;
(3) Under the constraint of structure illumination priori, the initial illumination component is optimized and estimated by an alternating direction minimization method;
(4) Performing gamma correction on the obtained optimized illumination component, and realizing nonlinear adjustment on the brightness of the image;
(5) And combining with a Retinex theoretical model to realize enhancement of the low-light image.
Further, the step (2) estimates an initial illumination component of the image based on the proposed illumination adaptive initialization module according to different input images, and specifically includes:
The typical image illumination initialization operation in the step (2) comprises taking R, G, B three-channel maximum values, taking R, G, B three-channel average values and taking V components in HSV space,
The H component represents hue, the S component represents saturation, and the V component represents brightness
The specific formula is as follows:
Wherein I 0 (x) is the initial illumination component, c includes R, G, B three color channels, S c (x) is the maximum component of the three color channels, I.e., an illumination weight matrix, Ω represents a local block centered at x, in this context a block size of 3 x 3,Parameters are adjusted for illumination.
Further, the step (3) performs optimization estimation on the initial illumination component by using an alternating direction minimization method under the constraint of the structure illumination prior, and specifically includes:
the ideal image illumination component optimization algorithm has the following objective functions:
wherein I 0 denotes an initial illumination component, I denotes an optimized illumination component, W is a structural weight matrix, Is a first derivative filter, which is specifically divided intoHorizontal directionTwo parts in the vertical direction, i·i 1 and i·i F are respectively a 1-norm and a standard F-norm, and in the above objective function, the first term isFor data fidelity terms, used to constrain the differences between I 0 and I, regularized termsThe function of the method is to limit the size of a solution space, and the coefficient alpha is used for balancing a fidelity term and a regularization term to realize the structural perception smoothing of illumination components;
The weight matrix W is intended to perceive structural edge information of an image, and specifically includes two parts of the following horizontal direction W h (x) and the vertical direction W v (x), and specifically includes:
wherein G σ (x, y) represents a Gaussian kernel function with standard deviation sigma, and has Dist (x, y) represents the spatial Euclidean distance of pixels x and y, ε is a small constant to avoid the case where the denominator is zero, and |·| represents the absolute value operation.
The approximate simplification operation is carried out on the objective function, firstly, the regular terms in the objective function are developed,
W d (x) is a structural weight matrix, where d comprises a horizontal direction h and a vertical direction v.
For use hereinApproximate replacement of regular termsFinally, the above formula can be equivalently written as follows,
In particular, whenWhen the value of the value is small, the value of the value,The value of (2) is also smaller, andThe value of (2) is also inhibited, namely the illumination component I obtained by final optimization estimation avoids gradient change at the position with smaller initial illumination component gradient.
Further, the step (4) performs gamma correction on the obtained optimized illumination component, and implements nonlinear adjustment on the brightness of the image, where the specific formula is:
Ig(x)=I(x)γ
Wherein, the value of gamma is 0.8, and the final enhancement result S out is obtained by combining the input image S (x) and the optimized illumination component I g after illumination adjustment with the Retinex model;
Here epsilon is a small constant, avoiding zero denominator.
Further, the core idea of the Retinex theory model is to decompose the observed image into an illumination component and a reflection component, wherein the illumination component represents the distribution of illumination in the image scene and includes the structural information of the image, the reflection component represents the inherent attribute of the object and is mainly represented by the texture detail and the color information of the image, and the formula is specifically as follows:
Wherein S (x) represents an input original weak light image, I (x) represents an illumination component, R (x) represents a reflection component, x represents a specific pixel, and an operator Then a per-element multiplication operation is represented.
The invention has the advantages and beneficial effects as follows:
the invention realizes the weak light image enhancement task by utilizing the technologies of computer vision, digital image processing, signal processing, image enhancement and the like. The invention provides a simple and effective illumination component self-adaptive initialization method based on a Retinex theory model, which accurately estimates the illumination component of an image and further realizes a satisfactory weak light image enhancement effect. The invention has the following advantages:
(1) The related experiments of training and testing are carried out based on the matlab software platform, so that the cost is low;
(2) The method is a weak light image enhancement method based on a Retinex theory model, provides a simple and effective self-adaptive illumination initialization module, and has better enhancement results than the existing method;
(3) The low-light image enhancement method provided by the invention has good enhancement effect on low-quality images including low-exposure images, illumination non-uniform images, backlight images, night images and the like;
(4) The invention has a certain enhancement effect on the video shot in the low light environment;
(5) The method has satisfactory enhancement effect detection, shows enhancement effect and objective evaluation index superior to those of the existing proposed method in a plurality of common weak light image data sets, and simultaneously maintains good calculation efficiency;
(6) The method is beneficial to the improvement of the performance of downstream advanced visual tasks such as target detection, instance segmentation, image classification and the like, and can be used in actual application scenes such as automatic driving technology and the like, thereby having practical significance.
In the low-light image enhancement method based on the Retinex theory model, the problem that the image decomposition estimation is highly singular is considered, so how to accurately estimate the illumination component of the image is always a key problem to be solved by the method. While the previous methods based on the Retinex theory model all have about the same basic operation flow, the main difference of the proposed methods is how to estimate the illumination component of the image. The prior methods focus on discussing how to more accurately constrain the optimal estimation of the illumination component, but researchers have rarely considered the initialization problem of the image illumination component. However, the initial illumination component of the low-light image not only directly determines the accuracy of the subsequent optimization estimation operation, but also relates to the quality of the final enhanced result. Therefore, a simple and effective method is provided, and the maximum value of three channels of the color image and the corresponding light weight matrix obtained by local block scanning are respectively extracted by considering the relevance of the local content information of the image, so that the accurate estimation of the initial light component of the image is realized, and further, the enhancement of a more effective weak light image is realized.
Drawings
FIG. 1 is a system main flow diagram of a preferred embodiment provided by the present invention;
FIGS. 2 (a 1) - (a 3) are, respectively, initial illumination components obtained by taking the maximum value of RGB three channels from an input image, and the corresponding optimized illumination components and enhancement results;
FIGS. 2 (b 1) - (b 3) are respectively the initial illumination component obtained by taking the average value of RGB three channels of the input image, and the optimized illumination component and enhancement result corresponding to the initial illumination component;
Fig. 2 (c 1) - (c 3) are respectively an initial illumination component obtained by taking the brightness V channel of the HSV color space from the input image, and a corresponding optimized illumination component and enhancement result.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and specifically described below with reference to the drawings in the embodiments of the present invention. The described embodiments are only a few embodiments of the present invention.
The technical scheme for solving the technical problems is as follows:
preferably, as shown in fig. 1, a method for enhancing a low-light image based on adaptive illumination initialization includes the following steps:
Firstly, collecting and arranging the existing disclosed weak light image data set on the internet for a weak light image enhancement task;
the second step, accurately estimating the initial illumination component of the image based on the proposed illumination self-adaptive initialization module according to different input images;
thirdly, under the constraint of structure illumination priori, optimizing and estimating an initial illumination component through an alternate direction minimization technology;
Performing gamma correction on the obtained optimized illumination component to further realize nonlinear adjustment on the brightness of the image;
And fifthly, combining with a Retinex theoretical model to realize enhancement of the low-light image.
Because of the high uncertainty of the illumination component decomposition estimation, how to accurately estimate the illumination component of an image has been a problem to be solved by the image enhancement method based on the Retinex model. The prior methods are used for constraining the optimized estimation of the illumination component through various prior and hypothesized conditions, but the problem of initializing the illumination component is rarely focused. Aiming at the problems, the invention provides a self-adaptive illumination initialization method which can accurately estimate the illumination component of an image and realize the enhancement of a weak light image. The method comprises the following specific steps:
Initially we first briefly introduce the Retinex model, which was inspired by human eye retinal imaging, land et al developed a Retinex theory model based on color constancy. The core idea of the model is to decompose the observed image into an illumination component and a reflection component, wherein the illumination component represents the distribution condition of illumination in an image scene and comprises the structural information of the image, and the reflection component represents the inherent attribute of an object and is mainly represented by the texture detail and the color information of the image. The formula is as follows:
Wherein S (x) represents an input original weak light image, I (x) represents an illumination component, R (x) represents a reflection component, x represents a specific pixel, and an operator Then a per-element multiplication operation is represented. Here we assume that the illumination components in the three color channels of the color image are identical.
As a first step in the Retinex theory-based method, we outline several methods that were commonly used in the past, including 1) as the earliest proposed color-invariant method, taking the maximum of three channels of the image R, G, B as the initial illumination component I 0 (x), 2) followed by a researcher taking the average of the three color channels to initialize the illumination component, and 3) also followed by a person converting the image from RGB color space to HSV space, and taking the luminance channel V therein as the initial illumination component. The specific formula is as follows:
I0(x)=SV(x)
Where I 0 (x) represents the initial illumination component, c contains different color channels, and S V (x) represents the V component of the image in the HSV color space.
In the prior art, the weak light image enhancement method based on the Retinex model is mainly used for initializing the illumination component in the mode, but the local consistent characteristic of illumination is not considered in the methods, so that the structural information of the local area of the image cannot be well protected, and the range prior of the illumination component is ignored by the method of taking the average value of three color channels, namely the brightness of the illumination component is not smaller than that of the original image. From the formula of the Retinex theory model, it is known that the estimation of the illumination component and the reflection component have a direct connection and also influence the final enhancement result. Therefore, the accurate decomposition estimation of the illumination component of the image is critical to the low-light image enhancement method based on the Retinex model, and the illumination component initialization as the first step is particularly critical.
Based on this, a simple and effective method is proposed herein to achieve accurate initialization of the illumination component, and the specific formula is as follows:
Wherein, I.e., an illumination weight matrix, Ω represents a local block centered at x, in this context a block size of 3 x 3,Parameters are adjusted for illumination. By introducing the illumination weight matrix W I, the method considers the local consistent characteristic of illumination, makes up the defect of local illumination content perception in the prior initialization method, and also considers the range priori of illumination components, skillfully limits the reflection components to [0,1], thereby avoiding the problems of color distortion of the reflection components and overexposure of the enhancement result.
After introducing the Retinex theory model and the illumination component adaptive initialization module proposed herein, we will next optimize the initial illumination component by an alternate direction minimization technique under the constraint of the structure illumination prior. From the foregoing analysis we can see that the ideal image illumination component optimization algorithm should take into account both the aspects of preserving the overall structure of the image and smoothing of the texture details, so we have the following objective functions:
wherein I 0 denotes an initial illumination component, I denotes an optimized illumination component, W is a structural weight matrix, Is a first derivative filter, which is specifically divided into(Horizontal direction) and(Vertical direction) and || 1 and || F are respectively 1 norm and standard F norm. In the above objective function, the first termFor data fidelity terms, used to constrain the differences between I 0 and I, regularized termsThe function of the method is to limit the size of the solution space, and the coefficient alpha is used for balancing the fidelity term and the regularization term to realize the structural perception smoothing of the illumination component.
The weight matrix W is intended to perceive structural edge information of an image, and specifically includes two parts of the following horizontal direction W h (x) and the vertical direction W v (x), and specifically includes:
it can be seen from the above equation that the structural weight matrix W is constructed based on the initial illumination component obtained by the previous step, and is not an optimal illumination component, that is, it is shown that the structural weight matrix only needs to be calculated once in the present text, so that the execution time of the algorithm can be effectively shortened, and on the other hand, the importance of the initial illumination component is emphasized again.
To further improve the computational efficiency of the algorithm, we perform an approximate reduction operation on the objective function described above. First we develop the canonical terms in the objective function,
We use hereApproximate replacement of regular termsFinally, the above formula can be equivalently written as follows,
In particular, whenWhen the value of the value is small, the value of the value,The value of (2) is also smaller, andThe value of (2) is also suppressed. The illumination component I obtained by final optimization estimation avoids gradient change at the position with smaller initial illumination component gradient, and vice versa. Thereby explaining the regularization in the above formula
The term's constraint on the edges of the illumination component structure remains consistent with the original objective function.
For the task of enhancing low-light images, the enhancement of the brightness of the images is one of the core problems to be solved, so after the optimized illumination component is obtained, gamma correction is further performed on the optimized illumination component, so as to realize nonlinear adjustment of the brightness of the images, and further improve the enhancement result. The specific formula is that,
Ig(x)=I(x)γ
Wherein, the value of gamma is 0.8. We get the final enhancement result S out from the input image S (x) and the optimized illumination component I g after illumination adjustment, in combination with the Retinex model.
Here epsilon is a small constant, avoiding zero denominator.
The experimental method comprises the following steps:
In the experimental process, a plurality of common weak light image public data sets and two non-reference evaluation indexes for evaluating the weak light image enhancement images are collected and arranged, and the effectiveness of the method is evaluated more comprehensively from two aspects of subjective vision and objective indexes.
The first step, according to different weak light images, obtaining a corresponding illumination weight matrix, and guiding the self-adaptive initialization of the illumination components of the images;
And secondly, inputting evidence obtaining frequency characteristics extracted from the training set image and corresponding labels into a KNN classifier by using a Matlab running program to obtain a trained model.
Under the constraint of structure illumination priori, carrying out optimization estimation on the initial illumination component through an alternating direction minimization technology, and executing gamma correction on the initial illumination component so as to further realize nonlinear adjustment on the brightness of the image;
And fourthly, gamma correction is carried out on the obtained optimized illumination component so as to further realize nonlinear adjustment on the brightness of the image, and enhancement of the weak light image is realized by combining with a Retinex theoretical model.
Experiments prove that compared with the prior method, the method provided by the invention has satisfactory enhancement effect and objective evaluation index in a plurality of common public dim light image data sets, and shows good effectiveness and generalization. In addition, the invention has a certain enhancement effect on the low-light video.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The above examples should be understood as illustrative only and not limiting the scope of the invention. Various changes and modifications to the present invention may be made by one skilled in the art after reading the teachings herein, and such equivalent changes and modifications are intended to fall within the scope of the invention as defined in the appended claims.