Method for correcting and enhancing distortion of flue-cured tobacco leaf image

By processing images of roasted tobacco leaves using the Poisson equation and the Laplace pyramid image fusion algorithm, the problems of shadows and reflections caused by uneven tobacco leaves were solved, achieving high-quality image correction and accurate quality assessment.

CN120953141AActive Publication Date: 2025-11-14TOBACCO RESEARCH INSTITUTE OF CHINESE ACADEMY OF AGRICULTURAL SCIENCES (QINGZHOU TOBACCO RESEARCH INSTITUTE OF CHINA NATIONAL TOBACCO COMPANY)

Patent Information

Application Number
CN202511468292.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2025-11-14
Estimated Expiration
2045-10-15

AI Technical Summary

Technical Problem

Traditional image acquisition techniques for cured tobacco leaves cannot effectively handle shadows and reflections caused by unevenness in the tobacco leaves, affecting image quality and the accuracy of subsequent analysis.

Method used

A Poisson-based illumination homogenization algorithm is used to identify distortion segmentation points. Multi-exposure images are processed using a Laplacian pyramid image fusion algorithm. The correction parameters are dynamically adjusted by combining the correction error vector and the correlation matrix to achieve image distortion correction.

Benefits of technology

It effectively eliminates the effects of shadows and reflections, improves image quality and analysis accuracy, adapts to complex three-dimensional surface morphology, and enhances the accuracy of the detection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953141A_ABST
    Figure CN120953141A_ABST
Patent Text Reader

Abstract

The invention provides a flue-cured tobacco leaf image distortion correction enhancement method, and belongs to the technical field of flue-cured tobaccos. Distortion segmentation point detection is carried out on an obtained flue-cured tobacco leaf image, and an illumination change area caused by unevenness of a tobacco leaf surface is identified by using an illumination homogenization algorithm based on a Poisson equation; secondly, constructing a distortion jump point matrix to mark gray abrupt change positions caused by shadows and light reflection between adjacent areas, then decomposing and reconstructing multi-scale image features by adopting a Laplacian pyramid image fusion algorithm, and eliminating optical interference generated by surface fluctuation through a designed fusion rule; and finishing processing when the accuracy reaches a set range, otherwise, carrying out correction and optimization again, thereby solving the technical problem that the image quality and the subsequent analysis accuracy are influenced by shadow and light reflection generated during image acquisition due to unevenness of the tobacco leaves in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of flue-cured tobacco technology, and more specifically, relates to a method for image distortion correction and enhancement of flue-cured tobacco leaves. Background Technology

[0002] In the field of flue-cured tobacco quality inspection in the tobacco industry, traditional image acquisition technology mainly uses a fixed-angle single-light source illumination system in conjunction with an industrial camera to acquire images. Standardized shooting distances and exposure parameters are set to record the surface features of tobacco leaves, and basic image enhancement algorithms such as contrast adjustment and sharpening filtering are used for post-processing of the acquired images. These methods can achieve satisfactory imaging results when processing flat tobacco leaf samples. However, traditional technology has significant limitations when dealing with the actual physical state of flue-cured tobacco leaves. Due to uneven heating and moisture loss during the curing process, the leaves will develop wrinkles, curls, and uneven surface morphology. These uneven surfaces will produce complex shadow distributions and local reflections under fixed light source illumination. Traditional uniform illumination systems cannot adapt to this three-dimensional morphological change, resulting in striped distortion with alternating light and dark areas and blown-out highlights in the images. In current automatic tobacco grading systems, the inability to effectively eliminate optical interference caused by uneven tobacco leaf surfaces leads color recognition algorithms to frequently misidentify shadowed areas as tobacco leaf defects and reflective areas as color anomalies, severely impacting the reliability of quality assessment. Furthermore, these optical distortions interfere with texture feature extraction and shape measurement, resulting in a significant decrease in the accuracy of the entire automated inspection system. In other words, existing technologies suffer from the technical problem of uneven tobacco leaves causing shadows and reflections during image acquisition, affecting image quality and the accuracy of subsequent analysis. Summary of the Invention

[0003] In view of this, the present invention provides a method for image distortion correction and enhancement of roasted tobacco leaves, which can solve the technical problem in the prior art that the unevenness of tobacco leaves causes shadows and reflections during image acquisition, affecting image quality.

[0004] This invention is implemented as follows: This invention provides a method for distortion correction and enhancement of cured tobacco leaf images, including: detecting distortion segmentation points in the acquired cured tobacco leaf images; calculating the image gradient field using an illumination homogenization algorithm based on the Poisson equation; obtaining a homogenized illumination distribution by solving the Poisson equation using the finite difference method; identifying regions where illumination changes exceed an illumination threshold and marking them as distortion segmentation points; constructing a distortion jump point matrix based on the distortion segmentation points; statistically analyzing the gray-level differences between adjacent distortion segmentation points; marking points as distortion jump points when the gray-level difference exceeds a jump threshold, thus forming a distortion jump point matrix; processing multi-exposure tobacco leaf images using a Laplacian pyramid image fusion algorithm, decomposing each input image into Laplacian pyramids of different scales; designing fusion rules based on local contrast and gradient magnitude; reconstructing a high-quality fused image and extracting distortion continuous point vectors; calculating the correction error vector; and... The fused image is compared pixel-level with the original image to calculate the color difference value of each region. When the color difference value exceeds the error threshold, the error information at the corresponding position is recorded to construct a correction error vector. A correction correlation matrix is ​​established to analyze the spatial relationship and numerical correlation between the vectors of distortion segmentation points, distortion jump points, and distortion continuous points, and the correlation coefficient between each point is calculated to form a correction correlation matrix. The correction parameters are dynamically adjusted according to the correction error vector and the correction correlation matrix. When the error value in the correction error vector exceeds the set error threshold, the intensity of the illumination homogenization processing is increased. When the correlation coefficient in the correction correlation matrix is ​​lower than the standard correlation value, the weight parameters of the fusion algorithm are reduced. The correction accuracy vector is calculated, and the corrected image is compared with a standard tobacco leaf image to calculate the color uniformity index. When the accuracy value in the correction accuracy vector reaches the accuracy range, the correction process is completed; otherwise, the correction is repeated.

[0005] Specifically, the distortion segmentation point detection step refers to the pixel location in the image of roasted tobacco leaves where the color changes abruptly due to uneven lighting or imaging distortion. The distortion segmentation point is determined by calculating the points in the image gradient field where the gradient amplitude exceeds a preset lighting threshold. The lighting threshold is calculated by the marker variable mark and obtained by summing the absolute values ​​of the differences between the red, green, and blue components of the real-time captured image and the background image and dividing by 3 times the product of the image length and width.

[0006] Specifically, the step of constructing the distortion jump point matrix involves a two-dimensional array structure that records significant jumps in grayscale values ​​between adjacent pixels. A value of 1 in the matrix element indicates the presence of a distortion jump point at that location, while a value of 0 indicates normal operation. The grayscale value of each pixel is calculated by averaging the red, green, and blue components using a grayscale processing formula, and then jump detection is performed.

