Method, device, computing equipment and storage medium for defect detection of annular workpiece

By expanding and gray-scale repairing the region of interest of the annular workpiece and constructing an adaptive template, the problem of detecting small-size defects in annular workpieces at high resolution is solved, and efficient and accurate defect detection is achieved.

CN116757992BActive Publication Date: 2025-09-19HUNAN UNIV +1

Patent Information

Application Number
CN202310315422.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2025-09-19
Estimated Expiration
2043-03-27

AI Technical Summary

Technical Problem

The existing technology for defect detection of annular workpieces has problems such as difficulty in detecting small-size defects at high resolution, imbalance in the number of positive and negative samples, and insufficient detection accuracy and efficiency. Especially in the high-resolution image processing of annular workpieces, the existing methods will lead to poor small-size target recognition and low defect segmentation accuracy.

Method used

By extracting the region of interest from the image to be inspected of the annular workpiece and expanding it, a grayscale probability distribution matrix is ​​constructed, the defect area is determined and grayscale repair is performed, an adaptive defect-free template is constructed, and the absolute difference is calculated to locate the defect position. The shrink and enlarge method is used to construct the template to maintain image resolution and improve detection efficiency.

Benefits of technology

It achieves the goal of reducing the amount of image processing data while maintaining the resolution of the region of interest, improving the accuracy and efficiency of large-scale defect detection, reducing the generalization ability of large-scale defects, and improving the ability to detect small-scale pixel-level defects. The algorithm has low computational complexity and efficient operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116757992B_ABST
    Figure CN116757992B_ABST
Patent Text Reader

Abstract

The present invention discloses a defect detection method, device, computing device and storage medium for an annular workpiece. The method is executed in a computing device and includes: obtaining an image of the annular workpiece to be detected; extracting an annular region of interest from the image to be detected and expanding it to obtain a rectangular expansion image to be detected; determining the pixel grayscale probability of the rectangular expansion image to be detected based on a grayscale probability distribution matrix to construct a probability map and determine the defect area in the probability map; performing grayscale repair on the defect area in the probability map to obtain a repaired map; constructing an adaptive defect-free template based on the repaired map; calculating the absolute difference between the adaptive defect-free template and the rectangular expansion image to be detected to obtain a defect residual map, so as to locate the defect position of the annular workpiece based on the defect residual map. According to the technical solution of the present invention, the detection effect of large-scale defects of annular workpieces can be improved, high-precision detection can be achieved, and the algorithm is optimized to improve the efficiency of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of defect detection technology, and in particular to a defect detection method, a defect detection device, a computing device and a storage medium for an annular workpiece. Background Art

[0002] Currently, annular workpieces are widely used in industrial production scenarios such as standard parts manufacturing, automotive accessories, and beverage production. Surface defect detection on annular workpieces is a critical component of product quality control. The area to be inspected on annular workpieces is typically thin-walled, with the region of interest occupying only a small portion of the entire image. Furthermore, due to the rotary machining process, the image exhibits uniform grayscale along the circumference. Developing a universal and efficient annular workpiece defect detection algorithm, tailored to the structure and image characteristics of annular workpieces, is crucial for automated defect detection in annular workpieces.

[0003] It should be noted that the core challenges of circular workpiece defect detection currently include detecting small defects at high resolution and developing defect detection algorithms with a small number of defect samples. Given that images of circular workpieces are generally high resolution, while the area of ​​the region of interest within the circular area is relatively small, existing solutions for high-resolution defect detection, besides directly processing the entire image, primarily involve resizing and cropping. Mainstream deep learning defect detection networks, such as R-CNN, the YOLO series, the SSD series, and classification networks like GoogleNet and MobileNet, all operate with input resolutions of around 100, while the resolution of images collected during industrial inspection is typically around several thousand.

[0004] In the prior art, in order to solve the problem of high-resolution defect detection, the scheme of directly using the Resize method to compress the size of the input image has little effect on the detection accuracy of large-sized targets to be detected. However, since direct Resizing will neutralize or remove pixels in the small target area, the scheme has poor recognition effect on small-sized targets to be detected. In response to the above problems, some researchers use a cutting method to cut large-sized images into small-sized images and process them, and finally splice the detection results as the final output. Some researchers use the sliding window method to process small-sized windows to achieve detection of high-resolution images. Using the method of the expansion map of interest, the area of ​​interest of the annular workpiece is directly expanded, and the detection of the annular workpiece is completed without reducing the resolution of the part to be detected.

[0005] From the above research, we can see that for defect detection, in order to ensure the detection effect of multi-scale defects, the image should be compressed as little as possible. At the same time, in order to improve the detection efficiency, the overall and local image characteristics should be utilized as much as possible to reduce the calculation time of the algorithm.

[0006] Furthermore, the imbalance in the number of positive and negative samples is a key issue hindering the development of defect detection algorithms. Acquiring defect samples is relatively difficult in actual algorithm development. To address this issue, researchers have conducted extensive technical exploration, including data augmentation, data generation, and loss function modification in supervised deep learning. In actual industrial applications, due to the relatively uniform imaging environment and uniform image quality of the workpieces being inspected, and the relative ease of acquiring positive sample data, researchers have conducted in-depth research on defect detection algorithms based on positive samples. Positive sample-based defect detection methods can be categorized as image reconstruction-based methods and discriminative embedding-based methods. Image reconstruction-based methods tend to learn the structural information of positive samples for image reconstruction, resulting in faster processing speeds but suffering from overgeneralization issues for large defects. Discriminative embedding-based methods focus on learning the feature distribution of positive samples. While this overcomes the overgeneralization issue for large defects, their processing speed is too slow to meet the requirements of industrial real-time computing. Furthermore, these methods suffer from poor defect segmentation accuracy, rarely achieving pixel-level accuracy.

[0007] Therefore, a method for detecting defects in an annular workpiece is needed to solve the problems existing in the above technical solutions. Summary of the Invention

[0008] To this end, the present invention provides a defect detection method and a defect detection device for an annular workpiece to solve or at least alleviate the above problems.

