Surface defect identification method and system for stainless steel pipe

By digitizing and regional clustering of the surface acquisition images of stainless steel steel pipes, the surface characteristics and defect characteristics of steel pipes are extracted, and the problems of noise interference and feature extraction in traditional recognition methods are solved, and the recognition accuracy is improved.

CN118840605BActive Publication Date: 2025-03-14JIANGSU YINYANG STAINLESS STEEL PIPE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410919247.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2025-03-14
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

In the prior art, the surface defect identification method of traditional stainless steel steel pipes is affected by noise interference and the degree of refinement of defect feature extraction is low, resulting in poor recognition accuracy.

Method used

By collecting and digitizing the surface image of the steel pipe, digital images of the steel pipe surface are generated, and the pixel coordinate positions are clustered according to the grayscale values ​​of the pixel points in the image, and the steel pipe surface feature image and quasi-defect area are generated. The quasi-defect area is traversed for defect feature extraction, and the quasi-defect area shape features and grayscale features are generated, and defect recognition is finally performed.

Benefits of technology

The image grayscale processing reduces noise interference, combined with defect feature extraction optimization, improves defect recognition efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118840605B_ABST
    Figure CN118840605B_ABST
Patent Text Reader

Abstract

The present invention discloses a surface defect recognition method and system for stainless steel pipes, and relates to the field of data processing technology. The method comprises: collecting a surface image of a steel pipe, digitizing it, and generating a digital image of the steel pipe surface, including pixel coordinate positions and pixel grayscale values; performing regional clustering on the pixel coordinate positions according to the pixel grayscale values, generating a surface feature image of the steel pipe and a quasi-defect region; traversing the quasi-defect region, extracting defect features, generating quasi-defect region shape features and quasi-defect region grayscale features, performing defect recognition, and generating defect type recognition results. The present invention solves the technical problem that the traditional defect recognition method in the prior art is subject to much noise interference, and the degree of refinement of defect feature extraction is low, resulting in poor recognition accuracy, and achieves the technical effect of reducing noise interference by image grayscale processing, combining defect feature extraction optimization, and improving defect recognition efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a surface defect recognition method and system for a stainless steel pipe. Background Art

[0002] During the use of stainless steel pipes, due to production defects, transportation bumps, equipment scratches, environmental corrosion and other reasons, stainless steel pipes will have surface defects such as pits, warping, indentations and scratches, which will affect the use effect. Therefore, it is necessary to identify and evaluate the surface defects of stainless steel pipes. The traditional surface defect recognition method cannot eliminate noise interference, and the defect feature extraction is not fine enough, resulting in poor defect recognition accuracy. Summary of the invention

[0003] The present application provides a surface defect recognition method and system for stainless steel pipes, which are used to solve the technical problems in the prior art that traditional defect recognition methods are subject to more noise interference and the degree of refinement of defect feature extraction is low, resulting in poor recognition accuracy.

[0004] In a first aspect of the present application, a surface defect recognition method for a stainless steel pipe is provided, the method comprising: when the stainless steel pipe is conveyed to a defect recognition interval, starting a clamping member, inserting a preset length of one end of the stainless steel pipe into a first rotation fixing hole, and inserting a preset length of the other end of the stainless steel pipe into a second rotation fixing hole; rotating the stainless steel pipe based on the first rotation fixing hole and the second rotation fixing hole, activating an imaging element to acquire an image, and generating a surface image of the steel pipe; digitizing the surface image of the steel pipe to generate a digital image of the surface of the steel pipe, wherein the digital image of the surface of the steel pipe includes pixel point coordinate positions and pixel point grayscale values; performing regional clustering on the pixel point coordinate positions according to the pixel point grayscale values ​​to generate a surface feature image of the steel pipe, wherein the surface feature image of the steel pipe includes a quasi-defect area; traversing the quasi-defect area, setting a defect sampling window, building a defect feature extraction node to perform feature extraction, and generating a shape feature of the quasi-defect area and a grayscale feature of the quasi-defect area; performing defect recognition according to the shape feature of the quasi-defect area and the grayscale feature of the quasi-defect area to generate a defect type recognition result.

[0005] The second aspect of the present application provides a surface defect recognition system for a stainless steel pipe, the system comprising: a rotation and fixing module, the rotation and fixing module is used to start the clamping member when the stainless steel pipe is transported to the defect recognition interval, insert a preset length of one end of the stainless steel pipe into a first rotation and fixing hole, and insert a preset length of the other end of the stainless steel pipe into a second rotation and fixing hole; a steel pipe surface image acquisition module, the steel pipe surface image acquisition module is used to rotate the stainless steel pipe based on the first rotation and fixing holes and activate the imaging element to perform image acquisition to generate a steel pipe surface image; a steel pipe surface digital image generation module, the steel pipe surface digital image generation module is used to digitize the steel pipe surface image to generate a steel pipe surface digital image, wherein , the digital image of the steel pipe surface includes pixel point coordinate positions and pixel point grayscale values; a steel pipe surface feature image generation module, the steel pipe surface feature image generation module is used to perform regional clustering on the pixel point coordinate positions according to the pixel point grayscale values, and generate a steel pipe surface feature image, wherein the steel pipe surface feature image includes a quasi-defect area; a defect feature extraction module, the defect feature extraction module is used to traverse the quasi-defect area, set a defect sampling window, build a defect feature extraction node for feature extraction, and generate a quasi-defect area shape feature and a quasi-defect area grayscale feature; a defect type recognition result generation module, the defect type recognition result generation module is used to perform defect recognition according to the quasi-defect area shape feature and the quasi-defect area grayscale feature, and generate a defect type recognition result.