[0007] Specifically, the Laplacian pyramid image fusion algorithm involves the following steps: the distortion continuous point vector is a one-dimensional array describing the continuous distribution characteristics of the distortion region in the image; continuous distortion feature points at different scales are extracted using the Laplacian pyramid image fusion algorithm to form a vector that characterizes the spatial continuity of the distortion; each input image is decomposed into a Laplacian pyramid structure at different scales; and feature extraction and fusion processing are performed at each level based on local contrast and gradient magnitude.

[0008] Specifically, the step of calculating the correction error vector involves using a one-dimensional array structure to quantify the differences between the images before and after correction. This array is constructed by calculating the color difference values ​​at each pixel position between the original image and the corrected image. The color difference calculation uses a binary segmentation method to divide the region. When the pixel gray value is greater than the optimal segmentation threshold, it is marked as 1; when the pixel gray value is less than or equal to the optimal segmentation threshold, it is marked as 0. The optimal segmentation threshold is obtained by maximizing the inter-class variance.

[0009] Specifically, the step of establishing the correction correlation matrix involves the correction correlation matrix being a square matrix that describes the spatial relationship and numerical correlation between various distortion point types. The matrix element values ​​represent the correlation strength between corresponding distortion types, and the correlation is quantified by calculating the inter-class variance.

[0010] Specifically, the step of dynamically adjusting the correction parameters involves adaptively adjusting the processing parameters based on the calculation results of the correction error vector and the correction correlation matrix. When the error value detected in the correction error vector exceeds the preset error threshold, the processing intensity of the illumination homogenization algorithm is automatically increased. When the correlation coefficient in the correction correlation matrix is ​​lower than the standard correlation threshold, the weight parameter setting of the Laplacian pyramid image fusion algorithm is reduced.

[0011] Specifically, the step of calculating the correction accuracy vector involves the correction accuracy vector being an array of indicators for evaluating the distortion correction effect, including multiple dimensions such as color uniformity, texture fidelity, and overall quality score. The color uniformity calculation uses a tobacco leaf image after removing the background, performs normalization processing on the tobacco leaf image after removing the background, and calculates the color uniformity index by statistically analyzing the pixel distribution characteristics of the tobacco leaf area.

[0012] Specifically, the accuracy range judgment criterion is that when the accuracy value in the correction accuracy vector reaches the range of 85% to 100%, the correction process is considered complete. When the accuracy value does not reach the range, the correction error vector calculation step is returned to perform iterative correction again until the accuracy index meets the preset requirements, thus forming a closed-loop correction optimization processing mechanism.

[0013] It also includes a conveyor belt optimal speed calculation function, which is used to dynamically optimize the conveyor belt speed based on the image correction effect and the conveyor belt operating parameters. The input includes the correction accuracy vector, the correction error vector, the correction correlation matrix and the current initial speed of the conveyor belt, and the output is the optimal speed of the conveyor belt. The image acquisition quality is optimized by analyzing the correlation between image quality and conveyor belt speed.

[0014] Specifically, the color uniformity calculation index is as follows: the average pixel value of the tobacco leaf area is obtained by summing all pixel values ​​in the tobacco leaf area and dividing by the area of ​​the tobacco leaf area; the standard deviation of the tobacco leaf area is obtained by taking the square root of the sum of the squares of the differences between the pixel values ​​and the mean and then dividing by the area of ​​the tobacco leaf area; the number of pixels within an interval is obtained by counting the number of pixels that meet the range of mean minus 3 times the standard deviation to mean plus 3 times the standard deviation; and color uniformity is defined as the ratio of the number of pixels within an interval to the total area of ​​the tobacco leaf area.

[0015] Optionally, the tobacco leaf image acquisition device mainly includes a conveyor belt, a camera, a light source, a shaded shed, and a processor. The conveyor belt is used to carry and transport the cured tobacco leaves. The camera is set above the conveyor belt to capture real-time images of the tobacco leaves. The light source provides stable lighting conditions for the camera. The shaded shed is used to shield the camera from external light interference. The processor processes and analyzes the acquired images.

[0016] Specifically, the illumination homogenization algorithm based on the Poisson equation establishes a mathematical model of the Poisson equation by calculating the distribution characteristics of the image gradient field, and uses the finite difference method to numerically solve the Poisson equation to obtain an ideal homogenized illumination distribution result. Under the premise of keeping the image gradient information unchanged, the influence of illumination changes on image quality is eliminated, and an image effect that meets the conditions of uniform illumination is reconstructed.

[0017] Specifically, the multi-exposure tobacco leaf image processing involves acquiring multiple images of the same tobacco leaf sample using different exposure parameters, converting each input image into a multi-scale frequency domain representation through Laplacian pyramid decomposition, designing corresponding fusion weight rules at each scale level based on local contrast and gradient magnitude features, and reconstructing a high-quality fused image containing rich detail information.

[0018] Specifically, the pixel-level comparison analysis involves comparing the fused image after correction with the original input image at each pixel position, calculating the color difference value of the corresponding pixel, statistically analyzing the color difference distribution in each image region, and recording the specific error information of the pixel position when the color difference value exceeds a preset error threshold, thereby constructing a complete correction error vector data structure.

[0019] Specifically, the spatial relationship and numerical correlation analysis involves calculating the spatial distance and numerical similarity relationships between three different distortion feature types—distortion segmentation points, distortion jump points, and distortion continuous point vectors—to establish a mathematical correlation model describing the degree of mutual influence between each distortion type. This model also calculates the correlation coefficients between distortion points at different locations, forming a complete correction correlation matrix to guide subsequent correction parameter adjustments.

[0020] This invention establishes an illumination homogenization mechanism based on the Poisson equation, which can effectively identify and compensate for illumination changes caused by unevenness on the tobacco leaf surface. By calculating the image gradient field and solving the Poisson equation, an ideal uniform illumination distribution is obtained, thereby eliminating the impact of shadows and reflections on image quality. This invention employs a multi-layered distortion detection system, including distortion segmentation point detection to identify regions of abrupt illumination changes, distortion jump point matrix construction to mark grayscale jump positions, and distortion continuous point vector extraction to describe continuous distortion features. This layered processing strategy can accurately locate various optical distortions caused by unevenness on the tobacco leaf surface, providing accurate data support for targeted correction. Simultaneously, it combines a Laplacian pyramid image fusion algorithm to achieve multi-scale image reconstruction, handling large-scale illumination changes while preserving detailed features. This invention constructs a dynamic correction parameter adjustment mechanism, including correction error vector calculation and correction correlation matrix analysis, which can adaptively adjust the processing parameters according to the surface morphology characteristics of different tobacco leaf samples. This ensures that high-quality correction results can be obtained when facing various degrees of surface unevenness. It solves the technical problem in the prior art that uneven tobacco leaves cause shadows and reflections during image acquisition, affecting image quality and the accuracy of subsequent analysis. Attached Figure Description

[0021] Figure 1 This is a flowchart of the method of the present invention.

[0022] Figure 2 This is a schematic diagram of the tobacco leaf image acquisition device in Example 2.

[0023] Figure 3 This is a spatial distribution diagram of the distortion jump points in Example 2.

[0024] Figure 4 This is a graph showing the optimized conveyor belt speed in Example 2.

[0025] Figure 5 This is a statistical graph showing the distribution of the correction error vector in Example 2.

[0026] Figure 6 This is a graph showing the quality score of the multi-scale Laplace pyramid reconstruction in Example 2.