[0009] According to one aspect of the present invention, a defect detection method for an annular workpiece is provided, which is executed in a computing device and includes: acquiring an image to be detected of the annular workpiece; extracting an annular region of interest from the image to be detected and expanding it to obtain a rectangular expansion image to be detected; determining the pixel grayscale probability of the rectangular expansion image to be detected based on a grayscale probability distribution matrix to construct a probability map and determine the defect area in the probability map; performing grayscale repair on the defect area in the probability map to obtain a repaired map; constructing an adaptive defect-free template based on the repaired map; calculating the absolute difference between the adaptive defect-free template and the rectangular expansion image to be detected to obtain a defect residual map, so as to locate the defect position of the annular workpiece based on the defect residual map.

[0010] Optionally, in the defect detection method for annular workpieces according to the present invention, after obtaining the defect residual map, it also includes: processing the defect residual map to obtain a significance lift map, so as to locate the defect position of the annular workpiece according to the significance lift map.

[0011] Optionally, in the defect detection method for annular workpieces according to the present invention, before obtaining the image to be detected of the annular workpiece, it also includes: obtaining a plurality of sample images of defect-free annular workpieces; extracting a sample annular region of interest from each of the sample images, and expanding them to obtain a corresponding sample rectangular expansion diagram; and statistically analyzing the grayscale value probability distribution of a single column in the sample rectangular expansion diagram to construct a grayscale probability distribution matrix.

[0012] Optionally, the defect detection method for an annular workpiece according to the present invention further includes: performing a normalization operation on the grayscale probability distribution matrix to obtain a final grayscale probability distribution matrix.

[0013] Optionally, in the defect detection method for annular workpieces according to the present invention, an annular region of interest is extracted from the image to be detected and expanded to obtain a rectangular expansion diagram to be detected, including: constructing an image rectangular coordinate system and a polar coordinate system with the center of the annular region of interest as the origin on the image to be detected, and establishing a first relationship between the image rectangular coordinate system and the polar coordinate system; determining a second relationship between the outer ring circumference of the annular region of interest, the size of the rectangular expansion diagram to be detected obtained by expanding the annular region of interest, and the outer ring radius and inner ring radius of the annular region of interest; establishing a conversion formula between points in the polar coordinate system and corresponding points in the rectangular expansion diagram to be detected; according to the first relationship, the second relationship and the conversion formula, the annular region of interest is extracted from the image to be detected and expanded to obtain a rectangular expansion diagram to be detected.

[0014] Optionally, in the defect detection method for annular workpieces according to the present invention, the pixel grayscale probability of the rectangular expansion image to be detected is determined according to the grayscale probability distribution matrix to construct a probability map, including: determining each pixel position in the rectangular expansion image to be detected that is different from the defect-free waveform trend column by column and pixel by pixel according to the grayscale probability distribution matrix to construct a probability map.

[0015] Optionally, in the defect detection method for annular workpieces according to the present invention, grayscale repair is performed on the defect area in the probability map to obtain a repair map, including: performing grayscale repair on the defect area in the probability map according to the grayscale mean of the non-defect area in the probability map to obtain a repair map.

[0016] Optionally, in the defect detection method for annular workpieces according to the present invention, grayscale repair is performed on the defect area in the probability map to obtain a repaired map, including: multiplying the rectangular expansion map to be detected by the probability map pixel by pixel to obtain an expansion map with significant defects removed; for each pixel point with a value of 0 in the expansion map with significant defects removed, replacing it based on the mean value of all non-zero pixels in the row where the pixel point is located to obtain a repaired map.

[0017] Optionally, in the defect detection method for annular workpieces according to the present invention, an adaptive defect-free template is constructed based on the repair image, including: horizontally reducing the repair image to obtain a reduced repair image; and using a bilinear interpolation method to enlarge the reduced repair image to the size of the rectangular expansion image to be detected to obtain an adaptive defect-free template.

[0018] Optionally, in the defect detection method for an annular workpiece according to the present invention, determining the defect area in the probability map includes: determining a black area in the probability map as the defect area.

[0019] Optionally, in the defect detection method for annular workpieces according to the present invention, the image to be detected and the sample image are respectively the end images of the annular workpiece; the sample images of the multiple annular workpieces include: one or more of: nuclear fuel rod groove sample images, rotating body thin-wall port sample images, and injector valve seat surface sample images.

[0020] According to one aspect of the present invention, there is provided a defect detection apparatus, which resides in a computing device and includes: an acquisition module, adapted to acquire an image to be detected of an annular workpiece; an extraction module, adapted to extract an annular region of interest from the image to be detected, and expand it to obtain a rectangular expansion image to be detected; a probability map construction module, adapted to determine the pixel grayscale probability of the rectangular expansion image to be detected based on a grayscale probability distribution matrix, so as to construct a probability map and determine the defective area in the probability map; a repair module, adapted to perform grayscale repair on the defective area in the probability map to obtain a repaired map; a template construction module, adapted to construct an adaptive defect-free template based on the repaired map; and a calculation module, adapted to calculate the absolute difference between the adaptive defect-free template and the rectangular expansion image to be detected to obtain a defect residual map, so as to locate the defect position of the annular workpiece based on the defect residual map.

[0021] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing the defect detection method for an annular workpiece as described above.

[0022] According to one aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the above-mentioned method for detecting defects in an annular workpiece.

[0023] According to the technical solution of the present invention, a method for detecting defects in annular workpieces is provided. The method extracts an annular region of interest (ROI) from an image to be inspected and expands it to obtain a rectangular expanded image of the image to be inspected. Based on a grayscale probability distribution matrix, the pixel grayscale probabilities of the rectangular expanded image to be inspected are determined to construct a probability map. Defective regions within the probability map are then identified and grayscale repair is performed on the defective regions to obtain a repaired image. Furthermore, an adaptive defect-free template is constructed based on the repaired image. A defect residual map is obtained by calculating the absolute difference between the adaptive defect-free template and the rectangular expanded image to be inspected. This allows the location of defects in the annular workpiece to be precisely located based on the defect residual map. According to the technical solution of the present invention, by expanding the annular ROI, the amount of image processing data is reduced while maintaining the pixel resolution of the ROI, thereby improving data processing efficiency. Furthermore, in the absence of defect samples, large-scale defects are repaired by statistically analyzing the grayscale probability distribution matrix of positive samples. This reduces the generalization capability of the adaptive template algorithm for large-scale defects to a certain extent, making the adaptive template algorithm more complete in extracting large-scale defects, improving the detection of large-scale defects in annular workpieces, and increasing the accuracy of defect location. Moreover, for the defect detection of annular workpieces, the detection efficiency of the present invention is much higher than the unsupervised defect detection algorithm commonly used in the prior art. The algorithm of the present invention is simple to deploy, has low requirements for computer configuration, consumes less memory, runs more efficiently, and maintains a high defect detection accuracy.

