Flange and end face flatness detection method thereof
By combining ring light source illumination with an industrial camera, and employing annular region segmentation and edge detection algorithms, the problems of image quality degradation and edge interference in flange end face inspection were solved, achieving efficient and accurate flange end face inspection and improving the comprehensiveness and accuracy of the inspection.
Patent Information
- Application Number
- CN202511051017.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies for flange end face inspection suffer from problems such as decreased image acquisition quality, edge line interference, and uneven lighting, resulting in insufficient detection accuracy and reliability, and making it difficult to accurately identify flatness defects on the flange end face.
The flange end face is illuminated by a ring light source, and images are acquired by an industrial camera. The standard deviation and coefficient of variation of the reflected light intensity are calculated. The Canny edge detection algorithm and the Laplacian edge detection algorithm are combined, and a ring-shaped region is divided. The flatness of the flange end face is comprehensively evaluated by combining the edge detection algorithm.
It enables efficient and accurate inspection of flange end faces, can identify macroscopic and microscopic defects, improves the comprehensiveness and accuracy of inspection, enhances the system's anti-interference ability, and ensures reliable judgment in complex environments.
Smart Images

Figure CN120912558A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of flanges, and more particularly to a flange and a method for detecting flatness of an end face thereof. BACKGROUND
[0002] As an indispensable connecting structure in pipeline, valve and other mechanical connecting components, the flatness of the end face of the flange is directly related to the sealing performance, connection stability and subsequent equipment machining and assembly accuracy. In the pipeline system of high pressure, high temperature or conveying corrosive medium, if there are scratches, pits, warping or other uneven defects on the end face of the flange, it is easy to cause safety hazards such as medium leakage, bolt loosening and even pipeline burst. Therefore, how to quickly and accurately detect the flatness of the end face of the flange has become an important link to ensure product quality and operation safety.
[0003] In order to ensure the strength and reliability of the flange in use, on the one hand, the structure design of the flange body needs to be optimized to enhance the overall rigidity and anti-deformation ability, and to avoid damage, deformation and other problems caused by weak structure; on the other hand, the flatness of the end face of the flange needs to be effectively detected to ensure its connection and sealing performance and assembly accuracy, and to avoid leakage, loosening or other safety hazards caused by end face defects.
[0004] With the continuous development of intelligent manufacturing and image recognition technology, non-contact optical detection methods have been widely used in the field of industrial quality detection. In particular, the image processing technology based on machine vision has the advantages of non-contact, fast detection speed, good repeatability, rich information and the like, and can realize the rapid analysis and judgment of the surface state of the workpiece without contacting the workpiece.
[0005] However, the traditional image recognition method still has many challenges in the application of flange end face detection. Since the flange structure often contains multiple complex feature regions, such as bolt hole edges, central regions or other special structural arrangements, the image acquisition process is easily affected by edge line interference, reflection or uneven illumination and other problems, resulting in a decline in image quality, which in turn affects the recognition and judgment of defects by the detection algorithm. In addition, the existing image processing method mostly adopts rectangular or irregular block division strategy in region division, which is difficult to accurately match the ring-shaped geometry of the flange end face, and the evaluation result often has errors, reducing the detection accuracy and reliability.
[0006] Based on the above problems, the present application provides a flange and a method for detecting flatness of an end face thereof. SUMMARY
[0007] In view of the deficiencies of the prior art, the purpose of the present application is to provide a flange and a method for detecting flatness of an end face thereof.
[0008] To achieve the above object, the present application provides the following technical solutions:
[0009] The flange body is provided with a neck portion in the middle, the neck portion is in a frustum structure, the axial height is 20mm-60mm, the outer edge is gradually contracted from bottom to top, a certain transition angle alpha is formed, the alpha is 25°-45°, the flange body includes a flange end face, a bolt hole is arranged around the flange end face, the bolt hole is through arranged, and a stop structure is arranged at the bottom of the flange body. The stop structure is annular protrusion, the height is 1mm-3mm, the width is 2mm-5mm, and the mechanical stop effect is provided in the flange installation and positioning process, and the relative displacement of the flange is prevented.
[0010] A flange end face flatness detection method is provided according to the above flange, and the method comprises the following steps:
[0011] S1, the ring light source is irradiated: the flange end face is irradiated by at least one ring light source, so that the flange end face presents uniform reflected light;
[0012] S2, the reflected image of the flange end face is collected by an industrial camera; an image processing algorithm is used to calculate the standard deviation or coefficient of variation of the reflected light intensity to evaluate the uniformity of light reflection; if the standard deviation or coefficient of variation exceeds the preset threshold, it is determined that the flange end face exists macro-unflatness;
[0013] S3, edge detection analysis: using Canny edge detection algorithm or Laplace operator to process the reflected image, detecting the gray value change and edge mutation on the flange end face; by analyzing the area with sharp gray value change in the image, it is determined whether the flange end face exists micro-scratch, local mutation or small unevenness;
[0014] S4, comprehensive defect evaluation: according to the results in S2 and S3, if the coefficient of variation CV is greater than the threshold T1, or any of the edge indicators is greater than the corresponding threshold T2 or T3, it is determined that the flange end face exists defects, and the detection result is "unqualified"; otherwise, it is determined as "qualified".
[0015] The present application is further provided: the illumination angle of the ring light source is 0° to 30°, so as to ensure that the light source uniformly irradiates the entire surface of the flange end face; the ring light source includes at least two directions of light source, the light intensity of the light source is adjustable, and the light intensity at different positions of the flange end face is kept uniform.
[0016] The present application is further provided: the image acquisition device is an industrial camera, and the resolution is not less than 5MP, so as to ensure high-precision image capture.
[0017] The application is further configured that the reflected light uniformity analysis is to calculate the standard deviation and coefficient of variation of the image gray value, and to judge whether the flange end face exists macro unevenness according to comparison with a preset threshold value.
[0018] The application is further configured that the specific steps of the reflected light uniformity analysis are:
[0019] S21, gray the image;
[0020] S22, pre-process and regionally divide the image;
[0021] S23, calculate the average gray value of each region.
[0022] The application is further configured that the region division in S22 is to divide in a circular ring form, to divide in a circular ring form from the center point of the flange, and to divide in the same area.
[0023] The application is further configured that the gray image of the flange end face is divided in a circular ring form in the same area from the center of the image to the outside, and is divided into n circular ring regions, and the average gray value of the i-th region is denoted as , the average gray value of the region is , the standard deviation of the overall gray value of the image is , and the coefficient of variation CV is calculated according to the following formula respectively:
[0024]
[0025] When the coefficient of variation CV is greater than a preset threshold value T1, it is judged that the flange end face exists macro unevenness.
[0026] The application is further configured that S31, the reflected image is gray processed, and a Gaussian filter is used to denoise the image;
[0027] S32, a Canny edge detection algorithm is used to obtain a region with significant edge intensity in the image;
[0028] S33, the edge pixel density of the edge region is counted , and the average value E of the edge gray value change intensity is calculated, and the specific formula is as follows:
[0029]
[0030] , wherein represents the gradient intensity at the j-th edge pixel, m is the total number of edge pixels, and A is the image area. If exceeds the corresponding threshold value T3, or E exceeds the corresponding threshold value T2, it is judged that the flange end face exists micro scratches or local mutations.
[0031] The application is further configured that: S41, the coefficient of variation CV in step S2 and the edge gray level change index E and the edge density in step S3 are respectively read .
[0032] S42, the above three indexes are compared with respective threshold values T1 and T2;
[0033] S43, if any one exceeds the set threshold value, that is, any one of the following conditions is met:
[0034]
[0035] If the flange end face has defects, the detection result is "unqualified"; otherwise, it is "qualified".
[0036] In summary, the present application includes at least one of the following beneficial technical effects:
[0037] 1. The present application realizes efficient and accurate detection of flange end face defects by adopting a circular ring area division method, combining edge structure recognition and gray level uniformity analysis. This method fully matches the axial symmetry structure characteristics of the flange, and reasonably avoids and shields the geometric mutation areas such as the center hole and bolt hole, effectively avoiding misjudgment caused by structural gray level fluctuation.
[0038] 2. The present application constructs a comprehensive evaluation system by combining the brightness variation coefficient and the edge gray level characteristics (including edge density and gray level change intensity), effectively overcoming the limitations of traditional single index detection in complex defect environment. This method can not only accurately identify the macro flatness abnormalities on the flange end face, but also sensitively capture micro scratches, fine cracks and other local mutations, significantly improving the comprehensiveness and accuracy of detection. At the same time, the region division and structure exclusion strategy further enhances the anti-interference ability and stability of the system, ensuring reliable judgment even in the presence of oil stains, dust and other non-structural interference, thereby realizing more efficient detection of flange surface flatness. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 The flowchart of the flange end face flatness detection method of the present application.
[0040] Figure 2 The structural schematic diagram of the flange in the present application.
[0041] Figure 3 The top view of the flange of the present application.
[0042] Figure 4 is Figure 3 the sectional view along A-A.
[0043] 1, flange; 2, center hole; 3, neck; 4, flange end face; 5, bolt hole; 6, baffle structure. DETAILED DESCRIPTION
[0044] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.
[0045] It should be noted that, unless otherwise specified, all technical and scientific terms used in the present application have the same meaning as generally understood by those skilled in the art to which the present application belongs.
[0046] Please refer to Figures 1-4 The present application provides the following technical solutions:
[0047] Example one, please refer to Figures 1-4 A flange is provided in the present application, which comprises a flange body 1, a center hole 2 is formed in the middle of the flange body 1, the center hole 2 is a circular through structure for coaxial connection with a pipeline. A neck 3 is arranged around the center hole 2, the neck 3 is in the form of a truncated cone structure, the axial height is 20mm-60mm, the outer edge gradually shrinks from bottom to top, forming a certain transition angle α, the α is 25°-45°, preferably 30°, to form a good stress diffusion path.
[0048] A transition section is arranged at the transition between the bottom of the neck 3 and the flange body 1, the length of the transition section is 2mm-5mm, which can relieve the stress concentration at the connection part and improve the structural fatigue life. The top of the neck 3 is a cylindrical section coaxial with the center hole 2, the length of the cylindrical section is 5mm-15mm, so as to facilitate the arrangement of the butt weld and enhance the axial bending strength.
[0049] The flange body 1 comprises a flange end face 4 extending radially therefrom, a plurality of bolt holes 5 are uniformly distributed and arranged on the flange end face 4 in the circumferential direction, the bolt holes 5 are through hole structures, preferably arranged as 6-12, uniformly arranged and circumferentially distributed at an angle of 30°-60°, for connecting and fixing with adjacent flanges or equipment end faces by bolts.
[0050] In order to improve the shear resistance and assembly stability of the flange during installation and loading, a baffle structure 6 is arranged at the outer edge of the bottom of the flange body 1, the baffle structure 6 is in the form of a ring protrusion, the height is 1mm-3mm, the width is 2mm-5mm, which is used to provide a mechanical stop function during the positioning of the flange installation, to prevent relative displacement of the flange.
[0051] Through the above structural design, the flange can realize stress dispersion and guidance in the stress transmission process, effectively avoids plastic deformation or crack propagation caused by local stress concentration, and thus improves the strength and sealing reliability of the overall structure.
[0052] In actual application, the end face of the flange needs to be detected before leaving the factory. Some traditional detection methods adopt direct visual detection method, but since the flange in the present application is provided with the neck portion 3, the neck portion may cause edge line interference in the photographed image, thereby affecting the detection accuracy. Therefore, the detection method proposed in the present application can effectively avoid the interference of the neck portion 3 in the image, and improve the detection accuracy. At the same time, the detection method can also identify and exclude the bolt hole 5 on the flange end face, so as to avoid the interference of the bolt hole on the detection result, thereby further improving the stability and reliability of the detection. Therefore, the method is universal for flanges.
[0053] Specifically, a flange end face flatness detection method comprises the following steps:
[0054] S1, ring light source irradiation: irradiating the flange end face by at least one ring light source, so that the flange end face presents uniform reflected light;
[0055] S2, collecting the reflected image of the flange end face by an industrial camera; using an image processing algorithm to calculate the standard deviation or coefficient of variation of the reflected light intensity to evaluate the uniformity of light reflection; if the standard deviation or coefficient of variation exceeds the preset threshold, it is determined that the flange end face has macroscopic unevenness;
[0056] S3, edge detection analysis: using Canny edge detection algorithm or Laplace operator to process the reflected image to detect the gray value change and edge mutation on the flange end face; by analyzing the regions with sharp gray value change in the image, it is determined whether the flange end face has micro scratches, local mutations or slight unevenness;
[0057] S4, comprehensive defect evaluation: according to the results in S2 and S3, if the coefficient of variation CV is greater than the threshold T1, or any one of the edge indicators (including edge density and gray value change intensity E) is greater than the corresponding threshold T2 or T3, it is determined that the flange end face has defects, and the detection result is “unqualified”; otherwise, it is determined as “qualified”.
[0058] The irradiation angle of the ring light source is 0° to 30°, preferably 15° in the present embodiment, so as to ensure that the light source uniformly irradiates the entire surface of the flange end face; the ring light source includes at least two directions of light source, the light intensity of the light source is adjustable, and the light intensity at different positions of the flange end face remains uniform and does not change significantly with the distance from the light source. And when the light source irradiates, it needs to be in a non-dazzling light environment to avoid detection error caused by dazzling light interference.
[0059] The image acquisition device is an industrial camera with a resolution of no less than 5MP, which is used to ensure high-precision image capture. In the present embodiment, an IDS uEye XS industrial camera is preferred.
[0060] The flange end face is photographed by the industrial camera, and image data thereof is acquired. Each pixel point in the image has a gray value representing the brightness intensity of the point. The gray value of the image is usually between 0 and 255, representing different gray levels from black to white. For a surface that uniformly reflects light, the gray values in the image should be evenly distributed. The reflected light uniformity analysis determines whether the flange end face has macroscopic unevenness by calculating the standard deviation and coefficient of variation of the gray values of the image, and comparing them with a preset threshold.
[0061] The specific steps of the reflected light uniformity analysis are as follows:
[0062] S21, image gray processing: The acquired color image is subjected to gray processing. Preferably, a weighted average method (for example, Y = 0.299R + 0.587G + 0.114B) is used to convert the RGB three-channel color image into a single-channel gray image. This method can better preserve the brightness information of the image while effectively removing color interference, which is conducive to subsequent gray intensity calculation and statistical analysis.
[0063] S22, image region division: In order to more accurately evaluate the spatial uniformity of the reflected light of the flange end face, the present application preferably adopts a circular ring segmentation method to divide the gray image into regions. Specifically, taking the center of the image (corresponding to the center position of the flange end face) as the center, the image is divided into n circular ring regions in the form of concentric circles, and the edge that has been determined is set as the determined segmentation line during segmentation.
[0064] It should be noted that the design logic of selecting circular ring segmentation not only takes into account the axial symmetry structure characteristics of the flange end face, but also fully considers the possible complex features such as central holes, structural depressions, bolt holes, etc. on the surface. These structures often appear as obvious gray mutation regions in the image, and if they are directly involved in gray uniformity analysis, it is easy to lead to misjudgment.
[0065] To avoid such interference, the present application sets the edge position of the flange center hole as the inner or outer boundary of a certain circular ring when performing circular ring division, so that the structural mutation region can be excluded or handled separately in the subsequent analysis. In addition, before region division, the edge detection algorithm is preferably used to pre-judge the positions of the center hole and the bolt hole, and the corresponding image regions are shielded or data excluded, further avoiding the misentry of non-defect structures into the defect recognition process due to gray fluctuations.
[0066] S23, calculate the average gray value of each region;
[0067] The gray image of the flange end face which has been pretreated is divided into n annular regions according to the annular division from the center of the image to the outside, and the average gray value of the i-th region is denoted as The average gray value of the region is The standard deviation of the gray value of the whole image is The coefficient of variation CV is calculated according to the following formula:
[0068]
[0069] When the coefficient of variation CV is greater than the preset threshold T1, it is judged that the flange end face has macro unevenness.
[0070] The specific steps of edge detection analysis are as follows:
[0071] S31, perform gray processing on the reflection image, and use a Gaussian filter to denoise the image;
[0072] S32, use Canny edge detection algorithm to obtain the region with significant edge intensity in the image;
[0073] S33, count the edge pixel density of the edge region , and calculate the average value E of the edge gray value change intensity, the specific formula is as follows:
[0074]
[0075] Wherein, represents the gradient intensity at the j-th edge pixel, m is the total number of edge pixels, and A is the image area. If exceeds the corresponding threshold T3, or E exceeds the corresponding threshold T2, it is judged that the flange end face has micro scratches or local mutations.
[0076] Since the types of surface defects of the flange end face have significant diversity, common defects include but are not limited to: macro flatness abnormality, micro scratches, fine cracks, surface roughness and local depression, etc. For different types of defects, their performance characteristics in the image are also different, some of which are uneven overall brightness, and some of which are abnormal prominent edge information or significant gray jump.
[0077] Traditional detection methods, relying solely on a single image feature value (such as grayscale mean, standard deviation, or edge gradient), often only cover a certain type of defect, making comprehensive and accurate quality identification difficult. Furthermore, a single indicator can easily lead to misjudgments or missed detections under limited lighting conditions or with localized dirt interference. For example, when using only the coefficient of variation as a criterion, the presence of localized oil or dust in the image may cause abnormal grayscale distribution, leading to a misjudgment as overall uneven brightness.
[0078] The specific steps for comprehensive defect assessment are as follows: S41, read the coefficient of variation (CV) from step S2 and the edge grayscale change index (E) and edge density from step S3 respectively. ;
[0079] S42. Compare the above three indicators with their respective thresholds T1 and T2;
[0080] S43. If any item exceeds its set threshold, then one of the following conditions is met:
[0081]
[0082] Where T1 is the threshold of the coefficient of variation (CV). The coefficient of variation is a standardized index that reflects the dispersion of image gray values. The larger the value, the more obvious the non-uniformity of the surface gray value distribution, which may indicate that there is macroscopic unevenness on the flange end face.
[0083] T2 is the threshold for the edge grayscale variation index (E). Edge grayscale variation reflects the grayscale changes on the flange end face surface at the edge. Abnormal changes at the edge may indicate surface cracks, defects, or unevenness. Since damage to the flange edge is more likely to affect the overall performance of the flange, the threshold T2 is usually set to a small value in actual inspection.
[0084] T3 is the edge density ( The threshold for edge density refers to the density of edge features in a flange end face image. Higher edge density may indicate irregular contours or multiple small defects on the surface.
[0085] If any of the above conditions are met, the flange end face is deemed to have a defect, and the test result is "unqualified"; otherwise, it is deemed "qualified".
[0086] This comprehensive evaluation method not only avoids problems, but also, because the coefficient of variation reflects the dispersion of the overall brightness distribution, it pays more attention to macroscopic uniformity; while E and This focuses on abrupt changes and densities in local details, making it more suitable for identifying minute cracks or surface texture issues. Combining these three methods allows for the identification of both global problems and local defects, achieving higher precision in quality assessment.
[0087] Obviously, the above described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative labor should belong to the protection scope of the present application.
Claims
1. A flange, characterized by: The flange body (1) is provided with a center hole (2) in the middle, a neck (3) is arranged around the center hole (2), the neck (3) is in a frustum structure, the axial height is 20mm-60mm, the outer edge is gradually contracted from bottom to top, a certain transition angle alpha is formed, the alpha is 25°-45°, the flange body (1) includes a flange end face (4), a bolt hole (5) is arranged around the flange end face (4), the bolt hole (5) is through, the bottom of the flange body (1) is provided with a baffle structure (6), the baffle structure (6) is annular protrusion, the height is 1mm-3mm, the width is 2mm-5mm, which is used for providing mechanical stop action in the flange installation and positioning process, preventing the relative displacement of the flange.
2. A method of detecting flatness of a flange end face, using the flange as claimed in claim 1, characterized by, It comprises the following steps: S1, ring light source irradiation: irradiate the flange end face (4) by at least one ring light source, so that the flange end face (4) presents uniform reflected light; S2, the reflected image of the flange end face (4) is collected by an industrial camera; an image processing algorithm is used to calculate the standard deviation or coefficient of variation of the reflected light intensity to evaluate the uniformity of light reflection; if the standard deviation or coefficient of variation exceeds the preset threshold, it is determined that the flange end face (4) has macro unevenness; S3, edge detection analysis: using Canny edge detection algorithm or Laplace operator to process the reflected image, detecting the gray value change and edge mutation on the flange end face (4); by analyzing the area with sharp change of gray value in the image, it is determined whether the flange end face (4) has micro scratches, local mutation or small unevenness; S4, comprehensive defect evaluation: according to the results in S2 and S3, if the coefficient of variation CV is greater than the threshold T1, or any of the edge indicators is greater than the corresponding threshold T2 or T3, it is determined that the flange end face (4) has defects, and the detection result is "unqualified"; otherwise, it is determined as "qualified".
3. The method for detecting the flatness of the end face of a flange according to claim 2, characterized in that: The irradiation angle of the ring light source is 0° to 30° to ensure that the light source uniformly irradiates the entire surface of the flange end face (4); the ring light source comprises at least two directions of light source, the light intensity of the light source can be adjusted, and the light intensity at different positions of the flange end face (4) remains uniform.
4. The method for detecting the flatness of the end face of a flange according to claim 3, characterized in that: The image acquisition device is an industrial camera with a resolution not less than 5MP to ensure high-precision image capture.
5. The method for detecting the flatness of the end face of a flange according to claim 3, characterized in that: The reflected light uniformity analysis calculates the standard deviation and coefficient of variation of the image gray value, and judges whether the flange end face (4) has macro unevenness according to the comparison with the preset threshold.
6. The method for detecting the flatness of the end face of a flange according to claim 5, characterized in that: The specific steps of the reflected light uniformity analysis are: S21, image graying; S22, image preprocessing and region division; S23, calculating the average gray value of each region.
7. The method for detecting the flatness of the end face of a flange according to claim 6, characterized in that: The region division in S22 adopts circular ring division, which is segmented in a circular ring shape from the center point of the flange, and the same area division is adopted.
8. The method of claim 6, wherein: The gray scale image of the flange end face (4) is divided into n ring areas according to equal area from the center of the image to the outside, and the average gray scale value of the i-th area is recorded as , the average gray scale value of the area is , the standard deviation of the gray scale value of the whole image is , and the coefficient of variation CV is calculated according to the following formula respectively: When the coefficient of variation CV is greater than the preset threshold T1, it is determined that the flange end face has macro unevenness.
9. The method of claim 6, wherein: S31, the reflected image is processed by gray value, and a Gaussian filter is used to denoise the image; S32, using Canny edge detection algorithm, obtaining the region with significant edge intensity in the image; S33、counting the edge pixel density of the edge region and calculate the average value E of the edge gray scale change intensity, the specific formula is as follows: wherein, Gj represents the gradient intensity at the jth edge pixel, m is the total number of edge pixels, and A is the image area. If If E exceeds the corresponding threshold T3, or Gj exceeds the corresponding threshold T2, it is determined that the flange end face has micro scratches or local mutations.
10. The flange end face flatness detection method according to claim 2, characterized in that: S41, respectively read the coefficient of variation CV in step S2 and the edge gray scale change index E and the edge density in step S3 ; S42, comparing the above three indexes with respective threshold values T1 and T2; S43, if any one exceeds the set threshold value, that is, if any of the following conditions is met: Then it is determined that the flange end face (4) has defects, and the detection result is "unqualified"; otherwise, it is determined as "qualified".
Citation Information
Patent Citations
Welding neck flange
CN109140075A
Flange surface defect detection algorithm based on traditional image processing
CN119379609A
Flange plate metal piece surface flatness detection method and system
CN120259292A
Hydraulic engineering crack detection method and system based on intelligent visual identification
CN120339222A
Hubbed flange with efficient sealing structure
CN216344520U