[0006] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0007] The present application provides a surface defect recognition method for a stainless steel pipe, which relates to the field of data processing technology. The method collects and digitizes the surface image of the steel pipe to generate a digital image of the surface of the steel pipe, performs regional clustering on the coordinate positions of the pixel points according to the grayscale values ​​of the pixel points in the image, generates a surface feature image of the steel pipe and a quasi-defect area, traverses the quasi-defect area, extracts defect features, generates shape features of the quasi-defect area and grayscale features of the quasi-defect area, performs defect recognition, and generates defect type recognition results. The method solves the technical problem that the traditional defect recognition method in the prior art is subject to much noise interference and the degree of refinement of the defect feature extraction is low, resulting in poor recognition accuracy. The method achieves the technical effect of reducing noise interference by image grayscale processing and combining defect feature extraction optimization to improve defect recognition efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0009] Figure 1 A schematic flow chart of a method for identifying surface defects of a stainless steel pipe provided in an embodiment of the present application;

[0010] Figure 2 A schematic diagram of a process for generating a surface feature image of a stainless steel pipe in a surface defect recognition method for a stainless steel pipe provided in an embodiment of the present application;

[0011] Figure 3 A schematic diagram of a flow chart of generating shape features of quasi-defect regions and grayscale features of quasi-defect regions in a surface defect recognition method for a stainless steel pipe provided in an embodiment of the present application;

[0012] Figure 4 A schematic diagram of the structure of a surface defect recognition system for a stainless steel pipe provided in an embodiment of the present application.

[0013] Explanation of the reference numerals: rotating and fixing module 11, steel pipe surface image acquisition module 12, steel pipe surface digital image generation module 13, steel pipe surface feature image generation module 14, defect feature extraction module 15, defect type identification result generation module 16. DETAILED DESCRIPTION

[0014] The present application provides a surface defect recognition method for stainless steel pipes, which is used to solve the technical problems in the prior art that traditional defect recognition methods are subject to more noise interference and the degree of refinement of defect feature extraction is low, resulting in poor recognition accuracy.

[0015] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0016] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products, or devices.

[0017] Embodiment 1

[0018] like Figure 1 As shown, the present application provides a method for identifying surface defects of a stainless steel pipe, the method comprising:

[0019] P10: When the stainless steel pipe is transported to the defect identification zone, the clamp is started to insert a preset length of one end of the stainless steel pipe into the first rotation fixing hole, and a preset length of the other end of the stainless steel pipe is inserted into the second rotation fixing hole;

[0020] Exemplarily, when the stainless steel pipe to be inspected is transported to the defect identification zone, the clamp is started, one end of the stainless steel pipe is inserted into the first rotation fixing hole according to a preset length for fixation, and the other end of the stainless steel pipe is inserted into the second rotation fixing hole according to another preset length. The clamp is an auxiliary mechanical device for clamping the steel pipe to be inspected and moving it. The first rotation fixing hole and the second rotation fixing hole are components for fixing the two ends of the stainless steel pipe and rotating the stainless steel pipe to collect the overall image of the outer surface of the stainless steel pipe through rotation.

[0021] P20: Based on the first rotating fixed hole and the second rotating fixed hole, the stainless steel pipe is rotated, and the imaging element is activated to collect images to generate a surface image of the steel pipe;

[0022] It should be understood that the first rotating fixed hole and the second rotating fixed hole are used to control the stainless steel pipe to rotate at a certain speed, and while rotating, the imaging element is started to capture the outer surface image of the stainless steel pipe. The imaging element, i.e., the image acquisition device, can be a CCD image acquisition device, a high-precision camera, etc., and the surface image of the steel pipe is obtained by synthesizing the collection of images of the stainless steel pipe captured in the rotating state.

[0023] P30: digitizing the steel pipe surface image to generate a digital image of the steel pipe surface, wherein the digital image of the steel pipe surface includes pixel point coordinate positions and pixel point grayscale values;

[0024] Optionally, the steel pipe surface image is digitized, that is, the steel pipe surface image is converted into a digital image that can be processed by a computer through sampling and quantization. Specifically, a reference coordinate system is set based on the steel pipe surface image, and based on the reference coordinate system, all pixel points in the steel pipe surface image are assigned coordinate positions, and are encoded together with the corresponding pixel grayscale values ​​and converted into a digital image to facilitate defect identification.

[0025] P40: performing regional clustering on the coordinate positions of the pixel points according to the grayscale values ​​of the pixel points to generate a surface feature image of the steel pipe, wherein the surface feature image of the steel pipe includes a quasi-defect area;

[0026] Further, such as Figure 2 As shown, step P40 of the embodiment of the present application also includes:

[0027] P41: according to the pixel point coordinate position and the pixel point grayscale value, obtain the pixel grayscale value at the first position, the pixel grayscale value at the second position, and so on until the pixel grayscale value at the Mth position;

