Canny operator edge detection method based on particle swarm optimization optimization

By optimized the edge detection method of the granular group algorithm, the problem of unclear extraction and noise interference of the interference of the intermodation of the intermodal angle measurement in contact angle measurement is solved, and a high -precision and clear liquid droplet boundary detection is improved. And anti -interference ability.

CN119379727APending Publication Date: 2025-01-28TOEC (GRP) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411539632.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing contact angle measurement technology has error problems caused by unclear extraction of micro droplets, breakpoints and blurred boundaries of droplet boundaries, and is affected by environmental factors and noise interference, which affects the measurement accuracy.

Method used

Adopting the edge detection method of Canny operator based on particle group algorithm optimization, through Gaussian filtering, gradient calculation, non -maximum value suppression, and double threshold method, iteratively to find the optimal threshold in combination ability.

Benefits of technology

The clear and continuous testing of the contour of the droplet boundary is realized, the accuracy and anti -interference ability of the contact angle measurement can be improved, the outline of the image is effectively identified, and the display of the image details can be enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005112470230000021
    Figure BDA0005112470230000021
  • Figure BDA0005112470230000022
    Figure BDA0005112470230000022
  • Figure BDA0005112470230000041
    Figure BDA0005112470230000041
Patent Text Reader

Abstract

The invention discloses a particle swarm optimization-based Canny operator edge detection method. The method comprises the following steps of S1, carrying out smoothing processing on an image through a Gaussian filter; s2, calculating an amplitude and a direction for an edge detection function through a first-order partial derivative difference formula; s3, non-maximum suppression is carried out on the gradient amplitude, a point with the maximum local gradient is reserved, a non-maximum is not suppressed, and in other words, a non-local maximum point is zeroed to obtain a refined boundary; according to the method, on the basis of the machine vision principle, interference caused by false boundaries on contact angle measurement is removed from the algorithm level, the particle swarm optimization and the Canny operator are fused and applied to the actual measurement process of the contact angle, an accurate, clear and continuous liquid drop boundary contour image can be obtained, and the accuracy and accuracy of measurement are improved. Therefore, the measurement accuracy of the contact angle is improved, the anti-noise capability is improved, the anti-interference performance is good, the application prospect is wide, and popularization and application are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of edge detection, and in particular to a Canny operator edge detection method based on particle swarm algorithm optimization. Background Art

[0002] In the study of the extreme wettability of solid material surfaces, the contact angle has an important scale significance. The common contact angle measurement is to collect the precise solid, liquid, and gas boundaries of the tiny droplets in a steady state through image acquisition and image processing technology, and solve the angle value of the contact angle using the Young equation. Due to reasons such as illumination and imaging, the current contact angle measurement still has problems such as unclear extraction of the subtle points of the tiny droplet boundaries and breakpoints in the droplet boundary contour. In addition, the existing contact angle measurement technology measures the boundary of the contact surface by visual analysis of the contact surface, which will produce certain errors from a visual perspective. This error comes from the fuzzy boundary. In the actual shooting process of the contact angle, due to interference from environmental factors and other factors, there will be a fuzzy boundary phenomenon in the contact angle picture taken, which will lead to false boundaries in the subsequent image processing process. At this time, it will bring large errors to the measurement of the contact angle, seriously affecting the measurement accuracy of the contact angle. In the process of contact angle measurement, while measuring the contact angle based on the image, it will also be interfered by the noise in the image caused by environmental factors, which will affect the boundary positioning and produce large contact angle measurement errors.

[0003] Edge detection is a basic problem in image processing and computer vision, that is, identifying points with obvious brightness changes in image processing. Compared with other edge detection operators, the Canny operator based on the double threshold method of gradient assignment can detect the image contour more accurately and has a certain noise suppression effect. However, the Canny algorithm contains multiple adjustable parameters, which will affect the calculation time and effectiveness of the algorithm. The setting of the "double threshold" (i.e., the upper threshold and the lower threshold) in the Canny operator directly determines the strong boundary and non-boundary of the image, and it is difficult to give a universal threshold that is applicable to all images. Therefore, it is urgent to develop a Canny operator edge detection method based on particle swarm algorithm optimization to solve the above technical problems.

[0004] In view of this, the present invention is proposed. Summary of the invention

[0005] The purpose of the present invention is to provide a Canny operator edge detection method based on particle swarm algorithm optimization. Based on the principle of machine vision, the interference of false boundaries on contact angle measurement is removed from the algorithm level. The particle swarm algorithm and the Canny operator are integrated and applied to the actual measurement process of the contact angle, so that an accurate, clear and continuous droplet boundary contour image can be obtained, thereby improving the measurement accuracy of the contact angle, and at the same time improving the anti-noise ability, having good anti-interference performance, having broad application prospects, and being conducive to popularization and application.

[0006] In order to achieve the above object, the present invention provides a Canny operator edge detection method based on particle swarm algorithm optimization, comprising the following steps:

[0007] S1: Smooth the image through a Gaussian filter;

[0008] S2: Calculate the amplitude and direction of the edge detection function through the differential formula of the first-order partial derivative;

[0009] S3: Perform non-maximum suppression on the gradient amplitude, retain the point with the largest local gradient, instead of suppressing the non-maximum, that is, set the non-local maximum point to zero to obtain the refined boundary;

[0010] S4: Use dual-range algorithm to detect and continuous edges.

[0011] Preferably, in S1, the Gaussian function H(x, y) in the Gaussian filter is:

[0012]

[0013] G(x, y)=f(x, y)*H(x, y); wherein f(x, y) is image data.

[0014] Preferably, in S2, the first-order difference convolution template used is:

[0015]

[0016] According to the above process into the formula we can get:

[0017] Amplitude:

[0018] direction:

[0019] Preferably, in S3, non-maximum suppression is performed on the gradient amplitude to retain the point with the maximum local gradient, rather than suppressing the non-maximum, that is, setting the non-local maximum point to zero to obtain a refined boundary.

[0020] Preferably, in S4, a particle swarm algorithm is added to perform iteration:

[0021]

[0022] X id (t+1)=X id (t)+V id (t+1);

[0023] Among them, V id is the velocity of the particle, X idis the current particle position, is a random number between (0, 1), C1, C2 are learning factors or acceleration constants, X id is the individual optimal solution, P gd It is the global optimal solution. S1-S4 suppresses the interference of noise on the image through filtering, maintains clear and accurate boundaries, and improves the sensitivity of edge detection. When the particle swarm algorithm is integrated into the Canny operator, the optimal threshold is found in the Canny operator through the iteration of the particle swarm algorithm, and the obtained optimal threshold is brought back to the process of edge detection, that is, an edge detection image with clear boundaries, continuity and filtering effect is obtained.

[0024] The present invention provides a Canny operator edge detection method based on particle swarm algorithm optimization, which has the following beneficial effects.

[0025] 1. The classic Canny operator includes five steps: Gaussian filtering, intensity gradient search, non-maximum suppression, double threshold method to determine the boundary, and hysteresis tracking boundary. The present invention uses the advantages of particle swarm algorithm in computer iteration to optimize the fourth step double threshold of the Canny operator, thereby achieving the purpose of finding the optimal edge detection threshold, making the image contour clear and continuous, and having better anti-noise interference ability and noise interference removal ability, so that the image contour can be effectively recognized.

[0026] 2. The present invention can detect richer boundary information, increase the continuity of the boundary, display more image details, and enhance some blurs in the image, intuitively displaying more image contour information. When edge detection is performed using the Canny operator after particle swarm optimization, the boundary contour of the droplet can be fully displayed, thereby providing image-level guarantees for the high-precision calculation process of the contact angle. The Canny operator has a certain anti-noise ability for the image through Gaussian smoothing filtering, and uses dual threshold and non-maximum suppression and connection technology to effectively extract image edges.

[0027] 3. The present invention applies particle swarm algorithm optimization and utilizes the iterative properties of the algorithm itself to accurately and quickly calculate the optimal solution of the dual threshold of the image, and substitutes the optimal threshold into the Canny operator, which can effectively improve the ability of image edge detection and obtain clear and continuous boundary contours, and has certain practicality and robustness.

[0028] 4. The Canny operator has a certain anti-noise ability for the image through Gaussian smoothing filtering, and the dual threshold and non-maximum suppression and connection technology can effectively extract the image edge. By combining the particle swarm algorithm and the Canny operator, the ability of image edge detection is effectively improved, thereby obtaining a clearer and continuous image boundary contour, which is convenient for the subsequent accurate measurement of the contact angle of the solid surface. DETAILED DESCRIPTION

[0029] The present invention is further described below in conjunction with specific embodiments to help understand the content of the present invention.

[0030] The present invention provides a Canny operator edge detection method based on particle swarm algorithm optimization, comprising the following steps:

[0031] S1: Smooth the image through a Gaussian filter;

[0032] S2: Calculate the amplitude and direction of the edge detection function through the differential formula of the first-order partial derivative;

[0033] S3: Perform non-maximum suppression on the gradient amplitude, retain the point with the largest local gradient, instead of suppressing the non-maximum, that is, set the non-local maximum point to zero to obtain the refined boundary;

[0034] S4: Use dual-range algorithm to detect and continuous edges.

[0035] In S1, the Gaussian function H(x,y) in the Gaussian filter is:

[0036]

[0037] G(x, y)=f(x, y)*H(x, y); wherein f(x, y) is image data.

[0038] In S2, the first-order difference convolution template used is:

[0039]

[0040] According to the above process into the formula we can get:

[0041] Amplitude:

[0042] direction:

[0043] In S3, non-maximum suppression is performed on the gradient amplitude, and the point with the maximum local gradient is retained, rather than suppressing the non-maximum, that is, setting the non-local maximum point to zero to obtain a refined boundary.