[0027] Figure 7This is a diagram of the weighting coefficients for the multi-scale Laplace pyramid reconstruction in Example 2. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0029] like Figure 1 The diagram shown is a flowchart of a method for image distortion correction and enhancement of roasted tobacco leaves provided by the present invention. This method includes the following steps:

[0030] S01. Detect distortion segmentation points in the acquired images of roasted tobacco leaves. Calculate the image gradient field using a light homogenization algorithm based on the Poisson equation. Obtain the homogenized light distribution by solving the Poisson equation using the finite difference method. Identify regions where the light variation exceeds the light threshold and mark them as distortion segmentation points.

[0031] S02. Construct a distortion jump point matrix based on distortion segmentation points, perform statistical analysis on the gray-level difference between adjacent distortion segmentation points, and mark the point as a distortion jump point when the gray-level difference exceeds the jump threshold, forming a distortion jump point matrix for subsequent correction processing.

[0032] S03. The multi-exposure tobacco leaf images are processed by the Laplacian pyramid image fusion algorithm. Each input image is decomposed into a Laplacian pyramid of different scales. The fusion rules are designed based on local contrast and gradient magnitude. A high-quality fused image is reconstructed and the distortion continuous point vector is extracted.

[0033] S04. Calculate the correction error vector. Compare the fused image with the original image at the pixel level, count the color difference value of each region, and record the error information at the corresponding position when the color difference value exceeds the error threshold. Construct the correction error vector to evaluate the correction effect.

[0034] S05. Establish a correction correlation matrix, analyze the spatial relationship and numerical correlation between the vectors of distortion segmentation points, distortion jump points and distortion continuity points, calculate the correlation coefficient between each point, and form a correction correlation matrix to guide the subsequent adjustment of correction parameters.

[0035] S06. Dynamically adjust the correction parameters based on the correction error vector and the correction correlation matrix. When the error value in the correction error vector exceeds the set error threshold, increase the intensity of the illumination homogenization process. When the correlation coefficient in the correction correlation matrix is ​​lower than the standard correlation value, reduce the weight parameters of the fusion algorithm.

[0036] S07. Calculate the correction accuracy vector, compare and analyze the corrected image with the standard tobacco leaf image, and statistically analyze the color uniformity index. When the accuracy value in the correction accuracy vector reaches the accuracy range [85%, 100%], the correction process is completed; otherwise, return to step S04 to perform correction again.

[0037] Here, the distortion segmentation point refers to the pixel location in the image of cured tobacco leaves where color abruptly occurs due to uneven illumination or imaging distortion. It is determined by calculating points in the image gradient field where the gradient magnitude exceeds a preset illumination threshold. The illumination threshold is calculated using the marker variable `mark`, and its mathematical expression is: ,in To capture images in real time, The background image is defined by M and N, representing the length and width of the image, respectively. The distortion jump point matrix is ​​a two-dimensional array structure that records significant jumps in grayscale values ​​between adjacent pixels. A value of 1 indicates a distortion jump point at that location, while a value of 0 indicates normal values. This is determined using the grayscale processing formula. After calculating the grayscale value of each pixel, jump detection is performed. , and In the image respectively The pixel values ​​of the red, green, and blue components at the location.

[0038] The distortion continuity vector is a one-dimensional array describing the continuous distribution characteristics of distorted regions in an image. It is formed by extracting continuous distortion feature points at different scales using the Laplacian pyramid image fusion algorithm, and is used to characterize the spatial continuity of distortion. The correction error vector is a one-dimensional array structure used to quantify the differences between the images before and after correction. It is constructed by calculating the color difference values ​​at each pixel position between the original and corrected images. The color difference calculation uses a binary segmentation formula to divide the region; when the pixel grayscale value is greater than the optimal segmentation threshold... hour, When the pixel grayscale value is less than or equal to the optimal segmentation threshold hour, The optimal segmentation threshold It is obtained by maximizing the inter-class variance.

[0039] The corrected correlation matrix is ​​a square matrix describing the spatial relationships and numerical correlations between various distortion point types. Matrix element values ​​represent the correlation strength between corresponding distortion types, quantified by calculating the inter-class variance. The formula for calculating the inter-class variance is as follows: ,in Let be the probability that a pixel is classified as class A. Let be the probability that a pixel is classified as class B. The mean value of pixels of class A. This represents the mean value of pixels in class B. The correction accuracy vector is an array of metrics used to evaluate the distortion correction effect, including multiple dimensions such as color uniformity, texture fidelity, and overall quality score. Color uniformity is calculated using the tobacco leaf image after removing the background. For the tobacco leaf image after background removal Normalization process is performed to obtain .

[0040] The average pixel value of the tobacco leaf area The calculation formula is: ,in The area of ​​the tobacco leaf region, and the standard deviation of the tobacco leaf region. The calculation formula is: , interval number of pixels The calculation formula is ,in Color uniformity is defined as .

[0041] It also includes a function for calculating the optimal speed of the conveyor belt, which is used to dynamically optimize the speed of the conveyor belt based on the image correction effect and the operating parameters of the conveyor belt to improve the quality of tobacco leaf image acquisition. The inputs include the correction accuracy vector, the correction error vector, the correction correlation matrix and the current initial speed of the conveyor belt, and the output is the optimal speed of the conveyor belt.

[0042] The tobacco leaf image acquisition device mainly includes a conveyor belt, a camera, a light source, a shaded area, and a processor. The conveyor belt is used to carry and transport the cured tobacco leaves. The camera is set above the conveyor belt to capture real-time images of the tobacco leaves. The light source provides stable lighting conditions for the camera. The shaded area is used to shield the camera from external light interference. The processor processes and analyzes the acquired images.

[0043] The specific implementation methods of the above steps are described in detail below.

[0044] The specific implementation of step S01 involves using a Poisson equation-based illumination homogenization algorithm to detect distortion segmentation points in the acquired images of cured tobacco leaves. First, real-time images of the cured tobacco leaves and a background image are acquired using a camera. The images are preprocessed using a labeled variable calculation method. This method calculates the sum of the absolute values ​​of the differences between the real-time captured image and the background image, then divides this sum by three times the product of the image's length and width to obtain the illumination threshold. The reference value for the illumination threshold is typically set between 0.15 and 0.25. Next, the Poisson equation-based illumination homogenization algorithm is applied to calculate the gradient field of the image. This algorithm constructs the Poisson equation using the image gradient information and solves it numerically using the finite difference method to obtain the homogenized illumination distribution result. The role of the finite difference method in this step is to discretize the continuous Poisson partial differential equation into a system of linear equations, thereby enabling the numerical calculation of the illumination distribution. Finally, by comparing the amplitude of illumination change before and after homogenization, regions where the illumination change exceeds the preset illumination threshold are identified and these locations are marked as distortion segmentation points. This process can effectively identify the locations of color abrupt changes caused by uneven illumination or imaging distortion.