[0024] Furthermore, the present invention uses the shrink and enlarge method to construct an adaptive defect-free template, ensuring the consistency of the template with the image to be detected in phase and amplitude, and realizing pixel-level high-precision detection of defect areas, thereby having stronger defect detection capabilities at the small-size pixel level. At the same time, the algorithm has a small amount of computation and runs efficiently.

[0025] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other objects, features, and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0027] Figure 1 A schematic diagram of a computing device 100 according to one embodiment of the present invention is shown;

[0028] Figure 2 A schematic diagram showing a defect detection method 200 for an annular workpiece according to an embodiment of the present invention is shown;

[0029] Figure 3 A schematic diagram of a defect detection process for an annular workpiece according to an embodiment of the present invention is shown;

[0030] Figure 4 A schematic diagram showing the principle of expanding a ring-shaped region of interest according to one embodiment of the present invention is shown;

[0031] Figure 5 A schematic diagram of image features of a sample rectangular expansion image according to an embodiment of the present invention is shown;

[0032] Figure 6 A schematic diagram of grayscale waveform analysis of an expanded image according to one embodiment of the present invention is shown;

[0033] Figure 7 FIG. 7 is a schematic diagram of a defect detection device 700 according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0035] Figure 1 FIG. 1 shows a schematic diagram of a computing device 100 according to an embodiment of the present invention. Figure 1As shown, in a basic configuration, computing device 100 includes at least one processing unit 102 and system memory 104. According to one aspect, depending on the configuration and type of computing device, processing unit 102 can be implemented as a processor. System memory 104 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, system memory 104 includes an operating system 105.

[0036] According to one aspect, operating system 105 is suitable for controlling the operation of computing device 100, for example. Furthermore, examples may be practiced in conjunction with graphics libraries, other operating systems, or any other application programs, and are not limited to any particular application or system. Figure 1 The basic configuration is shown in FIG. 1 by those components within the dashed lines. According to one aspect, the computing device 100 has additional features or functionality. For example, according to one aspect, the computing device 100 includes additional data storage devices (removable and / or non-removable), such as magnetic disks, optical disks, or tapes. Such additional storage Figure 1 1 is illustrated by a removable storage device 109 and a non-removable storage device 110.

[0037] As stated above, according to one aspect, a program module 103 is stored in the system memory 104. According to one aspect, the program module 103 may include one or more application programs, and the present invention is not limited to the type of application program. For example, the application program may include an email and contact application program, a word processing application program, a spreadsheet application program, a database application program, a slide show application program, a drawing or computer-aided application program, a web browser application program, etc.

[0038] According to one aspect, the program module 103 may include a defect detection device 700 including a plurality of program instructions suitable for executing the annular workpiece defect detection method 200 of the present invention, so as to execute the annular workpiece defect detection method 200 of the present invention.

[0039] According to one aspect, examples may be practiced on a circuit comprising discrete electronic components, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or a single chip containing electronic components or a microprocessor. Figure 1Each or many components shown in can be integrated into a system on a chip (SOC) on a single integrated circuit to practice examples. According to one aspect, such an SOC device may include one or more processing units, a graphics unit, a communication unit, a system virtualization unit, and various application functions, all of which are integrated (or "burned") onto a chip substrate as a single integrated circuit. When operated via SOC, the functions described in this article can be operated via dedicated logic integrated with other components of the computing device 100 on a single integrated circuit (chip). Embodiments of the present invention can also be practiced using other technologies capable of performing logical operations (such as AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. In addition, embodiments of the present invention can be practiced in a general-purpose computer or in any other circuit or system.

[0040] According to one aspect, the computing device 100 may also have one or more input devices 112, such as a keyboard, a mouse, a pen, a voice input device, a touch input device, etc. It may also include an output device 114, such as a display, a speaker, a printer, etc. The aforementioned devices are examples, and other devices may also be used. The computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118. Examples of suitable communication connections 116 include, but are not limited to: RF transmitter, receiver, and / or transceiver circuitry; Universal Serial Bus (USB), parallel, and / or serial ports.

[0041] As used herein, the term computer-readable medium includes computer storage media. Computer storage media can include volatile and non-volatile, removable and non-removable media implemented with any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules 103). System memory 104, removable storage device 109, and non-removable storage device 110 are all examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical storage, cassette tape, magnetic tape, disk storage or other magnetic storage device, or any other product that can be used to store information and can be accessed by computing device 100. According to one aspect, any such computer storage medium can be a part of computing device 100. Computer storage media does not include carrier waves or other propagated data signals.

[0042] According to one aspect, communication media is implemented by computer-readable instructions, data structures, program modules 103, or other data in a modulated data signal (e.g., a carrier wave or other transport mechanism), and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.

[0043] In an embodiment of the present invention, a computing device 100 is configured to execute a method 200 for detecting defects in an annular workpiece according to the present invention. The computing device 100 includes one or more processors and one or more readable storage media storing program instructions. When the program instructions are configured to be executed by the one or more processors, the computing device executes the method 200 for detecting defects in an annular workpiece according to the embodiment of the present invention.

[0044] According to one embodiment of the present invention, a defect detection device 700 is deployed in the computing device 100. The defect detection device 700 is configured to execute the annular workpiece defect detection method 200 according to the present invention. The defect detection device 700 includes a plurality of program instructions for executing the annular workpiece defect detection method 200 according to the present invention. These program instructions can instruct a processor to execute the annular workpiece defect detection method 200 according to the present invention. By executing the annular workpiece defect detection method 200 according to the present invention, the detection effect of large-scale defects in annular workpieces is improved, high-precision detection is achieved, and the algorithm is optimized to improve defect detection efficiency.

