A low-light image preprocessing method for monochrome-color dual cameras
Through the improved LIME image enhancement algorithm and adaptive exposure correction technology, it solves the problem of low image quality of monochrome-color dual cameras in low-light environments, improves image brightness and matching accuracy, and achieves better visual effects.
Patent Information
- Application Number
- CN202211628737.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-18
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-12-18
Smart Images

Figure CN116033278B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a low-illumination image preprocessing method for a monochrome-color dual camera. Background Art
[0002] In low-light environments such as weak light, backlight, and high light ratio, the amount of light received by the imaging device is insufficient, and the imaging often shows characteristics such as strong noise, low visibility, and low contrast. The human eye has poor resolution for low-light images, and cannot even distinguish local details. In the field of traditional cameras, the brightness of the picture is generally increased by increasing the aperture, extending the shutter time, and increasing the sensitivity, but this will bring other problems accordingly. For example, increasing the aperture will lead to high camera costs, and some cameras cannot increase the aperture due to structural design. Extending the shutter time will cause blur and freeze in the picture, and increasing the sensitivity will increase the noise of the picture. At present, there are solutions that use multi-camera fusion to overcome the above problems, such as cross-spectral binocular cameras with infrared-visible light and monochrome-color solutions. The monochrome camera module mentioned removes the filter in front of the color sensor because it will cause the loss of part of the light signal and easily cause distortion of the color space. The monochrome camera module abandons the filter at the front end of the sensor. Although it cannot recover the collected color information, its relatively higher light transmittance preserves more detailed structural changes in the scene, providing a guarantee for clear imaging under low illumination. The processing flow generally adopted by this type of binocular camera is image matching and image fusion, but the quality of images collected under low illumination is low, which affects the accuracy of image matching. And the unprocessed visible light image also has problems such as low brightness, gray color and excessive noise after fusion. Summary of the invention
[0003] Based on the problems existing in the above technologies, in order to better solve the problem that the quality of images collected under low illumination is low and affects the accuracy of image matching, the present invention proposes a low illumination image preprocessing method for a monochrome-color dual camera to improve the matching accuracy and image quality of the monochrome-color dual camera. The method includes:
[0004] S1: Obtain an original image pair in a low-light environment through a device, including a monochrome image M and a color image C;
[0005] S2: The acquired original image is enhanced using the improved low illumination image enhancement LIME image enhancement algorithm to obtain an enhanced monochrome image M1 and an enhanced color image C1;
[0006] S3: Perform color space conversion on the enhanced monochrome image C1 to obtain a color space image YCbCr;
[0007] S4: Enhance the brightness component C in the monochrome image C11Y , down-sampling the enhanced color image M1, and then detecting feature points on the down-sampled image;
[0008] S5: Perform feature point matching based on the feature points obtained in the previous step, classify them into feature point pairs, select matching feature point pairs with high matching degree, perform affine transformation on M1 to obtain the transformed image M2;
[0009] S6: Based on the exposure information of the transformed image M2, an adaptive exposure correction algorithm is used to modify the component C 1Y Perform Gamma transformation to obtain the corrected brightness component C' 1Y , realize the exposure value alignment of monochrome image M and color image C;
[0010] Among them, the YCbCr color space includes three components Y, Cb, and Cr, Y refers to the light brightness component, Cb refers to the blue chromaticity component, Cr refers to the red chromaticity component, and Gamma represents gamma correction.
[0011] Furthermore, the device for acquiring the original image pair is a monochrome-color dual camera.
[0012] The improved LIME image enhancement algorithm is a LIME image enhancement algorithm with adaptive gamma correction, specifically:
[0013] Based on the LIME image enhancement algorithm based on retinal cortex Retinex, the fixed parameter Gamma transformation is improved to adaptive parameter Gamma correction, where the Retinex theory is:
[0014]
[0015] I is the collected image, R is the reflection component, L is the estimated incident component, It is the product operation of the image; according to the estimated illumination map, the reflection component is solved by Retinex theory to achieve the effect of image enhancement;
[0016] The LIME image enhancement algorithm estimates the illumination map to solve the reflection component to achieve the effect of image enhancement in low-light environments, and uses BM3D to achieve noise reduction. The gamma correction used is a fixed parameter, which is not conducive to adjusting the image to the appropriate brightness, so an adaptive gamma correction algorithm is used; based on the Retinex theory, the expression used for the improved adaptive gamma correction is:
[0017]
[0018] Among them, V in represents the input pixel value, γ is the Gamma parameter, A is the amplitude value, Vout Gamma corrected output value.
[0019] Furthermore, the adaptive parameters of the improved Gamma correction include selecting a set of appropriate parameters and traversing the parameters to obtain a corrected image group, and using PSNR to evaluate the quality of the corrected image, and determining the corresponding Gamma correction parameters according to the highest PSNR value to ensure that the optimal Gamma correction parameters can be selected; the expression for peak signal-to-noise ratio PSNR evaluation is:
[0020]
[0021] The solution formula for the mean square error MSE is:
[0022]
[0023] Among them, m represents the total number of rows, n represents the total number of columns, i represents the index value of row traversal, j represents the index value of column traversal, I(i,j) represents the value of the pixel before Gamma enhancement, and K(i,j) represents the value of the pixel after Gamma enhancement.
[0024] Preferably, the expression for converting the RGB color space to the YCbCr color space is:
[0025]
[0026] RGB refers to the three color components: red R, green G, and blue B.
[0027] Preferably, the steps for acquiring the feature point pairs are:
[0028] The SIFT scale-invariant feature transformation algorithm is used to detect feature points;
[0029] The FLANN matching algorithm is used for feature point matching, and the RANSAC algorithm is used to eliminate unreasonable feature point pairs;
[0030] The four outermost feature point pairs are selected from the matched feature point pairs as the required feature point pairs to ensure that the two images can be aligned to the maximum extent.
[0031] Preferably, the adaptive exposure correction algorithm includes:
[0032] The feature point pairs are used to solve the homography matrix required for affine transformation; the two images are affine transformed so as to fit the two images to a greater extent;
[0033] Furthermore, the adaptive exposure correction algorithm refers to the process of adjusting the exposure of C based on M2. 1Y Gamma correction is performed to make its histogram close to M2, which is converted into the following optimization problem:
[0034]
[0035] Among them, C represents the Y component value of C1 before correction, C′ represents the Y component value of C1 after correction, and i is the value of C i The index of the pixel set traversal, n represents the total number of pixels, and the subscript F indicates the use of the Frobenious norm.
[0036] Furthermore, the calculation formula of the homography matrix required for affine transformation in the low-light image preprocessing method for a monochrome-color dual camera is as follows:
[0037]
[0038] Among them, ∝ means that the left side is positively correlated with the right side;
[0039] Use H 33 =1, so H has 8 unknowns in total, and 8 equations are needed to solve them. A pair of matching points provides 2 equations, which are expanded as follows:
[0040]
[0041] Solve the equations based on the four pairs of matching points, where (u1, v1) and (u2, v2) represent a pair of matching points, and u1 and v1 represent the values of the matching points respectively. The homography matrix H is obtained, and H is H 3×3 The matrix of H 11 ~H 33 Represents the row and column positions of the matrix.
[0042] Beneficial effects of the present invention:
[0043] The present invention uses a monochrome-color dual camera to acquire an original image pair, and performs image enhancement by using an improved LIME image enhancement algorithm with adaptive gamma correction, thereby improving the low grayscale dynamic range, further reasonably improving the image brightness, and obtaining a better visual effect; the present invention uses an adaptive exposure correction algorithm, so that subsequent image matching can obtain high-precision results. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of the process of the present invention;
[0045] Figure 2 Sample images taken with the color camera module;
[0046] Figure 3 Example images taken with the monochrome camera module;
[0047] Figure 4 M1 and C are obtained after processing1Y Matching feature point pairs;
[0048] Figure 5 The image obtained after subsequent fusion processing; DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The present invention provides a low-light image preprocessing method for a monochrome-color dual camera, such as Figure 1 As shown, a horizontally placed monochrome-color dual camera shoots the same scene and collects one monochrome image and one color image.
[0051] Among them, C is the collected color image, such as Figure 2 As shown; M is the collected monochrome image, such as Figure 3 As shown; the pair of images is preprocessed to improve the subsequent image registration effect and enhance the image quality.
[0052] A low-light image preprocessing method for a monochrome-color dual camera, the method comprising the following steps:
[0053] S1: Obtain an original image pair in a low-light environment through a device, including a monochrome image M and a color image C;
[0054] S2: The acquired original image is enhanced using the improved low illumination image enhancement LIME image enhancement algorithm to obtain an enhanced monochrome image M1 and an enhanced color image C1;
[0055] S3: Perform color space conversion on the enhanced monochrome image C1 to obtain a color space image YCbCr;
[0056] S4: Enhance the brightness component C in the monochrome image C1 1Y , down-sampling the enhanced color image M1, and then detecting feature points on the down-sampled image;
[0057] S5: Match feature points based on the feature points obtained in the previous step, classify them into feature point pairs, select feature point pairs with high matching degree, perform affine transformation on M1 to obtain transformed image M2;
[0058] S6: Based on the exposure information of the transformed image M2, an adaptive exposure correction algorithm is used to modify the component C 1YPerform Gamma transformation to obtain the corrected brightness component C' 1Y , realize the exposure value alignment of monochrome image M and color image C;
[0059] Among them, the YCbCr color space includes three components Y, Cb, and Cr, Y refers to the light brightness component, Cb refers to the blue chromaticity component, Cr refers to the red chromaticity component, and Gamma represents gamma correction.
[0060] The improved LIME image enhancement algorithm is a LIME image enhancement algorithm with adaptive gamma correction, specifically:
[0061] For the enhancement of low-light images, the LIME image enhancement algorithm based on Retinex theory is adopted. According to Retinex theory,
[0062]
[0063] Among them, I is the collected image, R is the reflection component (reflection map), and L is the estimated incident component (illuminance map). According to the estimated illumination map, the reflection component is solved by Retinex theory to achieve the effect of image enhancement.
[0064] Estimated illumination map of the input image The calculation formula is as follows:
[0065]
[0066] Estimated illumination map Optimizing the illumination map T is equivalent to solving the following optimization problem:
[0067]
[0068] The calculation formula for solving the reflected image R through the obtained illumination map T is as follows:
[0069]
[0070] Then, according to the properties of the reflected image R, adaptive Gamma correction is applied to it to obtain the corrected image R γ ;
[0071] R γ Use BM3D for denoising.
[0072] The following formula is used to solve the final enhanced images M1 and C1:
[0073]
[0074] The improved Gamma correction parameter determination includes selecting a set of appropriate parameters and traversing the parameters to obtain a corrected image group, and using PSNR to evaluate the quality of the corrected image, and selecting the best Gamma correction parameters from them. The peak signal-to-noise ratio PSNR evaluation expression is:
[0075]
[0076] Among them, the solution formula for the mean square error MSE is:
[0077]
[0078] Among them, m represents the total number of rows, n represents the total number of columns, i represents the index value of row traversal, j represents the index value of column traversal, I(i,j) represents the value of the pixel before Gamma enhancement, and K(i,j) represents the value of the pixel after Gamma enhancement.
[0079] The calculation formula for converting the input image from RGB color space to YCbCr color space is as follows:
[0080]
[0081] Among them, RGB refers to the three color components of red R, green G, and blue B.
[0082] Convert C1 to a color space image YCbCr. The color space image YCbCr is represented by three components, namely, C 1Y , C 1Cr and C 1Cb ;
[0083] For M1 and C 1Y Downsampling is performed separately to obtain downsampled component M1′ and downsampled component C 1Y ′:
[0084] For M1′ and C 1Y' Perform SIFT feature point detection, including establishing an image pyramid by using a convolution kernel, and obtaining a Gaussian difference scale space by differential operations between layers; if a point is the maximum or minimum value in the current layer and the neighborhood of the upper and lower layers in the Gaussian difference scale space, it is considered to be an extreme value and extracted; because the operator of the Gaussian difference scale space will produce a strong edge effect, it is necessary to remove the edge response points, and the remaining ones are the key points; each key point contains three pieces of information: position, scale and direction, thereby determining a SIFT feature area; and the peak value in the gradient histogram is used as the main direction of the key point; an 8×8 window is taken with the key point as the center, and divided into 4 small windows, and the gradient direction histogram of 8 directions is calculated on each 4×4 small block, and the accumulated value of each gradient direction is plotted to form a seed point. A key point consists of 4 seed points, and a key point contains a 128-dimensional feature point descriptor.
[0085] For M1′ and C 1Y ′ Perform FLANN matching on the detected SIFT feature points to find the dimension with the highest variance in the data set, use the value of this dimension to divide the data into two parts, and repeat the same process for each data.
[0086] The obtained matching feature point pairs are subjected to the random sampling consensus algorithm RANSAC. RANSAC determines the model by repeatedly selecting a random subset of the data to determine whether the data conforms.
[0087] The final matching feature points are obtained as Figure 4 shown.
[0088] Select the outermost 4 pairs of matching feature points from the remaining matching feature point pairs, and perform affine transformation through these 4 pairs of matching feature points. First, calculate the homography matrix. The calculation formula is as follows:
[0089]
[0090] Use H 33 =1, so H has 8 unknowns in total, and 8 equations are needed to solve them. A pair of matching points provides 2 equations, which are expanded as follows:
[0091]
[0092] Solving the equations based on four pairs of matching points, we can obtain the homography matrix H, which is H 3×3 The matrix of H 11 ~H 33 Represents the row and column positions of the matrix.
[0093] According to the homography matrix H, M1′ is affine transformed to obtain M2′, so that it is as close to C as possible. 1Y 'resemblance.
[0094] Based on M2′, 1Y ′Use the adaptive exposure correction algorithm to get C 2Y ′, the steps are as follows:
[0095] Exposure correction, that is, by performing Gamma correction on C1 to make its histogram close to M2, convert it into the following optimization problem:
[0096]
[0097] Among them, C represents the Y component value of C1 before correction, C′ represents the Y component value of C1 after correction, and i is the value of C i The index of the pixel set traversal, n represents the total number of pixels.
[0098] like Figure 5 As shown, the image obtained by the subsequent fusion processing shows that the present invention can help the subsequent processing flow to obtain better results.
[0099] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.
Claims
1. A low-light image preprocessing method for a monochrome-color dual camera, characterized in that: The method includes: S1: Obtain an original image pair in a low-light environment through a device, including a monochrome image M and a color image C; S2: The acquired original image pair is enhanced using an improved low illumination image enhancement LIME image enhancement algorithm to obtain an enhanced monochrome image M1 and an enhanced color image C1; the improved LIME image enhancement algorithm is a LIME image enhancement algorithm with adaptive gamma correction, specifically: Based on the LIME image enhancement algorithm based on retinal cortex Retinex, the fixed parameter Gamma transformation is improved to adaptive parameter Gamma correction; Among them, the basic theory of Retinex is; I is the captured image, R is the reflection component, L is the estimated incident component, and ° is the product operation between images; according to the estimated illumination map, the reflection component is solved by Retinex theory to achieve the effect of image enhancement; based on Retinex theory, the expression used for the improved adaptive Gamma correction is: Among them, V in represents the input pixel value, γ is the Gamma parameter, A is the amplitude value, V out Gamma correction output value; S3: Perform color space conversion on the enhanced color image C1 to obtain a color space image YCbCr; S4: Enhance the brightness component C in the color image C1 1Y , down-sampling the enhanced monochrome image M1, and then detecting feature points on the down-sampled image; S5: Match feature points based on the feature points obtained in the previous step, classify them into feature point pairs, select feature point pairs with high matching degree, perform affine transformation on M1 to obtain transformed image M2; S6: Based on the exposure information of the transformed image M2, an adaptive exposure correction algorithm is used to modify the component C 1Y Perform Gamma transformation to obtain the corrected brightness component C' 1Y , realize the exposure value alignment of monochrome image M and color image C; Among them, the YCbCr color space includes three components Y, Cb, and Cr. Y refers to the light brightness component, Cb refers to the blue chromaticity component, Cr refers to the red chromaticity component, and Gamma refers to gamma correction; Adaptive exposure correction algorithms include: Use feature point pairs to solve the homography matrix required for affine transformation; Perform affine transformation on the two images to make them fit together; Adaptive exposure correction refers to the use of M2 as a basis for C 1Y Gamma correction is performed to make its histogram close to M2, which is converted into the following optimization problem: Among them, C represents the Y component value of C1 before correction, C′ represents the Y component value of C1 after correction, and i is the value of C i The index of the pixel set traversal, n represents the total number of pixels, and the subscript F indicates the use of the Frobenious norm.
2. The low-light image preprocessing method for a monochrome-color dual camera according to claim 1, characterized in that: The device for acquiring the original image pair is a monochrome-color dual camera.
3. The low-light image preprocessing method for a monochrome-color dual camera according to claim 1, characterized in that: The improved adaptive parameters of Gamma correction include selecting a set of appropriate parameters and traversing the parameters to obtain a corrected image group, and using the peak signal-to-noise ratio (PSNR) to evaluate the quality of the corrected image. The corresponding Gamma correction parameters are determined according to the highest PSNR value to ensure that the optimal Gamma correction parameters can be selected. The peak signal-to-noise ratio PSNR evaluation expression is: Among them, the solution formula for the mean square error MSE is: Among them, m represents the total number of rows, n represents the total number of columns, i represents the index value of row traversal, j represents the index value of column traversal, I(i,j) represents the value of the pixel before Gamma enhancement, and K(i,j) represents the value of the pixel after Gamma enhancement.
4. The low-light image preprocessing method for a monochrome-color dual camera according to claim 1, characterized in that: The expression for converting RGB color space to YCbCr color space is: Among them, RGB refers to the three color components of red R, green G, and blue B.
5. The low-light image preprocessing method for a monochrome-color dual camera according to claim 1, characterized in that: The steps for obtaining feature point pairs are: The scale-invariant feature transformation algorithm SIFT is used to detect feature points; The fast nearest neighbor search package matching algorithm FLANN is used to match feature points into feature point pairs, and the random sampling consensus algorithm RANSAC is used to eliminate unreasonable feature point pairs; The outermost feature point pair is selected from the matched feature point pairs as the required feature point pair.
6. The low-light image preprocessing method for a monochrome-color dual camera according to claim 1, characterized in that: The calculation formula of the homography matrix required for affine transformation is as follows: Among them, ∝ means that the left side is positively correlated with the right side; Use H 33 =1, so H has 8 unknowns in total, and 8 equations are needed to solve them. A pair of matching points provides 2 equations, which are expanded as follows: Solve the equations based on the four pairs of matching points, where (u1, v1) and (u2, v2) represent a pair of matching points, and u1 and v1 represent the values of the matching points respectively. The homography matrix H is obtained, and H is H 3×3 The matrix of H 11 ~H 33 Represents the row and column positions of the matrix.
Citation Information
Patent Citations
Double exposure implementation method for inhomogeneous illumination image
CN103530848A
Retinex-based image enhancement method in a dark vision environment
CN111292257A
