Flange plate online detection method and system based on machine vision

Through machine vision technology, the flange edge detection is performed using the improved Canny operator and Zernike algorithm, and the existing flange detection efficiency is solved, and efficient dimensional measurement and quality control are achieved.

CN118982531AInactive Publication Date: 2024-11-19YANCHENG INST OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411116495.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing flange production process has low dimensional detection efficiency and high error detection rate, which cannot effectively guarantee product quality.

Method used

Using an online detection method based on machine vision, the flange transmission image is obtained, and the improved Canny operator edge extraction algorithm and Zernike subpixel edge detection algorithm are used to realize edge extraction and size measurement by acquiring flange transmission images. .

Benefits of technology

It improves the production efficiency of flange, can detect equipment abnormalities in time, ensures product dimensional accuracy, and reduces the error detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982531A_ABST
    Figure CN118982531A_ABST
Patent Text Reader

Abstract

The invention provides a flange plate online detection method and system based on machine vision. The method comprises the following steps: acquiring a transmission image of a flange plate during transmission; performing static processing on the transmission image to obtain a static image; carrying out edge extraction operation on the static image by adopting an improved Canny operator edge extraction algorithm, and determining an edge; and fitting the edge and measuring the size. According to the flange plate online detection method and system based on machine vision, efficient quality inspection of the flange plate in the production process is achieved, the production efficiency of the flange plate is improved, and abnormity of equipment can be found in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and in particular to an online flange detection method and system based on machine vision. Background Art

[0002] Automobile flanges are an important part of the automobile suspension system, used to connect the wheel axle to the suspension system. The flanges provide firm support and stable fixation for the wheel axle, ensuring that the wheels can rotate smoothly, and effectively absorbing and transmitting various forces and vibrations generated during vehicle driving. However, during the production process, due to reasons such as materials and processes, the flange size deviation is often too large, resulting in insufficient flange size accuracy. At present, companies mainly rely on manual sampling with inspection tools or measuring tools for flange size detection, which not only has low detection efficiency, but also has a high false detection rate, and cannot fully guarantee product quality.

[0003] In industrial inspection, the most common application of machine vision is the dimensional measurement of various mechanical parts. Machine vision measurement has the advantages of non-destructive, high speed and low cost, and is increasingly used in modern industrial production. How to achieve efficient dimensional inspection of flanges during the production process will help improve the production efficiency of flanges and detect equipment abnormalities in a timely manner. Summary of the invention

[0004] One of the purposes of the present invention is to provide a flange online detection method and system based on machine vision, so as to realize efficient geological inspection of flanges during the production process, improve the production efficiency of flanges, and detect equipment abnormalities in a timely manner.

[0005] An embodiment of the present invention provides a flange online detection method based on machine vision, comprising:

[0006] Acquire the transmission image of the flange during transmission;

[0007] Performing static processing on the transmitted image to obtain a static image;

[0008] The improved Canny operator edge extraction algorithm is used to perform edge extraction operations on static images to determine the edges;

[0009] Fit the edges and measure the dimensions.

[0010] Preferably, the static processing steps are as follows:

[0011] According to the transmission parameters of the flange, the pixels in the pre-configured static template are associated with the pixels in the transmitted image.

[0012] Pixels in the static template copy pixel values ​​from pixels in the transmitted image to which they are associated.

[0013] Preferably, the edge extraction operation includes:

[0014] The static image is filtered using bilateral filtering method;

[0015] Calculate the gradient magnitude;

[0016] Compare the current pixel gradient magnitude with the gradient magnitudes on both sides of the gradient direction. If it is an extreme point, keep the pixel as an edge point; if not, keep it as a non-edge point.

[0017] The double thresholds obtained by Otsu's method are used to detect and connect edges;

[0018] The improved Zernike sub-pixel edge detection algorithm is used to detect edges.

[0019] Preferably, the bilateral filtering formula is as follows:

[0020]

[0021] Where i, j are the coordinates of the current convolved pixel, k, l are the coordinates of the domain pixel; g(i, j) represents the template weight of the bilateral filter, and f(k, l) represents the spatial domain weight;

[0022] ω(i, j, k, l) represents the intensity domain weight.

[0023] Preferably, calculating the gradient amplitude includes:

[0024] The gradient template is as follows:

[0025]

[0026] In the formula, H x , H y , H 45° , H 135° Respectively represent the horizontal direction, vertical direction, 45° direction and 135° direction of the gradient template;

[0027] The gradient components in four directions are obtained by plane convolution of the multi-directional Canny template; the calculation formula is as follows:

[0028]

[0029] Where P x (i, j), P y (i, j), P 45° (i, j), P 135° (i, j) is the partial derivative of the gradient template in each direction;

[0030] Calculate the final gradient M, the calculation formula is as follows:

[0031]

[0032] In the formula, θ is the gradient direction, f x (i,j) and f y (i, j) represent the horizontal and vertical directions respectively; the gradient weighting coefficients are represented by α and β respectively, and the gradient in each direction is M x 、M y 、M 45° and M 135° .

[0033] Preferably, the calculation formula for obtaining the double threshold by the Otsu method is as follows:

[0034] Assume there is a threshold T h Divide all pixels of the image into two categories, C1 and C2. The grayscale means of C1 and C2 are m1 and m2 respectively. The global average grayscale value of the image is m. The probability of pixels being divided into C1 and C2 is p1 and p2 respectively. Then:

[0035]

[0036] σ 2 =p1(m1-m) 2 +p2(m2-m) 2

[0037] When σ 2 When the maximum value is reached, the optimal threshold value T is obtained. h As the high threshold of the dual threshold, select 0.5×T h , as the lower threshold of the dual threshold.

[0038] Preferably, an improved Zernike sub-pixel edge detection algorithm is used to detect edges, including:

[0039] Step 1: Use the traditional Zernike moment detection algorithm to obtain five different orders of Zernike moments Z 00 , Z 11 , Z 20 , Z 31 , Z 40 ; The calculation formula is as follows:

[0040]

[0041] In the formula, is the nth order and mth degree Zernike moment polynomial V nm The complex conjugate of (ρ,θ), ρ is the length of the vector from the origin to the point (x,y), and θ is the angle between the vector and the X-axis in the counterclockwise direction;

[0042] Step 2: According to the rotational invariance property of Zernike orthogonal moments, calculate Z′ 00 , Z′ 11 , Z′ 20 , Z′ 31 , Z′ 40 ; The formula is as follows:

[0043]

[0044] Step 3: According to Z′ 00 , Z′ 11 , Z′ 20 , Z′ 31 , Z′ 40 Derive l1, l2 and k, and calculate l; the calculation formula is as follows:

[0045]

[0046] Step 4: Substitute l into the formula of k and h to calculate k and h; the formula is as follows:

[0047]

[0048] Step 5: Determine whether the parameters of each edge pixel meet the judgment condition, that is, k ≥ k t and

[0049] Step 6: Use a new sub-pixel edge judgment criterion k ≥ k t ∩|l2-l1|≤l t , the pixel-level coarse edge points obtained by the improved Canny operator are judged, and those that meet the requirements are edge pixels, otherwise they are not.

[0050] The present invention also provides a flange online detection system based on machine vision, comprising: an image acquisition unit, a static processing unit, an edge extraction unit and a fitting measurement unit;

[0051] Among them, the image acquisition unit acquires the transmission image of the flange during transmission; the static processing unit performs static processing on the transmission image to obtain a static image; the edge extraction unit uses an improved Canny operator edge extraction algorithm to perform edge extraction operations on the static image to determine the edge; the fitting measurement unit fits the edge and measures the size.

[0052] Preferably, the static processing unit performs the following operations:

[0053] According to the transmission parameters of the flange, the pixels in the pre-configured static template are associated with the pixels in the transmitted image.

[0054] Pixels in the static template copy pixel values ​​from pixels in the transmitted image to which they are associated.

[0055] Preferably, the edge extraction unit performs the following operations:

[0056] The static image is filtered using bilateral filtering method;

[0057] Calculate the gradient magnitude;

[0058] Compare the current pixel gradient magnitude with the gradient magnitudes on both sides of the gradient direction. If it is an extreme point, keep the pixel as an edge point; if not, keep it as a non-edge point.

[0059] The double thresholds obtained by Otsu's method are used to detect and connect edges;

[0060] The improved Zernike sub-pixel edge detection algorithm is used to detect edges.

[0061] Preferably, the fitting measurement unit performs the following operations:

[0062] The inner and outer diameter profiles of circular hole parts are fitted by the least square method to achieve size measurement.

[0063] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0064] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0066] Figure 1 Schematic diagram of a flange online detection method based on machine vision in an embodiment of the present invention;

[0067] Figure 2 Schematic diagram of an ideal boundary step in an embodiment of the present invention;

[0068] Figure 3 Schematic diagram of a flange online detection system based on machine vision in an embodiment of the present invention. DETAILED DESCRIPTION

[0069] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0070] The embodiment of the present invention provides a flange online detection method based on machine vision, such as Figure 1 As shown, including:

[0071] Step S1: Acquire a transmission image of the flange during transmission;

[0072] Step S2: performing static processing on the transmitted image to obtain a static image;

[0073] Step S3: using an improved Canny operator edge extraction algorithm to perform edge extraction operations on the static image to determine the edge;

[0074] Step S4: Fit the edge and measure the size.

[0075] The static processing steps are as follows:

[0076] According to the transmission parameters of the flange, the pixels in the pre-configured static template are associated with the pixels in the transmitted image.

[0077] Pixels in the static template copy pixel values ​​from pixels in the transmitted image to which they are associated.

[0078] The edge extraction operation includes:

[0079] The static image is filtered using bilateral filtering method;

[0080] Calculate the gradient magnitude;

[0081] Compare the current pixel gradient magnitude with the gradient magnitudes on both sides of the gradient direction. If it is an extreme point, keep the pixel as an edge point; if not, keep it as a non-edge point.

[0082] The double thresholds obtained by Otsu's method are used to detect and connect edges;

[0083] The improved Zernike sub-pixel edge detection algorithm is used to detect edges.

[0084] To introduce the principle of edge extraction, we first need to understand some basics, such as: Zernike moment principle;

[0085] Zernike moments are orthogonal functions based on Zernike polynomials. Zernike orthogonal moments are widely used. They are rotationally invariant and less sensitive to noise. By calculating the step grayscale value, background grayscale value, vertical distance from the center of the circle to the edge of the image, and the angle between the X-axis and the vertical line of the image edge of the Zernike moment edge model, sub-pixel coordinates can be obtained to obtain accurate image edges.

[0086] The nth-order and mth-order Zernike moment Z of a continuous image f(x,y) nm The definition is as follows:

[0087]

[0088] Where: x, y satisfy x+y≤1; is the nth order and mth degree Zernike moment polynomial V nm The complex conjugate of (ρ,θ), where ρ is the length of the vector from the origin to the point (x,y), and θ is the angle between the vector and the counterclockwise direction of the X-axis.

[0089] Under discrete conditions, the Zernike moments are as follows:

[0090]

[0091] The principle of sub-pixel edge detection using the Zernike moment method: The ideal edge step model is as follows: Figure 2 shown. Figure 2 In the figure: (x0, y0) is the origin coordinate; L is the ideal edge of the image; k is the step amplitude between the background and the target area; h is the gray value of the image background; l is the vertical distance between the center of the circle and L; α is the angle between line l1 and the X-axis.