[0045] Figure 2 A schematic diagram of a method 200 for detecting defects in an annular workpiece according to an embodiment of the present invention is shown. Figure 3 The schematic diagram of the defect detection process of an annular workpiece according to one embodiment of the present invention is shown. The defect detection method 200 of an annular workpiece is suitable for being executed in a defect detection apparatus 700 of a computing device (such as the aforementioned computing device 100).

[0046] It should be noted that the defect detection method 200 of the present invention is not limited to the specific type of annular workpiece to be inspected. For example, the annular workpiece to be inspected includes but is not limited to nuclear fuel rods, thin walls of rotating bodies, and fuel injection nozzles.

[0047] like Figure 2 and Figure 3 As shown, method 200 begins at step 210 .

[0048] First, in step 210 , an image to be inspected (which may be expressed as Id) of the annular workpiece is acquired.

[0049] Here, it should be pointed out that the image to be detected is specifically an end image of the annular workpiece to be detected, that is, an end image collected along the axial direction of the annular workpiece.

[0050] Then, in step 220, an annular region of interest is extracted from the image to be detected, and the annular region of interest in the image to be detected is expanded to obtain an expanded rectangular image to be detected (which can be expressed as fd).

[0051] It should be noted that, since the annular region of interest of the annular workpiece only occupies a partial area in the image to be detected, in order to reduce the amount of data calculation when the computing device 100 executes the defect detection method and make full use of the structural characteristics of the annular workpiece with uniform grayscale in the circumferential direction, in an embodiment of the present invention, the annular region of interest is extracted from the image to be detected and expanded into a long rectangular image (i.e., an expanded image of the rectangle to be detected).

[0052] Figure 4 A schematic diagram showing the principle of expanding a ring-shaped region of interest according to an embodiment of the present invention is shown.

[0053] See also Figure 4 , wherein the original image (image to be detected) includes a ring-shaped region of interest, and a rectangular expansion image (rectangular expansion image to be detected) corresponding to the ring-shaped region of interest is shown below the original image.

[0054] To facilitate the expansion of the annular ROI, in one embodiment of the present invention, an image rectangular coordinate system O-XY and a polar coordinate system o-rθ with the center of the annular ROI as the origin can be constructed in the original image I(x,y). Let P(r,θ) in the polar coordinate system be any point in the upper right corner of the annular ROI, and its corresponding point in the image coordinate system be p(x,y). This establishes a first relationship between the image rectangular coordinate system and the polar coordinate system. See equation (1) below for the first relationship.

[0055]

[0056] In formula (1), x0 and y0 are the coordinates of the center o of the polar coordinate system o-rθ in the image coordinate system; is the floor symbol.

[0057] The inner ring and outer ring of the annular region of interest intersect with the 0° axis of the polar coordinate system at points A (r1, 0°) and B (r2, 0°), respectively. The corresponding positions of point A and point B in the rectangular expansion diagram f (x, y) are A' and B', respectively. Since the perimeters of the inner ring and outer ring of points A and B are different, in one embodiment of the present invention, the region of interest can be expanded based on the perimeter of the outer ring of the annular region of interest. Assuming that the size of the rectangular expansion diagram (rectangular expansion diagram to be detected) f (x, y) obtained by expanding the annular region of interest is n×m, the second relationship between the size of the rectangular expansion diagram (rectangular expansion diagram to be detected) and the outer ring radius and inner ring radius of the annular region of interest can be determined. The second relationship is shown in the following formula (2).

[0058]

[0059] In formula (2), n represents the number of rows of the rectangular expansion diagram (rectangular expansion diagram to be detected), m represents the number of columns of the rectangular expansion diagram (rectangular expansion diagram to be detected); r1 and r2 represent the inner ring radius and the outer ring radius respectively, and r1 and r2 are both integers; is the floor symbol.

[0060] After that, a conversion formula between a point in the polar coordinate system and a corresponding point in the rectangular expansion diagram (rectangular expansion diagram to be detected) can be established. Specifically, let the point P(r,θ) in the polar coordinate system correspond to the position P'(n p ,m p The conversion formula between a point in the polar coordinate system and the corresponding point in the rectangular expansion diagram (rectangular expansion diagram to be detected) is the conversion formula from point P to P', which is specifically referred to the following formula (3).

[0061]

[0062] In formula (3), n p , m p is the coordinate of point P' in the rectangular expansion diagram; m is the number of columns in the expansion diagram; r is the radius coordinate of point P in the polar coordinate system, where r = r1, r1+1, ..., r2; θ is the angular coordinate of point P in the polar coordinate system, where is the floor symbol.

[0063] In this way, for the original image of the end of any annular workpiece (the image to be detected or the sample image), it is only necessary to determine the coordinates o(x0, y0) of the center o of the annular region of interest in the original image in the image coordinate system, the inner ring radius r1 (pixel value) and the outer ring radius r2 (pixel value) of the annular region of interest. According to the above-mentioned first relationship (1), second relationship (2) and conversion formula (3), the annular region of interest can be extracted from the original image (the image to be detected or the sample image), and the annular region of interest can be expanded (counterclockwise) to obtain the corresponding rectangular expansion image (rectangular expansion image to be detected or rectangular expansion image of the sample).

[0064] Next, in step 230, the grayscale probabilities of the pixels in the expanded rectangular image to be detected are determined based on the grayscale probability distribution matrix to construct a probability map (which can be represented as G), and the defect area in the probability map is determined. Specifically, the black area in the probability map can be determined as the defect area. Here, the grayscale probabilities of the pixels in the expanded rectangular image to be detected can be determined column by column and pixel by pixel based on the grayscale probability distribution matrix, and the probability map can be obtained by threshold segmentation.

[0065] In a specific embodiment, the grayscale probability distribution matrix GL can be used to determine each pixel position in the expanded rectangular image to be inspected that has a waveform trend different from that of a defect-free image, column by column and pixel by pixel, to construct a probability map G.

[0066] Next, in step 240 , a repaired image (which may be expressed as R) may be obtained by performing grayscale repair on the defective area in the probability map.