[0045] The specific implementation of step S02 involves constructing a distortion jump point matrix based on the detected distortion segmentation points. First, the input color tobacco image is converted to grayscale using an RGB three-channel pixel value averaging method. This method calculates the average of the red, green, and blue components at each pixel location to obtain the corresponding grayscale value. Then, the grayscale differences between adjacent pixels are statistically analyzed. By calculating the grayscale differences between adjacent pixels in the horizontal and vertical directions, when the grayscale difference exceeds a preset jump threshold, the location is marked as a distortion jump point. The reference value for the jump threshold is typically set between 20 and 35. Finally, a two-dimensional distortion jump point matrix is ​​formed. In the matrix, an element value of 1 indicates the presence of a distortion jump point, and an element value of 0 indicates a normal pixel. This matrix provides spatial positioning information for subsequent correction processing.

[0046] The specific implementation of step S03 involves processing multi-exposure tobacco leaf images and extracting distortion continuous point vectors using a Laplacian pyramid image fusion algorithm. First, multiple tobacco leaf images taken under different exposure parameters are used as input. A Gaussian filter is used to decompose each input image at multiple scales, constructing a Gaussian pyramid structure. The number of layers in the Gaussian pyramid is typically set to 4 to 6. Next, the Laplacian pyramid is calculated by subtracting images from adjacent layers. The Laplacian pyramid can preserve the detailed information of the image at different scales. Then, a fusion rule is designed based on local contrast and gradient magnitude, and each layer of the Laplacian pyramid is weighted and fused. The fusion weights are dynamically determined based on the local contrast and gradient magnitude of each pixel position. The reference range for contrast weights is 0.3 to 0.7, and the reference range for gradient weights is 0.2 to 0.5. Finally, a high-quality fused image is obtained through the Laplacian pyramid reconstruction process. Simultaneously, continuous distortion feature points at different scales are extracted during the fusion process, forming a one-dimensional distortion continuous point vector describing the continuous distribution characteristics of the distortion region in the image.

[0047] The specific implementation of step S04 involves calculating a correction error vector to evaluate the image correction effect. First, the fused image obtained in step S03 is compared with the original input image at the pixel level. The color difference between the two images is calculated pixel-by-pixel to quantify the image difference before and after correction. Color difference calculation uses a binarization segmentation method to divide the region. The optimal segmentation threshold is determined using the inter-class variance maximization criterion. This method finds the optimal segmentation point by calculating the inter-class variance of foreground and background pixels. The reference value for the optimal segmentation threshold is typically between 120 and 140. When a pixel's grayscale value is greater than the optimal segmentation threshold, the pixel is marked as a foreground region; when the pixel's grayscale value is less than or equal to the optimal segmentation threshold, the pixel is marked as a background region. Then, the color difference values ​​of each region are statistically analyzed. When the color difference value of a certain region exceeds a preset error threshold, the error information at that location is recorded. The reference value for the error threshold is typically set between 15 and 25. Finally, a one-dimensional correction error vector is constructed. This vector is used to quantify the effect of the correction processing and provide a basis for subsequent parameter adjustments.

[0048] The specific implementation of step S05 involves establishing a correction correlation matrix to describe the relationships between various distortion point types. First, the spatial relationships between the distortion segmentation points detected in step S01, the distortion jump points constructed in step S02, and the distortion continuous point vectors extracted in step S03 are analyzed. The degree of inter-correlation is determined by calculating the spatial distribution characteristics of different distortion point types. Then, the numerical correlation between various distortion point types is quantitatively analyzed using the inter-class variance calculation method. This method divides different types of distortion points into two classes, calculates the probability distribution and mean difference between the two classes of pixels, and then obtains the inter-class variance value as a measure of correlation strength. The calculation of inter-class variance considers the probability of pixels being classified into different categories and the difference in the mean values ​​of pixels in each category, effectively reflecting the degree of correlation between different distortion types. Finally, a square matrix correction correlation matrix is ​​formed, where the matrix element values ​​represent the correlation strength between corresponding distortion types. The reference range for the correlation coefficient is typically between 0.6 and 0.9. This matrix provides guidance for subsequent adjustment of correction parameters.

[0049] The specific implementation of step S06 involves dynamically adjusting the correction parameters based on the correction error vector and the correction correlation matrix to optimize the correction effect. First, the error value in the correction error vector calculated in step S04 is read. When the error value exceeds a set error threshold, the intensity of the illumination homogenization process is automatically increased. The adjustment range of the illumination homogenization intensity is typically set to 10% to 20% of the current value. This increase in intensity is achieved by modifying the convergence conditions and iteration count in the Poisson equation solution process, thereby improving the uniformity of the illumination distribution. Simultaneously, the correlation coefficient in the correction correlation matrix established in step S05 is read. When the correlation coefficient is lower than the standard correlation value, the weight parameters of the Laplacian pyramid fusion algorithm are automatically reduced. The reference setting for the standard correlation value is between 0.7 and 0.8. The reduction of the fusion algorithm weight parameters is achieved by decreasing the local contrast weight and gradient magnitude weight, with the weight adjustment range typically between 5% and 15% of the current value. This dynamic adjustment mechanism can adaptively optimize the processing parameters according to the actual correction effect, improving the accuracy and stability of distortion correction.

[0050] The specific implementation of step S07 involves calculating a correction accuracy vector to evaluate the final distortion correction effect. First, the corrected tobacco leaf image is compared and analyzed with a standard tobacco leaf image. The correction accuracy vector is constructed by calculating multiple dimensions of indicators, including color uniformity, texture fidelity, and overall quality score. Color uniformity is calculated using a tobacco leaf image processing method after background removal. Image data of the pure tobacco leaf region is obtained by multiplying a binarized mask with a grayscale image. Then, the image is normalized to adjust the pixel value range to between 0 and 1. Next, the mean and standard deviation of the pixels in the tobacco leaf region are calculated. The average grayscale value is obtained by statistically analyzing the mean of all pixel values ​​within the tobacco leaf region, and the standard deviation is obtained by taking the square root of the sum of the squares of the differences between the pixel values ​​and the mean. Then, the number of pixels falling within the range of the mean plus or minus three times the standard deviation is counted. This range typically covers 99.7% of the normal pixel distribution. Finally, the color uniformity index is defined by the ratio of the number of pixels in the interval to the total number of pixels in the tobacco leaf area. When the accuracy value in the correction accuracy vector reaches the range of 85% to 100%, it means that the correction process has achieved the expected effect and the correction process can be completed. Otherwise, it is necessary to return to step S04 to repeat the correction process until the accuracy requirements are met.

[0051] The specific implementation of the optimal conveyor belt speed calculation function involves dynamically optimizing the conveyor belt speed based on the image correction effect and the conveyor belt operating parameters. This function takes the correction accuracy vector, correction error vector, correction correlation matrix, and the current initial conveyor belt speed as input parameters, and determines the optimal conveyor belt speed by analyzing the correlation between these parameters. When the correction accuracy is high and the correction error is small, the conveyor belt speed can be appropriately increased to improve processing efficiency; the speed increase is typically 5% to 10% of the current speed. When the correction effect is unsatisfactory, the conveyor belt speed needs to be reduced to obtain more stable image acquisition conditions; the speed reduction is typically 10% to 20% of the current speed. The optimal conveyor belt speed output by this function maximizes tobacco leaf processing efficiency while ensuring image quality.

[0052] It should be noted that the key technical ideas of this invention are mainly reflected in three aspects: multi-level distortion detection mechanism, adaptive parameter adjustment strategy, and multi-scale image fusion processing. These technical ideas work together to form a complete tobacco leaf image distortion correction and enhancement system.

