Dust leakage detection method based on image processing
By calculating the matching coefficient and error coefficient of edge lines, combining the gray mean difference and similar speed, the problem of dust in the air affecting the accuracy of edge lines matching is solved, and the accuracy of dust detection is improved.
Patent Information
- Application Number
- CN202510758767.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-09
AI Technical Summary
In the prior art, due to the presence of dust in the air, the accuracy of edge line matching is low, which affects the accuracy of dust detection results.
By acquiring the reference image and real-time image of the device, performing edge detection, calculating the matching coefficient and error coefficient of the edge line, evaluating the degree of dust leakage using the gray scale mean difference, and judging edge line matching with similar velocities and differential distances to improve matching accuracy.
The edge line matching effect is improved, the accuracy of dust detection results is improved, and the degree of dust leakage can be more accurately judged.
Smart Images

Figure CN120298394A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of dust detection, and particularly to a dust leakage detection method based on image processing. Background Art
[0002] During the production process in an injection molding workshop, due to reasons such as plastic raw material crushing, insufficient sealing of the feeding port and mold parting surface, and aging of the dust-proof rings in the hydraulic system, dust leakage is likely to occur. In addition, problems such as low workshop humidity, electrostatic adsorption, and insufficient coverage of waste gas treatment devices exacerbate dust suspension. The dust is dispersed in the air, which not only reduces the safety of the production environment but also may endanger the health of operators. Therefore, it is necessary to detect the dust content during the production process in the workshop to facilitate the management of the production environment.
[0003] The Chinese patent application document with the publication number CN119147429A discloses a dust concentration intelligent detection method and system. The method includes: obtaining a grayscale image based on a preset sampling interval, using edge detection to obtain at least one region in the grayscale image, and calculating the boundary clarity of the target region; dividing the target region into two sub-regions, and determining the region consistency of the target region according to the region consistency of the two sub-regions; taking the reciprocal of the product of the boundary clarity and the region consistency as the dust score, and when the dust score is greater than a preset threshold, the target region is a dust region; traversing to obtain the total area of the dust regions in the grayscale image, taking the ratio of the total area of the dust regions to the area of the grayscale image as the particle density, and calculating the final concentration value according to the particle density to complete the dust concentration detection.
[0004] In the prior art, by performing edge detection on a real-time obtained grayscale image and matching and comparing the extracted edge line with a standard edge line, the dust content in the air can be detected. When matching the edge lines, if there is dust diffused in the air, the edge line of the object is blurred, resulting in a low accuracy of edge line matching, and further leading to a low accuracy of the dust detection result. Summary of the Invention
[0005] In order to solve the problem of low accuracy of edge line matching caused by dust diffused in the air, the present invention provides a dust leakage detection method based on image processing.
[0006] In a first aspect, the present invention provides a dust leakage detection method based on image processing, adopting the following technical solution: Obtain the reference image of the device and the real-time image during the operation of the device; perform edge detection on the reference image and the real-time image respectively to obtain multiple reference edge lines and multiple real-time edge lines; calculate the matching coefficients between each real-time edge line and the multiple reference edge lines, and further obtain multiple matching coefficients. The matching coefficient represents the similarity degree between the real-time edge line and the reference edge line; calculate the error coefficient of the matching coefficient. When the error coefficient is greater than the preset error threshold, take the real-time edge line and the reference edge line with the largest matching coefficient as the matching edge lines; among the matching edge lines, calculate the difference between the gray mean values of the pixel points of the real-time edge line and the pixel points of the reference edge line, and take the normalized result of the difference as the fuzzy evaluation to detect the dust leakage degree.
[0007] By calculating the matching coefficients between the real-time edge lines and the reference edge lines, and matching the real-time edge lines and the reference edge lines according to the matching coefficients to obtain the matching edge lines, and by comparing the differences in the gray mean values in the matching edge lines, the dust leakage degree can be judged, the matching effect between the real-time edge lines and the reference edge lines is improved, and the accuracy of the dust detection result is further improved.
[0008] Preferably, the method further includes: mapping the real-time image and the reference image into the coordinate system respectively, and further obtaining the position coordinates of each pixel point in the reference edge line and the real-time edge line, and calculating the distance between each pixel point in the real-time edge line and each pixel point in the reference edge line according to the position coordinates of the pixel points.
[0009] By calculating the distance between the pixel points in the real-time edge line and the pixel points in the reference edge line, a theoretical basis is provided for calculating the matching coefficient.
[0010] Preferably, the expression of the matching coefficient is:
[0011] In the formula, r represents the matching coefficient between the real-time edge line and the reference edge line, represents the distance between the nth pixel point in the real-time edge line and the (k + n)th pixel point in the reference edge line, m represents the total number of pixel points in the real-time edge line, mid represents the median, represents the distance between the mth pixel point in the real-time edge line and the (k + m)th pixel point in the reference edge line.
[0012] By calculating the matching coefficient, the real-time edge line and the reference edge line can be matched to obtain the matching edge line, which is convenient for detecting the dust concentration in the air.
[0013] Preferably, the expression of the error coefficient is:
[0014] Wherein, w represents the error coefficient of the matching coefficient between the real-time edge line and multiple reference edge lines, represents the maximum value among multiple matching coefficients, represents the second largest value among multiple matching coefficients.
[0015] The error coefficient is obtained through calculation, and the accuracy of the matching coefficient can be measured by the error coefficient.
[0016] Preferably, the method further includes: when the error coefficient of the matching coefficient is less than a preset coefficient threshold, calculating the difference distance and similarity speed between the reference edge line and the real-time edge line, the similarity speed is negatively correlated with the difference distance, the difference distance represents the difference between the reference edge line and the real-time edge line, and taking the real-time edge line and the reference edge line with the maximum similarity speed as the matching edge lines.
[0017] Preferably, the method further includes: moving the real-time edge line to obtain a first auxiliary area; intercepting a sub-edge line on the reference edge line, the length of the sub-edge line is the same as that of the real-time edge line, moving the sub-edge line to obtain a second auxiliary area, the first auxiliary area is the same size as the second auxiliary area, calculating the difference in gray values of the pixel points at the same positions in the first auxiliary area and the second auxiliary area, and further obtaining a difference area.
[0018] Preferably, the expression of the difference distance is:
[0019] Wherein, is the difference distance between the real-time edge line and the reference edge line when the width of the difference area is c, a is the number of columns of the difference area, b is the number of rows of the difference area, is the value of the x-th row and y-th column of the difference area.
[0020] The difference distance can reflect the difference situation in the area near the real-time edge line and the reference edge line, and can further determine whether the corresponding real-time edge line and reference edge line are matching edge lines, improving the accuracy of the edge line matching result.
[0021] Preferably, the expression of the similarity speed is:
[0022] Wherein, q is the similarity speed when the width of the difference area between the real-time edge line and the reference edge line is c, is the difference distance between the real-time edge line and the reference edge line when the width of the difference area is c, is the difference distance between the real-time edge line and the reference edge line when the width of the difference area is 1, is the width of the difference area, and tanh represents the hyperbolic tangent function.
[0023] The similarity degree between the real-time edge line and the area near the reference edge line can be measured by the similarity speed, providing a basis for judging whether the real-time edge line and the reference edge line are matching edge lines.
[0024] Preferably, the Canny algorithm is used to perform edge detection on the reference image and the real-time image respectively to obtain multiple reference edge lines and multiple real-time edge lines.
[0025] Preferably, before performing edge detection on the reference image and the real-time image, there is also a step of denoising the reference image and the real-time image.
[0026] The present invention has the following technical effects: 1. Calculate the matching coefficient between the real-time edge line and the reference edge line, and match the real-time edge line and the reference edge line according to the matching coefficient to obtain the matching edge line. By comparing the difference in the gray mean value in the matching edge line, the leakage degree of dust can be judged, improving the matching effect between the real-time edge line and the reference edge line, and further improving the accuracy of the dust detection result.
[0027] 2. By calculating the similarity speed, it can be further judged whether the real-time edge line and the reference edge line are matching edge lines, improving the accuracy of the calculation result of the matching edge line, and further improving the accuracy of the dust detection result. Description of the Drawings
[0028] Figure 1 is a flowchart of the dust leakage detection method based on image processing of the present invention. Detailed Embodiments
[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0030] The embodiments of the present invention disclose a dust leakage detection method based on image processing, referring to Figure 1 , including the following steps: S1: Obtain the reference image of the device and the real-time image during the operation of the device, and perform edge detection on the reference image and the real-time image respectively to obtain multiple reference edge lines and multiple real-time edge lines.
[0031] Set up an industrial camera in the injection molding workshop. When the equipment in the injection molding workshop is in a stopped state, use the industrial camera to take a workshop image as a reference image. The reference image is an image when there is no dust in the air, and the reference image has clear edges. When the equipment in the injection molding workshop is in a production state, obtain the image in the workshop in real time, use the obtained image in the workshop in real time as a real-time image, perform denoising processing on the real-time image and the reference image, use the canny algorithm to obtain multiple reference edge lines for the reference image, use the canny algorithm to perform edge detection on the real-time image to obtain multiple real-time edge lines. When dust leakage occurs in the workshop, the edges in the real-time image will become blurred. Therefore, when using the canny algorithm to perform edge detection on the real-time image, the detected edges will show a discontinuous phenomenon.
[0032] S2: Calculate the matching coefficient between each real-time edge line and multiple reference edge lines to further obtain multiple matching coefficients. The matching coefficient represents the similarity degree between the real-time edge line and the reference edge line.
[0033] Construct a rectangular coordinate system in the reference image to obtain the position coordinates of each pixel point in the reference edge line. Construct a rectangular coordinate system in the real-time image to obtain the position coordinates of each pixel point in the real-time edge line. Calculate the distance between each pixel point in the real-time edge line and each pixel point in the reference edge line according to the position coordinates of the pixel points.
[0034] The expression of the matching coefficient is:
[0035] In the formula, r represents the matching coefficient between the real-time edge line and the reference edge line, represents the distance between the nth pixel point in the real-time edge line and the (k + n)th pixel point in the reference edge line, represents the distance between the mth pixel point in the real-time edge line and the (k + m)th pixel point in the reference edge line. m represents the total number of pixel points in the real-time edge line. mid represents the median. The denominator term is set to 0.1 to prevent the denominator from being 0.
[0036] is the distance sequence of pixel points on the real-time edge line and pixel points on the reference edge line. The median is used to represent the intermediate value of the distance between the real-time edge and the reference edge; It represents the average of the differences between other distance values and this intermediate value, so as to indicate the degree of fitting between the first to the m-th pixel points on the real-time edge line and the k-th to k+m-th pixel points on the reference edge line. The larger the matching coefficient, the more likely the corresponding real-time edge line and the reference edge line are the edge lines at the same position of the workshop equipment. It can be understood that there is a matching coefficient corresponding to any real-time edge line in the real-time image and any reference edge line in the reference image.
[0037] S3: Calculate the error coefficient of the matching coefficient. When the error coefficient is greater than the preset error threshold, take the real-time edge line and the reference edge line with the largest matching coefficient as the matching edge lines.
[0038] The expression of the error coefficient is:
[0039] In the formula, w represents the error coefficient of the matching coefficient between the real-time edge line and multiple reference edge lines, represents the maximum value among multiple matching coefficients, represents the second largest value among multiple matching coefficients. The error threshold is set manually according to the actual situation. Exemplarily, the error threshold is 0.3.
[0040] Since there may be multiple similar edges in the real-time image and the reference image, separately matching the edges will result in a relatively high error rate of matching. It may obtain several edges with similar matching coefficients, that is, one real-time edge line is matched to multiple reference edge lines. The error coefficient expresses the difference between the larger matching coefficients. If the difference between the maximum value and the second largest value among the matching coefficients is large, it indicates that the matching effect of the corresponding real-time edge line is good. At this time, take the real-time edge line and the reference edge line with the largest matching coefficient as the matching edge lines, that is, the real-time edge line and the reference edge line with the largest matching coefficient correspond to the edge lines at the same position.
[0041] S4: When the error coefficient of the matching coefficient is less than the preset coefficient threshold, calculate the difference distance and the similarity speed between the reference edge line and the real-time edge line. The similarity speed is negatively correlated with the difference distance. Take the real-time edge line and the reference edge line with the largest similarity speed as the matching edge lines.
[0042] When the error coefficient of the matching coefficient is less than the preset coefficient threshold, it indicates that the matching effect between the real-time edge line and the reference edge line this time is poor, and it is necessary to further verify the real-time edge line and the reference edge line with relatively large matching coefficients.
[0043] Exemplarily, for the error coefficient of multiple matching coefficients corresponding to the first real edge line in the real-time image being less than 0.3, where the matching coefficient between the first real edge line in the real-time image and the third reference edge line in the reference image is the largest, and the matching coefficient with the fourth reference edge line is the second largest. At this time, it is necessary to calculate the difference distance and similarity speed between the first real edge line and the third and fourth reference edge lines respectively.
[0044] The calculation methods of the difference distance and similarity speed are as follows: Move the real edge line to obtain the first auxiliary area; intercept a sub-edge line on the reference edge line, the length of the sub-edge line is the same as that of the real edge line, move the sub-edge line to obtain the second auxiliary area, the first auxiliary area and the second auxiliary area are of the same size, calculate the difference in the gray values of the pixel points at the same positions in the first auxiliary area and the second auxiliary area, and further obtain the difference area.
[0045] The expression of the difference distance is:
[0046] In the formula, is the difference distance between the real edge line and the reference edge line when the width of the difference area is c, a is the number of columns of the difference area, b is the number of rows of the difference area, is the value of the x-th row and y-th column of the difference area.
[0047] is the distance from the difference area to zero. The smaller this value is, the smaller the overall difference in the gray values of the two auxiliary areas of the real edge line and the reference edge line when the width is c, indicating that the similarity degree between the first auxiliary area and the second auxiliary area is greater, and the corresponding matching degree between the real edge line and the reference edge line is higher.
[0048] The expression of the similarity speed is:
[0049] In the formula, q is the similarity speed between the real edge line and the reference edge line when the width of the difference area between them is c, is the difference distance between the real edge line and the reference edge line when the width of the difference area is c, is the difference distance between the real edge line and the reference edge line when the width of the difference area is 1, is the width of the difference area, and tanh represents the hyperbolic tangent function. is the difference change speed of the difference areas with widths of c and 1 of the difference area, which is used to limit the infinite growth of the difference change speed.
[0050] When there is dust in the air, the real-time edge line is blurred, resulting in the problem that edge pixel points cannot be detected during the detection of the real-time edge line. Therefore, the length of the real-time edge line at the same position is less than or equal to the length of the reference edge line. Based on this background, an example is given below to facilitate the understanding of this solution.
[0051] Exemplarily, the number of pixel points of the first real-time edge line in the real-time image is 5 and it is distributed vertically. The number of pixel points of the third reference edge line in the reference image is 8 and it is distributed vertically. At this time, move the first real-time edge line 3 pixel points to the left and right sides respectively to obtain the first auxiliary area. It can be understood that at this time, the value of c is 6; in the third reference edge line in the reference image, intercept 5 pixel points starting from the first pixel point on the upper side as the sub-edge line, move the third reference edge line 3 pixel points to the left and right sides respectively to obtain the second auxiliary area, and further obtain the difference area and the similarity speed corresponding to the difference area.
[0052] Then, intercept 5 pixel points starting from the second pixel point on the upper side as the sub-edge line, move the third reference edge line 3 pixel points to the left and right sides respectively to obtain the second auxiliary area, and further obtain the difference area and the similarity speed corresponding to the difference area;...; intercept 5 pixel points starting from the fourth pixel point on the upper side as the sub-edge line, move the third reference edge line 3 pixel points to the left and right sides respectively to obtain the second auxiliary area, and further obtain the difference area and the similarity speed corresponding to the difference area. Among the obtained multiple similarity speeds, take the maximum value as the similarity speed between the first real-time edge line and the third reference edge line and the real-time edge line.
[0053] Similarly, calculate the similarity speed between the first real-time edge line and the fourth reference edge line. If the similarity speed between the first real-time edge line and the fourth reference edge line is greater than the similarity speed between the first real-time edge line and the third reference edge line, then take the first real-time edge line and the fourth reference edge line as the matching edge lines.
[0054] S5: Among the matching edge lines, calculate the difference between the gray mean values of the pixel points of the real-time edge line and the pixel points of the reference edge line, and take the normalized result of the difference as the blur evaluation to detect the leakage degree of the dust.
[0055] Among the matching edge lines, calculate the gray mean values of the pixel points of the real-time edge line and the pixel points of the reference edge line, calculate the difference according to the two gray mean values, further obtain multiple differences, and perform normalization processing on the differences to be used to evaluate the leakage degree of the detected dust.
[0056] Exemplarily, among the multiple normalized differences, the more the number of differences greater than the leakage threshold, the more serious the degree of dust leakage in the workshop. If the number of differences greater than the leakage threshold is 0, it indicates that there is no dust leakage in the workshop. The leakage threshold is set artificially according to the actual situation. Exemplarily, the leakage threshold is 0.3.
[0057] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited hereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention shall be covered within the protection scope of the present invention.
Claims
1. A dust leakage detection method based on image processing, characterized in that, Including the steps: Obtain a reference image of the device and a real-time image during the operation of the device; perform edge detection on the reference image and the real-time image respectively to obtain multiple reference edge lines and multiple real-time edge lines; calculate the matching coefficients between each real-time edge line and the multiple reference edge lines, and further obtain multiple matching coefficients, where the matching coefficient represents the similarity degree between the real-time edge line and the reference edge line; Calculate the error coefficient of the matching coefficient. When the error coefficient is greater than a preset error threshold, take the real-time edge line and the reference edge line with the largest matching coefficient as the matching edge lines; Among the matching edge lines, calculate the difference between the gray-scale mean values of the pixel points of the real-time edge line and the pixel points of the reference edge line, and take the normalized result of the difference as a fuzzy evaluation to detect the dust leakage degree.
2. The dust leakage detection method based on image processing according to claim 1, characterized in that, The method further includes: mapping the real-time image and the reference image into a coordinate system respectively, and further obtaining the position coordinates of each pixel point in the reference edge line and the real-time edge line, and calculating the distance between each pixel point in the real-time edge line and each pixel point in the reference edge line according to the position coordinates of the pixel points.
3. The dust leakage detection method based on image processing according to claim 2, characterized in that The expression of the matching coefficient is: Wherein, r represents the matching coefficient between the real-time edge line and the reference edge line. represents the distance between the nth pixel point in the real-time edge line and the (k + n)th pixel point in the reference edge line, m represents the total number of pixel points in the real-time edge line, and mid represents the median. represents the distance between the mth pixel point in the real-time edge line and the (k + m)th pixel point in the reference edge line.
4. The dust leakage detection method based on image processing according to claim 1, characterized in that The expression of the error coefficient is: Wherein, w represents the error coefficient of the matching coefficient between the real-time edge line and multiple reference edge lines. represents the maximum value among multiple matching coefficients. represents the second largest value among multiple matching coefficients.
5. The dust leakage detection method based on image processing according to claim 4, characterized in that The method further includes: when the error coefficient of the matching coefficient is less than a preset coefficient threshold, calculate the difference distance and the similarity speed between the reference edge line and the real-time edge line. The similarity speed is negatively correlated with the difference distance, and the difference distance represents the difference between the reference edge line and the real-time edge line. Take the real-time edge line and the reference edge line with the largest similarity speed as the matching edge lines.
6. The dust leakage detection method based on image processing according to claim 5, wherein The method further includes: moving the real-time edge line to obtain a first auxiliary area; intercepting a sub-edge line on the reference edge line, where the length of the sub-edge line is the same as the length of the real-time edge line, moving the sub-edge line to obtain a second auxiliary area, the first auxiliary area and the second auxiliary area are of the same size, and calculating the difference between the gray-scale values of the pixel points at the same positions in the first auxiliary area and the second auxiliary area, and further obtaining a difference area.
7. The dust leakage detection method based on image processing according to claim 6, characterized in that, The expression of the difference distance is: In the formula, is the difference distance between the real-time edge line and the reference edge line when the width of the difference area is c, a is the number of columns of the difference area, b is the number of rows of the difference area, is the value at the y-th column and x-th row of the difference area.
8. The dust leakage detection method based on image processing according to claim 7, wherein The expression of the similarity speed is: In the formula, q is the similarity speed when the width of the difference area between the real-time edge line and the reference edge line is c, is the difference distance between the real-time edge line and the reference edge line when the width of the difference area is c, is the difference distance between the real-time edge line and the reference edge line when the width of the difference area is 1, is the width of the difference area, and tanh represents the hyperbolic tangent function.
9. The dust leakage detection method based on image processing according to claim 1, characterized in that, Use the canny algorithm to perform edge detection on the reference image and the real-time image respectively to obtain multiple reference edge lines and multiple real-time edge lines.
10. The dust leakage detection method based on image processing according to claim 1, characterized in that, Before performing edge detection on the reference image and the real-time image, it further includes the step of denoising the reference image and the real-time image.
Citation Information
Patent Citations
Adaptive template matching algorithm based on edge detection
CN105704496A
Infrared image enhancement method for gas concentration analysis
CN115841434A
Part installation detection method and device, electronic equipment and storage medium
CN116721047A
Image processing method, image processing program, and image processing apparatus
US20070115371A1