A multi-scale fusion-based extremely low-light tobacco leaf image enhancement method and system
By employing a multi-scale fusion method and utilizing histogram equalization, dual Gamma correction, an improved CLAHE algorithm, and detail enhancement algorithms, the problems of detail loss and color distortion in image enhancement for tobacco curing in extremely low light conditions were solved, achieving high-quality image enhancement results. This method is suitable for image processing in extremely low light conditions during tobacco production.
Patent Information
- Application Number
- CN202510364790.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-03-26
AI Technical Summary
Existing technologies for image enhancement under extremely low light conditions during tobacco curing in barns suffer from issues such as loss of detail, blurring, low contrast, and color distortion. Furthermore, deep learning algorithms require a large amount of training data, which is difficult to obtain, resulting in poor image enhancement effects.
A multi-scale fusion method is adopted, including histogram equalization, dual Gamma correction, improved CLAHE algorithm and detail enhancement algorithm, to improve global and local contrast respectively, and enhance details in specific regions through high-frequency filtering. Combined with the improved algorithm to process the R, G and B channels of color image, the multi-scale fusion enhancement of image is achieved.
It significantly improves image quality under extremely low light conditions, suppresses noise, preserves detail information, and ensures color accuracy, providing clear and reliable image data support for the tobacco curing process.
Smart Images