[0053] A multi-level distortion detection mechanism detects three different types of feature points: distortion segmentation points, distortion jump points, and distortion continuity points, achieving comprehensive identification and precise localization of image distortions. This mechanism offers significant technical advantages over traditional single-threshold detection methods, simultaneously capturing gradual distortions caused by uneven illumination and abrupt distortions caused by imaging equipment, effectively solving the problem of low detection accuracy in complex lighting environments using traditional methods. By calculating the image gradient field using an illumination homogenization algorithm based on the Poisson equation, this mechanism can accurately identify subtle illumination changes, exhibiting stronger local adaptability and higher detection accuracy compared to traditional histogram equalization methods.

[0054] The adaptive parameter adjustment strategy achieves dynamic optimization and intelligent adjustment of correction parameters through a feedback mechanism of the correction error vector and the correction correlation matrix. This strategy has significant technical advantages over traditional correction methods with fixed parameters, automatically adjusting the illumination homogenization intensity and fusion algorithm weights based on the actual correction effect, avoiding the subjectivity and limitations of manual parameter setting. By establishing a correlation matrix between distortion point types, this strategy can accurately analyze the spatial relationships and numerical correlations of different distortion types, providing a scientific basis for parameter adjustment and significantly improving the stability and reliability of the correction process.

[0055] Multi-scale image fusion processing technology employs the Laplacian pyramid algorithm to fuse multi-exposure tobacco leaf images, achieving effective preservation of image detail and significant quality improvement. This technology offers significant advantages over traditional single-image processing methods, fully utilizing the complementary information of images under different exposure conditions and effectively solving the problem of detail loss in highlight and shadow areas of single-exposure images. Through fusion rule design based on local contrast and gradient magnitude, this technology adaptively determines the fusion weights for different regions, resulting in better visual effects and higher information fidelity compared to traditional mean fusion or weighted averaging methods.

[0056] The synergistic effect of these three key technological approaches creates a powerful technical advantage, achieving a complete closed-loop control from distortion detection to parameter optimization and image fusion. Multi-level distortion detection provides accurate feature information for adaptive parameter adjustment, adaptive parameter adjustment provides optimized processing parameters for multi-scale image fusion, and the results of multi-scale image fusion provide quality feedback for distortion detection and parameter adjustment. This synergistic mechanism has significant systemic advantages over traditional independent processing methods, achieving globally optimal correction results, greatly improving the quality and processing efficiency of cured tobacco leaf images, and providing reliable technical support for tobacco quality inspection and grading.

[0057] This invention also addresses the technical problem of traditional tobacco leaf image processing systems lacking adaptability to complex three-dimensional surface morphologies. In existing industrial tobacco leaf inspection equipment, most systems are designed based on planar imaging theory, assuming the inspected object has a relatively flat surface. Therefore, the light source configuration, camera parameter settings, and image processing algorithm design are all optimized for two-dimensional planar features. This design philosophy exhibits significant limitations when dealing with the complex three-dimensional surface morphologies of cured tobacco leaves. This invention establishes a multi-layered spatial feature perception mechanism, including three-dimensional coordinate mapping of distortion segmentation points, spatial correlation analysis of distortion jump point matrices, and morphological description of distortion continuous point vectors. This enables accurate perception and quantification of the three-dimensional geometric features of the tobacco leaf surface. Furthermore, by establishing a mathematical correlation model between distortion features at different spatial locations through a correction correlation matrix, this three-dimensional perception capability allows the system to adjust its processing strategy according to specific surface morphology features, significantly improving its adaptability to processing tobacco leaves with irregular surfaces.

[0058] Furthermore, this invention addresses the technical challenge of coordinating and optimizing optical information fidelity and processing efficiency in image fusion processing under multi-illumination conditions. Traditional image fusion techniques often face a trade-off between preserving optical details and improving processing speed, especially when dealing with complex illumination distributions caused by surface irregularities. Simple fusion algorithms can easily lead to the loss of important optical features, while complex fusion algorithms significantly increase the computational burden. This invention employs a Laplacian pyramid decomposition structure, breaking down the complex illumination correction task into multiple scale-level sub-tasks. At each scale, a targeted fusion strategy is adopted: the coarse scale primarily handles large-scale illumination variations, while the fine scale focuses on preserving local texture features. This hierarchical processing strategy ensures the integrity of optical information and significantly improves algorithm efficiency through parallel processing. Combined with a dynamic parameter adjustment mechanism, computational resources can be adaptively allocated according to the complexity of different images, maximizing computational efficiency while ensuring processing quality.

[0059] Specifically, the principle of this invention is as follows: The technical principle behind this invention's ability to solve image quality problems caused by uneven tobacco leaf surfaces lies in establishing a complete theoretical system for optical distortion recognition and correction. This system, starting from the physical mechanisms of light propagation and surface reflection, achieves accurate description and effective processing of image distortion under complex lighting conditions through mathematical modeling. First, addressing the shadow problem caused by uneven tobacco leaf surfaces, this invention employs a lighting homogenization algorithm based on the Poisson equation. By analyzing the distribution characteristics of the image gradient field, an ideal lighting model is reconstructed. The Poisson equation can effectively eliminate the uneven lighting phenomenon caused by surface undulations while maintaining the image edge and texture information. The core advantage of this method is its ability to distinguish between real tobacco leaf feature changes and false features caused by lighting changes, avoiding the image information loss that may be caused by traditional global brightness adjustment methods. Secondly, this invention constructs a three-tiered distortion feature description system, which can comprehensively capture different types of optical effects caused by unevenness on the tobacco leaf surface. Distortion segmentation point detection marks areas with drastic changes in illumination, the distortion jump point matrix is ​​used to identify gray-level abrupt changes between adjacent areas, and the distortion continuous point vector describes the spatial distribution characteristics of large-area shadows or reflective areas. This multi-dimensional feature extraction strategy ensures comprehensive perception of various surface morphological changes. Thirdly, the application of the Laplacian pyramid image fusion algorithm solves the problem of collaborative processing of multi-scale optical distortion. By decomposing the image into different resolution levels, it can handle large-scale illumination changes at the coarse scale and preserve local texture details at the fine scale. Then, reconstruction is performed based on fusion rules of local contrast and gradient magnitude. This layered processing mechanism can effectively eliminate macroscopic illumination changes caused by undulations on the tobacco leaf surface while maintaining the integrity of the microscopic texture features of the tobacco leaf surface. Finally, the dynamic parameter adjustment mechanism established in this invention can adaptively adjust the illumination homogenization intensity and fusion algorithm weights according to the surface characteristics of specific tobacco leaf samples by real-time calculation of the correction error vector and correction correlation matrix. This adaptive capability ensures that the algorithm can maintain a stable correction effect when facing tobacco leaves with different degrees of surface unevenness, thereby achieving accurate correction of various optical distortions caused by changes in the surface morphology of tobacco leaves and a significant improvement in image quality.

[0060] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0061] The specific implementation of step S01 involves detecting distortion segmentation points in the acquired image of cured tobacco leaves. This step employs an illumination homogenization algorithm based on the Poisson equation. First, the illumination threshold is calculated, specifically as follows:

[0062] ;