[0092] If the edge is rotated by -α, the Zernike moment Z′ after rotation nm and the Zernike moment Z before rotation nm The relationship is as follows:

[0093] Z′ nm =Z nm e -pmα ;

[0094] Where: p is the imaginary unit.

[0095] Using Z 11 The imaginary part Im[Z 11 ] and the real part Re[Z 11 ], the rotation angle, that is, the angle α, can be obtained, and the result is as follows:

[0096]

[0097] Derived Z′ 00, Z′ 11 and Z′ 20 , as shown in the formula:

[0098]

[0099] The parameters h, k and l can be obtained from the formula, as shown in the formula:

[0100]

[0101] Finally, the sub-pixel edge detection formula is obtained, as shown in the formula:

[0102]

[0103] Where: (x s ,y s ) are sub-pixel edge coordinates.

[0104] Then, when the unit circle is sampled using an N×N template in the discrete case, the Zernike moment sub-pixel coordinate calculation formula is:

[0105]

[0106] Improved Canny operator edge extraction algorithm: The Canny algorithm is a widely used edge detection algorithm, which mainly consists of four steps: convolution smoothing the image with a two-dimensional Gaussian template; calculating the gradient amplitude and direction of each pixel; non-maximum suppression of the gradient amplitude; double threshold algorithm detection and connection of edges. The traditional Canny algorithm has many shortcomings: edge protection is ignored when using Gaussian filtering; gradient calculation using a 2x2 neighborhood is easily affected by noise, resulting in the loss of target edges; and the artificial setting of double thresholds has low adaptability.

[0107] The traditional Canny operator was improved in the process of rough extraction of pixel-level edges. The improved algorithm optimized the image input process. At the same time, improvements were made to the shortcomings of the traditional algorithm in image denoising process, gradient amplitude calculation, and threshold selection method. Ultimately, the obtained pixel-level edge points have better continuity and the edge information is more accurate, which provides a basis for subsequent fine positioning of the edges and reduces the workload of subsequent sub-pixel precise positioning.

[0108] Use bilateral filtering instead of Gaussian filtering: During the image acquisition process, noise will be generated due to factors such as the external environment. Since Gaussian filtering will ignore the protection of edges, in order to ensure the integrity of the edges, this system uses bilateral filtering to denoise the image. Bilateral filtering is a nonlinear filtering method that adds pixel value weights to Gaussian filtering, while taking into account spatial information and grayscale similarity, maintaining the edge information of the image target and achieving noise reduction effects.

[0109] Bilateral filtering is shown in the following formula, where i and j are the coordinate points of the current convolved pixel, and k and l are the coordinate points of the domain pixel.

[0110]

[0111] Where g(i, j) represents the template weight of the bilateral filter, f(k, l) represents the spatial domain weight, and ω(i, j, k, l) represents the intensity domain weight.

[0112] Sobel operator is used to calculate the gradient amplitude: In the edge detection algorithm, the size of the gradient can well reflect the pixel changes of the image. On the basis of the traditional Sobel operator, 45° and 135° direction templates are added to transform the direction template into four directions: horizontal and vertical, 45° and 135°. The first-order partial derivatives in the x, y, 45° and 135° directions are calculated in the pixel 8 neighborhood, so the improved template is more accurate in edge positioning and can better suppress noise than the traditional template. The specific template is as follows:

[0113]

[0114] In the formula, H x , H y , H 45° , H 135° They represent the horizontal, vertical, 45° and 135° directions of the gradient template respectively. The original image after filtering uses the plane convolution of the multi-directional Canny template to obtain the gradient components in four directions. The gradient calculation process is as follows:

[0115]

[0116] The previous formula is the partial derivative of the gradient template in each direction. In the next formula, θ is the gradient direction, and f x (i,j) and f y (i, j) represent the horizontal and vertical directions respectively. The gradient weight coefficients are represented by α and β respectively, and the gradient in each direction is M x 、M y 、M 45° and M 135° , finally, the final gradient M can be obtained.