[0067] Specifically, the grayscale of the defective area in the probability map can be repaired according to the grayscale mean of the non-defective area in the probability map, thereby obtaining the repair map R.

[0068] In a specific embodiment, the expanded image of the rectangle to be detected is multiplied pixel by pixel by the probability map to obtain an expanded image with significant defects removed. Subsequently, for each pixel in the expanded image with significant defects removed that has a value of 0, it can be replaced based on the average value of all non-zero pixels in the row where the pixel resides (i.e., the value of the pixel with a value of 0 is replaced with the average value of all non-zero pixels in the row where the pixel resides), thereby obtaining a repaired image.

[0069] Then, in step 250, an adaptive defect-free template (denoted as M) may be constructed according to the repair image.

[0070] In one embodiment, a defect-free grayscale waveform may be constructed for each column in the expanded rectangular image to be inspected to generate an adaptive defect-free template M.

[0071] In one embodiment, the repair image R can first be horizontally reduced to obtain a reduced repair image M'. Then, a bilinear interpolation method can be used to enlarge the reduced repair image to the size of the rectangular expansion image to be inspected, so that an adaptive defect-free template M can be obtained.

[0072] Finally, in step 260, the defect residual map H can be obtained by calculating the absolute difference between the adaptive defect-free template M and the rectangular expansion map to be detected fd. In this way, the defect position of the annular workpiece can be located according to the defect residual map, thereby completing the defect detection of the annular workpiece.

[0073] In one embodiment, after calculating the absolute difference to obtain the defect residual image H, the defect residual image H can be processed to enhance its contrast, reduce interference, and thereby enhance the image saliency, thereby generating a saliency lift map S. In this way, the position of the defect in the annular workpiece can be located based on the saliency lift map. It should be noted that the saliency lift map S has a stronger contrast and enhanced saliency than the defect residual image H. Therefore, the saliency lift map can be used to more accurately and efficiently locate the position of the defect in the annular workpiece.

[0074] In one embodiment of the present invention, a grayscale probability distribution matrix GL may be pre-constructed before executing step 210. Specifically, multiple sample images of defect-free annular workpieces (specifically, positive sample images, denoted as Ig) are acquired. Subsequently, an annular region of interest (hereinafter referred to as a "sample annular region of interest") is extracted from each sample image Ig, and the sample annular region of interest is expanded to obtain a corresponding sample rectangular expansion image (denoted as fg).

[0075] Here, for each sample image, a sample annular region of interest is extracted from the sample image, and the sample annular region of interest is expanded to obtain the corresponding sample rectangular expansion map. For a specific method, see Figure 4 The schematic diagram of the principle of expanding the annular region of interest and the corresponding description in the above embodiment are shown.

[0076] It should be noted that the sample images are also images of the ends of annular workpieces. The multiple defect-free annular workpieces can be of different types. In one embodiment, the multiple sample images of annular workpieces obtained include one or more of: sample images of the groove of a nuclear fuel rod, sample images of a thin-walled port of a rotating body, and sample images of a valve seat surface of an injector nozzle.

[0077] Next, for each sample rectangular expansion diagram, the grayscale value probability distribution of each column can be statistically analyzed to construct a grayscale probability distribution matrix (which can be expressed as GL). Here, for each sample rectangular expansion diagram, the grayscale value probability distribution of a single column can be statistically analyzed to construct the grayscale probability distribution matrix GL based on the grayscale value probability distribution of the single column.

[0078] In one implementation, the size of the grayscale probability distribution matrix GL can be, for example, n×256, where n represents the width of the sample rectangular expansion (i.e., the length of each column of grayscale data), and 256 corresponds to 256 grayscale levels. The value of GL(j,k) can represent the number of times the grayscale value k appears in the jth row of the sample rectangular expansion.

[0079] It should be noted that, in order to facilitate calculation, the image to be detected and the sample image in the present invention can be converted into a single-channel grayscale image in advance, and the grayscale value range is 0-255.

[0080] Figure 5 FIG2 shows a schematic diagram of image features of a sample rectangular expansion diagram according to an embodiment of the present invention. Figure 5 As shown, in an ideal case, it can be considered that the grayscale value of each row of the sample rectangular expansion diagram is equal and the grayscale waveform of each column is the same.

[0081] It should be noted that in actual industrial inspection processes, the design of fixtures and imaging methods ensures that the imaging positions of annular workpieces are relatively uniform, and the brightness and contrast of the images at each position are relatively consistent. Therefore, it can be approximately assumed that the grayscale value distribution of each column in the sample rectangular expansion corresponding to the sample image conforms to a normal distribution. Based on this, for any annular workpiece's sample rectangular expansion, the probability distribution of the grayscale values ​​at each position in a single column of the sample rectangular expansion can be calculated to construct an n×256 grayscale probability distribution matrix GL.

[0082] Specifically, N columns of grayscale data can be randomly extracted from multiple sample rectangular expansion images, with the length of each column of grayscale data being denoted as n, to construct an n×N sample statistics matrix Ps. The number of occurrences num of grayscale values ​​from 0 to 255 in each row of the sample statistics matrix Ps is calculated and stored in the corresponding n×256 grayscale probability distribution matrix GL. To avoid unevenness in the number of grayscale values ​​in each row of the grayscale probability distribution matrix GL, in one embodiment, the grayscale probability distribution matrix GL can be normalized to obtain the final grayscale probability distribution matrix.

[0083] That is, in one embodiment of the present invention, after constructing the grayscale probability distribution matrix, the grayscale probability distribution matrix can be normalized to obtain a final grayscale probability distribution matrix. Specifically, the normalization operation on the grayscale probability distribution matrix can be achieved by dividing each row of data in the grayscale probability distribution matrix by the maximum value of each row. Thus, in this embodiment, the grayscale probabilities of the pixels in the expanded rectangular image to be detected can be determined based on the final grayscale probability distribution matrix to construct a probability map.

[0084] Figure 6 A schematic diagram of grayscale waveform analysis of an expanded image according to one embodiment of the present invention is shown.