[0063] In the formula, The illumination threshold; The pixel values ​​of the real-time captured image; These are the pixel values ​​of the background image; Image height; Let be the image width. Next, the Poisson equation is applied for illumination homogenization. The discrete form of the Poisson equation is as follows:

[0064] ;

[0065] In the formula, The grayscale values ​​of the image after homogenization; Let be the gradient divergence function; For the Laplace operator; Let be the pixel coordinates. The discretized expression of this equation obtained by the finite difference method is:

[0066] ;

[0067] In the formula, The grid spacing is typically set to 1. The distortion segmentation point detection conditions are as follows:

[0068] ;

[0069] In the formula, These are the pixel values ​​after homogenization. These are the pixel values ​​of the original image.

[0070] The specific implementation of step S02 is to construct a distortion jump point matrix based on distortion segmentation points. First, grayscale processing is performed, specifically as follows:

[0071] ;

[0072] In the formula, For position The grayscale value at that location; The pixel value is the red component. The pixel value is for the green component. This represents the pixel value of the blue component. The judgment criterion for the distortion jump point detection algorithm is:

[0073] ;

[0074] In the formula, This is the jump threshold, typically ranging from 20 to 35. Distortion jump point matrix. The construct expression is:

[0075] ;

[0076] In the formula, These are elements of the jump point matrix, where 1 indicates the presence of a distorted jump point and 0 indicates a normal pixel.

[0077] The specific implementation of step S03 involves processing multi-exposure tobacco leaf images using a Laplacian pyramid image fusion algorithm. The formula for constructing the Gaussian pyramid is:

[0078] ;

[0079] In the formula, For the first Image of the Gaussian pyramid in location Pixel values; These are the Gaussian kernel weight coefficients; It is a pyramid hierarchy; and This represents the offset of the Gaussian kernel, with values ​​ranging from -2 to 2. The formula for calculating the Laplace pyramid is:

[0080] ;

[0081] In the formula, For the first The Pyramid of Laplace in its location Pixel values; This is the upsampling expansion function. The formula for calculating the fusion weights is:

[0082] ;

[0083] In the formula, For the first Layer in position The fusion weight; Contrast weight; Saturation weight; Exposure weight; , , These are weighting coefficients, typically ranging from 0.3 to 0.7, 0.2 to 0.5, and 0.1 to 0.3. Distorted continuous point vector. The expression is:

[0084] ;

[0085] In the formula, Indicates the first Eigenvalues ​​of a series of distorted feature points; This represents the total number of continuous distortion feature points.

[0086] The specific implementation of step S04 involves calculating the correction error vector. Optimal segmentation threshold. This is obtained by maximizing the inter-class variance:

[0087] ;

[0088] In the formula, For inter-class variance; The probability that a pixel is classified as class A; The probability that a pixel is classified as class B; For grayscale values ​​less than or equal to The number of pixels; For grayscale values ​​greater than The number of pixels; This represents the total number of pixels in the image. The mean value of pixels of class A; The mean value of class B pixels; grayscale value The number of pixels; This is a grayscale value, ranging from 0 to 255. Let be the segmentation threshold. The expression for binarized segmentation is:

[0089] ;

[0090] In the formula, This is the binarized result. Correction error vector. The calculation formula is:

[0091] ;

[0092] In the formula, Indicates the first Color difference values ​​for each area; To correct the image in position Pixel values; For the original image at position Pixel values; For area code; This represents the total number of regions.

[0093] The specific implementation of step S05 is to establish a corrected correlation matrix. The correlation matrix... The expression is:

[0094] ;

[0095] In the formula, Indicates the first Type of distortion and the first Correlation coefficients between different types of aberrations; and These are the distortion type numbers, with values ​​of 1, 2, and 3, corresponding to the distortion breakpoint, distortion jump point, and distortion continuity point, respectively. The correlation coefficient is calculated based on the inter-class variance.

[0096] ;

[0097] In the formula, For the first Class and First Covariance between classes; and The first Class and First The variance of the class.

[0098] The specific implementation method of step S06 is the same as described above, and will not be repeated in detail here.

[0099] The specific implementation of step S07 involves calculating the correction accuracy vector. The formula for calculating the tobacco leaf image after background removal is as follows:

[0100] ;

[0101] In the formula, The image of tobacco leaves after removing the background; For binary masking; The image is grayscale. The normalization formula is:

[0102] ;

[0103] In the formula, The image is after normalization; The pixel value of the tobacco leaf area, i.e. The formula for calculating the average pixel value in the tobacco leaf area is:

[0104] ;

[0105] In the formula, This represents the average pixel value of the tobacco leaf area. Let be the area of ​​the tobacco leaf region. The formula for calculating the standard deviation of the tobacco leaf region is:

[0106] ;

[0107] In the formula, This represents the standard deviation of the tobacco leaf area. The number of pixels within the interval. The complete calculation formula is:

[0108] ;

[0109] In the formula, This is an indicator function that takes a value of 1 when the condition is met and 0 otherwise. The formula for defining color uniformity is:

[0110] ;

[0111] In the formula, For color uniformity. Correction accuracy vector. The expression is:

[0112] ;

[0113] In the formula, For texture fidelity; Score the overall quality.

[0114] It should be added that the specific implementation of the conveyor belt optimal speed calculation function adopts a multi-parameter optimization model. Optimal conveyor belt speed The calculation formula is:

[0115] ;

[0116] In the formula, The initial speed of the conveyor belt; To correct the accuracy vector average; For accuracy threshold; To correct the average value of the error vector; This is the maximum permissible error; To correct the average value of the correlation matrix; and These are the minimum and maximum values ​​of the correlation coefficient, respectively. , , The adjustment coefficient is typically set in the range of 0.1–0.3, 0.2–0.4, or 0.05–0.15.

[0117] It should be noted that the illumination threshold calculation formula is based on the principle of image difference statistics. It adaptively determines the detection threshold for illumination changes by calculating the global difference between the real-time image and the background image.

[0118] ;

[0119] Compared to the fixed threshold method, this formula can be dynamically adjusted according to actual lighting conditions, which significantly improves the accuracy and adaptability of distortion detection and effectively solves the problem of inconsistent detection accuracy under different lighting environments.

[0120] The Poisson equation is based on the gradient field reconstruction principle and achieves uniform illumination distribution by solving the Laplacian operator of the image.

[0121] ;

[0122] This equation can smooth illumination changes while preserving image edge and texture information. Compared with traditional histogram equalization methods, it has better local adaptability and edge preservation ability, significantly improving the visual quality of tobacco leaf images.

[0123] The Laplacian pyramid fusion weight formula is based on the principle of multi-feature weighted fusion, which comprehensively considers the image quality indicators of three dimensions: contrast, saturation, and exposure.

[0124] ;

[0125] This formula achieves optimal fusion of images with different exposures through adaptive weight allocation. Compared with the simple average fusion method, it can better preserve image details and color information, and significantly improve the overall quality of the fused image.

[0126] The inter-class variance formula is based on the principle of statistical segmentation, which determines the optimal segmentation threshold by maximizing the inter-class difference between the foreground and the background.

[0127] ;

[0128] This formula can automatically find the optimal binarization segmentation point of an image. Compared with the fixed threshold segmentation method, it has stronger adaptability and higher segmentation accuracy, providing a reliable basis for subsequent error calculation and correlation analysis.