[0117] Non-maximum suppression: The edge extracted only by the gradient value is still very fuzzy. The purpose of non-maximum suppression is to refine the edge. The basic method is to compare the gradient intensity of the current pixel with the gradient values ​​on both sides of the gradient direction. If it is an extreme point, the pixel is retained as an edge point; if not, it is a non-edge point.

[0118] A more accurate method is used to determine whether a pixel can form an edge. In addition to considering the gradient magnitude of the pixel, the direction of the gradient is also considered. Specifically, if the gradient magnitude of the current pixel in the x direction is greater than the gradient magnitude in the y direction, then the x-direction gradient is used for judgment; otherwise, the y-direction gradient is used for judgment. By considering the direction of the gradient, we can better capture the edge of the image, thereby improving the accuracy of edge detection.

[0119] Otsu threshold selection: After completing maximum value suppression, the image still contains some noise and false edges. The double threshold method is used in the Canny algorithm to reduce false edges. In order to solve the problem of double threshold selection difficulties, we improved the threshold selection method of the traditional Canny algorithm and used the Otsu method to obtain adaptive double thresholds to optimize the shortcomings of traditional manual experience threshold selection. The specific algorithm is as follows:

[0120] Assume there is a threshold T h Divide all pixels of the image into two categories, C1 and C2. The grayscale means of C1 and C2 are m1 and m2 respectively. The global average grayscale value of the image is m. The probability of pixels being divided into C1 and C2 is p1 and p2 respectively. Then:

[0121]

[0122] σ 2 =p1(m1-m) 2 +p2(m2-m) 2

[0123] When σ 2 When the maximum value is reached, the optimal threshold value T is obtained. h As the high threshold of the dual threshold, select 0.5×T h , as the lower threshold of the dual threshold.

[0124] Improved Canny-Zernike moment sub-pixel edge detection algorithm: When calculating the Zernike moment, the traditional algorithm identifies the centroid of the image as the coordinate origin and projects the entire image into the unit circle. The improved Canny-Zernike sub-pixel edge detection algorithm does not need to traverse the entire image. Therefore, the sub-pixel edge detection method can improve the detection speed.

[0125] Selection of Zernike template coefficients: The value of the Zernike moment obtained using Zernike templates of different orders directly affects the image edge detection accuracy in the sub-pixel detection process. Generally speaking, the larger the template size, the higher the detection accuracy will be, but the time will also be longer. Taking comprehensive consideration of the needs, a 7ⅹ7 Zernike moment parameter template will be used to further improve the detection accuracy of the algorithm.

[0126] Improvement on the edge judgment condition of Zernike moment algorithm: The improved algorithm adds Z 00 , Z 11 , Z 20 Expand to Z 31 , Z 40 Coefficient template, at the same time, adopt the new edge judgment condition k≥k t ∩|l2-l1|≤l t Instead of the traditional edge judgment condition k≥k t ∩l2-l1≤l t The specific algorithm is as follows:

[0127]

[0128] From this we can deduce:

[0129]

[0130] The specific implementation steps of the improved algorithm are as follows:

[0131] Step 1: Use the traditional Zernike moment detection algorithm to obtain five different orders of Zernike moments Z 00 , Z 11 , Z 20 , Z 31 , Z 40 ;

[0132] Step 2: According to the rotational invariance property of Zernike orthogonal moments, calculate Z′ 00 , Z′ 11 , Z′ 20 , Z′ 31 , Z′ 40 ;

[0133] Step 3: According to Z′ 00 , Z′ 11 , Z′ 20 , Z′ 31 , Z′ 40 Derive l1, l2 and k, and calculate l;

[0134] Step 4: Substitute l into the formula of k and h to calculate k;

