Edge enhancement method based on improved variational L1 norm model in resin identification
By constructing a variational L1 norm model with exponentially modified L1 regularization terms and spatially adaptive weights, the noise interference and blurring problems of edge detection in resin images during the imaging process are solved, achieving edge enhancement and image quality improvement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-13
- Publication Date
- 2026-04-10
AI Technical Summary
Resin images are subject to problems such as noise interference, uneven illumination, and blurred edges during the imaging process, which makes edge detection methods prone to edge breakage and noise sensitivity in complex scenes, making it difficult to meet the requirements of high-precision recognition.
A variational L1 norm model with exponentially modified L1 regularization and spatially adaptive weights is constructed. By combining the global intensity factor and smooth structural gradient weights, an iterative solution framework based on gradient descent is used to enhance edges while maintaining the overall structural consistency of the image.
It effectively improves the edge continuity, noise resistance, and detail preservation of resin images, outputting enhanced results with clear edges, prominent details, and suppressed noise, thus improving image quality.
Smart Images

Figure CN121837099A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of computer vision, and particularly relates to an edge enhancement method based on an improved variational L1 norm model in resin identification. BACKGROUND
[0002] Resin materials have wide application in industrial detection, material analysis and product quality control, and clear identification of the surface texture, internal structure and edge contour of the resin is a key to ensuring detection accuracy and reliability. However, in actual imaging process, the resin image is often affected by noise interference, uneven illumination, blurred edge and the like, so that the edge detection method is prone to edge breakage and noise sensitivity in a complex scene, and it is difficult to meet the high-precision identification requirement.
[0003] The application provides an edge enhancement method based on an improved variational L1 norm model in resin identification. An exponential modified L1 regular term is constructed to convert the gradient penalty in the traditional TV model into edge enhancement incentive. A spatial adaptive weight is introduced to realize adaptive spatial distribution of the edge enhancement intensity in combination with a global intensity factor and a smooth structure gradient weight. A gradient descent iterative solution framework is designed to maintain the overall structural consistency of the image while enhancing the edge through the synergistic effect of the diffusion coefficient and the fidelity term. The method shows good edge enhancement effect in the resin image, and improves the edge continuity, noise resistance and detail retention capability. SUMMARY
[0004] The application provides an edge enhancement method based on an improved variational L1 norm model in resin identification. An exponential modified L1 regular term is constructed to introduce a spatial adaptive weight, and combine a global intensity factor and a smooth structure gradient weight to realize image edge enhancement.
[0005] The application changes the traditional TV model to provide an edge enhancement technology based on an improved variational L1 norm model in resin identification, which includes the following steps.
[0006] S1, a camera is used to shoot a layered resin image with sedimentation completed, and a resin image to be processed is collected.
[0007] S2, an exponential modified L1 regular term is constructed, and the exponential modified L1 regular term includes a spatial adaptive weight and an exponential modified L1 function.
[0008] S3, a spatial adaptive weight is constructed, and the spatial adaptive weight includes a global intensity factor and a smooth structure gradient weight.
[0009] S4, a smooth structure gradient weight is generated by performing Gaussian smoothing, gradient amplitude, median normalization and global normalization on the image.
[0010] S5. Construct a variational energy model for image edge enhancement based on iterative formulas, including input, fidelity term, exponentially modified L1 regularization term, spatially adaptive weights, smooth structure gradient weights, and image output.
[0011] S6. Construct an iterative formula based on the gradient descent method. The iterative solution formula includes the input image, time step, diffusion term, and fidelity term.
[0012] S7. Input the resin image to be processed into the variational energy model for image edge enhancement, and perform iterative solution to obtain the resin edge enhanced image.
[0013] Preferably, in step S2, an exponentially modified L1 regularization term is constructed, characterized in that: Input the current image to be optimized and in its domain Spatial gradient information within Simultaneously, spatial adaptive weights are introduced. and preset parameters and At each pixel location First, calculate the smoothed form of the image gradient magnitude. Based on this gradient magnitude, the exponentially corrected L1 function is calculated. This modulates the strength of the local regularization constraint; subsequently, it incorporates spatial adaptive weights. For the entire image domain After performing integration, a negative sign is added to the result to obtain the exponentially modified L1 regularization term. This regularization term is used as a regularization constraint in subsequent optimization processes to guide the model to suppress noise in smooth regions while maintaining significant edge structures. The formula for the exponentially modified L1 regularization term is as follows: ,in This represents the exponentially modified L1 regularization term. Indicates in the region The double integral is the integral performed over the entire image. For gradient operators, Indicates spatial adaptive weights, This is the gradient suppression control parameter, used to adjust the exponential decay rate. This is a preset positive small constant to avoid numerical instability when the gradient is zero.
[0014] Preferably, in the S2 step, the gradient penalty mechanism for smoothing in the traditional model is converted into a targeted edge enhancement incentive by an exponential correction L1 regularization term; in the image flat area, the function is approximately constant, encouraging the gradient to increase to enhance the details; in the edge area, the function value tends to zero, preventing the gradient from being infinitely enlarged to cause distortion or numerical instability; the adaptability of edge enhancement is achieved; both weak edges and textures can be effectively enhanced, and over-enhancement of strong edges can be avoided, so that the image clarity is improved while the natural visual effect and numerical stability are maintained.
[0015] Preferably, in the S3 step, the spatial adaptive weight is constructed, characterized in that: an input original image , a current image to be optimized , and a preset minimum positive number and a smooth structure gradient weight are inputted, then a global intensity factor is calculated according to the gray difference between the original image and the current image to be optimized, which is calculated by integrating the square error of the pixels in the domain and normalized with the integral result of the absolute value of the error gradient, and the specific formula is: , then the global intensity factor and the smooth structure gradient weight are used to realize different enhancement intensities in regions with the same gradient but different positions, wherein the global intensity factor controls the overall enhancement intensity, and the smooth structure gradient weight controls the spatial enhancement distribution, and in large places, the enhancement effect is amplified; in small places, the enhancement effect is suppressed; the spatial adaptive weight formula is as follows: , wherein represents the smooth structure gradient weight, is a minimum positive number to prevent the denominator from being zero.
[0016] Preferably, in the S3 step, the spatial differentiation control of the edge enhancement intensity is realized by constructing the spatial adaptive weight; the global intensity factor is introduced to regulate the overall enhancement level, and the smooth structure gradient weight is combined to dynamically adjust the enhancement amplitude of different regions according to the local structure characteristics of the image; the enhancement intensity can be adaptively allocated according to the image content, so that the image edge clarity is improved while the overall naturalness and signal-to-noise ratio of the image are effectively protected.
[0017] Preferably, in the S4 step, the smooth structure gradient weight is generated, characterized in that: the input original image is Gaussian smoothed to suppress noise and obtain a smooth image Then, gradient calculation is performed to extract edge intensity information and obtain the gradient magnitude map. Then calculate the median of the gradient magnitude plot. Then, median normalization is performed to eliminate absolute intensity differences, enhance robustness, and obtain the relative edge map. Finally, global normalization is performed to make the mean of the weight graph 1, thus preserving the global strength factor. The overall control effect is not distorted, resulting in the final weighted graph. The specific formula for the smooth structure gradient weights is as follows: ,in The standard deviation is expressed as Gaussian kernel 1.2, This represents the convolution operation. This indicates taking the median value. Representing an image The area.
[0018] Preferably, in step S4, a smooth structural gradient weight is generated through multi-level processing to guide the spatial distribution of edge enhancement. First, Gaussian smoothing is used to filter out image noise. Then, the gradient magnitude is calculated to capture edge intensity information. Next, media normalization is applied to eliminate the influence of overall image brightness differences. Finally, global normalization is performed to ensure that the average value of the weight map is 1, thereby avoiding distortion of the overall adjustment effect of the global intensity factor. The generated weight map is robust, can accurately reflect the structural features of the image, and provides a reliable and stable spatial modulation basis for subsequent adaptive edge enhancement.
[0019] Preferably, in step S5, a variational energy model for image edge enhancement is constructed, characterized in that: For the input original image Current image to be optimized First, construct the fidelity item. The fidelity term is calculated, followed by an exponentially modified L1 regularization term to excite edge enhancement. Finally, the fidelity term and the exponentially modified L1 regularization term are combined to construct a variational energy model for image edge enhancement, as shown below: , This represents the minimized energy functional.
[0020] Preferably, in step S5, the edge enhancement problem is transformed into a mathematical optimization problem of minimizing energy by constructing a variational energy model. The model contains two terms: the first term is a fidelity term, which is used to constrain the enhanced image to maintain the same overall structure as the original input image and prevent excessive distortion; the second term is an exponentially modified L1 regularization term, which is used to encourage the increase of the image gradient, thereby strengthening the edges. The advantage of the model is that it formalizes the image processing task into a clear optimization objective.
[0021] Preferably, the iterative formula is constructed in step S6, characterized in that: For the input image, based on the principle of energy functional minimization, gradient descent is used for iterative solution, and the update magnitude is controlled by the time step, combined with the diffusion term. Achieve edge-selective enhancement and contribute through fidelity items. Preserve the overall image structure; the specific iterative update formula is: ,in, The diffusion coefficient is expressed by the following formula: , , This represents the image of the (k+1)th iteration. This represents the image of the k-th iteration. Indicates the iteration step size. This indicates the calculation of divergence. The spatial adaptive weights are Gaussian smoothed. For spatial adaptive weights, Use extremely small positive numbers to prevent the denominator from being zero.
[0022] Preferably, in step S6, the variational energy model is numerically solved by constructing an iterative update formula based on gradient descent. The core of this iterative formula is the combination of a diffusion term and a fidelity term: the diffusion term coefficient is adjusted by spatial adaptive weights and edge strength adaptively, with a larger diffusion coefficient in flat regions to promote gradient growth, and an automatic reduction at strong edges to protect the edges; the fidelity term ensures that the image does not deviate excessively from the original structure after each iteration; through the discretized iterative process, the minimum value of the energy functional can be stably and efficiently approximated, thereby gradually and controllably enhancing the image edges and effectively avoiding numerical instability or convergence problems that may occur during the iteration process.
[0023] Compared with the prior art, the present invention has the following technical effects:
[0024] This invention provides an edge enhancement method based on an improved variational L1 norm model for resin identification. First, layered resin images are acquired, and a variational energy model containing an exponentially modified L1 regularization term and spatially adaptive weights is constructed. This regularization term adaptively excites gradient enhancement in flat regions and suppresses over-enhancement in edge regions, while the spatial weights adjust the enhancement intensity distribution according to the local structure of the image. Then, a weight map is generated through Gaussian smoothing, gradient calculation, and median normalization. Finally, the gradient descent method is used to iteratively solve the energy minimization problem, gradually optimizing the image and outputting an enhanced result with clear edges, prominent details, and suppressed noise. This method effectively improves image edge problems and enhances image quality. Attached Figure Description
[0025] Figure 1 This is a flowchart of the edge enhancement method based on the improved variational L1 norm model in resin recognition provided by the present invention.
[0026] Figure 2 This is the structure diagram of the exponential modified L1 regularization term provided by the present invention.
[0027] Figure 3 This is the spatial adaptive weight structure diagram provided by the present invention.
[0028] Figure 4 This is the smooth structure gradient weight structure diagram provided by the present invention.
[0029] Figure 5 This is a flowchart of the iterative formula based on gradient descent provided by the present invention. Detailed Implementation
[0030] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0031] This invention provides an edge enhancement method based on an improved variational L1 norm model for resin identification. First, layered resin images are acquired, and a variational energy model containing an exponentially modified L1 regularization term and spatially adaptive weights is constructed. This regularization term adaptively excites gradient enhancement in flat regions and suppresses over-enhancement in edge regions, while the spatial weights adjust the enhancement intensity distribution according to the local structure of the image. Then, a weight map is generated through Gaussian smoothing, gradient calculation, and median normalization. Finally, the gradient descent method is used to iteratively solve the energy minimization problem, gradually optimizing the image and outputting an enhanced result with clear edges, prominent details, and suppressed noise. This method effectively improves image edge problems and enhances image quality.
[0032] Please see Figures 1 to 5 The edge enhancement method based on the improved variational L1 norm model in resin recognition in this application aims to improve the edge clarity of resin images while suppressing noise through spatial adaptive weights and smooth structural gradient weights. It has the advantages of strong robustness and stable convergence.
[0033] S1. Use a camera to capture images of the layered resin after sedimentation, and collect the resin images to be processed.
[0034] S2. Construct an exponentially modified L1 regularization term, which includes spatial adaptive weights and an exponentially modified L1 function.
[0035] Furthermore, in step S2, an exponentially modified L1 regularization term is constructed, and the specific steps are as follows.
[0036] Input image variables and in its domain Spatial gradient information within Simultaneously, spatial adaptive weights are introduced. and preset parameters and At each pixel location First, calculate the smoothed form of the image gradient magnitude. Based on this gradient magnitude, the exponentially corrected L1 function is calculated. This modulates the strength of the local regularization constraint; subsequently, it incorporates spatial adaptive weights. For the entire image domain After performing integration and adding a negative sign to the result, an exponentially modified L1 regularization term is obtained. This regularization term is used as a regularization constraint in subsequent optimization processes, guiding the model to suppress noise in smooth regions while preserving significant edge structures; in flat regions, the image gradient magnitude... Exponentially modified L1 function A constant value indicates a weaker constraint on gradient changes; the image gradient magnitude is more pronounced in edge regions. Exponentially modified L1 function At this point, the region constraining the gradient becomes saturated, preventing infinite edge enhancement that could lead to a numerical explosion; exponentially modified L1 function. With spatial adaptive weights Collaboration, in Large areas enhance signal strength, in The formula for the weak exponential correction L1 regularization term for signal enhancement in regions with small x is as follows: ,in This represents the exponentially modified L1 regularization term. Indicates in the region The double integral is the integral performed over the entire image. For gradient operators, Indicates spatial adaptive weights, This is the gradient suppression control parameter, used to adjust the exponential decay rate. , This is a preset positive small constant to avoid numerical instability when the gradient is zero. .
[0037] S3. Construct spatial adaptive weights, which include global strength factors and smooth structural gradient weights.
[0038] Furthermore, in step S3, spatial adaptive weights are constructed, and the specific steps are as follows.
[0039] Input original image Current image to be optimized and the preset minimal positive number and smooth structure gradient weights Then, based on the grayscale difference between the original image and the current image to be optimized, the global intensity factor is calculated. Its calculation method is based on the domain. The squared integral of the pixel error within the range is normalized by integrating it with the integral of the absolute value of the error gradient. The specific formula is as follows: Then through the global strength factor and smooth structure gradient weights To achieve different enhancement intensities in regions with the same gradient but at different locations, where the global intensity factor is... Control the overall enhancement intensity and smooth the structural gradient weights Control spatial enhancement distribution, in In large areas, the enhancement effect is amplified; in In small areas, the enhancement effect is suppressed; the spatial adaptive weighting formula is as follows: ,in, Represents the gradient weights of the smooth structure. Use extremely small positive numbers to prevent the denominator from being zero. .
[0040] S4. By performing Gaussian smoothing, gradient magnitude, median normalization, and global normalization on the image, smooth structure gradient weights are generated.
[0041] Furthermore, in step S4, smooth structural gradient weights are generated, and the specific steps are as follows.
[0042] Gaussian smoothing is applied to the original input image to suppress noise and obtain a smoothed image. Then, gradient calculation is performed to extract edge intensity information and obtain the gradient magnitude map. Then calculate the median of the gradient magnitude plot. Then, median normalization is performed to eliminate absolute intensity differences, enhance robustness, and obtain the relative edge map. Finally, global normalization is performed to make the mean of the weight graph 1, thus preserving the global strength factor. The overall control effect is not distorted, resulting in smooth structure gradient weights. The specific formula for the smooth structure gradient weights is as follows: ,in The standard deviation is expressed as The Gaussian kernel, where the size of the Gaussian kernel is... Standard deviation , This represents the convolution operation. This indicates taking the median value. Representing an image The area.
[0043] S5. Construct a variational energy model for image edge enhancement based on iterative formulas, including input, fidelity term, exponentially modified L1 regularization term, spatially adaptive weights, smooth structure gradient weights, and image output.
[0044] Preferably, in step S5, a variational energy model for image edge enhancement is constructed, and the specific steps are as follows.
[0045] For the input original image Current image to be optimized First, construct the fidelity item. The fidelity term is calculated, followed by an exponentially modified L1 regularization term to excite edge enhancement. Finally, the fidelity term and the exponentially modified L1 regularization term are combined to construct a variational energy model for image edge enhancement, as shown below: , This represents the minimized energy functional.
[0046] S6. Construct an iterative formula based on the gradient descent method. The iterative solution formula includes the input image, time step, diffusion term, and fidelity term.
[0047] Furthermore, the iterative formula is constructed in step S6, and the specific steps are as follows.
[0048] For the input image, based on the principle of energy functional minimization, gradient descent is used for iterative solution. The update amplitude is controlled by the time step, edge selective enhancement is achieved by combining a diffusion term, and a fidelity term contributes to the solution. Preserving the overall structure of the image; its iterative process first inputs the original image. And manually set parameters , and number of iterations And initialize it, let The current gradient is calculated. Calculate the current space adaptive weights After Gaussian smoothing, the result is Then calculate the current diffusion coefficient. Next, we calculate the diffusion term. Then, an iterative formula is used to update the image, resulting in an updated image. If the convergence condition is met... Or the number of iterations If the condition is met, the iteration terminates. If not, let k = k + 1 and continue to the next iteration. Finally, output the image with enhanced edges. The specific iterative update formula is as follows: ,in, The diffusion coefficient is expressed by the following formula: , , This represents the image in the (k+1)th iteration, i.e., the currently updated image. This represents the image in the k-th iteration, i.e., the input image. Indicates the iteration step size , This indicates the calculation of divergence. The spatial adaptive weights are Gaussian smoothed. For spatial adaptive weights, The standard deviation is expressed as The Gaussian kernel, where the size of the Gaussian kernel is... Standard deviation , For the spatial adaptive weights of the k-th iteration, Use extremely small positive numbers to prevent the denominator from being zero. The energy of the (k+1)th iteration Let be the energy of the k-th iteration. , The preset number of iterations is 50.
[0049] S7. Input the resin image to be processed into the variational energy model for image edge enhancement, and perform iterative solution to obtain the resin edge enhanced image.
[0050] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements all fall within the protection scope of the present invention.
Claims
1. An edge enhancement method based on an improved variational L1 norm model for resin identification, characterized in that, Includes the following steps: S1. Use a camera to capture images of the layered resin after sedimentation, and collect the resin images to be processed. S2. Construct an exponentially modified L1 regularization term, which includes spatial adaptive weights and an exponentially modified L1 function. S3. Construct spatial adaptive weights, which include global strength factors and smooth structural gradient weights. S4. By performing Gaussian smoothing, gradient magnitude, median normalization, and global normalization on the image, smooth structure gradient weights are generated. S5. Construct a variational energy model for image edge enhancement based on iterative formulas, including input, fidelity term, exponentially modified L1 regularization term, spatial adaptive weights, smooth structure gradient weights, and image output. S6. Construct an iterative formula based on the gradient descent method. The iterative solution formula includes the input image, time step, diffusion term, and fidelity term. S7. Input the resin image to be processed into the variational energy model for image edge enhancement, and perform iterative solution to obtain the resin edge enhanced image.
2. The edge enhancement method based on the improved variational L1 norm model in resin identification according to claim 1, wherein an exponential modified L1 regularization term is constructed in step S2, characterized in that: Input the current image to be optimized and in its domain Spatial gradient information within Simultaneously, spatial adaptive weights are introduced. and preset parameters and At each pixel location First, calculate the smoothed form of the image gradient magnitude. Based on this gradient magnitude, the exponentially corrected L1 function is calculated. This modulates the strength of the local regularization constraint; subsequently, it incorporates spatial adaptive weights. For the entire image domain After performing integration, a negative sign is added to the result to obtain the exponentially modified L1 regularization term. This regularization term is used as a regularization constraint in subsequent optimization processes to guide the model to suppress noise in smooth regions while maintaining significant edge structures. The formula for the exponentially modified L1 regularization term is as follows: ,in This represents the exponentially modified L1 regularization term. Indicates in the region The double integral is the integral performed over the entire image. For gradient operators, Indicates spatial adaptive weights, This is the gradient suppression control parameter, used to adjust the exponential decay rate. This is a preset positive small constant to avoid numerical instability when the gradient is zero.
3. The edge enhancement method based on the improved variational L1 norm model in resin recognition according to claim 2, wherein spatial adaptive weights are constructed in step S3, characterized in that: Input original image Current image to be optimized and the preset minimal positive number and smooth structure gradient weights Then, based on the grayscale difference between the original image and the current image to be optimized, the global intensity factor is calculated. Its calculation method is based on the domain. The squared integral of the pixel error within the range is normalized by integrating it with the integral of the absolute value of the error gradient. The specific formula is as follows: Then through the global strength factor and smooth structure gradient weights To achieve different enhancement intensities in regions with the same gradient but at different locations, where the global intensity factor is... Control the overall enhancement intensity and smooth the structural gradient weights Control spatial enhancement distribution, in In large areas, the enhancement effect is amplified; in In small areas, the enhancement effect is suppressed; the spatial adaptive weighting formula is as follows: ,in, Represents the gradient weights of the smooth structure. Use extremely small positive numbers to prevent the denominator from being zero.
4. The edge enhancement method based on the improved variational L1 norm model in resin identification according to claim 3, wherein smooth structural gradient weights are generated in step S4, characterized in that: Gaussian smoothing is applied to the original input image to suppress noise and obtain a smoothed image. Then, gradient calculation is performed to extract edge intensity information and obtain the gradient magnitude map. Then calculate the median of the gradient magnitude plot. Then, median normalization is performed to eliminate absolute intensity differences, enhance robustness, and obtain the relative edge map. Finally, global normalization is performed to make the mean of the weight graph 1, thus preserving the global strength factor. The overall control effect is not distorted, resulting in the final weighted graph. The specific formula for the smooth structure gradient weights is as follows: ,in The standard deviation is expressed as Gaussian kernel, This represents the convolution operation. This indicates taking the median value. Representing an image The area.
5. The edge enhancement method based on the improved variational L1 norm model in resin recognition according to claim 4, wherein a variational energy model for image edge enhancement is constructed in step S5, characterized in that: For the input original image Current image to be optimized First, construct the fidelity item. The fidelity term is calculated, followed by an exponentially modified L1 regularization term to excite edge enhancement. Finally, the fidelity term and the exponentially modified L1 regularization term are combined to construct a variational energy model for image edge enhancement, as shown below: , This represents the minimized energy functional.
6. The edge enhancement method based on the improved variational L1 norm model in resin identification according to claim 5, wherein an iterative formula is constructed in step S6, characterized in that: For the input image, based on the principle of energy functional minimization, gradient descent is used for iterative solution, and the update magnitude is controlled by the time step, combined with the diffusion term. Achieve edge-selective enhancement and contribute through fidelity items. Preserve the overall image structure; the specific iterative update formula is: ,in, The diffusion coefficient is expressed by the following formula: , , This represents the image of the (k+1)th iteration. This represents the image of the k-th iteration. Indicates the iteration step size. This indicates the calculation of divergence. The spatial adaptive weights are Gaussian smoothed. For spatial adaptive weights, Use extremely small positive numbers to prevent the denominator from being zero.
Citation Information
Patent Citations
An image denoising method based on an adaptive weighted total variational model
CN109003233A
Efficient Off-Policy Credit Assignment
US20200285993A1
Point-by-point correction and restoration method and system for large field-of-view degraded image having aero-optical effect
WO2023115801A1