[0129] The color uniformity calculation formula is based on the principle of statistical distribution, quantifying the color consistency of an image by calculating the proportion of pixels falling within a normal distribution interval. The pixel count indicator function is:

[0130] ;

[0131] This formula uses a 3-standard-deviation criterion to cover 99.7% of normal pixel distribution. Compared with simple variance calculation methods, it can more accurately reflect the color uniformity of the image, providing an objective and reliable quantitative indicator for tobacco quality assessment.

[0132] The optimal speed calculation formula for the conveyor belt takes into account multiple factors such as image correction effect, processing error and system correlation through the principle of multi-parameter coupling optimization.

[0133] ;

[0134] This formula establishes a quantitative relationship between image quality and conveyor belt speed. Compared with the fixed speed control method, it can achieve dynamic optimization and adaptive adjustment, effectively improving the efficiency and stability of the entire tobacco leaf image processing system.

[0135] To better understand and implement this invention, a specific application scenario of the invention is provided below as an example 2: The technical team established a tobacco leaf image acquisition device in a tobacco processing workshop to solve the technical problem of image distortion affecting the detection accuracy during tobacco leaf quality inspection. The device mainly includes a conveyor belt with a length of 8000mm and a width of 1200mm, an industrial camera with a resolution of 4096×3072 pixels, a 150W LED light source array, and a processing unit equipped with an Intel i3 processor, such as... Figure 2 As shown.

[0136] During the system initialization phase, the technical team first detected distortion segmentation points in the acquired images of cured tobacco leaves. Using a lighting homogenization algorithm based on the Poisson equation, the image gradient field was calculated, and a lighting threshold of 0.15 was set. When the difference between the real-time captured image and the background image exceeded this threshold, the system automatically identified and marked it as a distortion segmentation point. In a set of tobacco leaf images containing 3000×2400 pixels, the system detected 347 distortion segmentation points, mainly distributed at the edges and veins of the tobacco leaves. By solving the Poisson equation using the finite difference method, the system obtained a homogenized lighting distribution, effectively eliminating the alternating light and dark phenomena caused by uneven light sources in the original image.

[0137] Based on the detected distortion segmentation points, the system constructed a 347×347 dimensional distortion jump point matrix. Statistical analysis was performed on the gray-level differences between adjacent distortion segmentation points, setting a jump threshold of 25. When the gray-level difference exceeded this threshold, the corresponding point was marked as a distortion jump point. After processing, the system identified 156 distortion jump points, setting the corresponding element value in the matrix to 1, and setting the rest to 0. Figure 3 As shown, the distortion jump points are mainly concentrated in areas where the tobacco leaf texture changes drastically, providing accurate positioning information for subsequent correction processing.

[0138] The system employs a Laplacian pyramid image fusion algorithm to process multi-exposure tobacco leaf images, acquiring five images with different exposure times: 1 / 250s, 1 / 125s, 1 / 60s, 1 / 30s, and 1 / 15s. Each input image is decomposed into four Laplacian pyramids of different scales. A fusion rule is designed based on local contrast and gradient magnitude, with a contrast weight of 0.6 and a gradient magnitude weight of 0.4. During the fusion process, the system reconstructs a high-quality fused image, improving the dynamic range by 68% compared to the original image. Simultaneously, a 2048-bit distortion continuity vector is extracted, which describes the continuous distribution characteristics of the distortion region in the tobacco leaf image.

[0139] To evaluate the correction effect, the system calculates a correction error vector and compares the fused image with the original image at the pixel level. By statistically analyzing the color difference values ​​of each region, the system found that 67% of the pixel regions had a color difference value less than 10, 23% had a color difference value between 10 and 20, and 10% had a color difference value exceeding 20. An error threshold of 15 was set. When a color difference value exceeded this threshold, the system recorded the error information at the corresponding location, constructing a correction error vector of length 1024. This vector contains 203 error values ​​exceeding the threshold, mainly distributed at the edges of tobacco leaves and in areas with complex textures.

[0140] As shown in Table 1, the system establishes a correction correlation matrix to analyze the spatial relationship and numerical correlation between distortion segmentation points, distortion jump points, and distortion continuity point vectors.

[0141] Table 1. Parameter Table for Corrected Correlation Matrix

[0142] By calculating the correlation coefficients between each point, the system forms a 3×3 dimension correction correlation matrix, which guides the dynamic adjustment of subsequent correction parameters.

[0143] During the parameter adjustment phase, the system dynamically adjusts the correction parameters based on the correction error vector and the correction correlation matrix. When the error value in the correction error vector exceeds the set error threshold of 15, the system automatically increases the intensity of the illumination homogenization process, raising it from the initial value of 1.2 to 1.8. When the correlation coefficient in the correction correlation matrix is ​​lower than the standard correlation value of 0.7, the system reduces the weight parameters of the fusion algorithm, adjusting the contrast weight from 0.6 to 0.45 and the gradient magnitude weight from 0.4 to 0.55. After three iterations of adjustment, the system correction parameters tend to stabilize.

[0144] As shown in Table 2, the system calculates the correction accuracy vector and compares and analyzes the corrected image with the standard tobacco leaf image.

[0145] Table 2. Results of Calibration Accuracy Evaluation

[0146] Statistical color uniformity indicators show that the color uniformity of the corrected image reaches 0.891, exceeding the set lower limit of accuracy (85%), indicating that the system has completed the correction process. During the color uniformity calculation, the normalized results of the tobacco leaf image after background removal show that the average pixel value in the tobacco leaf area is 0.647, the standard deviation is 0.083, and the number of pixels within this range accounts for 89.1% of the total tobacco leaf area.

[0147] like Figure 4As shown, the system also implements the function of calculating the optimal conveyor belt speed, dynamically optimizing the conveyor belt speed based on the image correction effect and conveyor belt operating parameters. Input parameters include the correction accuracy vector, correction error vector, correction correlation matrix, and the current initial conveyor belt speed of 2.5 m / s. After optimization calculation, the system outputs an optimal conveyor belt speed of 1.8 m / s. At this speed, the camera can obtain clearer tobacco leaf images, distortion is significantly reduced, and image quality is significantly improved. Figures 5-7 The figure shown is a statistical diagram of the distribution of the correction error vector, a diagram of the reconstruction quality score of the multi-scale Laplace pyramid, and a diagram of the reconstruction weight coefficients in this embodiment.

[0148] The main advancements of this invention compared to traditional methods are reflected in several technical aspects. First, the illumination homogenization algorithm based on the Poisson equation fundamentally solves the limitation of traditional methods that only handle illumination unevenness through simple filtering. By solving partial differential equations, it obtains the optimal illumination distribution, achieving more accurate illumination correction. Second, the introduction of the distortion jump point matrix breaks through the bottleneck of traditional methods that rely solely on single feature point detection. By constructing a two-dimensional matrix structure, it systematically records and analyzes the gray-level jump phenomenon between adjacent pixels, providing more comprehensive and accurate information for distortion detection. Third, the application of the Laplacian pyramid image fusion algorithm changes the traditional approach to single image processing. Through multi-scale decomposition and reconstruction, it achieves the organic fusion of image information under different exposure conditions, significantly improving the dynamic range and detail representation of the image. Fourth, the establishment of the correction correlation matrix innovatively introduces the concept of correlation analysis between different distortion features. By quantifying the spatial relationships and numerical correlations between various distortion point types, it provides a scientific basis for dynamic parameter adjustment, realizing a shift from experience-driven to data-driven approaches. Fifth, the closed-loop feedback mechanism ensures the adaptability and robustness of the calibration process. By monitoring the calibration effect in real time and dynamically adjusting the parameters, it solves the problem of insufficient adaptability of traditional fixed-parameter methods when facing complex and changing environments.