[0135] Step 5: Determine whether the parameters of each edge pixel meet the judgment condition, that is, k ≥ k t and

[0136] Step 6: Use a new sub-pixel edge judgment criterion k ≥ k t ∩|l2-l1|≤l tThen, the pixel-level rough edge points obtained by using the improved Canny operator are identified. Those that meet the requirements are edge pixels, and those that do not meet the requirements are not.

[0137] The present invention also provides a flange online detection system based on machine vision, such as Figure 3 As shown, it includes: an image acquisition unit 1, a static processing unit 2, an edge extraction unit 3 and a fitting measurement unit 4;

[0138] Among them, the image acquisition unit 1 acquires the transmission image of the flange during transmission; the static processing unit 2 performs static processing on the transmission image to obtain a static image; the edge extraction unit 3 uses an improved Canny operator edge extraction algorithm to perform edge extraction operations on the static image to determine the edge; the fitting measurement unit 4 fits the edge and measures the size.

[0139] The static processing unit 2 performs the following operations:

[0140] According to the transmission parameters of the flange, the pixels in the pre-configured static template are associated with the pixels in the transmitted image.

[0141] Pixels in the static template copy pixel values ​​from pixels in the transmitted image to which they are associated.

[0142] The edge extraction unit 3 performs the following operations:

[0143] The static image is filtered using bilateral filtering method;

[0144] Calculate the gradient magnitude;

[0145] Compare the current pixel gradient magnitude with the gradient magnitudes on both sides of the gradient direction. If it is an extreme point, keep the pixel as an edge point; if not, keep it as a non-edge point.

[0146] The double thresholds obtained by Otsu's method are used to detect and connect edges;

[0147] The improved Zernike sub-pixel edge detection algorithm is used to detect edges.

[0148] The fitting measurement unit 4 performs the following operations:

[0149] The inner and outer diameter profiles of circular hole parts are fitted by the least square method to achieve size measurement.

[0150] The working principle and beneficial effects of the above embodiments are as follows:

[0151] The flange online detection system based on machine vision in this embodiment is configured on the production control platform of the factory. The image acquisition unit is communicatively connected with the image acquisition device arranged on the flange transmission device. The image acquisition device photographs the flange when the flange transmission device is working to obtain the image. Since the transmission device does not need to be intervened to obtain the image, the detection can be carried out without affecting the transmission, thereby ensuring the production efficiency. However, due to the dynamic shooting, static processing of the image is required, that is, according to the transmission parameters of the flange, the pixels in the pre-configured static template are correspondingly associated with the pixels in the transmission image, and the pixels in the static template copy the pixel values ​​from the pixels in the transmission image associated with it; first, the position of the starting pixel in the static template in the template is the same as the position of the starting pixel in the transmission image, and the imaging scanning direction of the pixel is also the same; the starting pixel in the static template (the first imaged pixel) and the starting pixel in the transmission image can be considered to be shot at the same time, so the two can be directly associated; each pixel after the starting pixel will have a deviation and the deviation is cumulative, and the cumulative step length is the distance value obtained by multiplying the transmission speed of the transmission equipment by the sampling interval between the pixels; therefore, the pixel with coordinates (x, y) on the static template corresponds to (x, y+nl+T xy ) corresponding to the pixel point; where l is the step size, n is the total number of pixels scanned before the current pixel point, T xy The position deviation is obtained by querying the pre-configured position deviation table according to the position of the pixel point on the template. The spatial deviation is eliminated by the position deviation, that is, the difference in visual impact caused by the height direction between the camera device and the transmission device as the transmission device moves. Of course, the prerequisite for achieving this corresponding relationship is that the horizontal scanning direction of the image acquisition device is perpendicular to the transmission direction of the transmission device, and the vertical scanning direction is the same as the transmission direction of the transmission device. How to realize the position adjustment of the image acquisition device and whether the adjustment is accurate are directly related to the accuracy of dynamic measurement.