[0028] P42: performing pairwise grayscale deviation enumeration analysis on the grayscale values ​​of the pixels at the first position, the grayscale values ​​of the pixels at the second position, and the grayscale values ​​of the pixels at the Mth position to generate a plurality of pixel grayscale distances;

[0029] P43: Based on the plurality of pixel grayscale distances, traverse the pixel point coordinate positions to perform grayscale density analysis, and generate grayscale density at a first position, grayscale density at a second position, and grayscale density at an Mth position;

[0030] P44: Based on the grayscale density of the first position, the grayscale density of the second position, and up to the grayscale density of the Mth position, the digital image of the steel pipe surface is subjected to regional clustering to generate a characteristic image of the steel pipe surface.

[0031] Specifically, according to the pixel coordinate position and the pixel gray value, the pixel gray value of each pixel position is extracted, and the first position pixel gray value, the second position pixel gray value, and the M-th position pixel gray value are obtained, where M is the total number of pixels contained in the digital image of the steel pipe surface. Further, the first position pixel gray value, the second position pixel gray value, and the M-th position pixel gray value are subjected to a pairwise gray deviation enumeration analysis, that is, the gray value difference of each two adjacent pixels is calculated respectively to obtain a plurality of gray value differences, and the absolute values ​​of the plurality of gray value differences are used as the plurality of pixel gray distances.

[0032] Furthermore, the average grayscale distance is calculated based on the grayscale distances of the multiple pixels, and the pixel coordinate positions are traversed to calculate the grayscale distance between each pixel and the adjacent pixel points, and the number of adjacent pixel points that is less than the average grayscale distance is screened out as the grayscale density of the point, and the grayscale density of the first position, the second position, and the Mth position are obtained.

[0033] Furthermore, referring to the grayscale density at the first position, the grayscale density at the second position, and up to the grayscale density at the Mth position, the digital image of the steel pipe surface is regionally clustered, and pixel points with close grayscale distances are clustered into the same region, and pixel points with far grayscale distances are clustered into different regions. The pixel values ​​are unified according to the clustering regions, the image grayscale of the digital image of the steel pipe surface is simplified, and the image contrast is enhanced, so as to achieve the purpose of improving the efficiency and accuracy of defect recognition.

[0034] Furthermore, step P43 of the embodiment of the present application also includes:

[0035] P43-1: averaging the plurality of pixel grayscale distances to generate a pixel grayscale distance mean;

[0036] P43-2: Based on the grayscale value of the pixel at the first position, count the number of pixel points whose grayscale deviation from the grayscale value of the pixel at the first position is less than the mean grayscale distance of the pixel, and set it as the grayscale density of the first position;

[0037] P43-3: Traverse the grayscale values ​​of the pixels at the second position until the grayscale values ​​of the pixels at the Mth position, perform grayscale density analysis based on the mean of the pixel grayscale distances, and generate the grayscale density of the second position until the grayscale density of the Mth position.

[0038] Among them, the average value of the plurality of pixel grayscale distances is calculated to obtain the mean pixel grayscale distance. Based on the first position pixel grayscale value, the grayscale deviation between the first position pixel grayscale value and the grayscale value of the adjacent pixel is calculated respectively, and the number of pixel points whose grayscale deviation from the first position pixel grayscale value is less than the mean pixel grayscale distance is counted, and set as the first position grayscale density, and so on, traverse the second position pixel grayscale value until the M-th position pixel grayscale value, and perform grayscale density calculation based on the mean pixel grayscale distance to obtain the second position grayscale density until the M-th position grayscale density.

[0039] Furthermore, step P44 of the embodiment of the present application also includes:

[0040] P44-1: Extract the maximum grayscale density from the grayscale density at the first position, the grayscale density at the second position, and the grayscale density at the Mth position;

[0041] P44-2: Taking the maximum grayscale density as the first cluster center, selecting pixel positions whose grayscale deviation from the maximum grayscale density is less than the mean value of the pixel grayscale distance, and adding them into the first cluster area;

[0042] P44-3: Clean the first clustering area from the first position grayscale density, the second position grayscale density to the Mth position grayscale density to obtain a retained pixel position set and a retained position grayscale density set;

[0043] P44-4: Set the center support coefficient, which is the product of the first center support parameter and the second center support parameter, wherein the first center support parameter is grayscale density and the second center support parameter is grayscale range;

[0044] P44-5: traverse the retained pixel position set and the retained position grayscale density set, and calculate the retained position center support coefficient set based on the first center support parameter and the second center support parameter;

[0045] P44-6: extract the retained pixel position of the maximum value of the central support coefficient of the retained position central support coefficient set, set it as the second cluster center, select the pixel position whose grayscale deviation from the second cluster center is less than the mean value of the pixel grayscale distance, and add it to the second cluster area;

[0046] P44-7: Clean the second clustering area from the retained pixel position set, repeat the iteration until the retained pixel position set is empty, and generate a steel pipe surface area clustering result;

[0047] P44-8: Compare the cluster center grayscale of the steel pipe surface area clustering results, set the grayscale of the area with the minimum cluster center grayscale value to the first preset grayscale value, set the grayscale of other areas to the second preset grayscale value, and generate the steel pipe surface feature image, wherein the local segmentation area of ​​the steel pipe surface feature image is set to the quasi-defect area.