[0085] like Figure 6 As shown in the figure, in the absence of defects, the grayscale waveforms of each column in the expanded image of the annular workpiece (i.e., the rectangular expanded image corresponding to the annular region of interest) can be considered consistent. In the presence of defects, there will be a grayscale difference between the waveform of the defective area and the normal waveform. The size of this grayscale difference can be used to locate the defect. In actual working conditions, the grayscale waveforms of the defect-free columns will have deviations in amplitude and phase.

[0086] Figure 6 (a) shows the expansion of two actual annular workpieces Figure 1 and expansion Figure 2 . Figure 1 Select 3 columns of waveforms, where a is a defective column, and b and c are non-defective columns. Column b is farther away from column a, while column c is closer to column a. Figure 2 Select the defect-free column d.

[0087] Draw Unfold Figure 1 and expansion Figure 2 The grayscale waveforms of the defect-free columns b and d are as follows: Figure 6 As shown in (b), the grayscale waveform trends of b and d are similar, but there are significant deviations in amplitude and phase in detail.

[0088] Figure 6 (c) in the figure shows the grayscale waveforms of the non-defective columns b and c that are far apart in the same expanded image. The phases of the waveforms b and c are consistent, and there is only a slight waveform difference at the pixel coordinate 100. Figure 6 From (a) in the figure, we can see that Figure 1 There is a significant difference in stripe width between points b and c. This difference is mainly caused by the expansion of the annular workpiece and the deviation of the lighting angle. The influence of this phenomenon needs to be overcome during inspection.

[0089] Figure 6 (d) shows the expansion Figure 1Comparing the grayscale waveforms of the two closely spaced waveforms a and c, it can be seen that the phases of waveforms a and c are consistent, and the amplitudes are also highly consistent. There is only a significant amplitude difference at the defect.

[0090] According to the above analysis, the rectangular expansion diagram corresponding to the annular region of interest has the following characteristics: (1) The waveform of the defect-free column has a consistent trend, but the amplitude and phase deviations are large; (2) The phase and amplitude deviations of the waveform of the defect-free column in the same expansion diagram are small, but there will be waveform interference; (3) The waveform and amplitude deviations of adjacent columns in the same expansion diagram are small. By comparing the waveforms of the defect-free column closest to the defective column, the optimal defect area detection effect can be obtained.

[0091] In actual defect detection, for large defects, people prefer to determine their presence without requiring precise location. However, for small defects, not only is their presence determined, but their precise location is also required. Using column-by-column waveform comparison can accurately detect defects at multiple scales, but this requires overcoming phase and amplitude offsets, which necessitates the construction of defect-free grayscale waveforms.

[0092] In combination with the above-mentioned characteristic (1) of the rectangular expansion diagram corresponding to the annular region of interest, in one embodiment, the position of each pixel in the rectangular expansion diagram to be inspected that has a waveform trend different from that of the defect-free region can be determined column by column and pixel by pixel based on the grayscale probability distribution matrix GL to construct a probability map G. Specifically, the probability map G can be calculated according to the following formula (4).

[0093]

[0094] In formula (4), i is the row coordinate i = 1, 2, ..., n; j is the column number j = 1, 2, ..., m; GL is the grayscale probability distribution matrix; f(i, j) is the grayscale value of the pixel with row coordinate i and column coordinate j in the rectangular expansion image; T is the probability threshold.

[0095] In a specific embodiment, the expanded image f(x, y) of the rectangle to be detected is multiplied pixel by pixel by the probability map GL(x, y) to obtain the expanded image f'(x, y) with significant defects removed. Subsequently, for pixels with a value of 0 in the expanded image f'(x, y) with significant defects removed, the pixel value can be replaced based on the mean value of all non-zero pixels in the row containing the pixel, to obtain the repaired image R(x, y). Specifically, the repaired image R can be calculated according to the following formula (5).

[0096]

[0097] In formula (5), R(k,p) represents the pixel position with a value of 0 in the expanded image f'(x,y) after removing significant defects, where k is the row coordinate and p is the column coordinate; row is a one-dimensional vector constructed based on all non-zero pixels in the kth row of f'(x,y), and its length is S.

[0098] At this time, it can be considered that only small-scale defect areas may exist in the repair image R(x, y). Combined with the characteristics (2) and (3) of the rectangular expansion image corresponding to the annular region of interest, in order to ensure the consistency of the defect-free waveform in amplitude and phase, in one embodiment of the present invention, the shrink and enlarge method can be used in step 250 to construct a defect-free grayscale waveform for each column in the rectangular expansion image f(x, y) to be detected, so as to construct the final adaptive defect-free template M.

[0099] In one embodiment, the restored image R can be reduced in the horizontal direction (while the height direction remains unchanged) to obtain a reduced restored image M'. The restored image M' can be calculated according to the following formula (6).

[0100]

[0101] In formula (6), M' is the reduced restoration image; i is the row coordinate of the reduced restoration image M', and its value range is 1, 2, ..., n; j' is the column coordinate of the reduced restoration image M', and its value range is 1, 2, ..., sk*m; j is the column coordinate of the restoration image R, and its value range is 1, 2, ..., m; is the floor symbol; sk is the scaling factor sk = number of repaired image columns / number of reduced repaired image columns.

[0102] It should be noted that by reducing the repair image, the defective data in the defective columns of the repair image is diluted by the data in the non-defective columns. Therefore, the defect-free data in the reduced repair image M' can be considered, and M' can serve as the defect-free template required for defect detection. In addition, to ensure that the defect-free template is consistent in scale with the rectangular expanded image f to be detected, in one embodiment of the present invention, a bilinear interpolation method can be used to enlarge the reduced repair image M' to the n×m size of the expanded image f. This method can produce the final adaptive defect-free template M.

[0103] In this way, the amplitude and phase of each grayscale waveform in the adaptive defect-free template M are highly consistent with the corresponding grayscale waveform in the rectangular expansion image f to be detected. Then, the defect residual map H can be obtained by using the absolute residual method. Specifically, the defect residual map H can be obtained by calculating the absolute difference between the adaptive defect-free template M and the rectangular expansion image fd to be detected. The specific formula is shown in the following formula (7).

[0104] H(x,y)=abs(M(x,y)-R(x,y)) (7)

[0105] In formula (7), H is the defect residual image; M is the adaptive defect-free template; f is the expanded image of the rectangle to be detected; and abs is the operation of obtaining the absolute value.

