A metal corrosion detection method and system based on image recognition
By partitioning and encoding the target image, the block image that meets the standard can be quickly selected, which solves the problems of large computation and large error in the existing technology and realizes efficient and accurate metal corrosion detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SKILL TRAINING CENT STATE GRID JIBEI ELECTRONICS POWER COMPANY
- Filing Date
- 2022-12-20
- Publication Date
- 2026-04-28
AI Technical Summary
Existing image recognition-based metal corrosion detection methods tend to include a large number of interference areas when acquiring target images, leading to increased computational load and larger errors in corrosion area measurement.
By partitioning the target image, the block images containing metal are extracted. Then, using a matching degree model and encoding, the block images that meet the criteria are quickly selected and combined into sample images for the extraction of rusted areas.
This reduces computational workload and measurement errors in rusted areas, improving detection efficiency and accuracy.
Smart Images

Figure CN115965796B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of metal detection technology, and more specifically to a metal corrosion detection method based on image recognition. Background Technology
[0002] Metal corrosion is mainly caused by the destruction of the structure of metal parts when they come into contact with oxygen and water. Metal materials have characteristics such as high hardness and strong electrical conductivity, making them indispensable materials in production and daily life, and an important material foundation for social development. However, most metals will corrode to varying degrees after prolonged use. Once the corroded area becomes too large, the metal can no longer be used. Therefore, it is essential to detect metal corrosion in order to ensure safe production and daily life. Common methods for detecting metal corrosion include potentiometric methods, resistance methods, and image recognition methods.
[0003] Existing image recognition-based metal corrosion detection methods analyze the target image as a whole. However, when acquiring the target image of the metal to be tested, there are often a large number of interference areas, i.e. areas where no metal exists. Extracting the corrosion area from the target image not only increases the computational load but also increases the error after the corrosion area is measured. Based on this, this solution proposes a metal corrosion detection method that can perform partitioning processing on the target image. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a metal corrosion detection method based on image recognition, which can perform partitioning processing on the target image before calculating the metal corrosion rate in the target image, and extract the block image of the metal. In the subsequent extraction of the metal corrosion area in the target image, it can not only reduce the amount of calculation, but also reduce the measurement error of the corrosion area.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows.
[0006] Image recognition-based methods for metal corrosion detection include:
[0007] Acquire target image information of the metal to be detected, wherein the target image information includes interference image information and the image information to be detected;
[0008] Obtain standard characteristic information of the metal to be detected;
[0009] The target image information is partitioned and encoded to obtain multiple consecutive block image information. The multiple block image information is then substituted into the matching degree model and compared with the standard feature information to obtain the block image matching degree.
[0010] Obtain the standard matching threshold for the target image;
[0011] The matching degree of the block image is compared with the standard matching threshold;
[0012] If the matching degree of the block image is greater than or equal to the standard matching threshold, then the block image information is marked as the image information to be tested;
[0013] If the matching degree of the block image is less than the standard matching threshold, the block image information is marked as interference image information;
[0014] The encoding of the image information to be tested is obtained and labeled as the reference encoding. Taking the reference encoding as the center, all supplementary encodings adjacent to the reference encoding are determined. The block images corresponding to the supplementary encodings are combined with the block images corresponding to the reference encodings to obtain the sample images.
[0015] The sample image is substituted into the discrimination model to extract the rusted area in the sample image;
[0016] The distribution area of the rusted area is obtained, and the corrosion rate of the metal to be tested is calculated in combination with the surface area of the metal to be tested. The metal to be tested is then judged to be qualified based on the corrosion rate.
[0017] In a preferred embodiment, the step of performing partition encoding processing on the target image information includes:
[0018] The target image is divided into equal parts;
[0019] A two-dimensional coordinate system is established with any corner of the target image as the origin;
[0020] All block images are acquired, and all block images are encoded starting from the block image closest to the two-dimensional coordinate system. The block image is encoded as xy, where x and y represent the vertical and horizontal coordinates in the two-dimensional coordinate system, respectively, and take values of 000001, 000002, 000003, ...
[0021] In a preferred embodiment, the step of substituting the information from multiple image blocks into a matching degree model and comparing it with standard feature information to obtain the image block matching degree includes:
[0022] Obtain feature information from the block image;
[0023] Substitute the feature information from the block image into the matching degree model to obtain the block image matching degree;
[0024] The standard function of the matching degree model is:
[0025] ,
[0026] In the formula, Indicates the matching degree of the block image. and These represent the length and width of the block image, respectively. Represents the first element in the block image. The pixel grayscale value of a point. Indicates the first element in the image of the metal to be detected. The standard pixel grayscale value of a point. This represents the average grayscale value of the block image. This represents the average grayscale value of the image of the metal to be detected.
[0027] In a preferred embodiment, the step of comparing the block image matching degree with the standard matching threshold includes:
[0028] Obtain the standard matching threshold;
[0029] Get the matching degree of all block images;
[0030] The matching degree of the block images is compared with the standard matching threshold in ascending order, and the comparison stops after the first block image with a matching degree greater than the standard matching threshold is found.
[0031] In a preferred embodiment, the steps of acquiring the encoding of the image information to be tested and labeling it as a reference encoding, determining all supplementary encodings adjacent to the reference encoding with the reference encoding as the center, and combining the block images corresponding to the supplementary encodings with the block images corresponding to the reference encodings to obtain the sample image include:
[0032] Obtain the baseline encoding of the image to be tested;
[0033] Using the reference code xy as the center, supplementary images at the edges and corners of the image under test are obtained respectively;
[0034] The supplementary codes corresponding to the supplementary images are as follows: (x-1)(y-1), x(y-1), (x+1)(y-1), (x-1)y, (x+1)y, (x-1)(y+1), x(y+1), (x+1)(y+1);
[0035] All the supplementary images are combined with the image to be tested to obtain the sample image.
[0036] In a preferred embodiment, when acquiring supplementary images at the edges and corners of the image to be tested, the number of supplementary images is determined based on the position of the image to be tested;
[0037] If either x or y takes the value 1, then x max Or y max And the adjacent coordinate values are in the interval (1, x). max) or (1, y max When the number of supplementary images corresponding to the image to be tested is within 5, the number of supplementary images corresponding to the image to be tested is 5.
[0038] If either x or y takes the value 1, then x max or y max And the adjacent coordinates are 1 and x. max or y max When any one of them is true, the number of supplementary images corresponding to the image to be tested is 3;
[0039] If the values of x and y belong to the interval (1, x... max ) and (1, y max The number of supplementary images corresponding to the image to be tested is 8.
[0040] In a preferred embodiment, the step of substituting the sample image into the discrimination model to extract the rusted areas in the sample image includes:
[0041] Obtain the grayscale value of the sample image;
[0042] Substitute the grayscale values of the sample image into the discrimination model to obtain the grayscale values of the rusted area;
[0043] The standard function of the distinguishing model is: In the formula, This indicates the grayscale value of the rusted area. , as well as This represents the three-channel grayscale values of the sample image.
[0044] In a preferred embodiment, the step of obtaining the distribution area of the rusted region, calculating the rust rate of the metal to be tested based on the surface area of the metal to be tested, and determining whether the metal to be tested is qualified based on the rust rate includes:
[0045] The corroded areas in the block image are binarized to obtain the area of the corroded areas;
[0046] According to the formula The corrosion rate of the metal to be tested is obtained from the formula, where, This indicates the corrosion rate of the metal being tested. This represents the area of the block image after binarization. This represents the area of the metal to be detected in the block image;
[0047] Obtain the threshold for determining the corrosion level;
[0048] If the corrosion rate of the metal to be tested is greater than or equal to the judgment threshold, it indicates that the metal to be tested is unqualified.
[0049] If the corrosion rate of the metal to be tested is less than the judgment threshold, it indicates that the metal to be tested is qualified.
[0050] The present invention also provides an image recognition-based metal corrosion detection system, applied to any one of the above-mentioned image recognition-based metal corrosion detection methods, comprising:
[0051] The first acquisition module is used to acquire target image information of the metal to be detected, wherein the target image information includes interference image information and image information to be tested;
[0052] The second acquisition module is used to acquire standard feature information of the metal to be detected.
[0053] The comparison module is used to perform partitioning and encoding processing on the target image information to obtain multiple consecutive block image information, and to substitute the multiple block image information into the matching degree model and compare it with the standard feature information to obtain the block image matching degree.
[0054] The third acquisition module is used to acquire the standard matching threshold of the target image;
[0055] A determination module, which is used to compare the matching degree of the block image with the standard matching threshold;
[0056] If the matching degree of the block image is greater than or equal to the standard matching threshold, then the block image information is marked as the image information to be tested;
[0057] If the matching degree of the block image is less than the standard matching threshold, the block image information is marked as interference image information;
[0058] The combination module is used to acquire the encoding of the image information to be tested and label it as the reference encoding. Taking the reference encoding as the center, all supplementary encodings adjacent to the reference encoding are determined. The block images corresponding to the supplementary encodings are combined with the block images corresponding to the reference encodings to obtain the sample image.
[0059] The extraction module is used to input the sample image into the differentiation model and extract the rust area in the sample image;
[0060] The evaluation module is used to obtain the distribution area of the rusted area, calculate the rust rate of the metal to be tested in combination with the surface area of the metal to be tested, and determine the rust level of the metal to be tested based on the rust rate.
[0061] Due to the adoption of the above technical solutions, the technical progress achieved by this invention is as follows.
[0062] This invention can partition the target image before calculating the metal corrosion rate, extracting the blocks containing metal. By encoding these blocks and sorting them before comparison, the invention quickly extracts the metal-containing blocks. The comparison is performed by position, and once a block with a matching degree greater than a standard threshold is found, the comparison stops, greatly reducing the computational load. Then, by combining supplementary images with the metal-containing blocks, a sample image is formed. Subsequently, when extracting the metal corrosion area in the target image, not only is the computational load reduced, but the measurement error of the corrosion area is also reduced. Attached Figure Description
[0063] Figure 1 This is a flowchart of the method described in this invention;
[0064] Figure 2 This is a structural block diagram of the system described in this invention. Detailed Implementation
[0065] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0066] A metal corrosion detection method based on image recognition, comprising:
[0067] S1. Obtain target image information of the metal to be detected, wherein the target image information includes interference image information and the image information to be detected;
[0068] S2. Obtain the standard characteristic information of the metal to be detected;
[0069] S3. Perform partitioning and encoding on the target image information to obtain multiple consecutive block image information. Substitute the multiple block image information into the matching degree model and compare it with the standard feature information to obtain the block image matching degree.
[0070] S4. Obtain the standard matching threshold of the target image;
[0071] S5. Compare the block image matching degree with the standard matching threshold;
[0072] If the matching degree of the block image is greater than or equal to the standard matching threshold, the block image information is identified as the image information to be tested.
[0073] If the matching degree of the block image is less than the standard matching threshold, the block image information is marked as interference image information;
[0074] S6. Obtain the encoding of the image information to be tested and label it as the reference encoding. Using the reference encoding as the center, determine all the supplementary encodings adjacent to the reference encoding. Combine the block image corresponding to the supplementary encoding with the block image corresponding to the reference encoding to obtain the sample image.
[0075] S7. Substitute the sample image into the discrimination model to extract the rusted areas in the sample image;
[0076] S8. Obtain the distribution area of the rusted area, and calculate the rust rate of the metal to be tested based on the surface area of the metal to be tested, and determine whether the metal to be tested is qualified based on the rust rate.
[0077] As described in steps S1-S8 above, metal materials have a high density and most possess high rigidity. Metal products are ubiquitous in society. However, most metals corrode to varying degrees after contact with water and oxygen. Once metal corrodes, its rigidity and service life decrease. Therefore, corrosion detection of metal parts is essential. In this embodiment, image recognition and comparison are used to calculate the corrosion rate of metal parts to determine whether corrosion will affect their normal use. When recognizing images of metal parts, some interference information is inevitably collected. Consequently, when comparing the metal parts in the target image with the standard features of the metal to be detected, the computational load of the target image increases, and the comparison results are also easily affected. In this embodiment, before calculating the corrosion rate of the metal parts in the target image, the target image is first decomposed. The image is divided into multiple blocks, and each block is compared with the standard features of the metal to be detected to extract the regions in the target image where the metal to be detected exists. Then, the corrosion rate of the metal parts in these regions is calculated. In this process, to ensure the integrity of the block images, after determining the block images that meet the standards, the adjacent images are identified as supplementary images and combined with the block images that meet the standards to form a sample image. Then, the corrosion regions of the metal to be detected in the sample image are extracted by a discrimination model. In this way, the corrosion rate of the metal to be detected can be obtained, and the qualification of the metal to be detected can be determined according to a preset judgment threshold. This method does not require a comprehensive analysis of the acquired target image. By extracting block images, the amount of computation is reduced, and the influence of interference factors can also be reduced, thus reducing the error of the metal corrosion rate detection result.
[0078] In a preferred embodiment, the step of performing partition encoding on the target image information includes:
[0079] S301. Divide the target image into equal parts;
[0080] S302. Establish a two-dimensional coordinate system with any corner of the target image as the origin;
[0081] S303. Obtain all block images, and encode all block images starting from the block image closest to the two-dimensional coordinate system. The block image is encoded as xy, where x and y represent the vertical and horizontal coordinates in the two-dimensional coordinate system, respectively, and take values of 000001, 000002, 000003, etc.
[0082] As described in steps S301-S303 above, when the target image is divided into blocks, all block images are encoded. In this embodiment, a coordinate system is established to encode all block images, so that each block has an independent code. Subsequently, after matching the block image that matches the standard feature information, the supplementary image can be quickly matched through this code, and the supplementary image is combined with the block image to generate a sample image.
[0083] In a preferred embodiment, the step of substituting multiple block image information into a matching degree model and comparing it with standard feature information to obtain the block image matching degree includes:
[0084] S304. Obtain feature information from the block image;
[0085] S305. Substitute the feature information in the block image into the matching degree model to obtain the block image matching degree;
[0086] The standard function of the matching degree model is: In the formula, Indicates the matching degree of the block image. and These represent the length and width of the block image, respectively. Represents the first element in the block image. The pixel grayscale value of a point. Indicates the first element in the image of the metal to be detected. The standard pixel grayscale value of a point. This represents the average grayscale value of the block image. This represents the average grayscale value of the image of the metal to be detected.
[0087] As described in steps S304-S305 above, when calculating the matching degree of the block image, the grayscale of the block image is compared with that of the standard image of the metal to be tested. This method uses the correlation coefficient method to calculate the correlation between the standard image of the metal to be tested and the block image. The value of the correlation is the matching degree of the block image. The closer this value is to 1, the closer the block image is to the standard image of the metal to be tested. Subsequently, according to the pre-set standard matching threshold, the matching degree of the block that meets the standard can be determined. Accordingly, the block image corresponding to the matching degree of the block can be determined.
[0088] In a preferred embodiment, the step of comparing the block image matching degree with a standard matching threshold includes:
[0089] S501. Obtain the standard matching threshold;
[0090] S502, Obtain the matching degree of all block images;
[0091] S503. Compare the block image matching degree with the standard matching threshold in order from low to high, and stop the comparison after the first block image with a matching degree greater than the standard matching threshold appears.
[0092] As described in steps S501-S503 above, when comparing the matching degree of the block image with the standard matching threshold, the first step is to determine the ranking of all block image matching degrees. In this process, the block matching degree and the standard matching threshold are compared in ascending order. When a block image matching degree greater than the standard threshold appears, it means that the matching degree of the blocks with higher rankings all meet the standard of the image to be tested, and the block images corresponding to these matching degrees are immediately determined. For block image matching degrees less than the standard matching threshold, the corresponding block images are marked as interference image information and are not included in the discrimination model to reduce their impact on the extraction of rusted areas. At the same time, the computational load of the discrimination model is reduced accordingly, thereby improving the detection efficiency of metal parts.
[0093] In a preferred embodiment, the steps of acquiring the encoding of the image information to be tested and labeling it as a reference encoding, determining all supplementary encodings adjacent to the reference encoding with the reference encoding as the center, and combining the block images corresponding to the supplementary encodings with the block images corresponding to the reference encodings to obtain the sample image include:
[0094] S601. Obtain the reference code of the image to be tested;
[0095] S602. Using the reference code xy as the center, obtain the supplementary images at the edges and corners of the image to be tested;
[0096] S603, The supplementary codes corresponding to the supplementary images are as follows: (x-1)(y-1), x(y-1), (x+1)(y-1), (x-1)y, (x+1)y, (x-1)(y+1), x(y+1), (x+1)(y+1);
[0097] S604. Combine all supplementary images with the image to be tested to obtain the sample image.
[0098] As described in steps S601-S604 above, when establishing a coordinate system based on the target image, the values of the horizontal and vertical coordinates are all set to non-zero natural numbers, making the encoding of the block image easier to identify. After the baseline encoding of the image to be tested is determined, the supplementary images connected to it are matched accordingly. In this embodiment, the encoding of the supplementary images is listed one by one based on the case where there are 8 supplementary images of the image to be tested, which also represents all possible situations of the supplementary images.
[0099] In a preferred embodiment, when acquiring supplementary images at the edges and corners of the image to be tested, the number of supplementary images is determined based on the position of the image to be tested;
[0100] S6021. If either x or y takes the value 1, x... max Or y max And the adjacent coordinate values are in the interval (1, x). max ) or (1, y max When the number of supplementary images corresponding to the image to be tested is within 5, the number of supplementary images is 5.
[0101] S6022. If either x or y takes the value 1, x max or y max And the adjacent coordinates are 1 and x. max or y max When any one of them is true, the number of supplementary images corresponding to the image to be tested is 3;
[0102] S6023. If the values of x and y belong to the interval (1, x...). max ) and (1, y max The number of supplementary images corresponding to the image to be tested is 8.
[0103] As described in steps S6021-S6023 above, in the established two-dimensional coordinate system, the position of the image to be measured is not fixed. It may appear adjacent to the coordinate axes, or at the edge or corner of the target image. In this case, the number of supplementary images will also decrease. Specifically, there may be 3 or 5 supplementary images. Of course, these are all determined based on the two-dimensional coordinate system. For example, if a target image is divided into 8×8 blocks, the maximum value of the horizontal and vertical coordinates of the two-dimensional coordinate system is also 8. In this case, the corresponding codes are 11, 18, 81. When any one of the four block images of 88 is identified as the image to be tested, the number of its supplementary images is 3. When any one of the block images coded as 12-17, 21-71, 28-78, and 82-87 is identified as the image to be tested, the number of its corresponding supplementary images is 5. Correspondingly, when all other block images are identified as the image to be tested, the number of their supplementary images is 8. Of course, there may also be cases where they are complementary images to each other. In this case, the block images that are complementary images to each other can be combined together to form a sample image.
[0104] In a preferred embodiment, the step of substituting the sample image into the discrimination model to extract the rusted areas in the sample image includes:
[0105] S701. Obtain the grayscale value of the sample image;
[0106] S702. Substitute the gray values of the sample image into the discrimination model to obtain the gray values of the rusted area;
[0107] The standard function for distinguishing models is: In the formula, This indicates the grayscale value of the rusted area. , as well as This represents the three-channel grayscale values of the sample image.
[0108] As described in steps S701-S702 above, the differentiation model is based on the super red algorithm. It uses the 2R-GB weighted combination method of the grayscale image components of the color image to effectively distinguish the dark red features of the rust area from other areas, thereby marking the rust area in the block image.
[0109] In a preferred embodiment, the steps of obtaining the distribution area of the rusted region, calculating the rust rate of the metal to be tested based on the surface area of the metal to be tested, and determining whether the metal to be tested is qualified based on the rust rate include:
[0110] S801. Binarize the rusted areas in the block image to obtain the area of the rusted areas;
[0111] S802, according to the formula The corrosion rate of the metal to be tested is obtained from the formula, where, This indicates the corrosion rate of the metal being tested. This represents the area of the block image after binarization. This represents the area of the metal to be detected in the block image;
[0112] S803, Obtain the threshold for determining the corrosion level;
[0113] If the corrosion rate of the metal to be tested is greater than or equal to the judgment threshold, it indicates that the metal to be tested is unqualified.
[0114] If the corrosion rate of the metal to be tested is less than the judgment threshold, it indicates that the metal to be tested is qualified.
[0115] As described in steps S801-S8103 above, after obtaining the rusted areas of all block images, they are added together to obtain the rusted area of the metal part in the target image. Then, based on the metal material, the rust level judgment threshold is obtained. Here, the rust level judgment threshold is determined according to the specific metal material, and is generally set to 40% to 50%. Then, the rust rate of the metal to be tested is compared with it, and the metal is judged as qualified for detection based on the comparison result.
[0116] This invention also provides an image recognition-based metal corrosion detection system, applied to the aforementioned image recognition-based metal corrosion detection method, comprising:
[0117] The first acquisition module is used to acquire target image information of the metal to be detected, wherein the target image information includes interference image information and the image information to be tested;
[0118] The second acquisition module is used to acquire the standard feature information of the metal to be detected.
[0119] The comparison module is used to perform partitioning and encoding of the target image information to obtain multiple consecutive block image information. The multiple block image information is then substituted into the matching degree model and compared with the standard feature information to obtain the block image matching degree.
[0120] The third acquisition module is used to acquire the standard matching threshold of the target image;
[0121] The determination module is used to compare the matching degree of the block image with the standard matching threshold.
[0122] If the matching degree of the block image is greater than or equal to the standard matching threshold, the block image information is identified as the image information to be tested.
[0123] If the matching degree of the block image is less than the standard matching threshold, the block image information is marked as interference image information;
[0124] The combination module is used to acquire the encoding of the image information to be tested and label it as the reference encoding. With the reference encoding as the center, all the supplementary encodings adjacent to the reference encoding are determined. The block images corresponding to the supplementary encodings are combined with the block images corresponding to the reference encodings to obtain the sample image.
[0125] The extraction module is used to input the sample image into the discrimination model and extract the rusted area in the sample image;
[0126] The evaluation module is used to obtain the distribution area of the rusted area, calculate the rust rate of the metal to be tested by combining it with the surface area of the metal to be tested, and determine the rust level of the metal to be tested based on the rust rate.
[0127] As mentioned above, a device with high-definition imaging capabilities is sufficient for acquiring the target image. The extraction of feature information from the target image or block image can be achieved by removing noise using a 5th-order two-dimensional Gaussian filter, and by using image enhancement algorithms such as color image histogram equalization and logarithmic transformation to address overexposure and improve image contrast, thus completing the preprocessing of the metal image to be detected. These are all relatively mature techniques in the field and are not the focus of this solution; therefore, they will not be explained in detail here. All the standard parameters mentioned above are preset in the system. When executing the comparison module or the judgment module, if...else functions can be used for nested execution. The execution of the program will not be elaborated upon here.
[0128] The present invention also provides a metal corrosion detection terminal based on image recognition, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement any of the above-mentioned metal corrosion detection methods based on image recognition.
[0129] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0130] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.
Claims
1. A metal corrosion detection method based on image recognition, characterized in that: include: Acquire target image information of the metal to be detected, wherein the target image information includes interference image information and the image information to be detected; Obtain standard characteristic information of the metal to be detected; The target image information is partitioned and encoded to obtain multiple consecutive block image information. The multiple block image information is then substituted into the matching degree model and compared with the standard feature information to obtain the block image matching degree. Obtain the standard matching threshold for the target image; The matching degree of the block image is compared with the standard matching threshold; If the matching degree of the block image is greater than or equal to the standard matching threshold, then the block image information is marked as the image information to be tested; If the matching degree of the block image is less than the standard matching threshold, the block image information is marked as interference image information; The encoding of the image information to be tested is obtained and labeled as the reference encoding. Taking the reference encoding as the center, all supplementary encodings adjacent to the reference encoding are determined. The block images corresponding to the supplementary encodings are combined with the block images corresponding to the reference encodings to obtain the sample images. The sample image is substituted into the discrimination model to extract the rusted area in the sample image; The distribution area of the rusted area is obtained, and the corrosion rate of the metal to be tested is calculated in combination with the surface area of the metal to be tested. The metal to be tested is then judged to be qualified based on the corrosion rate.
2. The metal corrosion detection method based on image recognition according to claim 1, characterized in that: The step of performing partition encoding processing on the target image information includes: The target image is divided into equal parts; A two-dimensional coordinate system is established with any corner of the target image as the origin; All block images are acquired, and the block images closest to the two-dimensional coordinate system are used as the starting point to encode all block images. The block image is encoded as xy, where x and y represent the vertical and horizontal coordinates in the two-dimensional coordinate system, respectively.
3. The metal corrosion detection method based on image recognition according to claim 1, characterized in that: The step of substituting the information from multiple image blocks into the matching degree model and comparing it with standard feature information to obtain the matching degree of the image blocks includes: Obtain feature information from the block image; Substitute the feature information from the block image into the matching degree model to obtain the block image matching degree; The standard function of the matching degree model is: , In the formula, Indicates the matching degree of the block image. and These represent the length and width of the block image, respectively. Represents the first element in the block image. The pixel grayscale value of a point. Indicates the first element in the image of the metal to be detected. The standard pixel grayscale value of a point. This represents the average grayscale value of the block image. This represents the average grayscale value of the image of the metal to be detected.
4. The metal corrosion detection method based on image recognition according to claim 3, characterized in that: The step of comparing the matching degree of the block image with the standard matching threshold includes: Obtain the standard matching threshold; Get the matching degree of all block images; The matching degree of the block images is compared with the standard matching threshold in ascending order, and the comparison stops after the first block image with a matching degree greater than the standard matching threshold is found.
5. The metal corrosion detection method based on image recognition according to claim 2, characterized in that: The steps of acquiring the encoding of the image information to be tested and labeling it as a reference encoding, determining all supplementary encodings adjacent to the reference encoding as the center, and combining the block images corresponding to the supplementary encodings with the block images corresponding to the reference encodings to obtain the sample image include: Obtain the baseline encoding of the image to be tested; Using the reference code xy as the center, supplementary images at the edges and corners of the image under test are obtained respectively; The supplementary codes corresponding to the supplementary images are as follows: (x-1)(y-1), x(y-1), (x+1)(y-1), (x-1)y, (x+1)y, (x-1)(y+1), x(y+1), (x+1)(y+1); All the supplementary images are combined with the image to be tested to obtain the sample image.
6. The metal corrosion detection method based on image recognition according to claim 5, characterized in that: When acquiring supplementary images at the edges and corners of the image to be tested, the number of supplementary images is determined according to the position of the image to be tested. If either x or y takes the value 1, then x max Or y max And the adjacent coordinate values are in the interval (1, x). max ) or (1, y max When the number of supplementary images corresponding to the image to be tested is within 5, the number of supplementary images corresponding to the image to be tested is 5. If either x or y takes the value 1, then x max or y max And the adjacent coordinates are 1 and x. max or y max When any one of them is true, the number of supplementary images corresponding to the image to be tested is 3; If the values of x and y belong to the interval (1, x... max ) and (1, y max The number of supplementary images corresponding to the image to be tested is 8.
7. The metal corrosion detection method based on image recognition according to claim 5, characterized in that: The step of substituting the sample image into the discrimination model to extract the rusted areas in the sample image includes: Obtain the grayscale value of the sample image; Substitute the grayscale values of the sample image into the discrimination model to obtain the grayscale values of the rusted area; The standard function of the distinguishing model is: In the formula, This indicates the grayscale value of the rusted area. , as well as This represents the three-channel grayscale values of the sample image.
8. The metal corrosion detection method based on image recognition according to claim 7, characterized in that: The steps of obtaining the distribution area of the rusted region, calculating the rust rate of the metal to be tested based on the surface area of the metal to be tested, and determining whether the metal to be tested is qualified based on the rust rate include: The corroded areas in the block image are binarized to obtain the area of the corroded areas; According to the formula The corrosion rate of the metal to be tested is obtained by formula, where, This indicates the corrosion rate of the metal being tested. This represents the area of the block image after binarization. This represents the area of the metal to be detected in the block image; Obtain the threshold for determining the corrosion level; If the corrosion rate of the metal to be tested is greater than or equal to the judgment threshold, it indicates that the metal to be tested is unqualified. If the corrosion rate of the metal to be tested is less than the judgment threshold, it indicates that the metal to be tested is qualified.
9. A metal corrosion detection system based on image recognition, applied to the metal corrosion detection method based on image recognition as described in any one of claims 1-8, characterized in that: include: The first acquisition module is used to acquire target image information of the metal to be detected, wherein the target image information includes interference image information and image information to be tested; The second acquisition module is used to acquire standard feature information of the metal to be detected. The comparison module is used to perform partitioning and encoding processing on the target image information to obtain multiple consecutive block image information, and to substitute the multiple block image information into the matching degree model and compare it with the standard feature information to obtain the block image matching degree. The third acquisition module is used to acquire the standard matching threshold of the target image; A determination module, which is used to compare the matching degree of the block image with the standard matching threshold; If the matching degree of the block image is greater than or equal to the standard matching threshold, then the block image information is marked as the image information to be tested; If the matching degree of the block image is less than the standard matching threshold, the block image information is marked as interference image information; The combination module is used to acquire the encoding of the image information to be tested and label it as the reference encoding. Taking the reference encoding as the center, all supplementary encodings adjacent to the reference encoding are determined. The block images corresponding to the supplementary encodings are combined with the block images corresponding to the reference encodings to obtain the sample image. The extraction module is used to input the sample image into the differentiation model and extract the rust area in the sample image; The evaluation module is used to obtain the distribution area of the rusted area, calculate the rust rate of the metal to be tested in combination with the surface area of the metal to be tested, and determine the rust level of the metal to be tested based on the rust rate.
Citation Information
Patent Citations
Bolt gusset plate corrosion detection method, device and equipment and storage medium
CN112419298A
Power transmission line hardware corrosion detection and analysis method based on deep learning
CN113724246A