[0048] In a possible embodiment of the present application, the maximum grayscale density is extracted from the grayscale density of the first position, the grayscale density of the second position, and the grayscale density of the Mth position. The pixel position where the maximum grayscale density is located is used as the first cluster center, and the deviation between the grayscale value of each pixel and the grayscale value of the pixel where the maximum grayscale density is located is calculated respectively, and the pixel position whose grayscale deviation from the pixel where the maximum grayscale density is located is less than the mean value of the pixel grayscale distance is screened out and added to the first cluster area. The pixels in the first cluster area are cleaned and removed from the grayscale density of the first position, the grayscale density of the second position, and the grayscale density of the Mth position to obtain a retained pixel position set and a retained position grayscale density set.

[0049] Furthermore, the second cluster center is selected. First, the center support coefficient is set, and the center support coefficient is the product of the first center support parameter and the second center support parameter. The first center support parameter is the grayscale density, and the second center support parameter is the grayscale range. The grayscale range is the maximum value of the grayscale difference between each pixel and the grayscale of other pixels. The set of retained pixel positions and the grayscale density set of the retained positions are traversed to obtain the first center support parameter and the second center support parameter of each retained pixel position, and then the center support coefficient of each retained position is calculated to obtain the center support coefficient set of the retained positions.

[0050] Furthermore, the retained pixel position of the maximum value of the central support coefficient of the retained position central support coefficient set is extracted, that is, the pixel point with the largest product of grayscale density and grayscale range is selected as the second cluster center, and the pixel position whose grayscale deviation from the second cluster center is less than the mean of the pixel grayscale distance is screened, added into the second cluster area, and the pixel points in the second cluster area are cleaned and removed from the retained pixel position set, and so on, repeated iterations are performed until the retained pixel position set is empty, and the steel pipe surface area clustering result is obtained, including multiple cluster areas.

[0051] Furthermore, the cluster center grayscale of each distance area in the steel pipe surface area clustering result is compared, and the cluster center grayscale is the grayscale value of the first and second distance centers selected above. The cluster area grayscale where the cluster center grayscale minimum value is located is set to the first preset grayscale value, such as setting the grayscale value to 255, and the grayscale of other areas is set to the second preset grayscale value, such as setting the grayscale value to 0, thereby obtaining the steel pipe surface feature image, so as to achieve the purpose of removing image noise and enhancing image contrast, which can simplify the defect recognition process and improve the recognition accuracy. And the local segmentation area of ​​the steel pipe surface feature image is set as the quasi-defect area, that is, the local area with a large grayscale difference is used as the quasi-defect area, so as to facilitate the defect recognition one by one.

[0052] Furthermore, step P44-4 of the embodiment of the present application also includes:

[0053] P44-41: Get the grayscale density of the pixel at the i-th position;

[0054] P44-42: traverse the grayscale density of other positions, and find the deviation with the grayscale density of the i-th position, and generate multiple grayscale density deviations, wherein the multiple grayscale density deviations have a maximum grayscale deviation value and a minimum grayscale deviation value;

[0055] P44-43: When the grayscale density at the i-th position is the maximum value of the grayscale density set of the retained positions, the grayscale deviation maximum value is set as the second center support parameter of the pixel point at the i-th position;

[0056] P44-44: When the grayscale density at the i-th position is not the maximum value of the grayscale density set of the retained positions, the minimum value of the grayscale deviation is set to the second center support parameter of the pixel point at the i-th position.

[0057] Among them, the grayscale density of the i-th position of the pixel at the i-th position is randomly obtained, and the grayscale densities of other positions are traversed, and the deviations are calculated from the grayscale density of the i-th position respectively to obtain multiple grayscale density deviations, and the multiple grayscale density deviations have a maximum grayscale deviation and a minimum grayscale deviation. When the grayscale density of the i-th position is the maximum value of the grayscale density set of the retained position, the maximum grayscale deviation is set as the second center support parameter of the pixel at the i-th position, and when the grayscale density of the i-th position is not the maximum value of the grayscale density set of the retained position, the minimum grayscale deviation is set as the second center support parameter of the pixel at the i-th position.

[0058] P50: traverse the quasi-defect area, set the defect sampling window, build a defect feature extraction node to extract features, and generate shape features and grayscale features of the quasi-defect area;

[0059] Further, such as Figure 3 As shown, step P50 of the embodiment of the present application also includes:

[0060] P51: traverse the quasi-defect area and count the number of pixels in the first area, wherein the number of pixels in any first area represents the number of pixels on the line connecting the pixels with the maximum distance in the area;

[0061] P52: Clustering the first region pixel number sequence based on a preset pixel number difference to generate a second region pixel number sequence;

[0062] P53: constructing a plurality of square convolution windows with the number sequence of pixels in the second area as the side length, and setting them as the defect sampling windows;

[0063] P54: traverse the multiple square convolution windows, construct multiple parallel feature extraction channels, generate the defect feature extraction node to perform feature extraction, and generate quasi-defect area shape features and quasi-defect area grayscale features.

