A method and system for detecting defect points of a metal plate
By acquiring and enhancing high-quality images, combined with texture direction feature extraction and morphological clustering, the problems of single control methods and inflexible energy regulation in metal sheet inspection are solved, achieving efficient and accurate defect detection and energy utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XUZHOU YUBANG ELECTROMECHANICAL CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-05
AI Technical Summary
Existing metal sheet defect detection technologies suffer from single, static detection and control methods, inflexible energy regulation, low image defect recognition accuracy, susceptibility to misjudgment and missed detection, low energy utilization efficiency, and difficulty in adapting to detection scenarios with rapid fluctuations in hot and cold loads.
By obtaining images with the highest clarity through continuous light source illumination, noise is suppressed by combining median filtering and Gaussian filtering, texture direction features are extracted, directional anomalies are analyzed by differential analysis, grayscale statistics and morphological clustering are performed, suspected defect points are screened, and finally, accurate clustering of defect areas is achieved.
It improves the accuracy and efficiency of defect detection in metal sheets, ensures image quality, comprehensively captures surface defects, meets the needs of refined inspection, and improves energy utilization efficiency.
Smart Images

Figure CN122156129A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for detecting defects in metal sheets. Background Technology
[0002] Currently, in the field of metal sheet defect detection technology, the control logic of existing detection schemes mostly relies on a single heat load threshold judgment or adopts a static parameter setting method to carry out heat recovery control operations. They lack comprehensive consideration of various dynamic influencing factors in the metal sheet detection process, making it difficult to adapt to the actual working conditions of the detection scenario. This results in a lack of flexibility and adaptability in energy coordination and regulation during the detection process, and makes it impossible to achieve global optimization of energy utilization in the detection system.
[0003] Existing technologies suffer from significant limitations in the accuracy and efficiency of image processing and defect identification of metal sheet surfaces when dealing with detection scenarios involving rapid fluctuations in thermal loads. They not only struggle to quickly capture texture anomalies and grayscale changes on the sheet surface, but also are prone to misjudgment and missed detection of defects, resulting in insufficient reliability of detection results. Furthermore, the energy efficiency of the detection system is low, making it difficult to meet the actual needs for efficient and accurate defect detection of metal sheets. Summary of the Invention
[0004] To address the aforementioned technical shortcomings, the purpose of this invention is to propose a defect detection method for metal sheets, aiming to solve the technical problems in the prior art, such as single static detection and control methods, inflexible energy regulation, low image defect recognition accuracy, easy misjudgment and missed judgment, and low energy utilization efficiency.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides a method for detecting defects in metal plates.
[0006] The defect detection method for the metal sheet includes: S1. Obtain a surface image of the target board material as the original image of the target board material; S2. Perform noise suppression on the original image to obtain an enhanced image of the target board material; S3. Extract texture direction features from the enhanced image to obtain the texture direction distribution map of the target board material; S4. Perform differential analysis on the texture direction distribution map and the preset standard texture direction map to obtain the direction anomalies of the enhanced image; S5. Perform grayscale statistics on the directional anomalies to obtain the local grayscale mean of the target board, and determine the pixels whose grayscale values of the directional anomalies are lower than the local grayscale mean as suspected defect points. S6. Perform morphological clustering on the suspected defect points to obtain the defect region of the target board.
[0007] Preferably, acquiring a surface image of the target board material as the original image of the target board material specifically includes: The target material is continuously illuminated by a light source to obtain multiple frames of surface images of the target material. The image with the highest resolution is selected from the multiple surface images as the candidate original image of the target board. The candidate original image is subjected to illumination uniformity correction to obtain the original image of the target board.
[0008] Preferably, noise suppression is performed on the original image to obtain an enhanced image of the target board material, specifically including: The original image is subjected to median filtering to obtain the first intermediate image of the target board material; The first intermediate image is subjected to Gaussian filtering to obtain the second intermediate image of the target board material. The second intermediate image is used as an enhanced image of the target board.
[0009] Preferably, texture direction feature extraction is performed on the enhanced image to obtain a texture direction distribution map of the target board material, specifically including: The enhanced image is convolved with a gradient operator to obtain the horizontal gradient map and the vertical gradient map of the target board material; The gradient direction of pixels in the enhanced image is determined based on the horizontal gradient map and the vertical gradient map. Discretize and encode the gradient direction to obtain the orientation category of the enhanced image; The topological reconstruction of the direction category yields the texture direction distribution map of the target board.
[0010] Preferably, the texture orientation distribution map is differentially analyzed with a preset standard texture orientation map to obtain the orientation anomalies in the enhanced image, specifically including: The orientation values of pixels in the texture orientation distribution map are compared with the orientation values of corresponding pixels in the preset standard texture orientation map to obtain the orientation deviation of the enhanced image. Pixels whose directional deviation is greater than the deviation threshold in the standard texture direction map are marked as the first candidate anomalies in the enhanced image. Perform connectivity analysis on the first candidate anomaly points to obtain the second candidate anomaly points in the enhanced image; The second candidate anomaly point is used as the directional anomaly point of the enhanced image.
[0011] Preferably, grayscale statistics are performed on the directional anomalies to obtain the local grayscale mean of the target board, and pixels whose grayscale values are lower than the local grayscale mean are identified as suspected defect points, specifically including: A neighborhood window of the target material is defined with the point of directional anomaly as the center; The grayscale values of the pixels in the neighborhood window are extracted to obtain the pixel grayscale values of the neighborhood window. The pixel grayscale values are averaged to determine the local grayscale average of the directional anomaly points; When the pixel grayscale value is less than the local grayscale mean, the directional anomaly point is marked as a candidate defect point of the target board material; Spatial domain verification is performed on the candidate defect points to eliminate isolated points, thereby obtaining the suspected defect points of the target board material.
[0012] Preferably, morphological clustering is performed on the suspected defect points to obtain the defect regions of the target board material, specifically including: The suspected defect points are binarized to obtain a binary image of the defect in the target board material; The binary image of the defect is dilated to obtain the dilated image of the target board. An etch operation is performed on the expanded image to obtain an etched image of the target plate. Connected component labeling is performed on the etched image to obtain the preliminary connected components of the target plate. The defect regions of the target material are obtained by morphological aggregation of the initial connected regions.
[0013] The present invention also provides a defect detection system for metal sheets, comprising: An image acquisition module is used to acquire a surface image of the target board material, which serves as the original image of the target board material. An image enhancement module is used to suppress noise in the original image to obtain an enhanced image of the target board material; The texture orientation module is used to extract texture orientation features from the enhanced image to obtain the texture orientation distribution map of the target board material. Anomaly analysis module is used to perform differential analysis between the texture direction distribution map and the preset standard texture direction map to obtain the directional anomaly points of the enhanced image; The defect determination module is used to perform grayscale statistics on the directional anomalies to obtain the local grayscale mean of the target board, and to determine the pixels whose grayscale values of the directional anomalies are lower than the local grayscale mean as suspected defect points. The target output module is used to perform morphological clustering on the suspected defect points to obtain the defect area of the target board.
[0014] The present invention also provides a defect detection device for metal sheets, comprising: a memory, a processor, and a defect detection program for metal sheets stored in the memory and executable on the processor. When the defect detection program for metal sheets is executed by the processor, a defect detection method for metal sheets is implemented.
[0015] The present invention also provides a computer program product, including a defect detection program for metal sheets, wherein the defect detection program for metal sheets, when executed by a processor, implements the defect detection method for metal sheets.
[0016] The beneficial effects of this invention are as follows: This invention lays a solid data foundation for the detection of defects in metal sheets through high-quality image acquisition and enhancement processing. The target sheet is continuously illuminated by a light source, and the image with the highest clarity is selected. After illuminance homogenization correction, a high-quality original image is obtained. Noise interference is suppressed through a combination of median filtering and Gaussian filtering, outputting an enhanced image with clear details and minimal interference, ensuring the reliability of subsequent feature extraction and defect identification.
[0017] This invention significantly improves the accuracy and efficiency of defect detection in metal sheets by leveraging precise feature extraction and multi-dimensional screening and clustering. It extracts texture direction features from enhanced images to construct a direction distribution map, and uses differential analysis with a standard texture direction map to locate directional anomalies. Suspected defect points are screened through local grayscale statistics and spatial neighborhood verification. Then, morphological dilation, erosion, and connected component labeling are used to achieve precise clustering of defect regions, comprehensively capturing surface defects in the sheet metal and meeting the refined requirements of metal sheet defect detection. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the first embodiment of a method for detecting defects in metal sheets according to the present invention.
[0020] Figure 2 This is a schematic diagram of the equipment for a method of detecting defects in metal sheets according to the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the defect detection method for metal plates of the present invention, which presents the first embodiment of the defect detection method for metal plates of the present invention.
[0023] In the first embodiment, the control method of the defect detection system for the metal sheet includes: S1. Obtain a surface image of the target board material as the original image of the target board material; In this embodiment of the invention, acquiring a surface image of the target material as the original image of the target material specifically includes: The target material is continuously illuminated by a light source to obtain multiple frames of surface images of the target material. The image with the highest resolution is selected from the multiple surface images as the candidate original image of the target board. The candidate original image is subjected to illumination uniformity correction to obtain the original image of the target board.
[0024] A continuous light source is used to stably illuminate the target board, ensuring that all areas of the target board surface are uniformly and continuously illuminated. The surface information of the target board under continuous light source illumination is continuously collected by an image acquisition device to form multiple frames of surface images.
[0025] The sharpness of each of the acquired multi-frame surface images is determined. The completeness of the surface texture, edges and details of the target board in each frame is compared. The frame with the clearest presentation effect is selected and determined as the candidate original image of the target board.
[0026] The illumination intensity of different regions in the candidate original image is uniformly adjusted to ensure that the brightness of each position in the candidate original image is consistent, eliminating the difference between local overbrightness and local underbrightness, and completing the illumination uniformity correction process. The image obtained after processing is the original image of the target board.
[0027] The beneficial effect is that by acquiring multiple frames of surface images through continuous light source illumination, sufficient samples can be provided for the selection of original images, ensuring the effectiveness of image acquisition.
[0028] Selecting the image with the highest resolution as the candidate original image can improve image quality from the source and reduce the interference of low-resolution images on subsequent detection.
[0029] Illumination uniformity correction of candidate original images can eliminate the problem of uneven illumination in the image, ensure the consistency of image grayscale features, and lay a good image foundation for subsequent defect detection.
[0030] S2. Perform noise suppression on the original image to obtain an enhanced image of the target board material; In this embodiment of the invention, noise suppression is performed on the original image to obtain an enhanced image of the target board material, specifically including: The original image is subjected to median filtering to obtain the first intermediate image of the target board material; The first intermediate image is subjected to Gaussian filtering to obtain the second intermediate image of the target board material. The second intermediate image is used as an enhanced image of the target board.
[0031] Traverse each pixel position in the original image, select pixels within a specified range around the selected pixel, arrange the brightness values of all pixels within the selected range in ascending order, and replace the brightness value of the current center pixel with the brightness value of the middle pixel after the arrangement is completed. After the replacement of all pixels is completed, the first intermediate image of the target board is obtained.
[0032] Taking each pixel in the first intermediate image as the center, select pixels within the corresponding neighborhood range, assign corresponding weights according to the distance relationship between the neighboring pixels and the center pixel, multiply the brightness value of each pixel by the corresponding weight and then perform a weighted average, use the brightness value obtained by the weighted average to update the brightness value of the current center pixel, and after completing the update processing of all pixels, obtain the second intermediate image of the target board.
[0033] The second intermediate image is directly identified as the enhanced image of the target board obtained after noise suppression processing.
[0034] The beneficial effect is that performing median filtering on the original image can effectively remove impulse noise in the image while preserving the texture details of the board surface.
[0035] Applying Gaussian filtering to the first intermediate image after median filtering can smooth Gaussian noise in the image and optimize the overall visual effect.
[0036] The enhanced image obtained by combining median filtering and Gaussian filtering can effectively suppress various types of noise, improve image quality, and provide a clear image foundation for subsequent texture feature extraction.
[0037] S3. Extract texture direction features from the enhanced image to obtain the texture direction distribution map of the target board material; In this embodiment of the invention, texture direction feature extraction is performed on the enhanced image to obtain a texture direction distribution map of the target board material, specifically including: The enhanced image is convolved with a gradient operator to obtain the horizontal gradient map and the vertical gradient map of the target board material; The gradient direction of pixels in the enhanced image is determined based on the horizontal gradient map and the vertical gradient map. Discretize and encode the gradient direction to obtain the orientation category of the enhanced image; The topological reconstruction of the direction category yields the texture direction distribution map of the target board.
[0038] The gradient operator is used to perform convolution operations with each pixel position in the enhanced image in turn. The horizontal gradient map of the target board is calculated by the brightness change of the horizontal neighboring pixels, and the vertical gradient map of the target board is calculated by the brightness change of the vertical neighboring pixels.
[0039] Each pixel in the enhanced image is traversed one by one. The horizontal gradient value corresponding to the pixel in the horizontal gradient map and the vertical gradient value corresponding to the pixel in the vertical gradient map are read. Based on the relative relationship between the horizontal gradient value and the vertical gradient value of the pixel, the unique gradient direction of the pixel is determined.
[0040] The gradient direction corresponding to each pixel is classified according to a preset angle range. A unique encoding identifier is assigned to each angle range. The gradient direction of the corresponding pixel is replaced with the encoding identifier to obtain the direction category of the enhanced image.
[0041] Based on the actual arrangement of pixels in the enhanced image, the orientation categories of all pixels are systematically integrated. Adjacent pixels with the same orientation category are connected and categorized to form continuous and regular texture regions, ultimately constructing a texture distribution map of the target board.
[0042] The beneficial effect is that by performing gradient operator convolution on the enhanced image to obtain horizontal and vertical gradient maps, the gradient change characteristics of pixels on the board surface can be accurately captured, providing data support for texture direction determination.
[0043] By determining the pixel gradient direction based on the horizontal and vertical gradient maps, the basic information of the texture direction on the board surface can be accurately identified, thus improving the accuracy of texture direction judgment.
[0044] Discretizing the gradient direction to obtain the direction category can quantify and classify continuous gradient direction information, which is convenient for subsequent texture feature analysis and processing.
[0045] Topological reconstruction of the directional categories yields a texture direction distribution map, which integrates discrete directional information into an intuitive texture distribution feature map, clearly presenting the overall texture direction of the board surface and providing a clear comparison basis for subsequent anomaly detection.
[0046] S4. Perform differential analysis on the texture direction distribution map and the preset standard texture direction map to obtain the direction anomalies of the enhanced image; In this embodiment of the invention, the texture direction distribution map is differentially analyzed with a preset standard texture direction map to obtain the directional anomalies of the enhanced image, specifically including: The orientation values of pixels in the texture orientation distribution map are compared with the orientation values of corresponding pixels in the preset standard texture orientation map to obtain the orientation deviation of the enhanced image. Pixels whose directional deviation is greater than the deviation threshold in the standard texture direction map are marked as the first candidate anomalies in the enhanced image. Perform connectivity analysis on the first candidate anomaly points to obtain the second candidate anomaly points in the enhanced image; The second candidate anomaly point is used as the directional anomaly point of the enhanced image.
[0047] Using the same pixel coordinates, the direction value of each pixel in the texture direction distribution map is compared with the direction value of the corresponding pixel in the preset standard texture direction map. The direction deviation of the enhanced image is obtained based on the comparison results.
[0048] Each pixel is judged for its directional deviation. Pixels with directional deviations greater than the preset deviation threshold in the standard texture direction map are marked separately. The marked pixels are the first candidate anomalies for image enhancement.
[0049] Spatial location correlation judgment is performed on all first candidate anomalies. First candidate anomalies that are adjacent and interconnected are aggregated and retained, while isolated first candidate anomalies are removed to obtain second candidate anomalies for the enhanced image.
[0050] The second candidate outlier obtained through connectivity analysis was directly identified as the directional outlier in the enhanced image.
[0051] The beneficial effect is that by comparing the pixel direction values of the texture direction distribution map with those of the standard texture direction map, the directional deviation between the two can be accurately quantified, providing a quantitative basis for anomaly point screening.
[0052] Marking pixels with directional deviations exceeding the threshold as first-line candidate anomalies can quickly identify pixels with obvious abnormalities in texture direction, thus improving the targeting of anomaly detection.
[0053] Connectivity analysis of the first candidate anomaly point yields the second candidate anomaly point, which can eliminate isolated abnormal pixels caused by noise and other factors, thus improving the accuracy of anomaly point screening.
[0054] By identifying the second candidate anomaly as a directional anomaly, a precise and effective texture directional anomaly region can be obtained, providing a reliable detection target for subsequent identification of suspected defects.
[0055] S5. Perform grayscale statistics on the directional anomalies to obtain the local grayscale mean of the target board, and determine the pixels whose grayscale values of the directional anomalies are lower than the local grayscale mean as suspected defect points. In this embodiment of the invention, grayscale statistics are performed on the directional anomalies to obtain the local grayscale mean of the target board, and pixels whose grayscale values are lower than the local grayscale mean are identified as suspected defect points. Specifically, this includes: A neighborhood window of the target material is defined with the point of directional anomaly as the center; The grayscale values of the pixels in the neighborhood window are extracted to obtain the pixel grayscale values of the neighborhood window. The pixel grayscale values are averaged to determine the local grayscale average of the directional anomaly points; When the pixel grayscale value is less than the local grayscale mean, the directional anomaly point is marked as a candidate defect point of the target board material; Spatial domain verification is performed on the candidate defect points to eliminate isolated points, thereby obtaining the suspected defect points of the target board material.
[0056] Centered on each directional anomaly point, a fixed range of regions is delineated on the enhanced image as the neighborhood window of the target board material.
[0057] Read the brightness information of all pixels in the neighborhood window one by one to obtain the pixel grayscale value of the neighborhood window.
[0058] The average value of all pixel grayscale values within the neighborhood window is calculated by summing them up, and the local grayscale mean value corresponding to the abnormal point in the current direction is determined.
[0059] The gray value of the directional anomaly point is compared with the local gray value. When the gray value is less than the local gray value, the directional anomaly point is marked as a candidate defect point of the target board.
[0060] Spatial location verification is performed on all candidate defect points. Candidate defect points that are adjacent to each other and continuously distributed are retained, while candidate defect points that exist alone without adjacent relationships are removed, thus obtaining the suspected defect points of the target board.
[0061] The beneficial effect is that by defining a neighborhood window centered on the directional anomaly point, the pixel range around the anomaly point can be accurately delineated, thus defining a reasonable analysis area for local grayscale statistics.
[0062] By extracting grayscale values from pixels within a neighborhood window, we can obtain basic grayscale data around outliers, providing accurate data support for subsequent mean calculations.
[0063] By averaging pixel grayscale values to determine the local grayscale mean, a grayscale benchmark for the area surrounding anomalies can be obtained, providing an objective reference standard for defect identification.
[0064] Points with gray values less than the local gray value are marked as candidate defect points. These points can be further screened for suspected defects by combining gray value features, thereby improving the targeting of defect judgment.
[0065] Spatial domain verification of candidate defect points and elimination of isolated points can eliminate false positives caused by noise and other factors, thereby improving the accuracy and reliability of suspected defect point identification.
[0066] S6. Perform morphological clustering on the suspected defect points to obtain the defect region of the target board.
[0067] In this embodiment of the invention, morphological clustering is performed on the suspected defect points to obtain the defect region of the target board material, specifically including: The suspected defect points are binarized to obtain a binary image of the defect in the target board material; The binary image of the defect is dilated to obtain the dilated image of the target board. An etch operation is performed on the expanded image to obtain an etched image of the target plate. Connected component labeling is performed on the etched image to obtain the preliminary connected components of the target plate. The defect regions of the target material are obtained by morphological aggregation of the initial connected regions.
[0068] The pixels at the locations of suspected defects are assigned as foreground pixels, and the pixels at the locations of non-suspected defects are assigned as background pixels. After completing the assignment of all pixels, a binary image of the defects in the target board is obtained.
[0069] Using each foreground pixel in the defect binary image as a reference, pixel expansion is performed to the adjacent positions around that pixel, converting background pixels within the expansion range into foreground pixels. After completing the full image expansion process, the expanded image of the target board is obtained.
[0070] Using the foreground pixels in the expanded image as the processing object, the foreground pixels formed by the outward expansion at the edge are shrunk and restored, and the foreground pixels that exceed the effective range are restored as background pixels. After the full image shrinkage processing is completed, the etched image of the target plate is obtained.
[0071] Traverse all foreground pixels in the eroded image, group adjacent and connected foreground pixels into the same group, assign a unique identifier to each group of connected foreground pixels, and obtain the preliminary connected domain of the target board after completing all the division and identification processing.
[0072] By merging and integrating the initial connected regions that are adjacent to each other and belong to the same defect distribution, a continuous, complete and independently distinguishable defect block is formed, and finally the defect area of the target board is obtained.
[0073] The beneficial effect is that by binarizing suspected defect points to obtain a defect binary image, the grayscale image can be converted into a black and white contrast form, clearly distinguishing the suspected defect points from the background area and simplifying subsequent morphological processing.
[0074] Dilation of a binary image of a defect can expand the pixel range of suspected defect points, fill in tiny gaps within the defect area, and prevent the missed detection of defect details.
[0075] Erosion operations on dilated images can shrink pixel boundaries in defective areas, eliminate edge noise caused by dilation, and restore the true contours of defective areas.
[0076] By labeling the eroded image with connected components, preliminary connected components can be obtained, which can accurately identify interconnected defect pixel groups in the image and achieve preliminary division of defect regions.
[0077] By morphologically aggregating the initial connected domains to obtain the defect region, adjacent defect connected domains can be integrated to form a complete defect region outline, intuitively presenting the location and extent of defects in the board material.
[0078] Example 2: Furthermore, the present invention provides a defect detection system for metal sheets, employing a defect detection method for metal sheets as described in the above embodiments, which can solve the technical problem of defect detection in metal sheets. The beneficial effects of the defect detection system for metal sheets provided by the present invention are the same as those of the defect detection method for metal sheets provided in the above embodiments, and other technical features of the defect detection system for metal sheets are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0079] Example 3: This invention provides a defect detection device for metal sheets. Please refer to... Figure 2A defect detection device for metal sheets includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the defect detection method for metal sheets described in Embodiment 1 above. The defect detection device for metal sheets in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. This defect detection device for metal sheets is merely an example and should not be construed as limiting the functionality or scope of the embodiments of this invention. The defect detection device for metal sheets may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. Random access memory 1004 also stores various programs and data required for the operation of a metal sheet defect detection device. Processing device 1001, read-only memory 1002, and random access memory 1004 are interconnected via bus 1005. I / O interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows a metal sheet defect detection device to communicate wirelessly or wiredly with other devices to exchange data. Although a metal sheet defect detection device with various systems is shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0080] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for detecting defects in a metal sheet. The computer program product provided by this invention can solve the technical problem of detecting defects in a metal sheet. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the method for detecting defects in a metal sheet provided in the above embodiments, and will not be repeated here.
[0081] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.
[0082] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0083] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for detecting defects in metal sheets, characterized in that, The methods include: S1. Obtain a surface image of the target board material as the original image of the target board material; S2. Perform noise suppression on the original image to obtain an enhanced image of the target board material; S3. Extract texture direction features from the enhanced image to obtain the texture direction distribution map of the target board material; S4. Perform differential analysis on the texture direction distribution map and the preset standard texture direction map to obtain the direction anomalies of the enhanced image; S5. Perform grayscale statistics on the directional anomalies to obtain the local grayscale mean of the target board, and determine the pixels whose grayscale values of the directional anomalies are lower than the local grayscale mean as suspected defect points. S6. Perform morphological clustering on the suspected defect points to obtain the defect region of the target board.
2. The method for detecting defects in metal sheets as described in claim 1, characterized in that, Acquiring a surface image of the target material as the original image of the target material specifically includes: The target material is continuously illuminated by a light source to obtain multiple frames of surface images of the target material. The image with the highest resolution is selected from the multiple surface images as the candidate original image of the target board. The candidate original image is subjected to illumination uniformity correction to obtain the original image of the target board.
3. The method for detecting defects in metal sheets as described in claim 1, characterized in that, The original image is subjected to noise suppression to obtain an enhanced image of the target board material, specifically including: The original image is subjected to median filtering to obtain the first intermediate image of the target board material; The first intermediate image is subjected to Gaussian filtering to obtain the second intermediate image of the target board material. The second intermediate image is used as an enhanced image of the target board.
4. The method for detecting defects in metal sheets as described in claim 1, characterized in that, The enhanced image is subjected to texture direction feature extraction to obtain the texture direction distribution map of the target board, specifically including: The enhanced image is convolved with a gradient operator to obtain the horizontal gradient map and the vertical gradient map of the target board material; The gradient direction of pixels in the enhanced image is determined based on the horizontal gradient map and the vertical gradient map. Discretize and encode the gradient direction to obtain the orientation category of the enhanced image; The topological reconstruction of the direction category yields the texture direction distribution map of the target board.
5. The method for detecting defects in metal sheets as described in claim 1, characterized in that, The texture orientation distribution map is compared with a preset standard texture orientation map using differential analysis to obtain the orientation anomalies in the enhanced image, specifically including: The orientation values of pixels in the texture orientation distribution map are compared with the orientation values of corresponding pixels in the preset standard texture orientation map to obtain the orientation deviation of the enhanced image. Pixels whose directional deviation is greater than the deviation threshold in the standard texture direction map are marked as the first candidate anomalies in the enhanced image. Perform connectivity analysis on the first candidate anomaly points to obtain the second candidate anomaly points in the enhanced image; The second candidate anomaly point is used as the directional anomaly point of the enhanced image.
6. The method for detecting defects in metal sheets as described in claim 1, characterized in that, Gray-scale statistics are performed on the directional anomalies to obtain the local gray-scale mean of the target board material. Pixels whose gray-scale values are lower than the local gray-scale mean are identified as suspected defect points. Specifically, this includes: A neighborhood window of the target material is defined with the point of directional anomaly as the center; The grayscale values of the pixels in the neighborhood window are extracted to obtain the pixel grayscale values of the neighborhood window. The pixel grayscale values are averaged to determine the local grayscale average of the directional anomaly points; When the pixel grayscale value is less than the local grayscale mean, the directional anomaly point is marked as a candidate defect point of the target board material; Spatial domain verification is performed on the candidate defect points to eliminate isolated points, thereby obtaining the suspected defect points of the target board material.
7. The method for detecting defects in metal sheets as described in claim 1, characterized in that, Morphological clustering of the suspected defect points yields the defect regions of the target board material, specifically including: The suspected defect points are binarized to obtain a binary image of the defect in the target board material; The binary image of the defect is dilated to obtain the dilated image of the target board. An etch operation is performed on the expanded image to obtain an etched image of the target plate. Connected component labeling is performed on the etched image to obtain the preliminary connected components of the target plate. The defect regions of the target material are obtained by morphological aggregation of the initial connected regions.
8. A defect detection system for metal sheets, applied to the defect detection method for metal sheets according to any one of claims 1 to 7, characterized in that, The defect detection system for the metal sheet includes: An image acquisition module is used to acquire a surface image of the target board material, which serves as the original image of the target board material. An image enhancement module is used to suppress noise in the original image to obtain an enhanced image of the target board material; The texture orientation module is used to extract texture orientation features from the enhanced image to obtain the texture orientation distribution map of the target board material. Anomaly analysis module is used to perform differential analysis between the texture direction distribution map and the preset standard texture direction map to obtain the directional anomaly points of the enhanced image; The defect determination module is used to perform grayscale statistics on the directional anomalies to obtain the local grayscale mean of the target board, and to determine the pixels whose grayscale values of the directional anomalies are lower than the local grayscale mean as suspected defect points. The target output module is used to perform morphological clustering on the suspected defect points to obtain the defect area of the target board.
9. A defect detection device for metal sheets, characterized in that, The defect detection device for the metal sheet includes: a memory, a processor, and a defect detection program for the metal sheet stored in the memory and executable on the processor. When the defect detection program for the metal sheet is executed by the processor, it implements a defect detection method for the metal sheet according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a defect detection program for metal sheets, which, when executed by a processor, implements a defect detection method for metal sheets according to any one of claims 1 to 7.