Image edge detection method based on canny algorithm
By introducing the LPG-PCA image denoising algorithm and the improved Grey Wolf optimization algorithm (Wolf King algorithm), the problems of poor Gaussian filtering effect and slow threshold setting in the Canny algorithm are solved, achieving faster, clearer and more accurate image edge detection.
Patent Information
- Application Number
- CN202410723687.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-06-05
AI Technical Summary
The existing Canny algorithm suffers from poor Gaussian filtering denoising effect and slow and poor quality when manually setting thresholds in image edge detection, resulting in inaccurate edge detection and affecting the subsequent feature extraction and target recognition.
The LPG-PCA image denoising algorithm is introduced to replace the traditional Gaussian filtering, and the optimal image threshold is automatically selected by adopting a nonlinear convergence factor and adaptive weight strategy through an improved gray wolf optimization algorithm. The improved gray wolf optimization algorithm is called the Wolf King algorithm.
It improves the accuracy of image edge detection and the efficiency and quality of threshold range acquisition, thereby enhancing the precision and adaptability of image edges.
Smart Images

Figure CN118552746B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge detection technology, and in particular to an image edge detection method based on the Canny algorithm. Background Technology
[0002] Edges are regions in an image where attributes such as grayscale, color, or texture change significantly. Image edge detection is a fundamental problem in image processing. Accurate edge detection provides valuable information for subsequent tasks such as feature extraction, object recognition, and image segmentation, making it crucial in computer vision, pattern recognition, and image analysis. Currently, the Canny algorithm is commonly used for image edge detection. The Canny algorithm typically includes: 1. Image grayscale conversion; 2. Gaussian filtering for noise reduction; 3. Pixel gradient calculation; 4. Non-maximum suppression; 5. Double thresholding. The Canny algorithm boasts advantages such as high detection accuracy and fast response. However, it suffers from the following drawbacks: 1. Gaussian filtering for noise reduction is ineffective, and unremoved noise can negatively impact edge detection quality; 2. Finding the optimal threshold requires manual searching and setting, leading to slow and poor-quality threshold determination, resulting in inaccurate edge detection and affecting the quality of subsequent tasks such as feature extraction, object recognition, and image segmentation. Summary of the Invention
[0003] The present invention aims to solve the above problems, thereby providing an image edge detection method based on the Canny algorithm that can improve the accuracy of edge localization and improve the efficiency and quality of obtaining the optimal threshold range of the image.
[0004] The invention solves the aforementioned problem by employing the following technical solution:
[0005] An image edge detection method based on the Canny algorithm, comprising the following steps:
[0006] S1, Grayscale conversion: Converting a color image into a grayscale image;
[0007] S2, Image Denoising: Smoothing the grayscale image;
[0008] S3, Calculate image gradient: Calculate the gradient value of each pixel to obtain the gradient intensity and gradient direction of each pixel;
[0009] S4, Non-maximum suppression: For each pixel, compare its two nearest neighboring pixels along the gradient direction, and only retain the pixel with the maximum gradient value along the gradient direction.
[0010] S5, Dual Threshold Processing: Find the optimal threshold range for the image and perform edge detection. Points with gradient strength greater than the high threshold in the optimal threshold range are identified as strong edge points. Points with gradient strength less than the low threshold in the optimal threshold range are excluded. Then, when the edge strength is greater than the low threshold, extend the edge as much as possible.
[0011] In step S5, the optimal threshold for the image is obtained by optimizing the OTSU algorithm with an improved gray wolf optimization algorithm. The improved gray wolf optimization algorithm is based on the original gray wolf optimization algorithm by introducing a nonlinear convergence factor and an adaptive weight strategy.
[0012] Preferably, step S5 is as follows:
[0013] S501, Initialize the gray wolf pack: Randomly generate a certain number of gray wolf individuals and assign an initial position to each gray wolf; wherein, each gray wolf individual is an image threshold;
[0014] S502, Calculate fitness: Calculate the fitness of each individual gray wolf according to the objective function of the OTSU algorithm;
[0015] S503, Update Gray Wolf Positions: Based on the fitness of each gray wolf in the gray wolf pack, update the individual gray wolf using the cooperative behavior of the gray wolf pack and the competitive behavior of the individual.
[0016] S504, Determine if the optimization stops: Check if the maximum number of iterations or the maximum fitness is met. If the maximum number of iterations or the maximum fitness is not met, return to S502. If it is met, directly output the gray wolf individual with the highest fitness as the optimal threshold for the image.
[0017] S501, Initialize the gray wolf pack: Randomly generate a certain number of gray wolf individuals and assign an initial position to each gray wolf; wherein, each gray wolf individual is an image threshold;
[0018] S502, Calculate fitness: Calculate the fitness of each individual gray wolf according to the objective function of the gray wolf optimization algorithm;
[0019] S503, Update Gray Wolf Positions: Based on the fitness of each gray wolf in the gray wolf pack, update the individual gray wolf using the cooperative behavior of the gray wolf pack and the competitive behavior of the individual.
[0020] S504, Determine if the optimization stops: Check if the maximum number of iterations or the maximum fitness is met. If the maximum number of iterations or the maximum fitness is not met, return to S502. If it is met, directly output the gray wolf individual with the highest fitness as the optimal threshold for the image.
[0021] Preferably, in step S2, the image is filtered using the LPG-PCA filtering method, and the steps are as follows:
[0022] S201, Local Principal Component Analysis: For a given image patch X, we first calculate the mean vector X and the covariance matrix C, where each column of X represents a pixel in the image patch;
[0023]
[0024] Where N is the number of pixels in the image patch, X i It is the pixel vector of the i-th column;
[0025] S202, calculate the eigenvalues and eigenvectors of the covariance matrix, arrange the eigenvectors according to the corresponding eigenvalues, and then select the first k eigenvectors to form a subspace;
[0026] S203, Introduction of Generalized Gaussian Prior: A generalized Gaussian prior is introduced to model the probability distribution of the image; the probability density function of the generalized Gaussian distribution is as follows:
[0027]
[0028] Where x is the pixel value, and α and β are the distribution parameters, which are gamma functions;
[0029] S204, Image Denoising: Denoise each image block X;
[0030]
[0031] in, It is the estimated denoised image patch, V m Y is a matrix composed of the first m eigenvectors, and Y is an estimate of the noise, which follows a generalized Gaussian distribution.
[0032] Preferably, in step S3, the specific process includes: S301: Calculating the gradient value of each pixel using the Sobel gradient operator; the Sobel operator includes four 3*3 convolution kernels, which calculate the gradient components h in the horizontal, 45°, vertical, and 135° directions respectively. x h 45 h y h 135 Then by h x h 45 h y h 135 Calculate the gradient intensity and gradient direction of the image;
[0033]
[0034] Where W is the gradient magnitude and θ is the gradient direction.
[0035] The present invention, which adopts the above technical solution, has the following prominent features compared with the prior art:
[0036] To address the issue of low accuracy in practical applications of the current Canny algorithm, this application introduces the LPG-PCA image denoising algorithm to replace the traditional Gaussian filtering for image smoothing and denoising. At the same time, it improves the Grey Wolf optimization algorithm by introducing a nonlinear convergence factor and an adaptive weighting strategy. The improved Grey Wolf optimization algorithm automatically selects the optimal threshold for the image, which can extract the edge information of the image more quickly, clearly and accurately, thereby improving the image edge accuracy and adaptability. Attached Figure Description
[0037] Figure 1 This is a flowchart of the image edge detection method based on the Canny algorithm in an embodiment of the present invention;
[0038] Figure 2 These are comparison images of image denoising using various methods in embodiments of the present invention;
[0039] Figure 3 This is the curve showing the change of the optimal threshold for each iteration of the improved gray wolf optimization algorithm in this embodiment of the invention after 50 iterations;
[0040] Figure 4 It is an image obtained by converting the Lena image, Mandril image, Peppers image, and Braint image to grayscale.
[0041] Figure 5 Based on Figure 4 Edge images used for edge recognition using the classic Canny algorithm;
[0042] Figure 6 Based on Figure 4 Edge images used for image edge recognition using the CPDMO algorithm;
[0043] Figure 7 Based on Figure 4 Edge images used for image edge recognition using the HAG algorithm;
[0044] Figure 8 Based on Figure 4 Edge images used for edge recognition using the CHSA algorithm;
[0045] Figure 9 Based on Figure 4 Edge images used for image edge recognition using the CMMO algorithm;
[0046] Figure 10 Based on Figure 4 Edge images used for image edge recognition in this application;
[0047] Figure 11 This is a bar chart showing the C / A values of each algorithm in the embodiments of the present invention during optimization of Lena plot, Mandril plot, Peppers plot, and Braint plot;
[0048] Figure 12 This is a bar chart showing the C / B values of each algorithm in the embodiments of the present invention during optimization of Lena plot, Mandril plot, Peppers plot, and Braint plot;
[0049] Figure 13 This is a gradient diagram in the four directions of horizontal, 45°, vertical, and 135° in the embodiment of the present invention.
[0050] in, Figure 2 Column a shows the image after grayscale processing, column b shows the image after Gaussian filtering, and column c shows the image after using the LPG-PCA image denoising algorithm described in this application. Detailed Implementation
[0051] The present invention will be further described below with reference to embodiments, which are intended only to provide a better understanding of the invention. Therefore, the examples given do not limit the scope of protection of the present invention.
[0052] like Figure 1 As shown, this embodiment discloses an image edge detection method based on the Canny algorithm, the steps of which include:
[0053] S1, Grayscale conversion: Converting a color image to a grayscale image; such as... Figure 4 This is the image after grayscale processing of the Lena, Mandril, Peppers, and Braint images.
[0054] S2, Image Denoising: The LPG-PCA filtering method is used to filter the image and smooth the grayscale image. The specific steps are as follows:
[0055] S201, Local Principal Component Analysis: For a given image patch X, we first calculate the mean vector X and the covariance matrix C, where each column of X represents a pixel in the image patch;
[0056]
[0057] Where N is the number of pixels in the image patch, X i It is the pixel vector of the i-th column;
[0058] S202, calculate the eigenvalues and eigenvectors of the covariance matrix, arrange the eigenvectors according to the corresponding eigenvalues, and then select the first k eigenvectors to form a subspace;
[0059] S203, Introduction of Generalized Gaussian Prior: A generalized Gaussian prior is introduced to model the probability distribution of the image; the probability density function of the generalized Gaussian distribution is as follows:
[0060]
[0061] Where x is the pixel value, and α and β are the distribution parameters, which are gamma functions;
[0062] S204, Image Denoising: Denoise each image block X;
[0063]
[0064] in, It is the estimated denoised image patch, which is a matrix composed of the first m feature vectors, and is the noise estimate that satisfies a generalized Gaussian distribution.
[0065] S3, Calculate the image gradient: Use the Sobel gradient operator to calculate the gradient value of each pixel, obtaining the gradient intensity and direction of each pixel; the specific steps are as follows:
[0066] S301: The Sobel gradient operator is used to calculate the gradient value of each pixel. Since the traditional Canny algorithm is sensitive to noise and easily interfered with when calculating gradient values, in order to obtain better image edges, this algorithm adds first-order gradient templates in the 45° and 135° directions on the basis of the original first-order gradient templates in the horizontal and vertical directions when calculating gradient values.
[0067] The Sobel operator consists of four 3x3 convolution kernels: one in the horizontal direction, one in the 45° direction, one in the vertical direction, and one in the 135° direction. Figure 13 As shown; the gradient components in the horizontal, 45°, vertical and 135° directions of each pixel are obtained by convolution operation with four convolution kernels; then the gradient intensity and gradient direction of the image are calculated from , , , and .
[0068]
[0069] Where W is the gradient magnitude and θ is the gradient direction.
[0070] S4, Non-maximum suppression: For each pixel, compare its two neighboring pixels along the gradient direction, retain only the pixel with the maximum gradient value along the gradient direction as the candidate edge point, and set the gray value of the non-maximum point to zero. This can effectively extract the real edges in the image and remove redundant edge responses.
[0071] S5, Dual Threshold Processing: Find the optimal threshold range for the image and perform edge detection. Points with gradient strength greater than the high threshold in the optimal threshold range are identified as strong edge points. Points with gradient strength less than the low threshold in the optimal threshold range are excluded. Then, when the edge strength is greater than the low threshold, extend the edge as much as possible.
[0072] In the traditional Canny algorithm, the threshold values for image edge detection and connection are manually set, and the threshold range has a significant impact on the final processing effect. The Grey Wolf optimization algorithm is a commonly used global threshold segmentation method, but given its slow convergence speed and tendency to get trapped in local optima, this paper proposes two improvement strategies: a nonlinear convergence factor and an adaptive weight strategy. These strategies aim to maximize the algorithm's solution accuracy and convergence speed while ensuring that the algorithm can escape local optima. Since these two improvement strategies enhance the leadership of the alpha wolf in the original algorithm structure, thereby improving the overall performance of the algorithm, it is named the Wolf King Algorithm.
[0073] (I) Nonlinear convergence factor
[0074] Intelligent algorithms possess both global search and local exploitation capabilities. Balancing these two attributes is a key issue in the optimization process. Global search focuses on finding the optimal solution across the entire search space, avoiding getting trapped in local optima, and improving the algorithm's optimization ability. Local exploitation, on the other hand, emphasizes precise searching within a local scope, improving solution accuracy and convergence speed. Generally, a global search strategy is used in the early stages of iteration, while a local exploitation strategy is used in later stages. This approach balances the global and local search characteristics throughout the optimization process, achieving better optimization results. Therefore, this paper presents a nonlinear variation strategy, with the following update formula:
[0075]
[0076] Where Max_iter is the maximum number of iterations.
[0077] (II) Adaptive Weighting Strategy
[0078] In the Grey Wolf Algorithm, late-stage local exploration can easily lead to premature convergence, where the algorithm gets trapped in local optima and fails to find the global optimum. To overcome this problem, an adaptive weighting strategy is proposed to maintain population diversity and help escape local optima in a timely manner. This strategy allows the weights of individuals to be adaptively adjusted based on their fitness during iteration. By introducing this adaptive weighting strategy, the Grey Wolf Algorithm can maintain a certain level of exploration capability in the later stages, thereby improving its global search ability and avoiding premature convergence. The mathematical expression of the adaptive weighting strategy is as follows:
[0079]
[0080] The final position can be represented as:
[0081]
[0082] By introducing these two improvement strategies, we aim to improve the convergence speed and solution accuracy of the algorithm without sacrificing global search capabilities, so as to better solve the problems of convergence speed and local optima in the Grey Wolf Optimization Algorithm.
[0083] To ensure that the threshold obtained using the OTSU method is the optimal threshold for the Canny algorithm, this application applies the OTSU method to the gradient image after non-maximum suppression during Canny edge detection to obtain a suitable segmentation threshold. Furthermore, to obtain a more precise threshold range, an improved Grey Wolf optimization algorithm is employed to find the optimal threshold for the image. The improved Grey Wolf optimization algorithm introduces a nonlinear convergence factor and an adaptive weighting strategy based on the original Grey Wolf optimization algorithm. This application refers to the improved Grey Wolf optimization algorithm as the Wolf King Algorithm; the specific process is as follows:
[0084] S501, Initialize the gray wolf pack: Randomly generate a certain number of gray wolf individuals and assign an initial position to each gray wolf; wherein, each gray wolf individual is an image threshold;
[0085] S502, Calculate fitness: Calculate the fitness of each individual gray wolf according to the objective function of the OTSU algorithm; in the OTSU algorithm, fitness is usually measured by measures such as inter-class variance or intra-class variance, that is, the segmentation effect of the gray-level histogram of the image at the threshold.
[0086] S503, Update Gray Wolf Positions: Update the positions of gray wolves based on the fitness of each wolf in the pack; typically, the cooperative behavior of the gray wolf pack and the competitive behavior of individuals are used to update positions in order to move towards better solutions;
[0087] S504, Determine if the optimization stops: Check if the maximum number of iterations or the maximum fitness is met. If the maximum number of iterations or the maximum fitness is not met, return to S502. If it is met, directly output the gray wolf individual with the highest fitness as the optimal threshold for the image.
[0088] To verify the optimization effect of the algorithm in this application, the following experimental data were used. Two sets of experiments were conducted for comparison: the first set was a comparison of the image denoising algorithm processing effect, and the second set was a comparison of the edge detection algorithm effect.
[0089] 1. Image denoising algorithm processing effect of LPG-PCA
[0090] To test the effectiveness of the LPG-PCA image denoising algorithm, this application selected Lena images, Mandril images, Peppers images, and Brain images. Figure 4 Use images to test. For example... Figure 2 , Figure 2 Column a shows the image after grayscale processing, column b shows the image after Gaussian filtering, and column c shows the image after using the LPG-PCA image denoising algorithm described in this application.
[0091] Specifically, two popular metrics in image segmentation are typically used to evaluate the quality of segmented images: Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM). Table 1 below shows the PSNR and SSIM values of Lena, Mandril, Peppers, and Braint images after Gaussian filtering and LPG-PCA filtering in this application.
[0092]
[0093] Table 1. PSNR and SSIM values of the filtered images.
[0094] Analysis of Table 1 shows that images processed by the LPG-PCA algorithm are better than those processed by Gaussian filtering. The LPG-PCA algorithm performs excellently in image denoising, with both its PSNR and SSIM values being superior to those of Gaussian filtering. The peak signal-to-noise ratio and structural similarity index of images processed by the LPG-PCA algorithm are improved by 18.8% and 13.6% respectively compared to traditional Gaussian filtering, demonstrating the superior performance of the LPG-PCA algorithm in image denoising.
[0095] 2. The Wolf King Algorithm for Determining the Optimal Threshold Effect in Images
[0096] Taking the Lena image as an example, the optimal threshold range is calculated using the Wolf King algorithm on the image processed in step S4. The population size is set to 50, and the number of iterations is 100. The curve showing the change of the optimal threshold in each iteration is shown below. Figure 3 As shown in the figure, when the number of iterations reaches the third iteration, the change curve has basically converged and reached the optimal fitness value. It can be seen that the Wolf King algorithm has a good convergence speed and solution accuracy.
[0097] To verify the effectiveness of the algorithm proposed in this paper, such as Figures 4 to 10 As shown, the traditional Canny edge detection algorithm; Algorithm 1 (CPDMO) based on multi-level threshold asymmetric cropping median filtering and Otsu improvement strategy; Algorithm 2 (HAG) based on wavelet thresholding, adaptive median filtering and vector gradient improvement measurement; Algorithm 3 (CHSA) based on hybrid filter and adaptive interpolation improvement strategy; and Algorithm 4 (CMMO) based on bilateral filtering, multi-scale detail enhancement, maximum entropy and Otsu improvement strategy are compared with the improved algorithm in this paper. Based on the results, the algorithm in this paper achieves better results than the other algorithms, with clearer image edges. Furthermore, the detected image edge contours are clearer and more connected than those of other algorithms, preserving more image edge details.
[0098] This application also uses a performance evaluation method for edge detection algorithms based on connected components. This evaluation method requires counting the total number of edge pixels (A), the number of four-connected components (B), and the number of eight-connected components (C) in the image, and then calculating the ratios C / A and C / B. C / A represents the ratio of the gray value of a point in the image to the gray value of its horizontal neighbors, while C / B represents the ratio of the gray value of a point in the image to the gray value of its vertical neighbors. The smaller the value of C / A, the stronger the continuity of the extracted image edges and the fewer the discontinuities. The smaller the value of C / B, the larger the proportion of single-pixel edges, and the better the single-sided response of the algorithm. The specific C / A and C / B values for the images are shown in Table 2 below.
[0099]
[0100] Table 2 Comparison of Algorithm Results
[0101] Figure 11 , Figure 12 The algorithm includes the traditional Canny edge detection algorithm; Algorithm 1 (CPDMO) based on multi-level threshold asymmetric cropping median filtering and Otsu improvement strategy; Algorithm 2 (HAG) based on wavelet thresholding, adaptive median filtering and vector gradient improvement measurement; Algorithm 3 (CHSA) based on hybrid filter and adaptive interpolation improvement strategy; and Algorithm 4 (CMMO) based on bilateral filtering, multi-scale detail enhancement, maximum entropy and Otsu improvement strategy. These algorithms are compared with the improved algorithm presented in this paper for processing Lena, Mandril, Peppers, and Brainstone images. Figure 4 Image C / A and C / B values.
[0102] Combination Figure 11 , Figure 12 As shown in Table 2, the improved algorithm in this paper has lower C / A and C / B values than the improved versions of the traditional Canny, CPDMO, HAG, CHSA, and CMMO algorithms when processing four different images. Therefore, this demonstrates that the improved algorithm in this paper has superior performance compared to traditional algorithms in terms of edge connectivity and one-sided response. Furthermore, combined with… Figures 4 to 10 In terms of processing results, the CPDMO and CHSA algorithms exhibit weak edge continuity when processing images. The CPDMO algorithm improves continuity but still has limitations in detail detection. The CPDMO algorithm can effectively detect image edges, but its single-sided response is poor, and the accuracy of image edge localization still needs to be improved. The improved algorithm in this paper processes images with better continuity and can extract more image details, resulting in a certain performance improvement.
[0103] To address the issue of low accuracy in practical applications of the current Canny algorithm, this application introduces the LPG-PCA image denoising algorithm to replace the traditional Gaussian filtering for image smoothing and denoising. At the same time, it improves the Grey Wolf optimization algorithm by introducing a nonlinear convergence factor and an adaptive weighting strategy. The improved Grey Wolf optimization algorithm automatically selects the optimal threshold for the image, which can extract the edge information of the image more quickly, clearly and accurately, thereby improving the image edge accuracy and adaptability.
[0104] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. All equivalent changes made based on the description and drawings of the present invention are included within the scope of the present invention.
Claims
1. An image edge detection method based on the Canny algorithm, comprising the following steps: S1, Grayscale conversion: Converting a color image into a grayscale image; S2, Image Denoising: Smoothing the grayscale image; S3, Calculate image gradient: Calculate the gradient value of each pixel to obtain the gradient intensity and gradient direction of each pixel; S4, Non-maximum suppression: For each pixel, compare its two nearest neighboring pixels along the gradient direction, and only retain the pixel with the maximum gradient value along the gradient direction. S5, Dual Threshold Processing: Find the optimal threshold range for the image and perform edge detection. Points with gradient strength greater than the high threshold in the optimal threshold range are identified as strong edge points. Points with gradient strength less than the low threshold in the optimal threshold range are excluded. Then, when the edge strength is greater than the low threshold, extend the edge as much as possible. The feature is that, in step S5, the optimal threshold of the image is obtained by optimizing the OTSU algorithm by introducing an improved gray wolf optimization algorithm. The improved gray wolf optimization algorithm is based on the original gray wolf optimization algorithm by introducing a nonlinear convergence factor and an adaptive weight strategy. Step S5 is as follows: S501, Initialize the gray wolf pack: Randomly generate a certain number of gray wolf individuals and assign an initial position to each gray wolf; wherein, each gray wolf individual is an image threshold; S502, Calculate fitness: Calculate the fitness of each individual gray wolf according to the objective function of the OTSU algorithm; S503, Update Gray Wolf Positions: Based on the fitness of each gray wolf in the gray wolf pack, update the individual gray wolf using the cooperative behavior of the gray wolf pack and the competitive behavior of the individual. S504, Determine if the optimization stops: Check if the maximum number of iterations or the maximum fitness is met. If the maximum number of iterations or the maximum fitness is not met, return to S502. If it is met, directly output the gray wolf individual with the highest fitness as the optimal threshold for the image. In step S2, the image is filtered using the LPG-PCA filtering method. The steps are as follows: S201, Local Principal Component Analysis: For a given image patch We first calculate the mean vector. Covariance Matrix ,in Each column represents a pixel in an image block; (1); (2); in, It is the number of pixels in the image patch. It is the first The pixel vector of the column; S202, calculate the eigenvalues and eigenvectors of the covariance matrix, arrange the eigenvectors according to the magnitude of their respective eigenvalues, and then select the first... eigenvectors, from the previous Each feature vector forms a subspace; S203, Introduction of Generalized Gaussian Prior: A generalized Gaussian prior is introduced to model the probability distribution of the image; the probability density function of the generalized Gaussian distribution is as follows: (3); in, It's a pixel value. and It is a parameter of the distribution. It is the gamma function; S204, Image Denoising: For each image patch Perform noise reduction; (4); in, It is an estimated denoised image patch. It was before A matrix composed of eigenvectors, It is an estimate of the noise, which follows a generalized Gaussian distribution; In S5, the nonlinear convergence factor adopts a nonlinear variation strategy, and its update formula is as follows: (7); in, This represents the maximum number of iterations. In S5, the mathematical expression for the adaptive weighting strategy is as follows: (8); (9); (10); The final position can be represented as: (15)。 2. The image edge detection method based on the Canny algorithm according to claim 1, characterized in that: Step S3 specifically includes: S301: Calculating the gradient value of each pixel using the Sobel gradient operator; The Sobel operator consists of four 3*3 convolution kernels, which calculate the gradient components in the horizontal, 45°, vertical, and 135° directions respectively. , , , Then by , , , Calculate the gradient intensity and gradient direction of the image; (5); (6); in, It is the gradient magnitude. It is the gradient direction.