[0064] It should be understood that the quasi-defect area is traversed and the first area pixel number sequence is counted. The first area pixel number refers to the number of pixels on the line between two pixels with the largest distance in any quasi-defect area. The purpose is to find the maximum range of the defect area to facilitate the subsequent delineation of the feature extraction area. The first area pixel number sequence consists of multiple first area pixel number sequences.

[0065] Furthermore, the first area pixel number sequence is clustered based on a preset pixel number difference, where the pixel number difference refers to the difference between the numbers of pixels of any two first areas. The areas with a number difference within the preset number difference are clustered into one category, and the maximum number of pixels is set as a representative value of the number of pixels in the category to generate a second area pixel number sequence. That is, the pixel number sequences in the first area with similar numbers of pixels are grouped into one category, and the number of pixels in the category is unified to obtain a simplified second area pixel number sequence.

[0066] Furthermore, the pixel number sequence of the second region is used as the side length of the feature acquisition region, and multiple square convolution windows are constructed and set as the defect sampling window. To ensure the integrity of defect feature acquisition, the defect sampling window is larger than the defect region. The multiple square convolution windows are traversed to construct multiple parallel feature extraction channels, and the defect feature extraction node is generated to extract defect shape and grayscale features, and multiple quasi-defect region shape features and quasi-defect region grayscale features are obtained.

[0067] P60: Defect identification is performed based on the shape characteristics of the quasi-defect area and the grayscale characteristics of the quasi-defect area to generate a defect type identification result.

[0068] Furthermore, step P60 of the embodiment of the present application also includes:

[0069] P61: Set the type of surface defect to be identified;

[0070] P62: Based on the surface defect type to be identified, retrieve defect sample images to perform regional clustering and then extract reference grayscale features and reference shape features;

[0071] P63: When the grayscale difference between the reference grayscale feature and the grayscale feature of the quasi-defect area is less than or equal to the consistent grayscale difference threshold, and the shape similarity between the reference shape feature and the shape feature of the quasi-defect area is greater than or equal to the shape similarity threshold, the quasi-defect area is marked as the surface defect type to be identified and added to the defect type identification result.

[0072] Specifically, based on historical stainless steel pipe defect data, the types of surface defects to be identified are set, including pits, peeling, scratches and roller marks, etc., and based on the types of surface defects to be identified, multiple types of defect sample images are obtained through big data retrieval, and clustered according to the defect types to obtain multiple different types of defect sample sets, and then according to the multiple different types of defect sample sets, the grayscale features and shape features of different types of defects are respectively extracted as benchmark grayscale features and benchmark shape features.

[0073] Furthermore, the shape feature of the quasi-defect area and the grayscale feature of the quasi-defect area are compared and calculated with the reference shape feature and the reference grayscale feature, respectively. When the grayscale difference between a reference grayscale feature and the grayscale feature of the quasi-defect area is less than or equal to a consistent grayscale difference threshold, and the shape similarity between a reference shape feature and the shape feature of the quasi-defect area is greater than or equal to a shape similarity threshold, it means that the defect feature of the current quasi-defect area is highly consistent with the feature of the defect sample. The defect type of the defect sample is then used as the defect type of the current quasi-defect area, the quasi-defect area is identified as the surface defect type to be identified, and the surface defect type identification result is added to the defect type identification result.

[0074] Among them, the consistent grayscale difference threshold and the shape similarity threshold are both feature judgment constraint values, which are set by professionals based on empirical data. The defect shape similarity can be achieved by training a twin neural network. The twin network takes two samples as input and outputs their representation embedded in a high-dimensional space to compare the similarity of the two samples. The two neural networks with shared weights can perform image feature recognition by inputting the reference shape features and the quasi-defect area shape features into the twin neural networks respectively to obtain standard feature recognition results and sample feature recognition results. By calculating the similarity of the standard feature recognition results and the sample feature recognition results, the shape similarity of the reference shape features and the quasi-defect area shape features can be obtained.

[0075] In summary, the embodiments of the present application have at least the following technical effects:

[0076] The present application acquires and digitizes the surface image of the steel pipe to generate a digital image of the surface of the steel pipe, performs regional clustering on the coordinate positions of the pixel points according to the grayscale values ​​of the pixel points in the image, generates a characteristic image of the surface of the steel pipe and a quasi-defect area, traverses the quasi-defect area, extracts defect features, generates shape features and grayscale features of the quasi-defect area, performs defect identification, and generates a defect type identification result.

[0077] The technical effect of reducing noise interference through image grayscale processing and combining defect feature extraction optimization to improve defect recognition efficiency and accuracy is achieved.

[0078] Embodiment 2

[0079] Based on the same inventive concept as the surface defect identification method of a stainless steel pipe in the aforementioned embodiment, Figure 4 As shown, the present application provides a surface defect recognition system for stainless steel pipes, and the system and method embodiments in the present application are based on the same inventive concept. The system includes:

[0080] A rotating and fixing module 11, which is used to start the clamping member when the stainless steel pipe is transported to the defect identification zone, insert a preset length of one end of the stainless steel pipe into the first rotating and fixing hole, and insert a preset length of the other end of the stainless steel pipe into the second rotating and fixing hole;

[0081] A steel pipe surface image acquisition module 12, wherein the steel pipe surface image acquisition module 12 is used to rotate the stainless steel pipe based on the first rotation fixing hole and the second rotation fixing hole, activate the imaging element to perform image acquisition, and generate a steel pipe surface image;

