Alloy furnace tube corrosion defect detection method, equipment and medium
By processing and analyzing the surface images of alloy furnace tubes, different types of corrosion areas are identified and distinguished, which solves the problem of insufficient morphological detection of corrosion areas of alloy furnace tubes in the existing technology and realizes accurate classification and morphological analysis of corrosion areas.
Patent Information
- Application Number
- CN202510887115.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-30
AI Technical Summary
The existing technology lacks effective detection of the morphology of corrosion areas in alloy furnace tubes, especially the lack of sensitivity to isolated point corrosion, which may lead to the neglect of its hazards.
By collecting and grayscale processing the surface images of the alloy furnace tube, identifying abnormal pixels, analyzing the edge, pending and isolated pixels, and combining gradient threshold and window analysis, the morphology of the corrosion area is determined.
It realizes effective detection of corrosion areas of alloy furnace tubes, and can distinguish circular concentrated corrosion, strip concentrated corrosion, circular isolated corrosion and strip isolated corrosion, thereby improving the accuracy and comprehensiveness of detection.
Smart Images

Figure CN120707549A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of corrosion defect detection, and in particular relates to a method, equipment and medium for detecting corrosion defects in alloy furnace tubes. Background Art
[0002] Alloy furnace tubes are tubular equipment made of alloy materials and used in high-temperature, high-pressure or special corrosive environments. They play an important role in industrial production. Alloy furnace tubes are mainly made of metal alloys. Common alloy systems include: iron-based alloys, nickel-based alloys and cobalt-based alloys. Alloy furnace tubes are important pipelines in corrosive environments. Their performance directly affects the safety and production efficiency of the equipment. Existing technologies typically perform quality inspections on corrosion defects on the surface of alloy furnace tubes to determine whether the corrosion severity of the alloy furnace tubes is severe. However, existing technologies lack analysis of the morphology of the corrosion area. For example, the resistance probe method can detect uniform corrosion rates, but is insensitive to localized corrosion such as point corrosion. The presence of point corrosion is often overlooked, and the different hazards caused by point corrosion and concentrated corrosion are ignored. To this end, the present invention provides a method, equipment and medium for detecting corrosion defects of alloy furnace tubes. Summary of the Invention
[0003] In view of the shortcomings of the prior art, the present invention aims to provide a method, equipment and medium for detecting corrosion defects in alloy furnace tubes.
[0004] The technical problems to be solved by the present invention are: How to effectively detect the presence and morphology of corrosion areas in alloy furnace tubes.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, a method for detecting corrosion defects in alloy furnace tubes is provided, the method comprising: Step S1, collecting images of the surfaces of the standard alloy furnace tube and the alloy furnace tube to be tested, and obtaining a standard image and an initial image; Step S2, performing grayscale processing on the standard image and the initial image to obtain abnormal pixels in the actual grayscale image; Step S3, analyzing abnormal pixels in the actual grayscale image of the alloy furnace tube to be inspected, and obtaining edge pixels and undetermined pixels in the actual grayscale image; Step S4, analyzing the undetermined pixel points in the actual grayscale image of the alloy furnace tube to be inspected, and obtaining internal pixel points and isolated pixel points by analysis; Step S5 , analyzing the corrosion area and corrosion morphology of the alloy furnace tube to be inspected based on different pixel points in the actual grayscale image.
[0006] Furthermore, the processing in step S2 includes the following sub-steps: Step S21, grayscale processing is performed on the standard image to obtain a standard grayscale image of the standard alloy furnace tube. Similarly, grayscale processing is performed on the initial image to obtain an actual grayscale image of the alloy furnace tube to be tested. Step S22, obtaining an initial grayscale value CSHi of each pixel in the standard grayscale image of the standard alloy furnace tube, wherein i=1, 2, ..., n, n is a positive integer, and i is the number of each pixel in the standard grayscale image of the standard alloy furnace tube; Step S23, counting the mode of the initial grayscale values of all pixels in the standard grayscale image of the standard alloy furnace tube, and at the same time, adding and averaging the initial grayscale values of all pixels to obtain the average grayscale value PJZ of all pixels in the standard grayscale image; Step S24, by formula The standard deviation BZC of the initial grayscale values of all pixels in the standard grayscale image is calculated.
[0007] Furthermore, the processing in step S2 includes the following sub-steps: Step S25, subtracting the standard deviation of the initial grayscale values of all pixels in the standard grayscale image from the mode of the initial grayscale values of all pixels to obtain a first value, and adding the standard deviation of the initial grayscale values of all pixels in the standard grayscale image to obtain a second value; Step S26, constructing a standard grayscale interval with the first value as the left endpoint and the second value as the right endpoint; Step S27, obtaining the actual grayscale value of each pixel in the actual grayscale image of the alloy furnace tube to be detected, and comparing the actual grayscale value of each pixel in the actual grayscale image of the alloy furnace tube to be detected with the standard grayscale interval; If the actual grayscale value of any pixel in the actual grayscale image of the alloy furnace tube to be inspected does not fall within the standard grayscale range, the corresponding pixel will be recorded as an abnormal pixel in the actual grayscale image; If the actual grayscale values of all pixels in the actual grayscale image of the alloy furnace tube to be inspected are within the standard grayscale range, no operation is performed.
[0008] Furthermore, the analysis process in step S3 includes the following sub-steps: Step S31, obtaining all abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected, and constructing a plane rectangular coordinate system with one end of the actual grayscale image as the x-axis and the other end of the actual grayscale image perpendicular to the x-axis as the y-axis; Step S32, obtaining the coordinates of all abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected; Step S33, calculating the gradient amplitude of abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected; Step S34, comparing the gradient amplitude of the abnormal pixel point in the actual grayscale image of the alloy furnace tube to be inspected with the gradient threshold; If the gradient amplitude of an abnormal pixel is greater than or equal to the gradient threshold, the corresponding abnormal pixel is recorded as an edge pixel; If the gradient amplitude of an abnormal pixel is less than the gradient threshold, the corresponding abnormal pixel is recorded as a pending pixel.
[0009] Furthermore, the calculation process in step S33 is as follows: Step S331, select any abnormal pixel point as the window center and establish a fixed-size detection window; Step S332 , obtaining the actual grayscale values of all pixels in the detection window with the abnormal pixel (X, Y) as the window center and forming a grayscale matrix I (X, Y); Step S333, by formula Calculate the horizontal gradient TDS of the abnormal pixel point in the horizontal direction; Similarly, through the formula Calculate the vertical gradient TDC of the abnormal pixel in the vertical direction; Step S334, by formula The gradient magnitude TDF corresponding to the abnormal pixel point is calculated.
[0010] Furthermore, the analysis process in step S4 includes the following sub-steps: Step S41: record the detection window with the undetermined pixel as the window center as the window to be detected, and obtain the number of abnormal pixels in the window to be detected except the window center; Step S42: If there is any abnormal pixel in the window to be detected except the center of the window, the corresponding pixel to be determined is recorded as an internal pixel; If there is no abnormal pixel point in the window to be detected except the center of the window, the size of the window to be detected is expanded until there is any abnormal pixel point in the window to be detected except the center of the window; Step S43, recording the enlarged window to be detected as an improved window to be detected, and obtaining the actual size of the improved window to be detected; Step S44, comparing the actual size of the improved window to be inspected with the standard size; If the actual size of the improved detection window is larger than the standard size, the corresponding undetermined pixel will be recorded as an isolated pixel; If the actual size of the improved window to be detected is less than or equal to the standard size, the corresponding undetermined pixel point is recorded as an internal pixel point.
[0011] Furthermore, the analysis process in step S5 is as follows: Step S51, dividing the number of abnormal pixels by the number of all pixels in the actual grayscale image to obtain the proportion of abnormal pixels in the actual grayscale image; Step S52, comparing the proportion of abnormal pixels in the actual grayscale image with the ratio threshold; If the proportion of abnormal pixels in the actual grayscale image is greater than or equal to the ratio threshold, the corresponding alloy furnace tube area to be detected in the actual grayscale image is recorded as a corrosion area; If the proportion of abnormal pixels in the actual grayscale image is less than the ratio threshold, the corresponding alloy furnace tube area to be inspected in the actual grayscale image is recorded as a corrosion risk area; Step S53: analyzing the corrosion morphology in the corrosion area.
[0012] Furthermore, the analysis process in step S53 is as follows: Step S531, obtaining the number of edge pixels, internal pixels and isolated pixels in the corrosion area; Step S532, adding the number of edge pixels, internal pixels, and isolated pixels in the corrosion area to obtain the total number of abnormal pixels in the corrosion area; Step S533: record the edge pixels and the internal pixels as regional corrosion pixels in the corrosion area, and add the number of edge pixels and the number of internal pixels to obtain the number of regional corrosion pixels in the corrosion area. Step S534: dividing the number of regional corroded pixels by the total number of abnormal pixels to obtain a ratio of regional corroded pixels in the corroded area. Similarly, the number of isolated pixels is divided by the total number of abnormal pixels to obtain the proportion of isolated pixels in the corrosion area; Step S535: Connect all edge pixels to form a complete defect outline, calculate the area of the defect outline as the area MJ of the corrosion area, and record the side length of the defect outline as the perimeter ZC of the corrosion area; Step S536, by the formula XZ=4π×(MJ / ZC 2 ) calculate the shape factor XZ of the corrosion area, where π is the pi constant; Step S537, comparing the proportion of regional corroded pixels in the corroded area with the proportion of isolated pixels, and comparing the shape factor of the corroded area with the standard interval; Step S538: If the proportion of regional corroded pixels in the corroded area is greater than or equal to the proportion of isolated pixels and the shape factor of the corroded area falls within the standard range, the corresponding corroded area is recorded as a circular concentrated corroded area; If the proportion of regional corroded pixels in the corroded area is greater than or equal to the proportion of isolated pixels and the shape factor of the corroded area does not belong to the standard range, the corresponding corroded area will be recorded as a strip-shaped concentrated corroded area; If the proportion of regional corroded pixels in the corroded area is smaller than the proportion of isolated pixels and the shape factor of the corroded area belongs to the standard range, the corresponding corroded area will be recorded as a circular isolated corroded area; If the proportion of regional corrosion pixels in the corrosion area is less than the proportion of isolated pixels and the shape factor of the corrosion area does not belong to the standard range, the corresponding corrosion area will be recorded as a strip-shaped isolated corrosion area.
[0013] According to a second aspect, an electronic device is provided, characterized in that the electronic device comprises: a memory storing a computer program; A processor is communicatively connected to the memory, and when the computer program is executed by the processor, the method for detecting corrosion defects of an alloy furnace tube is implemented.
[0014] In a third aspect, a computer-readable storage medium stores a computer program thereon, wherein the program, when executed by a processor, implements the aforementioned method for detecting corrosion defects in alloy furnace tubes.
[0015] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: 1. The present invention first performs image acquisition on the surfaces of the standard alloy furnace tube and the alloy furnace tube to be tested to obtain a standard image and an initial image. The standard image and the initial image are then grayscale processed to obtain abnormal pixel points in the actual grayscale image. The abnormal pixel points in the actual grayscale image of the alloy furnace tube to be tested are then analyzed to obtain edge pixel points and undetermined pixel points in the actual grayscale image. The present invention achieves preliminary classification of the pixel points in the actual grayscale image. 2. The present invention also analyzes the undetermined pixel points in the actual grayscale image of the alloy furnace tube to be inspected, obtains internal pixel points and isolated pixel points through analysis, and finally analyzes the corrosion area and corrosion morphology of the alloy furnace tube to be inspected based on the different pixel points in the actual grayscale image. The present invention realizes effective detection of the existence morphology of the corrosion area in the alloy furnace tube. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] To facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0017] Figure 1 is a flow chart of the method of the present invention; Figure 2 Schematic diagram of abnormal pixel points in the present invention; Figure 3Schematic diagram of the detection window in the present invention; Figure 4 Schematic diagram of the undetermined pixel points in the present invention; Figure 5 It is a structural schematic diagram of the electronic device in the present invention. DETAILED DESCRIPTION
[0018] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0019] Example 1: Please refer to Figures 1-4 As shown, the technical solution provided by the present invention is: a method for detecting corrosion defects in alloy furnace tubes, the method is specifically as follows: Step S1, collecting images of the surfaces of the standard alloy furnace tube and the alloy furnace tube to be tested, and obtaining a standard image and an initial image; In this embodiment, the acquisition process in step S1 is as follows: Step S11, using an image acquisition device to acquire an image of the surface of the standard alloy furnace tube to obtain a standard image of the standard alloy furnace tube; Step S12, capturing an image of the surface of the alloy furnace tube to be inspected by an image acquisition device, and recording the image as an initial image of the alloy furnace tube to be inspected; It should be explained that the standard alloy furnace tube is an uncorroded alloy furnace tube at the factory. The image acquisition equipment can be a high-resolution, low-noise camera equipped with a light source. When acquiring the standard image and the initial image, it is necessary to perform the acquisition in an environment with sufficient light source to reduce the environmental error caused by illumination. The standard image and the initial image are RGB images that have not been grayscale processed.
[0020] Step S2, performing grayscale processing on the standard image and the initial image to obtain abnormal pixels in the actual grayscale image; Furthermore, the processing in step S2 includes the following sub-steps: Step S21, grayscale processing is performed on the standard image to obtain a standard grayscale image of the standard alloy furnace tube. Similarly, grayscale processing is performed on the initial image to obtain an actual grayscale image of the alloy furnace tube to be tested. Step S22, obtaining an initial grayscale value CSHi of each pixel in the standard grayscale image of the standard alloy furnace tube, wherein i=1, 2, ..., n, n is a positive integer, and i is the number of each pixel in the standard grayscale image of the standard alloy furnace tube; Step S23, counting the mode of the initial grayscale values of all pixels in the standard grayscale image of the standard alloy furnace tube, and at the same time, adding and averaging the initial grayscale values of all pixels to obtain the average grayscale value PJZ of all pixels in the standard grayscale image; Step S24, by formula Calculate the standard deviation BZC of the initial grayscale values of all pixels in the standard grayscale image; Step S25, subtracting the standard deviation of the initial grayscale values of all pixels in the standard grayscale image from the mode of the initial grayscale values of all pixels to obtain a first value, and adding the standard deviation of the initial grayscale values of all pixels in the standard grayscale image to obtain a second value; Step S26, constructing a standard grayscale interval with the first value as the left endpoint and the second value as the right endpoint; Step S27, obtaining the actual grayscale value of each pixel in the actual grayscale image of the alloy furnace tube to be detected, and comparing the actual grayscale value of each pixel in the actual grayscale image of the alloy furnace tube to be detected with the standard grayscale interval; If the actual grayscale value of any pixel in the actual grayscale image of the alloy furnace tube to be inspected does not fall within the standard grayscale range, the corresponding pixel will be recorded as an abnormal pixel in the actual grayscale image; If the actual grayscale values of all pixels in the actual grayscale image of the alloy furnace tube to be inspected are within the standard grayscale range, no operation is performed.
[0021] Step S3, analyzing abnormal pixels in the actual grayscale image of the alloy furnace tube to be inspected, and obtaining edge pixels and undetermined pixels in the actual grayscale image; In this embodiment, the analysis process in step S3 includes the following sub-steps: Step S31, obtaining all abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected, and constructing a plane rectangular coordinate system with one end of the actual grayscale image as the x-axis and the other end of the actual grayscale image perpendicular to the x-axis as the y-axis; Step S32, obtaining the coordinates of all abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected; For clarification, see Figure 2As shown, each square unit in the actual grayscale image is a pixel point, and the number inside the square unit is the actual grayscale value of the corresponding pixel point. In this example, only the actual grayscale values of some pixels are listed. The shaded part inside the square unit in the figure is an abnormal pixel point. However, the square unit is an area in the plane rectangular coordinate system, and it is impossible to use a point coordinate to represent the position of the corresponding pixel point in the plane rectangular coordinate system. Therefore, in this embodiment, the position of the abnormal pixel point in the image is recorded as the coordinate of the corresponding abnormal pixel point. For example, the abnormal pixel point is located in the vertical direction of the 6th pixel point from the origin position to the right, and the abnormal pixel point is located in the horizontal direction of the 1st pixel point from the origin position upward, and the coordinate of the corresponding abnormal pixel point is marked as (6, 1); Step S33, calculating the gradient amplitude of abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected; The calculation process in step S33 is as follows: Step S331, select any abnormal pixel point as the window center and establish a fixed-size detection window; For example, the abnormal pixel with coordinates (6, 1) is selected as the window center. In this embodiment, a detection window with a length and width of 3 pixels is established. It should be explained that the length and width of the detection window must be equal, that is, the shape of the detection window is square; For clarification, see Figure 3 As shown in the figure, when the horizontal coordinate or vertical coordinate of the abnormal pixel is 1, that is, the abnormal pixel is on the coordinate axis, if a 3×3 detection window is established with the abnormal pixel as the window center, there will be a pixel-free area. At this time, the actual grayscale value of the corresponding pixel-free area is set to the actual grayscale value of the adjacent pixel. For example, a 3×3 detection window is established with the abnormal pixel (1, 2) as the window center. There is a pixel-free area on the left side of the abnormal pixel (1, 2). At this time, the actual grayscale values of the pixels adjacent to the left area are filled into the left area. Step S332 , obtaining the actual grayscale values of all pixels in the detection window with the abnormal pixel (X, Y) as the window center and forming a grayscale matrix I (X, Y); In this embodiment, the actual grayscale value of the abnormal pixel corresponding to the center of the detection window is used as the central element of the grayscale matrix, and the actual grayscale value of the pixel in the first row and first column of the detection window is used as the element in the first row and first column of the grayscale matrix. Similarly, the actual grayscale value of the pixel in the kth row and kth column of the detection window is used as the element in the kth row and kth column of the grayscale matrix. Step S333, by formula Calculate the horizontal gradient TDS of the abnormal pixel point in the horizontal direction; Similarly, through the formula Calculate the vertical gradient TDC of the abnormal pixel in the vertical direction; It should be explained that the calculation of horizontal gradient and vertical gradient is based on the actual grayscale value of the abnormal pixel and is obtained by weighted summation; For example, a detection window is established with the abnormal pixel point at coordinates (6, 1) as the window center, and a grayscale matrix is constructed based on the actual grayscale values of each pixel point in the detection window: ; The formula is used to calculate TDS = [(-1) × 10 + 0 × 25 + 1 × 15] + [(-2) × 15 + 0 × 50 + 2 × 10] + [(-1) × 10 + 0 × 20 + 1 × 15] = 0; TDC=[(-1)×10+(-2)×25+(-1)×15]+(0×15+0×50+0×10)+(1×10+2×20+1×15)=-10; Step S334, by formula Calculate the gradient magnitude TDF corresponding to the abnormal pixel point; Step S34, comparing the gradient amplitude of the abnormal pixel point in the actual grayscale image of the alloy furnace tube to be inspected with the gradient threshold; If the gradient amplitude of an abnormal pixel is greater than or equal to the gradient threshold, the corresponding abnormal pixel is recorded as an edge pixel; If the gradient amplitude of the abnormal pixel is less than the gradient threshold, the corresponding abnormal pixel is recorded as a pending pixel; It should be explained that the position with a larger gradient amplitude indicates that the actual grayscale value difference on both sides of the corresponding position is large, and it may be at the boundary between the normal area and the corrosion area. The position with a smaller gradient amplitude indicates that the actual grayscale value difference on both sides of the corresponding position is small, but due to the existence of abnormal pixels, the position with a smaller gradient amplitude may be inside the corrosion area or isolated corrosion on the normal area. For example, Figure 4 The gradient amplitude of the abnormal pixel in the left detection window is 0, but the abnormal pixel is surrounded by normal pixels. The corresponding abnormal pixel may be an isolated pixel in the normal area. Figure 4 The gradient amplitude of the abnormal pixel point corresponding to the center of the window in the detection window on the right side is also not 0, but the center of the window is all abnormal pixels, so the corresponding abnormal pixels may be internal pixels of the corrosion area.
[0022] Step S4, analyzing the undetermined pixel points in the actual grayscale image of the alloy furnace tube to be inspected, and obtaining internal pixel points and isolated pixel points by analysis; In this embodiment, the analysis process in step S4 includes the following sub-steps: Step S41: record the detection window with the undetermined pixel as the window center as the window to be detected, and obtain the number of abnormal pixels in the window to be detected except the window center; Step S42: If there is any abnormal pixel in the window to be detected except the center of the window, the corresponding pixel to be determined is recorded as an internal pixel; If there is no abnormal pixel point in the window to be detected except the center of the window, the size of the window to be detected is expanded until there is any abnormal pixel point in the window to be detected except the center of the window; Step S43, recording the enlarged window to be detected as an improved window to be detected, and obtaining the actual size of the improved window to be detected; It should be explained that each time the size of the window to be detected is enlarged, it needs to be enlarged to an odd size. For example, if the size of the current window to be detected is 3×3, the size of the window to be detected needs to be enlarged to 5×5. Step S44, comparing the actual size of the improved window to be inspected with the standard size; If the actual size of the improved detection window is larger than the standard size, the corresponding undetermined pixel will be recorded as an isolated pixel; If the actual size of the improved window to be detected is less than or equal to the standard size, the corresponding undetermined pixel point is recorded as an internal pixel point; It should be explained that the standard size can be obtained by analyzing the historical corrosion conditions of the alloy furnace tubes. For example, if the corrosion area in the historical corrosion detection of the alloy furnace tubes is larger, a larger standard size can be selected. If the corrosion area in the historical corrosion detection of the alloy furnace tubes is smaller, a smaller standard size can be selected.
[0023] Step S5, analyzing the corrosion area and corrosion morphology of the alloy furnace tube to be inspected based on different pixel points in the actual grayscale image; The analysis process in step S5 is as follows: Step S51, dividing the number of abnormal pixels by the number of all pixels in the actual grayscale image to obtain the proportion of abnormal pixels in the actual grayscale image; Step S52, comparing the proportion of abnormal pixels in the actual grayscale image with the ratio threshold; If the proportion of abnormal pixels in the actual grayscale image is greater than or equal to the ratio threshold, it means that the corresponding alloy furnace tube area to be detected in the actual grayscale image is severely corroded, and the corresponding alloy furnace tube area to be detected in the actual grayscale image is recorded as a corroded area; If the proportion of abnormal pixels in the actual grayscale image is less than the ratio threshold, it means that the corresponding alloy furnace tube area to be inspected in the actual grayscale image has a corrosion risk, and the corresponding alloy furnace tube area to be inspected in the actual grayscale image is recorded as a corrosion risk area; It should be explained that the ratio threshold is set by the user according to his or her requirements for detection accuracy. The corrosion risk area is the area where corrosion risk exists. In specific implementation, the corrosion risk area needs to be continuously monitored or further processed; Step S53: Analyze the corrosion morphology in the corrosion area. The analysis process is as follows: Step S531, obtaining the number of edge pixels, internal pixels and isolated pixels in the corrosion area; Step S532, adding the number of edge pixels, internal pixels, and isolated pixels in the corrosion area to obtain the total number of abnormal pixels in the corrosion area; Step S533: record the edge pixels and the internal pixels as regional corrosion pixels in the corrosion area, and add the number of edge pixels and the number of internal pixels to obtain the number of regional corrosion pixels in the corrosion area. Step S534: dividing the number of regional corroded pixels by the total number of abnormal pixels to obtain a ratio of regional corroded pixels in the corroded area. Similarly, the number of isolated pixels is divided by the total number of abnormal pixels to obtain the proportion of isolated pixels in the corrosion area; Step S535: Connect all edge pixels to form a complete defect outline, calculate the area of the defect outline as the area MJ of the corrosion area, and record the side length of the defect outline as the perimeter ZC of the corrosion area; Step S536, by the formula XZ=4π×(MJ / ZC 2 ) calculate the shape factor XZ of the corrosion area, where π is the pi constant; Step S537, comparing the proportion of regional corroded pixels in the corroded area with the proportion of isolated pixels, and comparing the shape factor of the corroded area with the standard interval; Step S538: If the proportion of regional corroded pixels in the corroded area is greater than or equal to the proportion of isolated pixels and the shape factor of the corroded area falls within the standard range, indicating that the corresponding corroded area is mainly a concentrated contiguous area and the corroded shape is close to a circle, then the corresponding corroded area is recorded as a circular concentrated corroded area. If the proportion of regional corroded pixels in the corrosion area is greater than or equal to the proportion of isolated pixels and the shape factor of the corrosion area does not belong to the standard range, it means that the corresponding corrosion area is mainly a concentrated continuous area and the corrosion shape is close to a strip. In this case, the corresponding corrosion area is recorded as a strip-shaped concentrated corrosion area. If the proportion of regional corrosion pixels in the corrosion area is smaller than the proportion of isolated pixels and the shape factor of the corrosion area belongs to the standard range, it means that the corresponding corrosion area is mainly caused by corrosion of different isolated areas and the corrosion shape of the isolated areas is close to circular. In this case, the corresponding corrosion area is recorded as a circular isolated corrosion area. If the proportion of regional corrosion pixels in the corrosion area is smaller than the proportion of isolated pixels and the shape factor of the corrosion area does not belong to the standard range, it means that the corresponding corrosion area is mainly caused by corrosion in different isolated areas and the corrosion shape of the isolated areas is close to strip-shaped. In this case, the corresponding corrosion area is recorded as a strip-shaped isolated corrosion area. In specific implementation, the value of the standard interval can be 0.7 to 1.
[0024] In this application, if a corresponding calculation formula appears, the above calculation formula is dimensionless and its numerical calculation is performed. The weight coefficient, proportional coefficient and other coefficients in the formula are set to a result value obtained by quantifying each parameter. Regarding the size of the weight coefficient and the proportional coefficient, as long as it does not affect the proportional relationship between the parameter and the result value, it is acceptable.
[0025] Example 2: The present invention also provides an electronic device for running the above-mentioned method for detecting corrosion defects in alloy furnace tubes; see Figure 5 The structure diagram of an electronic device provided by an embodiment of the present invention is shown, the electronic device including a memory and a processor, wherein the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the above-mentioned alloy furnace tube corrosion defect detection method; Furthermore, Figure 5 The electronic device shown further includes a communication bus and a communication interface, and the processor, the communication interface and the memory are connected via the communication bus; The memory may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is achieved through at least one communication interface (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The communication bus can be an ISA bus, PCI bus or EISA bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used, but it does not mean that there is only one communication bus or one type of communication bus; The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method may be completed by hardware integrated logic circuits in the processor or by software instructions. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present invention may be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or the like. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the method of the above embodiment in combination with its hardware.
[0026] Embodiment 3: The embodiment of the present invention further provides a computer storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned alloy furnace tube corrosion defect detection method. The specific implementation can be found in the method embodiment and will not be repeated here. A computer program product of a method for detecting corrosion defects in alloy furnace tubes provided in an embodiment of the present invention includes a computer storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0027] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0028] In addition, in the description of the embodiments of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0029] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0030] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting corrosion defects in alloy furnace tubes, characterized in that: Methods include: Step S1, collecting images of the surfaces of the standard alloy furnace tube and the alloy furnace tube to be tested, and obtaining a standard image and an initial image; Step S2, performing grayscale processing on the standard image and the initial image to obtain abnormal pixels in the actual grayscale image; Step S3, analyzing abnormal pixels in the actual grayscale image of the alloy furnace tube to be inspected, and obtaining edge pixels and undetermined pixels in the actual grayscale image; Step S4, analyzing the undetermined pixel points in the actual grayscale image of the alloy furnace tube to be inspected, and obtaining internal pixel points and isolated pixel points by analysis; Step S5 , analyzing the corrosion area and corrosion morphology of the alloy furnace tube to be inspected based on different pixel points in the actual grayscale image.
2. The method for detecting corrosion defects of an alloy furnace tube according to claim 1, characterized in that: The processing in step S2 includes the following sub-steps: Step S21, grayscale processing is performed on the standard image to obtain a standard grayscale image of the standard alloy furnace tube. Similarly, grayscale processing is performed on the initial image to obtain an actual grayscale image of the alloy furnace tube to be tested. Step S22, obtaining an initial grayscale value CSHi of each pixel in the standard grayscale image of the standard alloy furnace tube, wherein i=1, 2, ..., n, n is a positive integer, and i is the number of each pixel in the standard grayscale image of the standard alloy furnace tube; Step S23, counting the mode of the initial grayscale values of all pixels in the standard grayscale image of the standard alloy furnace tube, and at the same time, adding and averaging the initial grayscale values of all pixels to obtain the average grayscale value PJZ of all pixels in the standard grayscale image; Step S24, by formula The standard deviation BZC of the initial grayscale values of all pixels in the standard grayscale image is calculated.
3. The method for detecting corrosion defects of alloy furnace tubes according to claim 2, characterized in that: The processing in step S2 further includes the following sub-steps: Step S25, subtracting the standard deviation of the initial grayscale values of all pixels in the standard grayscale image from the mode of the initial grayscale values of all pixels to obtain a first value, and adding the standard deviation of the initial grayscale values of all pixels in the standard grayscale image to obtain a second value; Step S26, constructing a standard grayscale interval with the first value as the left endpoint and the second value as the right endpoint; Step S27, obtaining the actual grayscale value of each pixel in the actual grayscale image of the alloy furnace tube to be detected, and comparing the actual grayscale value of each pixel in the actual grayscale image of the alloy furnace tube to be detected with the standard grayscale interval; If the actual grayscale value of any pixel in the actual grayscale image of the alloy furnace tube to be inspected does not fall within the standard grayscale range, the corresponding pixel will be recorded as an abnormal pixel in the actual grayscale image; If the actual grayscale values of all pixels in the actual grayscale image of the alloy furnace tube to be inspected are within the standard grayscale range, no operation is performed.
4. The method for detecting corrosion defects of alloy furnace tubes according to claim 3, characterized in that: The analysis process in step S3 includes the following sub-steps: Step S31, obtaining all abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected, and constructing a plane rectangular coordinate system with one end of the actual grayscale image as the x-axis and the other end of the actual grayscale image perpendicular to the x-axis as the y-axis; Step S32, obtaining the coordinates of all abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected; Step S33, calculating the gradient amplitude of abnormal pixel points in the actual grayscale image of the alloy furnace tube to be inspected; Step S34, comparing the gradient amplitude of the abnormal pixel point in the actual grayscale image of the alloy furnace tube to be inspected with the gradient threshold; If the gradient amplitude of an abnormal pixel is greater than or equal to the gradient threshold, the corresponding abnormal pixel is recorded as an edge pixel; If the gradient amplitude of an abnormal pixel is less than the gradient threshold, the corresponding abnormal pixel is recorded as a pending pixel.
5. The method for detecting corrosion defects of alloy furnace tubes according to claim 4, characterized in that: The calculation process in step S33 is as follows: Step S331, select any abnormal pixel point as the window center and establish a fixed-size detection window; Step S332 , obtaining the actual grayscale values of all pixels in the detection window with the abnormal pixel (X, Y) as the window center and forming a grayscale matrix I (X, Y); Step S333, by formula Calculate the horizontal gradient TDS of the abnormal pixel point in the horizontal direction; Similarly, through the formula Calculate the vertical gradient TDC of the abnormal pixel in the vertical direction; Step S334, by formula The gradient magnitude TDF corresponding to the abnormal pixel point is calculated.
6. The method for detecting corrosion defects of alloy furnace tubes according to claim 5, characterized in that: The analysis process in step S4 includes the following sub-steps: Step S41: record the detection window with the undetermined pixel as the window center as the window to be detected, and obtain the number of abnormal pixels in the window to be detected except the window center; Step S42: If there is any abnormal pixel in the window to be detected except the center of the window, the corresponding pixel to be determined is recorded as an internal pixel; If there is no abnormal pixel point in the window to be detected except the center of the window, the size of the window to be detected is expanded until there is any abnormal pixel point in the window to be detected except the center of the window; Step S43, recording the enlarged window to be detected as an improved window to be detected, and obtaining the actual size of the improved window to be detected; Step S44, comparing the actual size of the improved window to be inspected with the standard size; If the actual size of the improved detection window is larger than the standard size, the corresponding undetermined pixel will be recorded as an isolated pixel; If the actual size of the improved window to be detected is less than or equal to the standard size, the corresponding undetermined pixel point is recorded as an internal pixel point.
7. The method for detecting corrosion defects of alloy furnace tubes according to claim 6, characterized in that: The analysis process in step S5 is as follows: Step S51, dividing the number of abnormal pixels by the number of all pixels in the actual grayscale image to obtain the proportion of abnormal pixels in the actual grayscale image; Step S52, comparing the proportion of abnormal pixels in the actual grayscale image with the ratio threshold; If the proportion of abnormal pixels in the actual grayscale image is greater than or equal to the ratio threshold, the corresponding alloy furnace tube area to be detected in the actual grayscale image is recorded as a corrosion area; If the proportion of abnormal pixels in the actual grayscale image is less than the ratio threshold, the corresponding alloy furnace tube area to be inspected in the actual grayscale image is recorded as a corrosion risk area; Step S53: analyzing the corrosion morphology in the corrosion area.
8. The method for detecting corrosion defects of alloy furnace tubes according to claim 7, characterized in that: The analysis process in step S53 is as follows: Step S531, obtaining the number of edge pixels, internal pixels and isolated pixels in the corrosion area; Step S532, adding the number of edge pixels, internal pixels, and isolated pixels in the corrosion area to obtain the total number of abnormal pixels in the corrosion area; Step S533: record the edge pixels and the internal pixels as regional corrosion pixels in the corrosion area, and add the number of edge pixels and the number of internal pixels to obtain the number of regional corrosion pixels in the corrosion area. Step S534: dividing the number of regional corroded pixels by the total number of abnormal pixels to obtain a ratio of regional corroded pixels in the corroded area. Similarly, the number of isolated pixels is divided by the total number of abnormal pixels to obtain the proportion of isolated pixels in the corrosion area; Step S535: Connect all edge pixels to form a complete defect outline, calculate the area of the defect outline as the area MJ of the corrosion area, and record the side length of the defect outline as the perimeter ZC of the corrosion area; Step S536, by the formula XZ=4π×(MJ / ZC 2 ) calculate the shape factor XZ of the corrosion area, where π is the pi constant; Step S537, comparing the proportion of regional corroded pixels in the corroded area with the proportion of isolated pixels, and comparing the shape factor of the corroded area with the standard interval; Step S538: If the proportion of regional corroded pixels in the corroded area is greater than or equal to the proportion of isolated pixels and the shape factor of the corroded area falls within the standard range, the corresponding corroded area is recorded as a circular concentrated corroded area; If the proportion of regional corroded pixels in the corroded area is greater than or equal to the proportion of isolated pixels and the shape factor of the corroded area does not belong to the standard range, the corresponding corroded area will be recorded as a strip-shaped concentrated corroded area; If the proportion of regional corroded pixels in the corroded area is smaller than the proportion of isolated pixels and the shape factor of the corroded area belongs to the standard range, the corresponding corroded area will be recorded as a circular isolated corroded area; If the proportion of regional corrosion pixels in the corrosion area is less than the proportion of isolated pixels and the shape factor of the corrosion area does not belong to the standard range, the corresponding corrosion area will be recorded as a strip-shaped isolated corrosion area.
9. An electronic device, characterized in that: The electronic device comprises: a memory storing a computer program; A processor is communicatively connected to the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Aluminum pipe quality detection method
CN114943739A
Alloy defect quantitative detection method based on data processing
CN115272322A
Copper-aluminum adapter surface machining quality detection method
CN117218124A
Cylinder cover quality detection method and system
CN117252882A
Marine metal corrosion degree detection method based on image processing
CN119313656A