[0152] The image acquisition device includes: a horizontal rotating platform and a camera arranged on the lower end surface of the horizontal rotating platform. The camera can adjust the position relationship between the horizontal scanning direction and the vertical scanning direction and the transmission direction of the transmission device under the drive of the horizontal rotating platform; due to the on-site environment (vibration and accidental touch of other objects), the position of the camera will be deflected, which will cause inaccurate detection, so it is necessary to adjust the equipment, but manual adjustment will cause processing delays and the adjustment depends on the subjective experience of the personnel, which may not be ideal. In order to realize automatic adjustment anytime and anywhere, a static image acquisition device is also configured on the transmission device side. The static image acquisition device includes: a detection platform, a grabbing manipulator and a camera; the grabbing manipulator is responsible for grabbing the flange on the conveying equipment and placing it on the detection platform, and the detection platform detects it and obtains the size detection data as a reference size;

[0153] The active adjustment unit of the flange online detection system based on machine vision performs the following operations:

[0154] Partition the fitted image: take the horizontal scanning direction as the abscissa and the vertical scanning direction as the ordinate, record the deviation of the fitted contour on the abscissa as the first measurement size, and record the deviation of the fitted contour on the ordinate as the second measurement size;

[0155] When the difference between the first measured dimension and the second measured dimension is greater than a preset first threshold, or the difference between the first measured dimension and the reference dimension is greater than a preset second threshold, or the difference between the second measured dimension and the reference dimension is greater than a preset third threshold, triggering entry into the automatic adjustment mode;

[0156] In the automatic adjustment mode, the rotating platform is rotated within a preset size deviation range (plus or minus 10 degrees) to perform measurements respectively, and the position at which the first measured size is the largest during the corresponding measurement is used as the target position for adjustment.

[0157] In addition, since there is also a size between pixels, (x, y+nl+T xy ) coordinates may have position deviations from the pixel point, i.e., y+nl+T xy There is a remainder after dividing by the pixel interval value; when the remainder is less than or equal to one-third of the pixel interval value or greater than or equal to two-thirds of the pixel interval value, the corresponding relationship of the pixel points is determined by rounding down or rounding up respectively; otherwise, a positioning block is constructed based on the determined pixel points, and the first pixel value of the pixel point is determined by scanning and positioning on the pre-constructed template based on the positioning block; then (x, y+nl+T xy ) coordinates; when the second pixel values ​​are the same, the second pixel value is used as the standard; when the first pixel value is the same as any second pixel value, the first pixel value is used as the standard.

[0158] In addition, the flange online detection system based on machine vision also includes: the active adjustment unit also performs the following operations:

[0159] Construct an analysis data set based on the minimum distance between each pixel point on the unfitted inner and outer diameter contours and the maximum inscribed circle or the minimum circumscribed circle after the fitted inner and outer diameter contours;

[0160] Matching the analysis data set with the data sets in each anomaly analysis item in the pre-configured anomaly analysis library;

[0161] When the abnormal probability in the abnormal analysis item of the data set matching the analysis data set is greater than or equal to the probability threshold, it triggers the automatic adjustment mode;

[0162] Among them, when constructing the analysis data set, the outer diameter contour and the inner diameter contour are analyzed separately, and the minimum distance between each pixel point on the outer diameter contour and the smallest circumscribed circle after the fitted outer diameter contour is used to construct the analysis data set; the minimum distance between each pixel point on the inner diameter contour and the largest inscribed circle after the fitted inner diameter contour is used to construct the analysis data set; the abnormal analysis library is configured by professionals in advance, and multiple abnormal analysis items are stored in the abnormal analysis library, and the abnormal analysis items include: data sets and analysis results associated with them; wherein, the data set is used to match and retrieve the analysis data set, and the analysis result is the probability of abnormality under the corresponding data set. The positional relationship between the pixel points on the contour before fitting and the circumscribed circle or inscribed circle used for measurement after fitting is analyzed to determine the probability of abnormality, and then enter automatic adjustment to achieve effective online detection.