[0082] A steel pipe surface digital image generation module 13, the steel pipe surface digital image generation module 13 is used to digitize the steel pipe surface image to generate a steel pipe surface digital image, wherein the steel pipe surface digital image includes pixel point coordinate positions and pixel point grayscale values;

[0083] A steel pipe surface characteristic image generation module 14, the steel pipe surface characteristic image generation module 14 is used to perform regional clustering on the pixel point coordinate positions according to the pixel point grayscale values ​​to generate a steel pipe surface characteristic image, wherein the steel pipe surface characteristic image includes a quasi-defect area;

[0084] A defect feature extraction module 15, which is used to traverse the quasi-defect area, set a defect sampling window, build a defect feature extraction node to extract features, and generate shape features and grayscale features of the quasi-defect area;

[0085] The defect type identification result generating module 16 is used to perform defect identification according to the shape feature of the quasi-defect area and the grayscale feature of the quasi-defect area to generate a defect type identification result.

[0086] Furthermore, the steel pipe surface feature image generation module 14 is also used to perform the following steps:

[0087] According to the pixel point coordinate position and the pixel point grayscale value, obtain the first position pixel grayscale value, the second position pixel grayscale value, and so on until the Mth position pixel grayscale value;

[0088] Performing pairwise grayscale deviation enumeration analysis on the grayscale values ​​of the pixels at the first position, the grayscale values ​​of the pixels at the second position, and the grayscale values ​​of the pixels at the Mth position to generate a plurality of pixel grayscale distances;

[0089] Based on the plurality of pixel grayscale distances, traverse the pixel point coordinate positions to perform grayscale density analysis, and generate grayscale density at a first position, grayscale density at a second position, and grayscale density at an Mth position;

[0090] Based on the grayscale density of the first position, the grayscale density of the second position, and up to the grayscale density of the Mth position, the digital image of the steel pipe surface is subjected to regional clustering to generate the characteristic image of the steel pipe surface.

[0091] Furthermore, the steel pipe surface feature image generation module 14 is also used to perform the following steps:

[0092] averaging the plurality of pixel grayscale distances to generate a pixel grayscale distance mean;

[0093] Based on the grayscale value of the pixel at the first position, the number of pixel points whose grayscale deviation from the grayscale value of the pixel at the first position is less than the mean value of the pixel grayscale distance is counted, and the number is set as the grayscale density at the first position;

[0094] Traverse the second position pixel grayscale values ​​until the M-th position pixel grayscale values, perform grayscale density analysis based on the pixel grayscale distance mean, and generate the second position grayscale density until the M-th position grayscale density.

[0095] Furthermore, the steel pipe surface feature image generation module 14 is also used to perform the following steps:

[0096] Extracting the maximum grayscale density from the grayscale density at the first position, the grayscale density at the second position, and the grayscale density at the Mth position;

[0097] Taking the maximum grayscale density as the first cluster center, selecting pixel positions whose grayscale deviation from the maximum grayscale density is less than the mean value of the pixel grayscale distance, and adding them into the first cluster area;

[0098] Cleaning the first clustering area from the first position grayscale density, the second position grayscale density to the Mth position grayscale density to obtain a retained pixel position set and a retained position grayscale density set;

[0099] Setting a center support coefficient, wherein the center support coefficient is the product of a first center support parameter and a second center support parameter, wherein the first center support parameter is grayscale density, and the second center support parameter is grayscale range;

[0100] Traversing the retained pixel position set and the retained position grayscale density set, and calculating a retained position center support coefficient set based on the first center support parameter and the second center support parameter;

[0101] Extract the retained pixel position of the maximum value center support coefficient of the retained position center support coefficient set, set it as the second cluster center, select the pixel position whose grayscale deviation from the second cluster center is less than the mean value of the pixel grayscale distance, and add it to the second cluster area;

[0102] Cleaning the second clustering area from the retained pixel position set, repeating the iteration until the retained pixel position set is empty, and generating a steel pipe surface area clustering result;

[0103] Compare the cluster center grayscales of the steel pipe surface area clustering results, set the grayscale of the area with the minimum cluster center grayscale value to the first preset grayscale value, and set the grayscales of other areas to the second preset grayscale values ​​to generate the steel pipe surface feature image, wherein the local segmentation area of ​​the steel pipe surface feature image is set to the quasi-defect area.

[0104] Furthermore, the steel pipe surface feature image generation module 14 is also used to perform the following steps:

[0105] Get the grayscale density of the pixel at the ith position;

[0106] Traversing the grayscale densities at other positions, and calculating deviations from the grayscale density at the i-th position, to generate a plurality of grayscale density deviations, wherein the plurality of grayscale density deviations have a maximum grayscale deviation value and a minimum grayscale deviation value;

[0107] When the grayscale density at the i-th position is the maximum value of the grayscale density set of the retained positions, the grayscale deviation maximum value is set as the second center support parameter of the pixel point at the i-th position;

[0108] When the grayscale density at the i-th position is not the maximum value of the retained position grayscale density set, the minimum grayscale deviation is set as the second center support parameter of the pixel point at the i-th position.