[0106] According to the present invention, a defect detection method 200 for an annular workpiece is provided. An annular region of interest (ROI) is extracted from an image to be inspected and expanded to obtain a rectangular expanded image of the image to be inspected. The grayscale probability of the pixels in the rectangular expanded image to be inspected is determined based on a grayscale probability distribution matrix to construct a probability map. The defect region in the probability map is then identified and grayscale repair is performed on the defect region to obtain a repaired image. Furthermore, an adaptive defect-free template is constructed based on the repaired image. A defect residual map is obtained by calculating the absolute difference between the adaptive defect-free template and the rectangular expanded image to be inspected. This allows the defect location of the annular workpiece to be accurately located based on the defect residual map. According to the technical solution of the present invention, by expanding the annular ROI, the amount of image processing data is reduced while maintaining the pixel resolution of the ROI, thereby improving data processing efficiency. Furthermore, in the absence of defect samples, large-scale defects are repaired by statistically analyzing the grayscale probability distribution matrix of positive samples. This reduces the generalization capability of the adaptive template algorithm for large-scale defects to a certain extent, making the adaptive template algorithm more complete in extracting large-scale defects, improving the detection effect of large-scale defects in annular workpieces, and increasing the accuracy of defect location. Moreover, for the defect detection of annular workpieces, the detection efficiency of the present invention is much higher than the unsupervised defect detection algorithm commonly used in the prior art. The algorithm of the present invention is simple to deploy, has low requirements for computer configuration, consumes less memory, runs more efficiently, and maintains a high defect detection accuracy.

[0107] Furthermore, the present invention uses the shrink and enlarge method to construct an adaptive defect-free template, ensuring the consistency of the template and the image to be detected in phase and amplitude, and achieving pixel-level accuracy in defect positioning, thereby having stronger detection capabilities for small-size pixel-level defects. At the same time, the algorithm has a small amount of computation and runs efficiently.

[0108] Figure 7 FIG2 shows a schematic diagram of a defect detection apparatus 700 according to an embodiment of the present invention. The defect detection apparatus 700 resides in the computing device 100. The defect detection apparatus 700 can be configured to execute the defect detection method 200 for an annular workpiece of the present invention.

[0109] like Figure 7As shown, the defect detection apparatus 700 includes an acquisition module 710, an extraction module 720, a probability map construction module 730, a repair module 740, a template construction module 750, and a calculation module 760 that are communicatively connected in sequence.

[0110] Among them, the acquisition module 710 is suitable for acquiring the image to be inspected of the annular workpiece. The extraction module 720 is suitable for extracting the annular region of interest from the image to be inspected and expanding it to obtain the rectangular expansion image to be inspected. The probability map construction module 730 is suitable for determining the pixel grayscale probability of the rectangular expansion image to be inspected based on the grayscale probability distribution matrix to construct a probability map and determine the defect area in the probability map. The repair module 740 is suitable for performing grayscale repair on the defect area in the probability map to obtain a repaired map. The template construction module 750 is suitable for constructing an adaptive defect-free template based on the repaired map. The calculation module 760 is suitable for calculating the absolute difference between the adaptive defect-free template and the rectangular expansion image to be inspected to obtain a defect residual map, so as to locate the defect position of the annular workpiece based on the defect residual map.

[0111] It should be noted that the acquisition module 710 is used to perform the aforementioned step 210, the extraction module 720 is used to perform the aforementioned step 220, the probability map construction module 730 is used to perform the aforementioned step 230, the repair module 740 is used to perform the aforementioned step 240, the template construction module 750 is used to perform the aforementioned step 250, and the calculation module 760 is used to perform the aforementioned step 260. Here, the specific execution logic of the acquisition module 710, the extraction module 720, the probability map construction module 730, the repair module 740, the template construction module 750, and the calculation module 760 can be found in the description of steps 210 to 260 in the method 200 above, and will not be repeated here.

[0112] A8. A method as described in any one of A1-A7, wherein grayscale repair is performed on the defective area in the probability map to obtain a repaired map, comprising: multiplying the expanded map of the rectangle to be detected by the probability map pixel by pixel to obtain an expanded map with significant defects removed; for each pixel point with a value of 0 in the expanded map with significant defects removed, replacing it based on the mean value of all non-zero pixels in the row where the pixel point is located to obtain a repaired map.

[0113] A9. A method as described in any one of A1-A8, wherein an adaptive defect-free template is constructed based on the repair image, including: horizontally reducing the repair image to obtain a reduced repair image; and using a bilinear interpolation method to enlarge the reduced repair image to the size of the rectangular expanded image to be detected to obtain an adaptive defect-free template.

[0114] A10. The method as described in any one of A1-A9, wherein determining the defect area in the probability map includes: determining the black area in the probability map as the defect area.

[0115] A11. The method as described in A3, wherein the image to be detected and the sample image are end images of an annular workpiece respectively; the sample images of the multiple annular workpieces include: one or more of: a sample image of a nuclear fuel rod groove, a sample image of a thin-walled port of a rotating body, and a sample image of a nozzle valve seat surface.

[0116] The various techniques described herein may be implemented in conjunction with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may be implemented in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes an apparatus for practicing the present invention.

[0117] When the program code is executed on a programmable computer, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code, and the processor is configured to execute the ring-shaped workpiece defect detection method of the present invention according to the instructions in the program code stored in the memory.

[0118] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media store information such as computer-readable instructions, data structures, program modules, or other data. Communication media typically embody computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and include any information delivery medium. Combinations of any of the above are also included within the scope of readable media.

[0119] In the description provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems may also be used in conjunction with the examples of the present invention. Based on the above description, it is apparent that the structure required for constructing such systems is well understood. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages ​​may be utilized to implement the present invention described herein, and the description of specific languages ​​above is provided for the purpose of disclosing the preferred embodiment of the present invention.

[0120] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.

[0121] Similarly, it should be understood that in order to streamline the disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or description thereof.

[0122] Those skilled in the art will appreciate that the modules, units, or components of the devices in the examples disclosed herein may be arranged in the device described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple submodules.