[0163] In addition, the flange online detection system based on machine vision also includes: a secondary analysis unit, which is used to record the results of the N-times active adjustment unit analyzing the positional relationship between the pixel points on the contour before fitting and the circumscribed circle or inscribed circle for measurement after fitting, and construct a secondary analysis data set;

[0164] The analysis results in the abnormal analysis items are retrieved by matching the secondary analysis data set with the data sets in each abnormal analysis item in the secondary analysis library; the secondary analysis library is constructed by professionals in advance;

[0165] When the analysis result indicates that automatic adjustment is required, the automatic adjustment mode is entered.

[0166] By conducting horizontal analysis of the results, abnormalities can be discovered, and automatic adjustments can be made to achieve effective online testing.

[0167] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A flange online detection method based on machine vision, characterized in that: include: Acquire the transmission image of the flange during transmission; Performing static processing on the transmitted image to obtain a static image; The improved Canny operator edge extraction algorithm is used to perform edge extraction operations on static images; Fit the edges and measure the dimensions.

2. The flange online detection method based on machine vision according to claim 1 is characterized in that: The static processing steps are as follows: According to the transmission parameters of the flange, the pixel points in the pre-configured static template are correspondingly associated with the pixel points in the transmission image, and the pixel values ​​are copied from the pixel points in the transmission image associated with them.

3. The flange online detection method based on machine vision according to claim 1 is characterized in that: The edge extraction operations include: The static image is filtered using bilateral filtering method; Calculate the gradient magnitude; Compare the current pixel gradient magnitude with the gradient magnitudes on both sides of the gradient direction. If it is an extreme point, keep the pixel as an edge point; if not, keep it as a non-edge point. The double thresholds obtained by Otsu's method are used to detect and connect edges; The improved Zernike sub-pixel edge detection algorithm is used to detect edges.

4. The flange online detection method based on machine vision according to claim 3 is characterized in that: Fitting and measuring the size of the edge includes: The inner and outer diameter profiles of circular hole parts are fitted by the least square method to achieve size measurement.

5. A flange online detection system based on machine vision, characterized in that: include: Image acquisition unit, static processing unit, edge extraction unit and fitting measurement unit; Among them, the image acquisition unit acquires the transmission image of the flange during transmission; the static processing unit performs static processing on the transmission image to obtain a static image; the edge extraction unit uses an improved Canny operator edge extraction algorithm to perform edge extraction operations on the static image to determine the edge; the fitting measurement unit fits the edge and measures the size.

6. The flange online detection system based on machine vision according to claim 5 is characterized in that: The static processing unit performs the following operations: According to the transmission parameters of the flange, the pixels in the pre-configured static template are associated with the pixels in the transmitted image. Pixels in the static template copy pixel values ​​from pixels in the transmitted image to which they are associated.

7. The flange online detection system based on machine vision according to claim 5 is characterized in that: The edge extraction unit performs the following operations: The static image is filtered using bilateral filtering method; Calculate the gradient magnitude; Compare the current pixel gradient magnitude with the gradient magnitudes on both sides of the gradient direction. If it is an extreme point, keep the pixel as an edge point; if not, keep it as a non-edge point. The double thresholds obtained by Otsu's method are used to detect and connect edges; The improved Zernike sub-pixel edge detection algorithm is used to detect edges.

8. The flange online detection system based on machine vision according to claim 7 is characterized in that: The fit measurement unit performs the following operations: The inner and outer diameter profiles of circular hole parts are fitted by the least square method to achieve size measurement.

Citation Information

Patent Citations

  • Flange diameter measuring device based on machine vision

    CN105588517A

  • Instrument image recognition method and system based on optimized Canny edge detection

    CN117475154A

  • High-precision linear distance detection algorithm

    CN117911447A