[0044] In S4, a particle swarm algorithm is added for iteration:

[0045]

[0046] X id (t+1)=X id (t)+V id (t+1);

[0047] Among them, V id is the velocity of the particle, X id is the current particle position, is a random number between (0, 1), C1, C2 are learning factors or acceleration constants, X id is the individual optimal solution, P gd It is the global optimal solution. S1-S4 suppresses the interference of noise on the image through filtering, maintains clear and accurate boundaries, and improves the sensitivity of edge detection. When the particle swarm algorithm is integrated into the Canny operator, the optimal threshold is found in the Canny operator through the iteration of the particle swarm algorithm, and the obtained optimal threshold is brought back to the process of edge detection, that is, an edge detection image with clear boundaries, continuity and filtering effect is obtained.

[0048] The classic Canny operator includes five steps: Gaussian filtering, intensity gradient search, non-maximum suppression, double threshold method to determine the boundary, and hysteresis tracking boundary. The present invention uses the advantages of particle swarm algorithm in computer iteration to optimize the fourth step double threshold of Canny operator, thereby achieving the purpose of finding the optimal edge detection threshold, making the image contour clear and continuous, and having better anti-noise interference ability and noise interference removal ability, so that the image contour can be effectively identified. The present invention can detect richer boundary information, while increasing the continuity of the boundary, showing more image details, and enhancing some blurs in the image, intuitively showing more image contour information. When edge detection is performed by the Canny operator after particle swarm optimization, the boundary contour of the droplet can be fully displayed, thereby providing image-level guarantees for the high-precision calculation process of the contact angle. The Canny operator has a certain anti-noise ability for the image through Gaussian smoothing filtering, and adopts double threshold and non-maximum suppression and connection technology to effectively extract the image edge. The present invention can accurately and quickly calculate the optimal solution of the double threshold of the image by applying the particle swarm algorithm optimization and utilizing the iterative property of the algorithm itself, and substitute the optimal threshold into the Canny operator, which can effectively improve the ability of image edge detection, obtain a clear and continuous boundary contour, and has certain practicality and robustness. The Canny operator has a certain anti-noise ability for the image through Gaussian smoothing filtering, and adopts double threshold and non-maximum suppression and connection technology to effectively extract the edge of the image. By applying the combination of the particle swarm algorithm and the Canny operator, the ability of image edge detection is effectively improved, thereby obtaining a clearer and continuous image boundary contour, which is convenient for the subsequent accurate measurement of the contact angle of the solid surface.

[0049] The invention concept is described in detail using specific examples herein, and the description of the above embodiments is only used to help understand the core idea of ​​the invention. It should be pointed out that any obvious modification, equivalent substitution or other improvement made by a person of ordinary skill in the art without departing from the invention concept should be included in the protection scope of the present invention.

Claims

1. A Canny operator edge detection method based on particle swarm optimization, characterized in that: The steps include: S1: Smooth the image through a Gaussian filter; S2: Calculate the amplitude and direction of the edge detection function through the differential formula of the first-order partial derivative; S3: Perform non-maximum suppression on the gradient amplitude, retain the point with the largest local gradient, instead of suppressing the non-maximum, that is, set the non-local maximum point to zero to obtain the refined boundary; S4: Use dual-range algorithm to detect and continuous edges.

2. The Canny operator edge detection method based on particle swarm algorithm optimization according to claim 1 is characterized in that: In S1, the Gaussian function H(x,y) in the Gaussian filter is: G(x, y)=f(x, y)*H(x, y); wherein f(x, y) is image data.

3. The Canny operator edge detection method based on particle swarm algorithm optimization according to claim 1 is characterized in that: In S2, the first-order difference convolution template used is: According to the above process into the formula we can get: Amplitude: direction:

4. The Canny operator edge detection method based on particle swarm algorithm optimization according to claim 1 is characterized in that: In S3, non-maximum suppression is performed on the gradient amplitude, and the point with the maximum local gradient is retained, rather than suppressing the non-maximum, that is, setting the non-local maximum point to zero to obtain a refined boundary.

5. The Canny operator edge detection method based on particle swarm algorithm optimization according to claim 1 is characterized in that: In S4, a particle swarm algorithm is added for iteration: X id (t+1)=X id (t)+V id (t+1); Among them, V id is the velocity of the particle, X id is the current particle position, is a random number between (0, 1), C1, C2 are learning factors or acceleration constants, X id is the individual optimal solution, P gd It is the global optimal solution. S1-S4 suppresses the interference of noise on the image through filtering, maintains clear and accurate boundaries, and improves the sensitivity of edge detection. When the particle swarm algorithm is integrated into the Canny operator, the optimal threshold is found in the Canny operator through the iteration of the particle swarm algorithm, and the obtained optimal threshold is brought back to the process of edge detection, that is, an edge detection image with clear boundaries, continuity and filtering effect is obtained.