[0123] Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and installed in one or more devices different from the embodiments. The modules, units, or components in the embodiments can be combined into one module, unit, or component, and furthermore, they can be divided into multiple submodules, subunits, or subcomponents.

[0124] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features and not other features included in other embodiments, the combination of features from different embodiments is intended to be within the scope of the invention and to form different embodiments.

[0125] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions described. Thus, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. Furthermore, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.

[0126] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved and are not intended to imply that the objects so described must have a given order in time, space, ranking, or in any other manner.

[0127] Although the present invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the foregoing description, will appreciate that other embodiments are contemplated within the scope of the invention thus described. Furthermore, it should be noted that the language used in this specification has been selected primarily for readability and instructional purposes and is not selected to explain or limit the subject matter of the present invention.

Claims

1. A method for detecting defects in an annular workpiece, executed in a computing device, comprising: Acquire an image of the annular workpiece to be inspected; Extracting a circular region of interest from the image to be detected and expanding it to obtain a rectangular expansion image to be detected; Determining the pixel grayscale probability of the expanded rectangular image to be inspected according to the grayscale probability distribution matrix to construct a probability map, and determining the defect area in the probability map; Performing grayscale repair on the defective area in the probability map to obtain a repaired map; constructing an adaptive defect-free template according to the repair image; The absolute difference between the adaptive defect-free template and the expanded rectangular image to be inspected is calculated to obtain a defect residual map, so as to locate the defect position of the annular workpiece according to the defect residual map.

2. The method according to claim 1, wherein After obtaining the defect residual graph, it also includes: The defect residual map is processed to obtain a significance lifting map, so as to locate the defect position of the annular workpiece according to the significance lifting map.

3. The method according to claim 1 or 2, wherein Before acquiring the image of the ring-shaped workpiece to be inspected, the following steps are also included: Acquire a plurality of sample images of defect-free annular workpieces; Extracting a sample annular region of interest from each sample image and expanding it to obtain a corresponding sample rectangular expansion image; The grayscale value probability distribution of a single column in the sample rectangular expansion diagram is statistically analyzed to construct a grayscale probability distribution matrix.

4. The method according to claim 3, wherein: Also includes: A normalization operation is performed on the grayscale probability distribution matrix to obtain a final grayscale probability distribution matrix.

5. The method according to any one of claims 1 to 4, wherein Extracting a circular region of interest from the image to be detected and expanding it to obtain a rectangular expansion image to be detected, including: Constructing an image rectangular coordinate system and a polar coordinate system with the center of the annular region of interest as the origin on the image to be detected, and establishing a first relationship between the image rectangular coordinate system and the polar coordinate system; Determine a second relationship between a size of a rectangular expansion image to be detected obtained by expanding the annular region of interest based on an outer ring circumference of the annular region of interest, and an outer ring radius and an inner ring radius of the annular region of interest; Establishing a conversion formula between a point in the polar coordinate system and a corresponding point in the expanded image of the rectangle to be detected; According to the first relational expression, the second relational expression and the conversion formula, an annular region of interest is extracted from the image to be detected and expanded to obtain an expanded image of the rectangle to be detected.

6. The method according to any one of claims 1 to 5, wherein Determining the pixel grayscale probability of the expanded rectangular image to be detected according to the grayscale probability distribution matrix to construct a probability map, including: According to the grayscale probability distribution matrix, each pixel position in the expanded rectangular image to be detected that has a waveform trend different from that of a defect-free image is determined column by column and pixel by pixel to construct a probability map.

7. The method according to any one of claims 1 to 6, wherein Performing grayscale repair on the defective area in the probability map to obtain a repaired map, including: Grayscale repair is performed on the defective area in the probability map according to the grayscale mean of the non-defective area in the probability map to obtain a repaired image.

8. The method according to any one of claims 1 to 7, wherein Performing grayscale repair on the defective area in the probability map to obtain a repaired map, including: Multiplying the expanded image of the rectangle to be detected by the probability map pixel by pixel to obtain an expanded image with significant defects removed; For each pixel point with a value of 0 in the expanded image after removing the significant defects, replacement is performed based on the average value of all non-zero pixels in the row where the pixel point is located to obtain a repaired image.

9. The method according to any one of claims 1 to 8, wherein According to the repair image, an adaptive defect-free template is constructed, including: performing horizontal reduction processing on the repaired image to obtain a reduced repaired image; The reduced repair image is enlarged to the size of the expanded rectangular image to be inspected by using a bilinear interpolation method to obtain an adaptive defect-free template.

10. The method according to any one of claims 1 to 9, wherein Determining a defect area in the probability map includes: The black area in the probability map is determined as a defect area.

11. The method of claim 3, wherein: The image to be detected and the sample image are respectively images of the end portion of the annular workpiece; The sample images of the plurality of annular workpieces include one or more of: a sample image of a nuclear fuel rod groove, a sample image of a thin-walled port of a rotating body, and a sample image of a valve seat surface of an injector nozzle.

12. A defect detection apparatus, resident in a computing device, comprising: An acquisition module, adapted to acquire an image of the annular workpiece to be inspected; An extraction module, adapted to extract a circular region of interest from the image to be detected, and expand it to obtain an expanded image of a rectangular region to be detected; a probability map construction module adapted to determine the pixel grayscale probabilities of the rectangular expansion image to be inspected according to the grayscale probability distribution matrix, so as to construct a probability map and determine the defect area in the probability map; a repair module, adapted to perform grayscale repair on the defective area in the probability map to obtain a repaired map; A template construction module, adapted to construct an adaptive defect-free template according to the repair image; The calculation module is adapted to calculate the absolute difference between the adaptive defect-free template and the rectangular expansion image to be detected to obtain a defect residual map, so as to locate the defect position of the annular workpiece according to the defect residual map.

13. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 11.

14. A readable storage medium storing program instructions, wherein when the program instructions are read and executed by a computing device, the computing device is caused to execute the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Mobile phone TFT-LCD screen Mura defect online automatic detection method

    CN108460757A

  • Defect detection method and device based on saliency feature pre-extraction and image segmentation

    CN114299066A

Cited By

  • Piston corner defect detection system and method based on deep learning and machine vision

    CN122156585A