[0149] It should be noted that the variables involved in this invention are explained in detail in Tables 3 and 4.

[0150] Table 3. Variable Explanation Table (Part 1)

[0151] Table 4. Variable Explanation Table (Part Two)

[0152] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for image distortion correction and enhancement of roasted tobacco leaves, characterized in that, The process includes: detecting distortion segmentation points in acquired images of roasted tobacco leaves; calculating the image gradient field using a Poisson-based illumination homogenization algorithm; obtaining a homogenized illumination distribution by solving the Poisson equation using the finite difference method; identifying regions where illumination changes exceed an illumination threshold and marking them as distortion segmentation points; constructing a distortion jump point matrix based on these segmentation points; statistically analyzing the gray-level differences between adjacent distortion segmentation points; marking points as distortion jump points when the gray-level difference exceeds a jump threshold; processing multi-exposure tobacco leaf images using a Laplacian pyramid image fusion algorithm; decomposing each input image into Laplacian pyramids of different scales; designing fusion rules based on local contrast and gradient magnitude; reconstructing a high-quality fused image and extracting distortion continuous point vectors; calculating a correction error vector; comparing the fused image with the original image at the pixel level; statistically analyzing the color difference values ​​of each region; recording the error information at the corresponding position when the color difference value exceeds an error threshold; and constructing a correction error vector. A correction correlation matrix is ​​established to analyze the spatial relationship and numerical correlation between the vectors of distortion segmentation points, distortion jump points, and distortion continuous points. The correlation coefficient between each point is calculated to form the correction correlation matrix. The correction parameters are dynamically adjusted according to the correction error vector and the correction correlation matrix. When the error value in the correction error vector exceeds the set error threshold, the intensity of the illumination homogenization process is increased. When the correlation coefficient in the correction correlation matrix is ​​lower than the standard correlation value, the weight parameters of the fusion algorithm are reduced. Calculate the correction accuracy vector, compare and analyze the corrected image with the standard tobacco leaf image, and statistically analyze the color uniformity index. When the accuracy value in the correction accuracy vector reaches the accuracy range, the correction process is completed; otherwise, the correction is repeated.

2. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 1, characterized in that, The distortion segmentation point detection step specifically involves identifying pixel locations in the image of roasted tobacco leaves where color changes abruptly due to uneven illumination or imaging distortion. These locations are determined by calculating points in the image gradient field where the gradient magnitude exceeds a preset illumination threshold. The illumination threshold is calculated using a marker variable, which is obtained by summing the absolute values ​​of the differences between the red, green, and blue components of the real-time captured image and the background image, and then dividing by three times the product of the image's length and width.

3. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 2, characterized in that, The steps for constructing the distortion jump point matrix are as follows: the distortion jump point matrix is ​​a two-dimensional array structure that records significant jumps in grayscale values ​​between adjacent pixels. A value of 1 in the matrix element indicates that there is a distortion jump point at the location, and a value of 0 indicates that it is normal. The grayscale value of each pixel is calculated by averaging the red, green, and blue components using the grayscale processing formula, and then jump detection is performed.

4. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 3, characterized in that, The Laplacian pyramid image fusion algorithm specifically involves the following steps: the distortion continuous point vector is a one-dimensional array describing the continuous distribution characteristics of the distortion region in the image. The Laplacian pyramid image fusion algorithm extracts continuous distortion feature points at different scales to form a vector, which is used to characterize the spatial continuity of the distortion. Each input image is decomposed into a Laplacian pyramid structure at different scales, and feature extraction and fusion processing are performed at each level based on local contrast and gradient magnitude.

5. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 4, characterized in that, The step of calculating the correction error vector specifically involves using a one-dimensional array structure to quantify the differences between the images before and after correction. This array is constructed by calculating the color difference values ​​at each pixel position between the original image and the corrected image. The color difference calculation uses a binary segmentation method to divide the region. When the pixel gray value is greater than the optimal segmentation threshold, it is marked as 1, and when the pixel gray value is less than or equal to the optimal segmentation threshold, it is marked as 0. The optimal segmentation threshold is obtained by maximizing the inter-class variance.

6. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 5, characterized in that, The steps for establishing the correction correlation matrix are as follows: the correction correlation matrix is ​​a square matrix that describes the spatial relationship and numerical correlation between various distortion point types. The matrix element values ​​represent the correlation strength between corresponding distortion types, and the correlation is quantified by calculating the inter-class variance.

7. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 6, characterized in that, The step of dynamically adjusting the correction parameters specifically involves adaptively adjusting the processing parameters based on the calculation results of the correction error vector and the correction correlation matrix. When the error value detected in the correction error vector exceeds the preset error threshold, the processing intensity of the illumination homogenization algorithm is automatically increased. When the correlation coefficient in the correction correlation matrix is ​​lower than the standard correlation threshold, the weight parameter setting of the Laplacian pyramid image fusion algorithm is reduced.

8. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 7, characterized in that, The step of calculating the correction accuracy vector specifically involves the correction accuracy vector being an array of indicators for evaluating the distortion correction effect, including multiple dimensions such as color uniformity, texture fidelity, and overall quality score. The color uniformity calculation uses a tobacco leaf image after removing the background, performs normalization processing on the tobacco leaf image after removing the background, and calculates the color uniformity index by statistically analyzing the pixel distribution characteristics of the tobacco leaf area.

9. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 8, characterized in that, The accuracy range judgment criterion is specifically that when the accuracy value in the correction accuracy vector reaches the range of 85% to 100%, the correction process is considered complete. When the accuracy value does not reach the range, the correction error vector calculation step is returned to perform iterative correction again until the accuracy index meets the preset requirements, thus forming a closed-loop correction optimization processing mechanism.

10. The method for image distortion correction and enhancement of roasted tobacco leaves according to claim 9, characterized in that, It also includes a conveyor belt optimal speed calculation function, which is used to dynamically optimize the conveyor belt speed based on the image correction effect and the conveyor belt operating parameters. The input includes the correction accuracy vector, the correction error vector, the correction correlation matrix and the current initial speed of the conveyor belt, and the output is the optimal speed of the conveyor belt. The image acquisition quality is optimized by analyzing the correlation between image quality and conveyor belt speed.

Citation Information

Patent Citations

  • Depth image correction method, device and equipment

    CN108961184A

  • Brightness compensation method for non-uniform illumination tobacco leaf image

    CN112330568A

  • Method and device for judging color uniformity of flue-cured tobacco leaves based on machine vision

    CN113838081A

  • Distortion correction method and system for image projection

    CN119831907A

  • Extremely low illumination tobacco image enhancement method and system based on multi-scale fusion

    CN119887604A

Cited By

  • Automobile circuit board solder paste printing quality detection method and system

    CN121504881A

  • Automobile circuit board tin paste printing quality detection method and system

    CN121504881B