[0109] Furthermore, the defect feature extraction module 15 is also used to perform the following steps:

[0110] Traversing the quasi-defect area, counting the number of pixel points in the first area, wherein the number of pixel points in any first area represents the number of pixel points on the line connecting the pixel points with the maximum distance in the area;

[0111] Clustering the first region pixel number sequence based on a preset pixel number difference to generate a second region pixel number sequence;

[0112] Taking the pixel number sequence of the second area as the side length, constructing a plurality of square convolution windows, which are set as the defect sampling windows;

[0113] The plurality of square convolution windows are traversed to construct a plurality of parallel feature extraction channels, and the defect feature extraction node is generated to perform feature extraction, thereby generating shape features of quasi-defect regions and grayscale features of quasi-defect regions.

[0114] Furthermore, the defect type identification result generating module 16 is further configured to perform the following steps:

[0115] Set the type of surface defects to be identified;

[0116] Based on the surface defect type to be identified, retrieve defect sample images, perform regional clustering, and then extract reference grayscale features and reference shape features;

[0117] When the grayscale difference between the reference grayscale feature and the grayscale feature of the quasi-defect area is less than or equal to the consistent grayscale difference threshold, and the shape similarity between the reference shape feature and the shape feature of the quasi-defect area is greater than or equal to the shape similarity threshold, the quasi-defect area is identified as the surface defect type to be identified and added to the defect type identification result.

[0118] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0119] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

[0120] This specification and drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.

Claims

1. A method for identifying surface defects of a stainless steel pipe, characterized in that: include: When the stainless steel pipe is transported to the defect identification zone, the clamp is started to insert a preset length of one end of the stainless steel pipe into the first rotation fixing hole, and a preset length of the other end of the stainless steel pipe is inserted into the second rotation fixing hole; Based on the first rotating fixed hole and the second rotating fixed hole, the stainless steel pipe is rotated, and the imaging element is activated to collect images to generate a surface image of the steel pipe; The steel pipe surface image is digitized to generate a digital image of the steel pipe surface, wherein the digital image of the steel pipe surface includes pixel point coordinate positions and pixel point grayscale values; Performing regional clustering on the coordinate positions of the pixel points according to the grayscale values ​​of the pixel points to generate a steel pipe surface feature image, wherein the steel pipe surface feature image includes a quasi-defect area; Traversing the quasi-defect area, setting a defect sampling window, building a defect feature extraction node to extract features, and generating shape features and grayscale features of the quasi-defect area; Defect identification is performed according to the shape characteristics of the quasi-defect area and the grayscale characteristics of the quasi-defect area, and a defect type identification result is generated; Traversing the quasi-defect area, setting a defect sampling window, building a defect feature extraction node to extract features, and generating shape features and grayscale features of the quasi-defect area, including: Traversing the quasi-defect area, counting the number of pixel points in the first area, wherein the number of pixel points in any first area represents the number of pixel points on the line connecting the pixel points with the maximum distance in the area; Clustering the first region pixel number sequence based on a preset pixel number difference to generate a second region pixel number sequence, specifically, clustering regions with a number difference within the preset number difference into one class, and setting the maximum number of pixels as a representative value of the number of pixels in the class to generate the second region pixel number sequence, wherein the pixel number difference refers to the difference between the numbers of pixels of any two first regions; Taking the pixel number sequence of the second area as the side length, constructing a plurality of square convolution windows, which are set as the defect sampling windows; The plurality of square convolution windows are traversed to construct a plurality of parallel feature extraction channels, and the defect feature extraction node is generated to perform feature extraction, thereby generating shape features of quasi-defect regions and grayscale features of quasi-defect regions.

2. The method according to claim 1, characterized in that The pixel coordinate positions are regionally clustered according to the grayscale values ​​of the pixel points to generate a steel pipe surface feature image, wherein the steel pipe surface feature image includes a quasi-defect area, including: According to the pixel point coordinate position and the pixel point grayscale value, obtain the first position pixel grayscale value, the second position pixel grayscale value, and so on until the Mth position pixel grayscale value; Performing pairwise grayscale deviation enumeration analysis on the grayscale values ​​of the pixels at the first position, the grayscale values ​​of the pixels at the second position, and the grayscale values ​​of the pixels at the Mth position to generate a plurality of pixel grayscale distances; Based on the plurality of pixel grayscale distances, traverse the pixel point coordinate positions to perform grayscale density analysis, and generate grayscale density at a first position, grayscale density at a second position, and grayscale density at an Mth position; Based on the grayscale density of the first position, the grayscale density of the second position, and up to the grayscale density of the Mth position, the digital image of the steel pipe surface is subjected to regional clustering to generate the characteristic image of the steel pipe surface.

3. The method according to claim 2, characterized in that Based on the plurality of pixel grayscale distances, traversing the pixel point coordinate positions to perform grayscale density analysis, generating a first position grayscale density, a second position grayscale density, and finally an Mth position grayscale density, including: averaging the plurality of pixel grayscale distances to generate a pixel grayscale distance mean; Based on the grayscale value of the pixel at the first position, the number of pixel points whose grayscale deviation from the grayscale value of the pixel at the first position is less than the mean value of the pixel grayscale distance is counted, and the number is set as the grayscale density at the first position; Traverse the second position pixel grayscale values ​​until the M-th position pixel grayscale values, perform grayscale density analysis based on the pixel grayscale distance mean, and generate the second position grayscale density until the M-th position grayscale density.

