Metal surface scratch detection method and system combined with visual detection
By combining visual inspection and image processing technology, a metal surface scratch detection system is built, which solves the existing problems of low detection efficiency and limited accuracy, and achieves more efficient and accurate metal surface scratch detection.
Patent Information
- Application Number
- CN202411699091.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-28
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN119540210A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image analysis, and in particular to a metal surface scratch detection method and system combined with visual detection. Background Art
[0002] With the rapid development of the manufacturing industry, the requirements for the quality of metal products are increasing. Scratches on the metal surface are not only related to the aesthetics of the product, but also directly affect the durability and safety of the product. Therefore, scratch detection has become an important link in ensuring product quality. Common scratch detection methods include visual detection and optical detection. The visual detection method observes the scratches on the metal surface with the naked eye. This method is limited by human subjectivity and vision limitations. It is difficult to detect small or hidden scratches. Due to the influence of human factors and environmental conditions, the accuracy of detection is difficult to guarantee. The optical detection method uses optical instruments such as microscopes and projectors to magnify and observe the metal surface. Although it can detect the details of the scratches, the detection speed is slow, the efficiency is low, and the operator's skills are required to be high.
[0003] In the current related technologies, metal surface scratch detection has technical problems such as low detection efficiency and limited detection accuracy. Summary of the invention
[0004] The present application provides a metal surface scratch detection method and system combined with visual detection, which controls a visual detector to perform an all-round scan of the target metal, constructs a two-dimensional surface image, and uses an image correction module to perform branch processing on the image under bidirectional transformation to determine the target surface image. Then, by traversing a pixel comparison library for pixel comparison and recognition, the surface scratch features are determined, and integrated based on the relative position in space, as a visual display of the scratch detection results, and other technical means, thereby achieving the technical effect of improving detection efficiency and enhancing detection accuracy.
[0005] The present application provides a metal surface scratch detection method combined with visual detection, comprising: By controlling the visual detector, the target metal is scanned in all directions, and the perspective stitching is performed to determine the two-dimensional surface image; the image correction architecture is determined and sample-driven training is performed to construct an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block; the image correction module is assisted to perform branch processing under bidirectional transformation on the two-dimensional surface image to determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering and denoising processing of the high-frequency part; for the target metal, a pixel comparison library is determined, the target surface image is traversed to perform pixel comparison and recognition, and the surface scratch features are determined; based on the relative position in space, the surface scratch features are integrated as the scratch detection result of the target metal and visualized on the display interface.
[0006] In a possible implementation, the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block, which performs the following processing: Based on the high and low frequency decomposition of the image, supervised training of the shearing transformation block is performed; the shearing transformation block is inverted to serve as an inverse shearing transformation block; for the low frequency image part, the image grayscale closing operation is used as a processing method to supervise the training of the low frequency processing branch; for the high frequency image part, filtering and denoising is used as a processing method to supervise the training of the high frequency processing branch; the shearing transformation block, the low frequency processing branch, the high frequency processing branch and the inverse shearing transformation block are combined to determine the image correction module.
[0007] In a possible implementation, the two-dimensional surface image is subjected to branch processing under bidirectional transformation, and the following processing is performed: Perform a shearing transformation on the two-dimensional surface image to determine a first image portion and a second image portion, wherein the first image portion is a low-frequency portion containing main image information, and the second image portion is a high-frequency portion containing non-main information; combine the low-frequency processing branch and the high-frequency processing branch to perform parallel processing on the first image portion and the second image portion to determine a first processed image and a second processed image; perform an inverse shearing transformation on the first processed image and the second processed image to determine a target surface image.
[0008] In a possible implementation, the first image part and the second image part are processed in parallel, and the following processing is performed: For the first image part, the pixel processing scale is set and pixel dilation processing and corrosion processing are performed to determine the first processed image; for the second image part, filtering and noise reduction processing is performed to determine the second processed image.
[0009] In a possible implementation, the pixel comparison library is determined by performing the following processing: The target metal is traversed to determine the metal intrinsic characteristics, wherein the metal intrinsic characteristics are the pixel contrast characteristics of the target metal itself under the standard specifications; the pixel grayscale distribution is determined in combination with the metal intrinsic characteristics as the pixel contrast library.
[0010] In a possible implementation, the determining of the surface scratch characteristics performs the following processing: Perform pixel recognition on the target surface image to determine the target pixel distribution; traverse the pixel comparison library, perform mapping and calibration with the target pixel distribution, and locate pixel pairs with pixel deviations; integrate the pixel pairs to determine the surface scratch characteristics.
[0011] In a possible implementation, the determining of the two-dimensional surface image includes performing the following processing: The scanned image is transformed in perspective to determine a two-dimensional scanned image; the two-dimensional scanned image is traversed to determine a splicing boundary by performing image overlap recognition; based on the splicing boundary, the two-dimensional scanned image is spliced in the same perspective to determine the two-dimensional surface image.
[0012] The present application also provides a metal surface scratch detection system combined with visual detection, comprising: A metal scanning module, the metal scanning module is used to perform an all-round scan of the target metal by controlling the visual detector, and perform perspective stitching to determine the two-dimensional surface image; an image correction construction module, the image correction construction module is used to determine the image correction architecture and perform sample-driven training to construct an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block; an image processing module, the image processing module is used to assist the image correction module, perform branch processing under bidirectional transformation on the two-dimensional surface image, and determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering and denoising processing of the high-frequency part; a pixel comparison and recognition module, the pixel comparison and recognition module is used to determine a pixel comparison library for the target metal, traverse the target surface image to perform pixel comparison and recognition, and determine the surface scratch features; a scratch feature integration module, the scratch feature integration module is used to perform the integration of the surface scratch features based on the relative position in space as the scratch detection result of the target metal and perform display interface visualization.
[0013] The metal surface scratch detection method and system proposed in this application in combination with visual detection first control the visual detector to perform an all-round scan of the target metal, perform perspective stitching to determine the two-dimensional surface image, then determine the image correction architecture and perform sample-driven training to build an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block, and then the auxiliary image correction module performs branch processing under bidirectional transformation on the two-dimensional surface image to determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering and denoising processing of the high-frequency part, and then for the target metal, determine the pixel comparison library, traverse the target surface image for pixel comparison and recognition, determine the surface scratch features, and finally, based on the relative position in space, perform surface scratch feature integration as the scratch detection result of the target metal and perform display interface visualization, thereby achieving the technical effect of improving detection efficiency and detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the accompanying drawings of the embodiment of the present invention will be briefly introduced below. A flow chart is used in the present application to illustrate the operations performed by the system according to the embodiment of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps can be processed in reverse order or simultaneously as needed. At the same time, other operations can also be added to these processes, or one or more operations can be removed from these processes.
[0015] Figure 1 A schematic flow chart of a metal surface scratch detection method combined with visual detection provided in an embodiment of the present application.
[0016] Figure 2 A schematic diagram of the structure of a metal surface scratch detection system combined with visual detection provided in an embodiment of the present application.
[0017] Explanation of reference numerals: metal scanning module 10 , image correction construction module 20 , image processing module 30 , pixel comparison and recognition module 40 , scratch feature integration module 50 . DETAILED DESCRIPTION
[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, 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 application more obvious and easy to understand, the specific implementation methods of the present application are listed below.
[0019] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0020] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict, and the terms "first\second" involved are merely to distinguish similar objects and do not represent a specific ordering of objects. The terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products, or devices. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of this application. The terms used herein are for the purpose of describing the embodiments of the present application only.
[0021] The present application embodiment provides a metal surface scratch detection method combined with visual detection, such as Figure 1 As shown, the method includes: Step S100, by controlling the visual detector, the target metal is scanned in all directions, and the perspective stitching is performed to determine the two-dimensional surface image. Specifically, the visual detector is started by the detection system, and the visual detector can be a high-resolution camera or scanner for capturing images of the metal surface. The visual detector scans the target metal in all directions, that is, it captures images of the metal surface from multiple angles or positions to ensure that all details of the metal surface are captured. Since the images are captured from multiple angles or positions, these images need to be stitched through image registration and fusion technology to form a complete two-dimensional surface image.
[0022] In a possible implementation, the two-dimensional surface image is determined, and step S100 further includes step S110, which performs a perspective transformation on the scanned image to determine the two-dimensional scanned image. Specifically, when the visual detector scans the target metal, it will capture a series of original scanned images, and these images are different due to factors such as scanning angles and light. In order to unify these original scanned images to the same perspective, it is necessary to perform perspective transformation processing through operations such as image rotation, scaling, and translation to ensure that all images can be seamlessly connected during subsequent splicing. After the perspective transformation processing, a series of two-dimensional scanned images with consistent perspectives are obtained. Step S120, traverse the two-dimensional scanned images, and determine the splicing boundary by performing image overlap recognition. Specifically, each pair of adjacent two-dimensional scanned images is checked in turn, and the overlapping parts between adjacent images are identified by using an image matching algorithm through steps such as feature point extraction and feature matching. After identifying the overlapping parts, the splicing boundary is determined. The splicing boundary is the position where adjacent images should be connected, which determines whether the spliced image is continuous and seamless. Step S130, based on the stitching boundary, the two-dimensional scanned images are stitched with the same perspective to determine the two-dimensional surface image. Specifically, according to the stitching boundary, adjacent two-dimensional scanned images are aligned by operations such as image translation and rotation. Image fusion processing is performed between the aligned images, that is, by operations such as image weighting and smoothing, the traces of the stitching are reduced to make the stitched image more natural. After the image alignment and fusion processing, a complete two-dimensional surface image is obtained, which is the basis for subsequent image correction and scratch detection. This implementation method eliminates the image differences caused by factors such as scanning angle and light through perspective transformation processing, accurately finds the overlapping parts and stitching positions between adjacent images through image overlap recognition and stitching boundary determination, further reduces the traces of the stitching through image alignment and fusion processing, and makes the stitched image more natural and continuous, achieving the technical effect of ensuring that the entire processing process from the original scanned image to the final two-dimensional surface image is accurate and reliable.
[0023] Step S200, determine the image correction architecture and perform sample-driven training to construct an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block. Specifically, determine a metal surface image correction architecture, which is used to correct metal surface images, including components such as a shearing transformation block, a two-way processing branch, and an inverse shearing transformation block. Use a sample data set containing metal surface images and corresponding correction results to train the image correction architecture. During the training process, adjust the parameters in the architecture according to the sample data to improve the correction effect. After the training is completed, encapsulate the image correction architecture into a module for subsequent use.
[0024] In a possible implementation, the image correction architecture includes a shearing transform block-a two-way processing branch-an inverse shearing transform block, and step S200 further includes step S210, which supervises the training of the shearing transform block based on the high and low frequency decomposition of the image. Specifically, an image decomposition method, such as Shearlet decomposition, is used to decompose the input image into a low frequency part and a high frequency part. The low frequency part contains the main structure and contour information of the image, and the high frequency part contains the details and noise information of the image. A set of sample data sets including metal surface images and their corresponding corrected images are used to supervise the training of the shearing transform block. During the training process, the shearing transform block learns how to perform appropriate transformations on the high and low frequency parts of the image to adapt to different image correction requirements. Step S220, invert the shearing transform block as an inverse shearing transform block. Specifically, after the shearing transform block is trained, the inverse shearing transform block is obtained by inverting its parameters. The function of the inverse shearing transform block is to inversely transform the image processed by the shearing transform block to restore it to the original state or close to the original state.
[0025] Step S230, for the low-frequency image part, supervise the training of the low-frequency processing branch by using the grayscale closing operation of the image as the processing method. Specifically, the low-frequency image part is processed by grayscale closing operation. Grayscale closing operation is a morphological processing used to remove small black spots or holes in the image while retaining the main structural information. Using a sample data set containing low-frequency images and their corresponding processed images, supervise the training of the low-frequency processing branch (the neural network branch that processes the low-frequency image part) so that the low-frequency processing branch learns how to perform appropriate grayscale closing operation processing on the low-frequency image to improve its quality. Step S240, for the high-frequency image part, supervise the training of the high-frequency processing branch by using filtering and denoising as the processing method. Specifically, filtering methods such as Gaussian filtering, mean filtering, etc. are used to perform filtering and denoising processing on the high-frequency image part to remove unnecessary parts of noise and detail information in the image. Using a sample data set containing high-frequency images and their corresponding processed images, supervise the training of the high-frequency processing branch (the neural network branch that processes the high-frequency image part) so that the high-frequency processing branch learns how to perform appropriate filtering and denoising processing on the high-frequency image to improve its quality. Step S250, combining the shearing transform block, the low-frequency processing branch, the high-frequency processing branch and the inverse shearing transform block to determine the image correction module. Specifically, the trained shearing transform block, the low-frequency processing branch, the high-frequency processing branch and the inverse shearing transform block are combined together to form a complete image correction module for correcting the image. This implementation method uses the shearing transform block to transform the image as a whole to adapt to different correction requirements, improves the main structure and contour information of the image through the low-frequency processing branch, removes unnecessary parts of noise and detail information in the image through the high-frequency processing branch, and restores the original state or near the original state of the image through the inverse shearing transform block, constructing an image correction module that can effectively process defects such as scratches in metal surface images, providing an efficient and accurate method for metal surface scratch detection.
[0026] Step S300, assisting the image correction module, performs branch processing under bidirectional transformation on the two-dimensional surface image to determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering and denoising processing of the high-frequency part. Specifically, the image correction module is used to perform bidirectional transformation on the two-dimensional surface image, and the transformed image is divided into two parts, low-frequency and high-frequency, and different processing is performed on each part. The low-frequency part is subjected to grayscale closing operation processing to highlight the main features of the image; the high-frequency part is subjected to filtering and denoising processing to reduce the noise in the image. The processed low-frequency and high-frequency images are recombined to obtain the target surface image, which reflects the actual situation of the metal surface more clearly and accurately than the original image.
[0027] In a possible implementation, the two-dimensional surface image is subjected to branch processing under bidirectional transformation, and step S300 further includes step S310, performing shear transformation on the two-dimensional surface image to determine a first image part and a second image part, wherein the first image part is a low-frequency part containing the main information of the image, and the second image part is a high-frequency part containing non-main information. Specifically, the two-dimensional surface image is input into a trained shear transformation block. The shear transformation block decomposes the image into two main parts: a first image part (low-frequency part) and a second image part (high-frequency part). The low-frequency part contains the main information of the image, such as the overall structure, smooth area, etc., and the high-frequency part contains non-main information, such as the edge, details, noise, etc. of the image. Step S320, combining the low-frequency processing branch and the high-frequency processing branch, parallel processing the first image part and the second image part, and determining a first processed image and a second processed image. Specifically, the first image part (low-frequency part) is input into the low-frequency processing branch to perform grayscale closing operation processing. Grayscale closing operation can enhance the bright areas in the image and smooth the small dark areas, which helps to remove noise in the low-frequency part and fill small holes. The second image part (high-frequency part) is input into the high-frequency processing branch for filtering and noise reduction processing to remove the noise in the high-frequency part while retaining the edges and details of the image. The two processing branches work in parallel and can process different parts of the image at the same time to improve processing efficiency. Step S330, perform an inverse shearing transformation on the first processed image and the second processed image to determine the target surface image. Specifically, the image parts processed by the low-frequency processing branch and the high-frequency processing branch (i.e., the first processed image and the second processed image) are input into the inverse shearing transformation block. The inverse shearing transformation block performs an inverse transformation on these image parts and recombines them into a complete image, i.e., the target surface image. This implementation method decomposes the image into low-frequency and high-frequency parts through shearing transformation, and performs targeted processing respectively, which effectively removes noise, enhances image features, and improves the accuracy of scratch detection. At the same time, parallel processing of low-frequency and high-frequency parts speeds up processing and improves detection efficiency.
[0028] In a possible implementation, the first image part and the second image part are processed in parallel, and step S320 further includes step S321, for the first image part, by setting the pixel processing scale, performing pixel expansion processing and corrosion processing, and determining the first processed image. Specifically, according to the characteristics of the first image part and the requirements of scratch detection, a suitable pixel processing scale is set, and this scale determines the size of the neighborhood affected by the expansion and corrosion operations. Each pixel of the first image part is traversed, compared with the pixels in its neighborhood, and a larger pixel value is selected as the output value of the position to expand the bright area in the image and enhance the image details. After the expansion process, each pixel is traversed again, and this time a smaller pixel value is selected as the output value, and the tiny bright spots or noise generated by the expansion process in the image are removed by corrosion processing. After the expansion and corrosion processes, the first processed image obtained retains the main information of the low-frequency part while enhancing the image details and reducing the noise. Step S322, for the second image part, filtering and noise reduction processing is performed to determine the second processed image. Specifically, the second image part (high-frequency part) is directly subjected to filtering and denoising processing to remove the noise in the high-frequency part while retaining the edges and details of the image. After filtering and denoising processing, the second processed image obtained significantly reduces the noise while retaining the important information of the high-frequency part. This implementation method enhances the bright areas in the image, smoothes the small dark areas, and removes the noise that may be generated by scanning or splicing through expansion and corrosion processing, maintaining the details and clarity of the image. Through filtering and denoising processing, the high-frequency noise in the image is removed while retaining the edge and detail features of the image, thereby improving the accuracy and efficiency of metal surface scratch detection.
[0029] Step S400, for the target metal, determine a pixel comparison library, traverse the target surface image to perform pixel comparison identification, and determine the surface scratch characteristics. Specifically, determine a pixel comparison library for the target metal, which contains the metal's own pixel comparison characteristics under standard specifications for comparison with subsequent captured images. Traverse each pixel point in the target surface image and compare it with the characteristics in the pixel comparison library. Through the comparison, identify the pixel points that do not match the characteristics in the pixel comparison library. These points represent scratches or other defects on the metal surface. These points are integrated to obtain the scratch characteristics of the metal surface.
[0030] In a possible implementation, the step S400 of determining the pixel comparison library further includes step S410, traversing the target metal to determine the metal intrinsic features, wherein the metal intrinsic features are the pixel comparison features of the target metal itself under the standard specifications. Specifically, image samples of the target metal under different conditions are collected, and these conditions include different lighting, angles, surface treatments, etc. The collected image samples are preprocessed, including denoising, contrast enhancement, etc., to improve the accuracy of subsequent processing. The pixel comparison features (differences and distributions between pixel values in the image) of the metal samples are extracted using image processing techniques (such as edge detection, texture analysis, etc.). These features are determined by the physical and chemical properties of the metal and can accurately reflect the inherent properties of the metal surface, such as glossiness, texture pattern, etc. Based on the extracted features, a pixel comparison feature library under the standard specifications of the target metal is established, and this library contains the intrinsic features of the metal under different conditions. Step S420, combined with the metal intrinsic features, the pixel grayscale distribution is determined as the pixel comparison library. Specifically, the extracted metal intrinsic feature image is converted into a grayscale image, and the grayscale image is statistically analyzed to determine the statistical characteristics of the distribution range, mean, variance, etc. of the pixel grayscale value. These characteristics reflect the grayscale change law and texture characteristics of the metal surface. Based on the grayscale distribution analysis results, a pixel comparison library of the target metal is constructed. This library contains the grayscale distribution characteristics of the metal under different conditions, which is used for subsequent pixel-level comparison with the detection image. This implementation method extracts the intrinsic characteristics of the metal under different conditions and establishes a standard pixel comparison feature library for the metal surface, which provides a benchmark for subsequent scratch detection, so that the detection process can accurately identify abnormal changes (such as scratches) on the metal surface. By determining the grayscale distribution characteristics of the metal surface, the scratch detection standard is further refined, the detection accuracy and sensitivity are improved, and the technical effect of improving the accuracy and reliability of metal surface scratch detection is achieved.
[0031] In a possible implementation, the step S400 of determining the surface scratch characteristics further includes a step S430 of performing pixel recognition on the target surface image to determine the target pixel distribution. Specifically, the target surface image processed by the image correction module is subjected to pixel-level analysis, that is, the grayscale value of each pixel is read and recorded, so as to construct a detailed target pixel distribution map. This distribution map reflects the grayscale performance of the metal surface at each pixel point, and is the basis for subsequent comparison with the pixel comparison library. Step S440, traverses the pixel comparison library, performs mapping and calibration with the target pixel distribution, and locates the pixel pairs with pixel deviation. Specifically, traverses the constructed pixel comparison library (this library contains the pixel grayscale distribution of the intrinsic characteristics of the metal), and compares the grayscale value of each pixel in the library with the grayscale value of the corresponding pixel in the target pixel distribution, and the comparison process is achieved by calculating the grayscale value difference between the two. When the grayscale value difference of a certain pixel exceeds a preset threshold, the pixel is considered to have a pixel deviation, that is, an area where scratches may exist. Step S450, integrating the pixel pairs to determine the surface scratch features. Specifically, all located pixels with grayscale deviations are integrated to form a scratch feature set. Each element in this set represents an area on the metal surface where scratches may exist. Through further analysis and processing of these areas (such as morphological processing, connected domain analysis, etc.), the scratch features on the metal surface can eventually be determined, including information such as the location, shape, and size of the scratches. This implementation method accurately locates the area on the metal surface where scratches may exist by constructing a pixel comparison library and comparing the target pixel distribution with the pixels in the library. This method not only has a high degree of accuracy, but also can handle a variety of complex and subtle scratch features, thereby improving the accuracy and reliability of scratch detection.
[0032] Step S500, based on the relative position in space, the surface scratch features are integrated as the scratch detection results of the target metal and visualized on the display interface. Specifically, according to the relative position information of the scratch features on the metal surface, the identified surface scratch features are integrated in space to form a complete scratch detection result, which includes information such as the position, shape, and size of the scratches. The scratch detection results are presented on the display interface in a visual manner (image or graphic, etc.) so that the user can intuitively see the scratches on the metal surface. The embodiment of the present application adopts the method of controlling the visual detector to perform an all-round scan of the target metal, constructing a two-dimensional surface image, and using the image correction module to perform branch processing under bidirectional transformation on the image to determine the target surface image, and then, by traversing the pixel comparison library for pixel comparison identification, determining the surface scratch features, and integrating based on the relative position in space, as a scratch detection result for visualization and other technical means, to achieve the technical effect of improving detection efficiency and improving detection accuracy.
[0033] In the above, refer to Figure 1 The metal surface scratch detection method combined with visual detection according to an embodiment of the present invention is described in detail. Figure 2 A metal surface scratch detection system combined with visual detection according to an embodiment of the present invention is described.
[0034] The metal surface scratch detection system combined with visual detection according to the embodiment of the present invention is used to solve the technical problems of low detection efficiency and limited detection accuracy in the existing metal surface scratch detection, so as to achieve the technical effect of improving detection efficiency and detection accuracy. The metal surface scratch detection system combined with visual detection includes: a metal scanning module 10, an image correction construction module 20, an image processing module 30, a pixel comparison recognition module 40, and a scratch feature integration module 50.
[0035] The metal scanning module 10 is used to perform an all-round scan of the target metal by controlling the visual detector, and perform perspective stitching to determine the two-dimensional surface image; the image correction construction module 20 is used to determine the image correction architecture and perform sample-driven training to construct an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block; the image processing module 30 is used to assist the image correction module, perform branch processing under bidirectional transformation on the two-dimensional surface image, and determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering and denoising processing of the high-frequency part; the pixel comparison and recognition module 40 is used to determine a pixel comparison library for the target metal, traverse the target surface image for pixel comparison and recognition, and determine the surface scratch features; the scratch feature integration module 50 is used to perform the integration of the surface scratch features based on the relative position in space as the scratch detection result of the target metal and perform display interface visualization.
[0036] The specific configuration of the image correction construction module 20 will be described in detail below. As described above, the image correction architecture includes a shearing transform block-a two-way processing branch-an inverse shearing transform block, and the image correction construction module 20 may further include: a shearing transform block training unit for supervising the training of the shearing transform block based on the high and low frequency decomposition of the image; a shearing transform block inversion unit for inverting the shearing transform block as an inverse shearing transform block; a low frequency processing branch training unit for supervising the training of the low frequency processing branch for the low frequency image part by using the image grayscale closing operation as the processing method; a high frequency processing branch training unit for supervising the training of the high frequency processing branch for the high frequency image part by using filtering and denoising as the processing method; an image correction module determination unit for combining the shearing transform block, the low frequency processing branch, the high frequency processing branch and the inverse shearing transform block to determine the image correction module.
[0037] The specific configuration of the image processing module 30 will be described in detail below. As described above, the branch processing under the bidirectional transformation is performed on the two-dimensional surface image, and the image processing module 30 may further include: a shearing transformation unit is used to perform a shearing transformation on the two-dimensional surface image to determine a first image part and a second image part, wherein the first image part is a low-frequency part containing the main information of the image, and the second image part is a high-frequency part containing non-main information; a parallel processing unit is used to combine the low-frequency processing branch and the high-frequency processing branch, and perform parallel processing on the first image part and the second image part to determine a first processed image and a second processed image; an inverse shearing transformation unit is used to perform an inverse shearing transformation on the first processed image and the second processed image to determine a target surface image.
[0038] The first image part and the second image part are processed in parallel, and the parallel processing unit may further include: a pixel expansion and corrosion processing subunit for determining the first processed image by setting a pixel processing scale for the first image part and performing pixel expansion processing and corrosion processing; and a filtering and denoising processing subunit for determining the second processed image by performing filtering and denoising processing for the second image part.
[0039] The specific configuration of the pixel comparison recognition module 40 will be described in detail below. As described above, the pixel comparison library is determined, and the pixel comparison recognition module 40 may further include: a metal intrinsic feature determination unit for traversing the target metal to determine the metal intrinsic feature, wherein the metal intrinsic feature is the pixel comparison feature of the target metal itself under the standard specification; a pixel grayscale distribution determination unit for combining the metal intrinsic feature to determine the pixel grayscale distribution as the pixel comparison library.
[0040] Among them, for determining the surface scratch characteristics, the pixel comparison and recognition module 40 may further include: a pixel recognition unit for performing pixel recognition on the target surface image to determine the target pixel distribution; a mapping and proofreading unit for traversing the pixel comparison library, performing mapping and proofreading with the target pixel distribution, and locating pixel pairs with pixel deviations; a pixel pair integration unit for integrating the pixel pairs to determine the surface scratch characteristics.
[0041] The specific configuration of the metal scanning module 10 will be described in detail below. As described above, to determine the two-dimensional surface image, the metal scanning module 10 may further include: a perspective transformation unit for performing perspective transformation on the scanned image to determine the two-dimensional scanned image; an image overlap recognition unit for traversing the two-dimensional scanned image to determine the splicing boundary by performing image overlap recognition; and a same-perspective splicing unit for performing same-perspective splicing on the two-dimensional scanned image based on the splicing boundary to determine the two-dimensional surface image.
[0042] The metal surface scratch detection system combined with visual inspection provided in the embodiment of the present invention can execute the metal surface scratch detection method combined with visual inspection provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0043] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules may be used and run on the user terminal and / or server, and the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0044] The above specific implementation manner does not constitute a limitation to the protection scope of the present application. It should be understood by those skilled in the art that various modifications, combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application. In some cases, the actions or steps recorded in the present application can be performed in an order different from that in the embodiment and can still achieve the desired results. In addition, the process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A metal surface scratch detection method combined with visual detection, characterized in that: The method comprises: By controlling the visual detector, the target metal is scanned in all directions, and the perspective stitching is performed to determine the two-dimensional surface image; Determine an image correction architecture and perform sample-driven training to construct an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block; Assisting the image correction module to perform branch processing under bidirectional transformation on the two-dimensional surface image to determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering noise reduction processing of the high-frequency part; For the target metal, determine a pixel comparison library, traverse the target surface image to perform pixel comparison and identification, and determine surface scratch features; Based on the relative spatial position, the surface scratch features are integrated as the scratch detection result of the target metal and visualized on a display interface.
2. The metal surface scratch detection method combined with visual detection as claimed in claim 1, characterized in that: The image correction architecture comprises a shearing transformation block-a two-way processing branch-an inverse shearing transformation block, including: Based on the high and low frequency decomposition of the image, supervise the training of the shear transformation block; Inverting the shear transformation block to obtain an inverse shear transformation block; For the low-frequency image part, the grayscale closing operation of the image is used as the processing method to supervise the training of the low-frequency processing branch; For the high-frequency image part, filtering and denoising are used as the processing method, and the high-frequency processing branch is supervised and trained; The shearing transformation block, the low frequency processing branch, the high frequency processing branch and the inverse shearing transformation block are combined to determine the image correction module.
3. The metal surface scratch detection method combined with visual detection as claimed in claim 2, characterized in that: The two-dimensional surface image is subjected to branch processing under bidirectional transformation, including: Performing shear transformation on the two-dimensional surface image to determine a first image portion and a second image portion, wherein the first image portion is a low-frequency portion containing main image information, and the second image portion is a high-frequency portion containing non-main image information; Combining the low-frequency processing branch and the high-frequency processing branch, processing the first image portion and the second image portion in parallel to determine a first processed image and a second processed image; An inverse shearing transformation is performed on the first processed image and the second processed image to determine a target surface image.
4. The metal surface scratch detection method combined with visual detection as claimed in claim 3, characterized in that: The first image portion and the second image portion are processed in parallel, comprising: For the first image portion, by setting a pixel processing scale, performing pixel dilation processing and erosion processing to determine the first processed image; A filtering and noise reduction process is performed on the second image portion to determine the second processed image.
5. The metal surface scratch detection method combined with visual detection as claimed in claim 1, characterized in that: The step of determining a pixel comparison library comprises: Traversing the target metal to determine the metal intrinsic characteristics, wherein the metal intrinsic characteristics are pixel contrast characteristics of the target metal itself under standard specifications; In combination with the intrinsic characteristics of the metal, the pixel grayscale distribution is determined as the pixel comparison library.
6. The metal surface scratch detection method combined with visual detection as claimed in claim 5, characterized in that: The determining of surface scratch characteristics comprises: Performing pixel recognition on the target surface image to determine target pixel distribution; Traversing the pixel comparison library, mapping and calibrating with the target pixel distribution, and locating pixel pairs with pixel deviations; The pixel pairs are integrated to determine the surface scratch characteristics.
7. The metal surface scratch detection method combined with visual detection as claimed in claim 1, characterized in that: The determining of the two-dimensional surface image comprises: Performing perspective transformation on the scanned image to determine a two-dimensional scanned image; Traversing the two-dimensional scanned image, and determining a splicing boundary by performing image overlap recognition; Based on the stitching boundary, the two-dimensional scanned images are stitched in the same viewing angle to determine the two-dimensional surface image.
8. A metal surface scratch detection system combined with visual detection, characterized in that: The system is used to implement the metal surface scratch detection method combined with visual detection according to any one of claims 1 to 7, and the system comprises: A metal scanning module, which is used to perform an omnidirectional scan of the target metal by controlling a visual detector and perform perspective stitching to determine a two-dimensional surface image; An image correction construction module, the image correction construction module is used to determine an image correction architecture and perform sample-driven training to construct an image correction module, wherein the image correction architecture includes a shearing transformation block-a two-way processing branch-an inverse shearing transformation block; An image processing module, the image processing module is used to assist the image correction module to perform branch processing under bidirectional transformation on the two-dimensional surface image to determine the target surface image, wherein the branch processing includes grayscale closing operation processing of the low-frequency part and filtering noise reduction processing of the high-frequency part; A pixel comparison and recognition module, wherein the pixel comparison and recognition module is used to determine a pixel comparison library for the target metal, traverse the target surface image to perform pixel comparison and recognition, and determine surface scratch features; A scratch feature integration module is used to perform integration of the surface scratch features based on spatial relative positions, as the scratch detection result of the target metal and to perform visualization on a display interface.