Figure CN119887604B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tobacco leaf image enhancement technology, and in particular to a method and system for enhancing tobacco leaf images under extremely low light conditions based on multi-scale fusion. Background Technology
[0002] Currently, image enhancement technology is widely used in tobacco production, including nighttime monitoring of tobacco leaves under extremely low light conditions, monitoring tobacco crop conditions under low light conditions during rainy weather, nighttime extremely low light conditions during cigar drying in drying rooms, and extremely low light conditions during tobacco curing in curing barns. This technology enhances images from extremely low / low light environments during tobacco production. With breakthroughs in zero-sample or few-sample image enhancement techniques, enhancing images from extremely low light conditions during tobacco curing in curing barns has become feasible even under data-scarce conditions. However, achieving image enhancement from extremely low light conditions in curing barns still faces numerous technical challenges: the enhanced images suffer from quality issues such as loss of detail and blurring, and low contrast. Increasing image brightness can easily lead to noise amplification, and color distortion and color cast can also occur. Furthermore, while deep learning-based image enhancement algorithms offer excellent results, they require a large amount of high-quality training data, which is difficult to obtain in actual curing barn environments. Therefore, this poses a challenge to enhancing images from extremely low light conditions during tobacco curing in curing barns. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for enhancing tobacco leaf images under extremely low light conditions based on multi-scale fusion.
[0004] The objective of this invention is achieved through the following technical solution: The first aspect of this invention provides: a method for enhancing tobacco leaf images under extremely low light conditions based on multi-scale fusion, comprising the following steps:
[0005] S1: Acquire image data of tobacco leaves under extremely low light conditions;
[0006] S2: Decompose the color image of tobacco leaves under extremely low light into three color channels: R, G, and B.
[0007] S3: Improve the global contrast of tobacco leaf images under extremely low light by using histogram equalization, enhance the overall contrast of the image, and make the blurred areas clearer to obtain the first image;
[0008] S4: By using a dual Gamma correction algorithm to enhance the brightness and contrast of the first image, adapt to different lighting conditions, and improve visual consistency, a second image is obtained.
[0009] S5: The improved CLAHE algorithm is used to adaptively adjust the local contrast of the second image, preserve the texture of the tobacco leaf image in the curing barn, and improve the image quality to obtain the third image;
[0010] S6: High-frequency filtering in the detail enhancement algorithm is used to enhance the leaf veins in the third image, improve the details of specific areas of the tobacco leaf image in the curing barn, and preserve the detail features to finally obtain the enhanced image of the tobacco leaf in the curing barn.
[0011] Preferably, the dual Gamma correction algorithm includes the following steps:
[0012] The first image is normalized; then statistical features are calculated to obtain the average brightness and standard deviation; the gamma value r of the dark area is calculated based on the average brightness and standard deviation. dark Gamma value of bright areas r bright ;
[0013] r dark = γ*(1-α d *μ+β d *σ); r bright = γ*(1+α b *μ +β b *σ); where μ represents the average image brightness; σ represents the image standard deviation; α d β represents the weighting coefficient for dark area brightness. d Indicates the contrast weighting coefficient for dark areas; α b β represents the brightness weighting coefficient for bright areas; b This represents the highlight contrast weighting coefficient; γ is the global Gamma value.
[0014] Next, perform dark area mapping O dark (i) and highlight mapping O bright (i), then use the smooth transition function O(i) to fuse and perform a smooth transition, generate a lookup table, and apply the lookup table to perform correction to obtain the second image;
[0015] ; ;
[0016] O(i) = w(i) * O dark (i)+(1−w(i))*O bright (i); where w(i) = 0.5 + 0.5 * cos(π * (it) / r), represents the output weight value; t represents the threshold point, i.e. the boundary point between the dark and bright parts; r represents the transition region range, i.e. the width of the smooth transition interval; i represents the input pixel value.
[0017] Preferably, the improved CLAHE algorithm includes the following steps:
[0018] Input the second image, convert the second image to the LAB color space, separate the L, A, and B channels, and calculate the histogram of the L channel;
[0019] The L-channel histogram is first divided into blocks to obtain image blocks. An adaptive threshold is set for each image block, and bilinear interpolation is performed to eliminate block artifacts and obtain the first image block.
[0020] The first image block is further divided into blocks, and an adaptive threshold is set for each of the re-divided image blocks. Then, bilinear interpolation is performed again to eliminate the block artifacts and obtain the third image.
[0021] Preferably, the detail enhancement algorithm includes the following steps:
[0022] Input a third image and perform image preprocessing on it, including image normalization, calculation of image statistical features and adaptive parameters;
[0023] Image detail extraction is performed on the preprocessed image, including multi-scale Gaussian filtering, detail layer separation, weight calculation, and detail enhancement;
[0024] Image enhancement and optimization are performed on the image after detail extraction, including local contrast enhancement, edge detection enhancement, and adaptive fusion;
[0025] The enhanced and optimized image is then refined through processes including bilateral filtering optimization, noise suppression, and result normalization to finally obtain the enhanced image of tobacco leaves cured in the curing barn.
[0026] A second aspect of the present invention provides: a multi-scale fusion-based image enhancement system for tobacco leaves in extremely low light conditions, used to implement any of the above-mentioned multi-scale fusion-based image enhancement methods for tobacco leaves in extremely low light conditions, comprising:
[0027] The image acquisition module is used to acquire image data of tobacco leaves under extremely low light conditions.
[0028] The image segmentation module is used to segment a colored, low-light tobacco leaf image into three color channels: R, G, and B.
[0029] The image enhancement module is used to improve the global contrast of tobacco leaf images under extremely low light conditions through histogram equalization, thereby enhancing the overall contrast of the image and making blurred areas clearer to obtain the first image. A dual Gamma correction algorithm is used to enhance the brightness and contrast of the first image, adapting to different lighting conditions and improving visual consistency to obtain the second image. An improved CLAHE algorithm is used to adaptively adjust the local contrast of the second image, preserving the veins of the tobacco leaves in the curing barn image and improving image quality to obtain the third image. High-frequency filtering in the detail enhancement algorithm is used to enhance the leaf veins in the third image, improving details in specific areas of the tobacco leaf image in the curing barn image, and preserving detailed features to finally obtain the enhanced image of the tobacco leaves after curing in the curing barn.
[0030] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, the aforementioned method for enhancing tobacco leaf images in extremely low light conditions based on multi-scale fusion is implemented.
[0031] A fourth aspect of the present invention provides: a computer program product containing instructions, which, when run on a terminal, causes the terminal to execute any of the above-described methods for enhancing tobacco leaf images in extremely low light conditions based on multi-scale fusion.
[0032] The beneficial effects of this invention are:
[0033] 1) By combining an improved histogram equalization algorithm, detail enhancement, adaptive Gamma correction, and CLAHE contrast enhancement, effective enhancement of tobacco leaf images can be achieved even under extremely low light conditions with severe degradation such as low signal-to-noise ratio, loss of detail information, and color distortion, providing clear and reliable image data support for the automated monitoring of tobacco curing process.
[0034] 2) It can effectively solve the image quality problem caused by insufficient light in the baking room environment. Attached Figure Description
[0035] Figure 1 The flowchart shows a method for enhancing tobacco leaf images under extremely low light conditions based on multi-scale fusion.
[0036] Figure 2 Here is a flowchart of the dual Gamma correction algorithm;
[0037] Figure 3 Flowchart of the improved CLAHE algorithm;
[0038] Figure 4 Flowchart of the algorithm for enhancing details. Detailed Implementation
[0039] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] See Figures 1-4 The first aspect of this invention provides: a method for enhancing tobacco leaf images under extremely low light conditions based on multi-scale fusion, comprising the following steps:
[0041] S1: Acquire image data of tobacco leaves under extremely low light conditions;
[0042] S2: Decompose the color image of tobacco leaves under extremely low light into three color channels: R, G, and B.
[0043] S3: Improve the global contrast of tobacco leaf images under extremely low light by using histogram equalization, enhance the overall contrast of the image, and make the blurred areas clearer to obtain the first image;
[0044] S4: By using a dual Gamma correction algorithm to enhance the brightness and contrast of the first image, adapt to different lighting conditions, and improve visual consistency, a second image is obtained.
[0045] S5: The improved CLAHE algorithm is used to adaptively adjust the local contrast of the second image, preserve the texture of the tobacco leaf image in the curing barn, and improve the image quality to obtain the third image;
[0046] S6: High-frequency filtering in the detail enhancement algorithm is used to enhance the leaf veins in the third image, improve the details of specific areas of the tobacco leaf image in the curing barn, and preserve the detail features to finally obtain the enhanced image of the tobacco leaf in the curing barn.
[0047] In this embodiment, the zero-sample adaptive enhancement algorithm effectively overcomes the limitations of traditional low-light image enhancement techniques in the complex environment of the curing barn. While maintaining computational efficiency, this method significantly improves key image quality indicators: achieving a high signal-to-noise ratio to effectively suppress image noise, ensuring clear presentation of details, and guaranteeing accurate color reproduction. The enhanced tobacco leaf images not only offer excellent visual effects but also provide a high-quality data foundation for subsequent intelligent monitoring and analysis of the tobacco curing process. This method significantly outperforms existing technologies in image enhancement under extremely low light conditions, especially in the complex and variable lighting environment of the curing barn, enabling extremely low-light image enhancement and overcoming the shortcomings of existing low-light image enhancement techniques.
[0048] In some embodiments, the dual Gamma correction algorithm includes the following steps:
[0049] The first image is normalized; then statistical features are calculated to obtain the average brightness and standard deviation; the gamma value r of the dark area is calculated based on the average brightness and standard deviation. dark Gamma value of bright areas r bright ;
[0050] r dark = γ*(1-α d *μ+β d *σ); r bright = γ*(1+α b *μ +β b *σ); where μ represents the average image brightness; σ represents the image standard deviation; α dβ represents the weighting coefficient for dark area brightness. d Indicates the contrast weighting coefficient for dark areas; α b β represents the brightness weighting coefficient for bright areas; b This represents the highlight contrast weighting coefficient; γ is the global Gamma value.
[0051] Next, perform dark area mapping O dark (i) and highlight mapping O bright (i), then use the smooth transition function O(i) to fuse and perform a smooth transition, generate a lookup table, and apply the lookup table to perform correction to obtain the second image;
[0052] ; ;
[0053] O(i) = w(i) * O dark (i)+(1−w(i))*O bright (i); where w(i) = 0.5 + 0.5 * cos(π * (it) / r), represents the output weight value; t represents the threshold point, i.e. the boundary point between the dark and bright parts; r represents the transition region range, i.e. the width of the smooth transition interval; i represents the input pixel value.
[0054] In some embodiments, the improved CLAHE algorithm includes the following steps:
[0055] Input the second image, convert the second image to the LAB color space, separate the L, A, and B channels, and calculate the histogram of the L channel;
[0056] The L-channel histogram is first divided into blocks to obtain image blocks. An adaptive threshold is set for each image block, and bilinear interpolation is performed to eliminate block artifacts and obtain the first image block.
[0057] The first image block is further divided into blocks, and an adaptive threshold is set for each of the re-divided image blocks. Then, bilinear interpolation is performed again to eliminate the block artifacts and obtain the third image.
[0058] In this embodiment, the specific calculation formula includes: 1) Converting the RGB color space to the LAB color space: converting the nighttime image of the cigar to the LAB color space. gamma (x,y) can be decomposed into I gamma_B (x,y), I gamma_G (x,y), I gamma_R Three channels (x, y). I gamma (x,y)=[I gamma_B (x,y), I gamma_G (x,y), I gamma_R (x,y)].
[0059] 2) RGB normalization: I gamma_B' (x,y)=I gamma_B (x,y) / 255;
[0060] I gamma_G' (x,y)= I gamma_G (x,y) / 255;
[0061] I gamma_R' (x,y)= I gamma_R (x,y) / 255;
[0062] 3) Non-linear RGB to linear RGB conversion:
[0063] ;
[0064] Wherein, cgamrgb is represented as {gamma_R, gamma_G, gamma_B}; This represents linear RGB values.
[0065] 4) Direct transformation matrix from linear RGB to LAB:
[0066] ;
[0067] Nonlinear transformation function f(t): ;
[0068] fx = f(X'); fy = f(Y'); fz = f(Z');
[0069] Calculate LAB: L = 116×fy – 16; a = 500×(fx - fy); b = 200×(fy - fz).
[0070] 5) Separate the Lab channel into L channel, a channel, and b channel.
[0071] 6) Apply local histogram equalization to the L channel.
[0072] Among them, L lab_out1 (x,y) represents the image equalization result using the local histogram algorithm; L lab_in (x,y) represents the local values of the input L-channel plot; max(L lab_in (x,y)) and min(L lab_in (x,y)) represent the maximum and minimum L-channel values within the current local region, respectively.
[0073] 7) Calculate the variance of the Laplacian value of channel L from the previous step using the Laplacian operator:
[0074] Among them, lap var L represents the variance of the Laplace operator; ∇² represents the Laplace operator; lab_out1 (x,y) represents the image after L-channel local histogram equalization in the previous step; Var represents the variance calculation function.
[0075] Laplace operator calculation formula: ;in, This represents the formula for calculating the Laplace operator.
[0076] Laplace variance calculation formula:
[0077] ; where N lab The total number of pixels in the L-channel local histogram equalized image is represented by μ; μ represents the mean of the Laplacian operator.
[0078] 8) Limiting: cliplimit=min(40.0,2.0+α) lab ×ln(1 + lap var )); where clip limit Indicates the contrast limit value; α lab Indicates the scaling factor; lap var This represents the variance of the Laplace operator.
[0079] 9) Improved CLAHE: Apply local histogram equalization to the L channel:
[0080] Among them, L lab_out2 (x,y) represents the relationship between L lab_out1 Image equalization result; max(L) lab_out1 (x,y)) and min(L lab_out1 (x,y)) represent the maximum and minimum L-channel values within the current local region, respectively.
[0081] 10) Use bilinear interpolation for the L channel to eliminate block artifacts:
[0082] ;in, x' and y' They represent L respectively lab_out2 (x,y) are the x and y coordinates after affine transformation; Represents the affine transformation matrix; x and y L respectively lab_out2The x-coordinates and y-coordinates of (x,y).
[0083] 11) Merge Image I that converts Lab color channels to RGB color channels (a, b, and c). enhance_clahe (x,y).
[0084] In some embodiments, the detail enhancement algorithm includes the following steps:
[0085] Input a third image and perform image preprocessing on it, including image normalization, calculation of image statistical features and adaptive parameters;
[0086] Image detail extraction is performed on the preprocessed image, including multi-scale Gaussian filtering, detail layer separation, weight calculation, and detail enhancement;
[0087] Image enhancement and optimization are performed on the image after detail extraction, including local contrast enhancement, edge detection enhancement, and adaptive fusion;
[0088] The enhanced and optimized image is then refined through processes including bilateral filtering optimization, noise suppression, and result normalization to finally obtain the enhanced image of tobacco leaves cured in the curing barn.
[0089] In this embodiment, the specific calculation formula includes: (1) taking the output image I from the previous step enhance_clahe Image I is obtained by normalizing (x,y). img_normal (x,y).
[0090] (2) Calculate I img_normal The mean μ of the (x,y) graph img_normal and standard deviation σ img_normal .
[0091] (3) Gaussian filtering:
[0092] Among them, I gauss (x,y,σi mg_normal ) indicates that in the original normalized I img_normal The image after Gaussian transformation of the (x,y) graph; σ img_normal Indicate I img_normal The standard deviation of the (x,y) graph.
[0093] (4) Adaptive weights, difference calculation formula:
[0094] ;
[0095] The formula for calculating the mean is: ; where μ diff Represents the difference image I diffThe mean of (x,y); N diff Represents the difference image I diff The total number of pixels in (x,y).
[0096] Local standard deviation formula: ; where σ diff Represents the difference image I diff (x, y) represents the standard deviation of the local region; M and N represent the difference image I, respectively. diff Width and height of (x,y).
[0097] Adaptive weight formula: ; where ω detail Represents the difference image I diff Adaptive weights of (x,y); σ diff Represents the difference image I diff (x,y) represents the standard deviation of a local region; σ img_normal Indicate I img_normal The standard deviation of the (x,y) graph.
[0098] (5) Multi-scale detail extraction, formula for calculating fine-scale details:
[0099]
[0100] Basic Scale Details Calculation Formula:
[0101]
[0102] Coarse-scale details:
[0103]
[0104] Among them, I detail_f (x,y), I detail_b (x,y), I detail_c (x, y) represent the fine-scale detail map, the basic-scale detail map, and the coarse-scale detail map, respectively; I gauss_f (x,y,σ img_normal ), I gauss_b (x,y, σ img_normal ), I gauss_c (x,y, σ img_normal ) respectively represent the values for I img_normal The image after Gaussian blurring of the (x,y) image.
[0105] (6) Edge strength, formula for edge strength calculation: Among them, E edge (x,y) represents the edge strength; G x Indicate I img_normal The gradient of the (x,y) image in the x-direction; Gy Indicate I img_normal The gradient of the (x,y) image in the y-direction.
[0106] Edge strength weight calculation formula: ; where ω edge (x,y) represents the marginal weights; ε represents the numerical stability factor.
[0107] (7) Local contrast enhancement, enhancement coefficient calculation formula: k=(w-1) / 2, where w and h are the mean filter window sizes (15,15). Local mean calculation:
[0108] Among them, I local_contrast (x,y) represents Local mean of the image; N local This represents the number of pixels in a w×h window.
[0109] Local difference calculation: ;
[0110] Contrast enhancement calculation formula:
[0111]
[0112] Among them, I local_contrast (x,y) represents I img_normal The local mean of the (x,y) graph; ω edge (x,y) represents the edge intensity map.
[0113] (8) Detail blending, the formula for detail blending:
[0114]
[0115] Where, ω detail_1 ω detail_2 ω detail_3 These represent the fine-scale weight, the basic-scale weight, and the coarse-scale weight, respectively, ω. detail_1 +ω detail_2 +ω detail_3 =1.
[0116] (9) Image enhancement:
[0117] ; where ω contrast Represents the contrast edge weight; ω detail This indicates the detail edge weight.
[0118] A second aspect of the present invention provides: a multi-scale fusion-based image enhancement system for tobacco leaves in extremely low light conditions, used to implement any of the above-mentioned multi-scale fusion-based image enhancement methods for tobacco leaves in extremely low light conditions, comprising:
[0119] The image acquisition module is used to acquire image data of tobacco leaves under extremely low light conditions.
[0120] The image segmentation module is used to segment a colored, low-light tobacco leaf image into three color channels: R, G, and B.
[0121] The image enhancement module is used to improve the global contrast of tobacco leaf images under extremely low light conditions through histogram equalization, thereby enhancing the overall contrast of the image and making blurred areas clearer to obtain the first image. A dual Gamma correction algorithm is used to enhance the brightness and contrast of the first image, adapting to different lighting conditions and improving visual consistency to obtain the second image. An improved CLAHE algorithm is used to adaptively adjust the local contrast of the second image, preserving the veins of the tobacco leaves in the curing barn image and improving image quality to obtain the third image. High-frequency filtering in the detail enhancement algorithm is used to enhance the leaf veins in the third image, improving details in specific areas of the tobacco leaf image in the curing barn image, and preserving detailed features to finally obtain the enhanced image of the tobacco leaves after curing in the curing barn.
[0122] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, the aforementioned method for enhancing tobacco leaf images in extremely low light conditions based on multi-scale fusion is implemented.
[0123] A fourth aspect of the present invention provides: a computer program product containing instructions, which, when run on a terminal, causes the terminal to execute any of the above-described methods for enhancing tobacco leaf images in extremely low light conditions based on multi-scale fusion.
[0124] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. A method for enhancing tobacco leaf images under extremely low illumination based on multi-scale fusion, characterized in that: Includes the following steps: S1: Acquire image data of tobacco leaves under extremely low light conditions; S2: Decompose the color image of tobacco leaves under extremely low light into three color channels: R, G, and B. S3: Improve the global contrast of tobacco leaf images under extremely low light by using histogram equalization, enhance the overall contrast of the image, and make the blurred areas clearer to obtain the first image; S4: By using a dual Gamma correction algorithm to enhance the brightness and contrast of the first image, adapt to different lighting conditions, and improve visual consistency, a second image is obtained. S5: The improved CLAHE algorithm is used to adaptively adjust the local contrast of the second image, preserve the texture of the tobacco leaf image in the curing barn, and improve the image quality to obtain the third image; S6: High-frequency filtering in the detail enhancement algorithm is used to enhance the leaf veins in the third image, improve the details of specific areas of the tobacco leaf image in the curing barn, and preserve the detail features to finally obtain the enhanced image of the tobacco leaf in the curing barn. The dual Gamma correction algorithm includes the following steps: The first image is normalized; then statistical features are calculated to obtain the average brightness and standard deviation; the gamma value r of the dark area is calculated based on the average brightness and standard deviation. dark Gamma value of bright areas r bright ; r dark = γ*(1-α d *μ+β d *σ); r bright = γ*(1+α b *μ +β b *σ); where μ represents the average image brightness; σ represents the image standard deviation; α d β represents the weighting coefficient for dark area brightness. d Indicates the contrast weighting coefficient for dark areas; α b β represents the brightness weighting coefficient for bright areas; b This represents the highlight contrast weighting coefficient; γ is the global Gamma value. Next, perform dark area mapping O dark (i) and highlight mapping O bright (i), then use the smooth transition function O(i) to fuse and perform a smooth transition, generate a lookup table, and apply the lookup table to perform correction to obtain the second image; ; ; O(i) = w(i) * O dark (i)+(1−w(i))*O bright (i); where w(i) = 0.5 + 0.5 * cos(π * (it) / r), represents the output weight value; t represents the threshold point, i.e. the boundary point between the dark and bright parts; r represents the transition region range, i.e. the width of the smooth transition interval; i represents the input pixel value; The improved CLAHE algorithm includes the following steps: Input the second image, convert the second image to the LAB color space, separate the L, A, and B channels, and calculate the histogram of the L channel; The L-channel histogram is first divided into blocks to obtain image blocks. An adaptive threshold is set for each image block, and bilinear interpolation is performed to eliminate block artifacts and obtain the first image block. Apply local histogram equalization to the L channel: Among them, L lab_out1 (x,y) represents the image equalization result using the local histogram algorithm; L lab_in (x,y) represents the local values of the input L-channel plot; max(L lab_in (x,y)) and min(L lab_in (x,y)) represent the maximum and minimum L-channel values within the current local region, respectively; Calculate the variance of the Laplacian value for channel L using the Laplacian operator: Among them, lap var L represents the variance of the Laplace operator; ∇² represents the Laplace operator; lab_out1 (x,y) represents the L-channel local histogram equalization image; Var represents the variance calculation function. Laplace operator calculation formula: ;in, This represents the formula for calculating the Laplace operator; Laplace variance calculation formula: ; where N lab The total number of pixels in the L-channel local histogram equalization image; μ represents the mean of the Laplacian operator; Implement restriction processing: clip limit =min(40.0,2.0+α lab ×ln(1 + lap var )); where clip limit Indicates the contrast limit value; α lab Indicates the scaling factor; lap var This represents the variance of the Laplace operator; Improved CLAHE: Apply local histogram equalization again to the L channel: Among them, L lab_out2 (x,y) represents the relationship between L lab_out1 Image equalization result; max(L) lab_out1 (x,y)) and min(L lab_out1 (x,y)) represent the maximum and minimum L-channel values within the current local region, respectively; Bilinear interpolation is used to eliminate block artifacts in the L channel: ;in, x' and y' They represent L respectively lab_out2 (x,y) are the x and y coordinates after affine transformation; Represents the affine transformation matrix; x and y L respectively lab_out2 The x and y coordinates of (x, y); merge Image I that converts Lab color channels to RGB color channels (a, b, and c). enhance_clahe (x,y); The first image block is further divided into blocks, and an adaptive threshold is set for each image block after the second division. Then, bilinear interpolation is performed again to eliminate the block artifacts and obtain the third image. The detail enhancement algorithm includes the following steps: Input a third image and perform image preprocessing on it, including image normalization, calculation of image statistical features and adaptive parameters; Image detail extraction is performed on the preprocessed image, including multi-scale Gaussian filtering, detail layer separation, weight calculation, and detail enhancement; Image enhancement and optimization are performed on the image after detail extraction, including local contrast enhancement, edge detection enhancement, and adaptive fusion; The enhanced and optimized image is then refined through processes including bilateral filtering optimization, noise suppression, and result normalization to finally obtain the enhanced image of tobacco leaves cured in the curing barn.
2. A system for enhancing images of tobacco leaves under extremely low light conditions based on multi-scale fusion, characterized in that: The method for enhancing tobacco leaf images in extremely low light conditions based on multi-scale fusion as described in claim 1 includes: The image acquisition module is used to acquire image data of tobacco leaves under extremely low light conditions. The image segmentation module is used to segment a colored, low-light tobacco leaf image into three color channels: R, G, and B. The image enhancement module is used to improve the global contrast of tobacco leaf images under extremely low light conditions through histogram equalization, thereby enhancing the overall contrast of the image and making blurred areas clearer to obtain the first image. A dual Gamma correction algorithm is used to enhance the brightness and contrast of the first image, adapting to different lighting conditions and improving visual consistency to obtain the second image. An improved CLAHE algorithm is used to adaptively adjust the local contrast of the second image, preserving the veins of the tobacco leaves in the curing barn image and improving image quality to obtain the third image. High-frequency filtering in the detail enhancement algorithm is used to enhance the leaf veins in the third image, improving details in specific areas of the tobacco leaf image in the curing barn image, and preserving detailed features to finally obtain the enhanced image of the tobacco leaves after curing in the curing barn.
3. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the method for enhancing tobacco leaf images in extremely low light conditions as described in claim 1 based on multi-scale fusion.
4. A computer program product containing instructions, characterized in that: When the computer program product is run on a terminal, the terminal executes the ultra-low light tobacco leaf image enhancement method based on multi-scale fusion as described in claim 1.
Citation Information
Patent Citations
Non-uniform illumination color image enhancement method
CN110047051A