4. The method according to claim 3, characterized in that Based on the grayscale density of the first position, the grayscale density of the second position, and the grayscale density of the Mth position, the digital image of the steel pipe surface is subjected to regional clustering to generate the characteristic image of the steel pipe surface, including: Extracting the maximum grayscale density from the grayscale density at the first position, the grayscale density at the second position, and the grayscale density at the Mth position; Taking the maximum grayscale density as the first cluster center, selecting pixel positions whose grayscale deviation from the maximum grayscale density is less than the mean value of the pixel grayscale distance, and adding them into the first cluster area; Cleaning the first clustering area from the first position grayscale density, the second position grayscale density to the Mth position grayscale density to obtain a retained pixel position set and a retained position grayscale density set; Setting a center support coefficient, wherein the center support coefficient is the product of a first center support parameter and a second center support parameter, wherein the first center support parameter is grayscale density, and the second center support parameter is grayscale range; Traversing the retained pixel position set and the retained position grayscale density set, and calculating a retained position center support coefficient set based on the first center support parameter and the second center support parameter; Extract the retained pixel position of the maximum value center support coefficient of the retained position center support coefficient set, set it as the second cluster center, select the pixel position whose grayscale deviation from the second cluster center is less than the mean value of the pixel grayscale distance, and add it to the second cluster area; Cleaning the second clustering area from the retained pixel position set, repeating the iteration until the retained pixel position set is empty, and generating a steel pipe surface area clustering result; Compare the cluster center grayscales of the steel pipe surface area clustering results, set the grayscale of the area with the minimum cluster center grayscale value to the first preset grayscale value, and set the grayscales of other areas to the second preset grayscale values ​​to generate the steel pipe surface feature image, wherein the local segmentation area of ​​the steel pipe surface feature image is set to the quasi-defect area.

5. The method according to claim 4, characterized in that Setting a center support coefficient, where the center support coefficient is the product of a first center support parameter and a second center support parameter, wherein the first center support parameter is grayscale density and the second center support parameter is grayscale range, includes: Get the grayscale density of the pixel at the ith position; Traversing the grayscale densities at other positions, and calculating deviations from the grayscale density at the i-th position, to generate a plurality of grayscale density deviations, wherein the plurality of grayscale density deviations have a maximum grayscale deviation value and a minimum grayscale deviation value; When the grayscale density at the i-th position is the maximum value of the grayscale density set of the retained positions, the grayscale deviation maximum value is set as the second center support parameter of the pixel point at the i-th position; When the grayscale density at the i-th position is not the maximum value of the retained position grayscale density set, the minimum grayscale deviation is set as the second center support parameter of the pixel point at the i-th position.

6. The method according to claim 1, characterized in that Defect identification is performed according to the shape feature of the quasi-defect area and the grayscale feature of the quasi-defect area to generate a defect type identification result, including: Set the type of surface defects to be identified; Based on the surface defect type to be identified, retrieve defect sample images, perform regional clustering, and then extract reference grayscale features and reference shape features; When the grayscale difference between the reference grayscale feature and the grayscale feature of the quasi-defect area is less than or equal to the consistent grayscale difference threshold, and the shape similarity between the reference shape feature and the shape feature of the quasi-defect area is greater than or equal to the shape similarity threshold, the quasi-defect area is identified as the surface defect type to be identified and added to the defect type identification result.

7. Surface defect recognition system for stainless steel pipes, characterized in that: The system is used to execute the method according to any one of claims 1 to 6, and the system comprises: A rotation fixing module, wherein when the stainless steel pipe is transported to the defect identification zone, the rotation fixing module starts the clamping member, inserts a preset length of one end of the stainless steel pipe into the first rotation fixing hole, and inserts a preset length of the other end of the stainless steel pipe into the second rotation fixing hole; A steel pipe surface image acquisition module, the steel pipe surface image acquisition module is used to rotate the stainless steel pipe based on the first rotation fixing hole and the second rotation fixing hole, activate the imaging element to perform image acquisition, and generate a steel pipe surface image; A steel pipe surface digital image generation module, the steel pipe surface digital image generation module is used to digitize the steel pipe surface image to generate a steel pipe surface digital image, wherein the steel pipe surface digital image includes pixel point coordinate positions and pixel point grayscale values; A steel pipe surface feature image generation module, the steel pipe surface feature image generation module is used to perform regional clustering on the pixel point coordinate positions according to the pixel point grayscale values ​​to generate a steel pipe surface feature image, wherein the steel pipe surface feature image includes a quasi-defect area; A defect feature extraction module, which is used to traverse the quasi-defect area, set a defect sampling window, build a defect feature extraction node to extract features, and generate shape features and grayscale features of the quasi-defect area; The defect type identification result generating module is used to perform defect identification according to the shape characteristics of the quasi-defect area and the grayscale characteristics of the quasi-defect area to generate a defect type identification result.

Citation Information

Patent Citations

  • Steel pipe surface defect detection method based on machine vision

    CN116735610A

  • Method and system for improving image detection speed

    CN117392404A