Automobile sheet metal part crack detection method

By combining precise image preprocessing and gradient calculation with mask matching technology, the problem of low efficiency in traditional detection methods has been solved, and efficient automated detection of cracks in automotive sheet metal parts has been achieved.

CN118967604APending Publication Date: 2024-11-15HARBIN SHIMADA BIG BIRD IND +1

Patent Information

Application Number
CN202411004449.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the production of automotive sheet metal parts, traditional manual inspection methods are inefficient and easily affected by subjective factors, making it difficult to accurately identify cracks and defects. Deep learning technology lacks sufficient training samples, making it difficult to build efficient models.

Method used

Through precise image preprocessing, gradient calculation, and mask matching, the gradient is calculated using the Sobel operator, combined with Gaussian filtering and perspective transformation, and masks are generated using Otsu's method and morphological operations to identify and mark abnormal regions in the image.

Benefits of technology

It improves the accuracy and efficiency of detecting changes in metal areas of automotive sheet metal parts, and can quickly identify cracks and defects in images, providing an effective automated solution for industrial inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967604A_ABST
    Figure CN118967604A_ABST
Patent Text Reader

Abstract

The invention relates to an automobile sheet metal part crack detection method. The invention relates to the technical field of visual inspection in the automobile industry. The method comprises the following steps: selecting a reference image, creating a reference mask, performing Gaussian filtering processing, performing gradient calculation, performing gradient mask, performing perspective transformation and mask positioning, performing gradient calculation on a new image, performing gradient map difference calculation, setting a threshold value, extracting an abnormal region, and marking and reporting the abnormal region. According to the method, through accurate gradient calculation and mask matching, the accuracy and efficiency of workpiece metal area change detection are improved. Through perspective transformation and threshold setting, the method can quickly identify the change area in the image, and provides an effective solution for industrial detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of visual inspection in the automobile industry, and relates to a method for detecting cracks in automobile sheet metal parts. Background Art

[0002] In the manufacturing process of automotive parts, product appearance defects are often an important factor affecting product quality and reliability. However, traditional manual inspection methods are not only inefficient, but also easily affected by subjective factors, making it difficult to ensure the accuracy and consistency of inspection.

[0003] With the rapid development of artificial intelligence, machine vision inspection technology has emerged. Using high-precision industrial cameras to imitate human vision to capture product image information, through image processing algorithms, it can quickly and accurately detect scratches, deformation, dirt, oxidation, cracks, dents and other defects on the surface of automotive parts, realize automated inspection, improve work efficiency and reduce production costs.

[0004] The visual inspection equipment automatically loads materials to the inspection platform through a vibration plate. The industrial camera then takes high-speed photos of the moving products. The machine vision inspection software system then performs real-time inspection, analysis, and calculation on the photographs with high speed, high precision, and high stability to determine whether the samples are qualified. Finally, the results are output, counted, and defective products are automatically eliminated.

[0005] Visual inspection equipment is widely used in various industries in the manufacturing industry, such as electronics, machinery, automobiles, medical and other fields. It can detect the appearance defects of various parts, such as dimensional scratches, cracks, missing materials, breaks, foreign matter, burrs, internal blockages, inner and outer diameters, different colors, mixed materials, etc. Visual inspection equipment can be automatically linked with other production equipment to detect the real material, wrong or missing loading, mixed materials, etc. In practical applications, the entire production process is automatically controlled. In addition, visual inspection equipment can also realize automated packaging, thus providing strong support for the quality of products in the production process.

[0006] The automotive industry has extremely high quality requirements for die-cast sheet metal parts because these parts play a key role in vehicles. During the die-casting process, metal materials are stretched and extended as they cool and solidify. This process may cause defects such as cracks. If these defects are not discovered in time, they will seriously affect the strength and durability of the parts. However, the use of deep learning technology for defect detection faces a major obstacle: obtaining enough training samples. In actual production environments, crack defects do not occur frequently, and the high cost and complexity of obtaining defective samples make it difficult to collect a large number of accurately labeled crack defect samples, which limits the training of an efficient deep learning model. Summary of the invention

[0007] In view of the shortcomings of the prior art, in order to solve the above problems, through accurate image preprocessing, gradient calculation and mask matching, efficient detection of changes in the metal area of ​​the workpiece is achieved. The present invention proposes a method for detecting cracks in automobile sheet metal parts.

[0008] The present invention provides a method for detecting cracks in automobile sheet metal parts, and the present invention provides the following technical solutions:

[0009] A method for detecting cracks in automobile sheet metal parts comprises the following steps:

[0010] Step 1: Select a reference image. Select a high-resolution image containing the metal area of ​​the workpiece as the reference image.

[0011] Step 2: Create a reference mask and draw a mask that accurately covers the metal area of ​​the workpiece in the reference image;

[0012] Step 3: Gaussian filtering, applying Gaussian filtering to the reference image, and convolution using a Gaussian kernel to smooth the image and reduce noise;

[0013] Step 4: Gradient calculation: use the Sobel operator to obtain the gradients in the x and y directions of the reference image and calculate the composite gradient;

[0014] Step 5: Gradient mask, use the mask created in step 2 to mask the gradient obtained in step 4 to retain the gradient information in the metal area;

[0015] Step 6: Perspective transformation and mask positioning, input a new workpiece image, and position the reference mask on the new image through perspective transformation;

[0016] Step 7: Gradient calculation of the new image. Repeat steps 3 and 4 for the new image to obtain the gradient map of the new image.

[0017] Step 8: Gradient map difference calculation, calculating the difference between the reference image gradient map and the new image gradient map;

[0018] Step 9: Threshold setting and abnormal region extraction: Set a threshold to distinguish significant changes in gradient differences and extract regions with large gradient differences.

[0019] Step 10: Marking and reporting of abnormal areas. Mark the abnormal areas extracted in step 9 on the new image and generate a detection report.

[0020] Preferably, the step 2 is specifically:

[0021] When creating the reference mask, the metal area is determined by image segmentation technology, and the threshold is automatically calculated using Otsu's method to convert the image into a binary image;

[0022] For the existing noise or incoherent areas, morphological closing operations are applied to fill small holes, and opening operations are applied to remove small objects attached to the edge of the metal area to ensure that the mask accurately covers the metal area and does not include non-target areas.

[0023] Preferably, step 3 is specifically:

[0024] When selecting the standard deviation of the Gaussian filter, it should be determined based on the noise level and detail requirements of the image. When the standard deviation is 1.0, preliminary filtering is performed to remove high-frequency noise. Then, the standard deviation is adjusted to 1.5 or higher as needed for refinement to achieve a balance between smoothing and detail preservation.

[0025] Preferably, step 4 is specifically:

[0026] When using the Sobel operator to calculate the gradient, the convolution kernel size is selected as 3x3 to maintain computational efficiency and accuracy of the results. The gradient magnitude of each pixel is calculated as the Euclidean norm of the gradient calculated by the Sobel operator in the x and y directions.

[0027] Preferably, step 5 is specifically:

[0028] When applying gradient masking, in addition to simple pixel-level masking operations, the gradient values ​​at the mask edges should be checked to ensure that there is no sudden loss of gradient information at the mask boundary, which is achieved by attenuating the gradient values ​​within a certain range outside the mask edge.

[0029] Preferably, step 6 is specifically:

[0030] In perspective transformation, feature point matching algorithms such as SIFT or ORB are used to identify and match feature points in the reference image and the new image, and these matching point pairs are used to calculate the perspective transformation matrix to ensure that the transformed mask is accurately aligned with the metal area of ​​the workpiece in the new image.

[0031] Preferably, step 8 is specifically:

[0032] When performing gradient map difference calculation, an efficient numerical method is used to calculate the difference between two gradient maps using the difference function in the image processing library. The difference result is quantified by calculating the absolute value or square difference of the difference image.

[0033] A crack detection system for automobile sheet metal parts, the system comprising:

[0034] A reference image selection module, the reference image selection module selects a high-definition image containing a metal area of ​​a workpiece as a reference image;

[0035] A reference mask creation module, the reference mask creation module draws a mask, the mask accurately covers the metal area of ​​the workpiece in the reference image;

[0036] A Gaussian filter processing module, which applies Gaussian filtering to the reference image and performs convolution using a Gaussian kernel to smooth the image and reduce noise;

[0037] Gradient calculation module: The gradient calculation module uses the Sobel operator to obtain the gradients of the reference image in the x and y directions respectively, and calculates the composite gradient;

[0038] Gradient mask module, the gradient mask module uses the created mask to perform mask operation on the obtained gradient to retain the gradient information in the metal area;

[0039] Perspective transformation and mask positioning module,The perspective transformation and mask positioning module inputs a new workpiece image and positions the reference mask on the new image through perspective transformation;

[0040] A new image gradient calculation module calculates the new image to obtain a gradient map of the new image;

[0041] A gradient map difference calculation module, wherein the gradient map difference calculation module calculates the difference between the reference image gradient map and the new image gradient map;

[0042] The threshold setting and abnormal region extraction module sets a threshold value for distinguishing significant changes in gradient differences and extracting regions with large gradient differences;

[0043] The abnormal area marking and reporting module marks the extracted abnormal area on the new image and generates a detection report.

[0044] A computer-readable storage medium stores a computer program, which is executed by a processor to implement a method for detecting cracks in automobile sheet metal parts.

[0045] A computer device comprises a memory and a processor, wherein the memory stores a computer program and the processor implements a method for detecting cracks in automobile sheet metal parts when executing the computer program.

[0046] The present invention has the following beneficial effects:

[0047] Compared with the prior art, the present invention has the following advantages:

[0048] The method of the present invention improves the accuracy and efficiency of detecting changes in the metal region of a workpiece through precise gradient calculation and mask matching. Through perspective transformation and threshold setting, the method can quickly identify the changed region in the image, providing an effective solution for industrial detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 is a flow chart of the method of the present invention;

[0051] Figure 2 This is a schematic diagram of contour positioning;

[0052] Figure 3 Schematic diagram of crack edge detection. DETAILED DESCRIPTION

[0053] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0055] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0056] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0057] The present invention is described in detail below in conjunction with specific embodiments. Specific embodiment one:

[0059] according to Figure 1-Figure 3 As shown, the specific optimization technical solution adopted by the present invention to solve the above technical problems is: the present invention relates to a method for detecting cracks in automobile sheet metal parts.

[0060] A method for detecting cracks in automobile sheet metal parts comprises the following steps:

[0061] Step 1: Select a reference image. Select a high-resolution image containing the metal area of ​​the workpiece as the reference image.

[0062] Step 2: Create a reference mask and draw a mask that accurately covers the metal area of ​​the workpiece in the reference image;

[0063] Step 3: Gaussian filtering, applying Gaussian filtering to the reference image, and convolution using a Gaussian kernel to smooth the image and reduce noise;

[0064] Step 4: Gradient calculation: use the Sobel operator to obtain the gradients in the x and y directions of the reference image and calculate the composite gradient;

[0065] Step 5: Gradient mask, use the mask created in step 2 to mask the gradient obtained in step 4 to retain the gradient information in the metal area;

[0066] Step 6: Perspective transformation and mask positioning, input a new workpiece image, and position the reference mask on the new image through perspective transformation;

[0067] Step 7: Gradient calculation of the new image. Repeat steps 3 and 4 for the new image to obtain the gradient map of the new image.

[0068] Step 8: Gradient map difference calculation, calculating the difference between the reference image gradient map and the new image gradient map;

[0069] Step 9: Threshold setting and abnormal region extraction: Set a threshold to distinguish significant changes in gradient differences and extract regions with large gradient differences.

[0070] Step 10: Marking and reporting of abnormal areas. Mark the abnormal areas extracted in step 9 on the new image and generate a detection report.

[0071] The method of the present invention improves the accuracy and efficiency of detecting changes in the metal region of a workpiece through precise gradient calculation and mask matching. Through perspective transformation and threshold setting, the method can quickly identify the changed region in the image, providing an effective solution for industrial detection. Specific embodiment 2:

[0073] The difference between the second embodiment of the present invention and the first embodiment is that:

[0074] The step 2 is specifically as follows:

[0075] When creating the reference mask, the metal area is determined by image segmentation technology, and the threshold is automatically calculated using Otsu's method to convert the image into a binary image;

[0076] For the existing noise or incoherent areas, morphological closing operations are applied to fill small holes, and opening operations are applied to remove small objects attached to the edge of the metal area to ensure that the mask accurately covers the metal area and does not include non-target areas. Specific embodiment three:

[0078] The difference between the third embodiment of the present invention and the second embodiment is that:

[0079] Step 3 is as follows:

[0080] When selecting the standard deviation of the Gaussian filter, it should be determined based on the noise level and detail requirements of the image. When the standard deviation is 1.0, preliminary filtering is performed to remove high-frequency noise. Then, the standard deviation is adjusted to 1.5 or higher as needed for refinement to achieve a balance between smoothing and detail preservation. Specific embodiment four:

[0082] The difference between the fourth embodiment of the present invention and the third embodiment is that:

[0083] Step 4 is as follows:

[0084] When using the Sobel operator to calculate the gradient, the convolution kernel size is selected as 3x3 to maintain computational efficiency and accuracy of the results. The gradient magnitude of each pixel is calculated as the Euclidean norm of the gradient calculated by the Sobel operator in the x and y directions. Specific embodiment five:

[0086] The difference between the fifth embodiment of the present invention and the fourth embodiment is that:

[0087] Step 5 is as follows:

[0088] When applying gradient masking, in addition to simple pixel-level masking operations, the gradient values ​​at the mask edges should be checked to ensure that there is no sudden loss of gradient information at the mask boundary, which is achieved by attenuating the gradient values ​​within a certain range outside the mask edge. Specific embodiment six:

[0090] The difference between the sixth embodiment of the present invention and the fifth embodiment is that:

[0091] Step 6 is as follows:

[0092] In perspective transformation, feature point matching algorithms such as SIFT or ORB are used to identify and match feature points in the reference image and the new image, and these matching point pairs are used to calculate the perspective transformation matrix to ensure that the transformed mask is accurately aligned with the metal area of ​​the workpiece in the new image. Specific embodiment seven:

[0094] The difference between the seventh embodiment of the present invention and the sixth embodiment is that:

[0095] Step 8 is as follows:

[0096] When performing gradient map difference calculation, an efficient numerical method is used to calculate the difference between two gradient maps using the difference function in the image processing library. The difference result is quantified by calculating the absolute value or square difference of the difference image. Specific embodiment eight:

[0098] The difference between the eighth embodiment of the present invention and the seventh embodiment is that:

[0099] The present invention provides a crack detection system for automobile sheet metal parts, the system comprising:

[0100] A reference image selection module, the reference image selection module selects a high-definition image containing a metal area of ​​a workpiece as a reference image;

[0101] A reference mask creation module, the reference mask creation module draws a mask, the mask accurately covers the metal area of ​​the workpiece in the reference image;

[0102] A Gaussian filter processing module, which applies Gaussian filtering to the reference image and performs convolution using a Gaussian kernel to smooth the image and reduce noise;

[0103] Gradient calculation module: The gradient calculation module uses the Sobel operator to obtain the gradients of the reference image in the x and y directions respectively, and calculates the composite gradient;

[0104] Gradient mask module, the gradient mask module uses the created mask to perform mask operation on the obtained gradient to retain the gradient information in the metal area;

[0105] Perspective transformation and mask positioning module,The perspective transformation and mask positioning module inputs a new workpiece image and positions the reference mask on the new image through perspective transformation;

[0106] A new image gradient calculation module calculates the new image to obtain a gradient map of the new image;

[0107] A gradient map difference calculation module, wherein the gradient map difference calculation module calculates the difference between the reference image gradient map and the new image gradient map;

[0108] The threshold setting and abnormal region extraction module sets a threshold value for distinguishing significant changes in gradient differences and extracting regions with large gradient differences;

[0109] The abnormal area marking and reporting module marks the extracted abnormal area on the new image and generates a detection report. Specific embodiment nine:

[0111] The difference between the ninth embodiment of the present invention and the eighth embodiment is that:

[0112] The present invention provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement a method for detecting cracks in a sheet metal part of an automobile.

[0113] The technical solution of the present invention comprises the following steps:

[0114] Step 1: Selection of reference image

[0115] Select a high-resolution image containing the metal area of ​​the workpiece as the reference image to ensure that the image quality meets the requirements of subsequent processing.

[0116] Step 2: Creation of the reference mask

[0117] Draw a mask that accurately covers the metal areas of the workpiece in the reference image. The mask can be a binary image where the metal areas are white (or non-zero value) and the non-metal areas are black (or zero value)

[0118] Step 3: Gaussian filtering

[0119] Gaussian filtering is applied to the reference image, and convolution is performed using a Gaussian kernel to smooth the image and reduce noise. The size and standard deviation of the Gaussian kernel are selected based on the characteristics of the image.

[0120] Step 4: Gradient calculation

[0121] Use the Sobel operator to calculate the gradients in the x and y directions of the reference image, and then calculate the composite gradient.

[0122] Step 5: Gradient Mask Application

[0123] Use the mask created in step 2 to mask the gradient map obtained in step 4 to retain the gradient information in the metal area.

[0124] Step 6: Perspective transformation and mask positioning

[0125] A new workpiece image is input and the reference mask is positioned on the new image through perspective transformation.

[0126] Step 7: Gradient calculation of the new image

[0127] Repeat steps 3 and 4 for the new image to obtain the gradient map of the new image.

[0128] Step 8: Differential calculation of gradient map

[0129] Calculate the difference between the reference image gradient map and the new image gradient map.

[0130] Step 9: Threshold setting and abnormal area extraction

[0131] Set a threshold to distinguish significant changes in gradient differences and extract areas with large gradient differences.

[0132] Step 10: Marking and reporting of abnormal areas

[0133] The abnormal area extracted in step 9 is marked on the new image and a detection report is generated.

[0134] Step 2 is as follows: When creating the reference mask, first determine the metal area through image segmentation technology. Use Otsu's method to automatically calculate the threshold and convert the image into a binary image. For possible noise or incoherent areas, apply morphological closing operations to fill small holes and opening operations to remove small objects attached to the edge of the metal area. Ensure that the mask accurately covers the metal area and does not include non-target areas.

[0135] Step 3 is as follows: When selecting the standard deviation of the Gaussian filter, it should be determined based on the noise level and detail requirements of the image. For example, a preliminary filter is performed when the standard deviation is 1.0 to remove high-frequency noise, and then the standard deviation is adjusted to 1.5 or higher as needed for refinement to achieve a balance between smoothing and detail preservation.

[0136] Step 4 is as follows: When using the Sobel operator to calculate the gradient, select a convolution kernel size of 3x3 to maintain computational efficiency and accuracy of the result. The gradient magnitude of each pixel is calculated as the Euclidean norm of the gradient calculated by the Sobel operator in the x and y directions.

[0137] Preferably, step 5 is specifically as follows: when applying the gradient mask, in addition to simple pixel-level masking operations, the gradient value at the edge of the mask should also be checked to ensure that there is no sudden loss of gradient information at the mask boundary. This can be achieved by attenuating the gradient value within a certain range outside the mask edge.

[0138] Step 6 is as follows: In perspective transformation, feature point matching algorithms such as SIFT or ORB are used to identify and match feature points in the reference image and the new image. Then, the perspective transformation matrix is ​​calculated using these matching point pairs to ensure that the transformed mask is accurately aligned with the metal area of ​​the workpiece in the new image.

[0139] Step 7 is as follows: When repeating the gradient calculation on the new image, an adaptive algorithm can be introduced to adjust the parameters of the Gaussian filter and the Sobel operator. For example, the standard deviation of the Gaussian filter can be automatically adjusted according to the local contrast of the image, or the sensitivity of the Sobel operator can be adjusted according to the local gradient amplitude of the image.

[0140] Step 8 is specifically as follows: when performing gradient image difference calculation, an efficient numerical method is used, such as using a difference function in an image processing library, to calculate the difference between the two gradient images. The difference result can be quantified by calculating the absolute value or square difference of the difference image.

[0141] The method of the present invention improves the accuracy and efficiency of detecting changes in the metal region of a workpiece through precise gradient calculation and mask matching. Through perspective transformation and threshold setting, the method can quickly identify the changed region in the image, providing an effective solution for industrial detection. Specific embodiment ten:

[0143] The difference between the tenth embodiment of the present invention and the ninth embodiment is that:

[0144] The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements a method for detecting cracks in automobile sheet metal parts when executing the computer program.

[0145] The technical solution of the present invention comprises the following steps:

[0146] Step 1: Selection of reference image

[0147] Select a high-resolution image containing the metal area of ​​the workpiece as the reference image to ensure that the image quality meets the requirements of subsequent processing.

[0148] Step 2: Creation of the reference mask

[0149] Draw a mask that accurately covers the metal areas of the workpiece in the reference image. The mask can be a binary image where the metal areas are white (or non-zero value) and the non-metal areas are black (or zero value)

[0150] Step 3: Gaussian filtering

[0151] Gaussian filtering is applied to the reference image, and convolution is performed using a Gaussian kernel to smooth the image and reduce noise. The size and standard deviation of the Gaussian kernel are selected based on the characteristics of the image.

[0152] Step 4: Gradient calculation

[0153] Use the Sobel operator to calculate the gradients in the x and y directions of the reference image, and then calculate the composite gradient.

[0154] Step 5: Gradient Mask Application

[0155] Use the mask created in step 2 to mask the gradient map obtained in step 4 to retain the gradient information in the metal area.

[0156] Step 6: Perspective transformation and mask positioning

[0157] A new workpiece image is input and the reference mask is positioned on the new image through perspective transformation.

[0158] Step 7: Gradient calculation of the new image

[0159] Repeat steps 3 and 4 for the new image to obtain the gradient map of the new image.

[0160] Step 8: Differential calculation of gradient map

[0161] Calculate the difference between the reference image gradient map and the new image gradient map.

[0162] Step 9: Threshold setting and abnormal area extraction

[0163] Set a threshold to distinguish significant changes in gradient differences and extract areas with large gradient differences.

[0164] Step 10: Marking and reporting of abnormal areas

[0165] The abnormal area extracted in step 9 is marked on the new image and a detection report is generated.

[0166] Step 2 is as follows: When creating the reference mask, first determine the metal area through image segmentation technology. Use Otsu's method to automatically calculate the threshold and convert the image into a binary image. For possible noise or incoherent areas, apply morphological closing operations to fill small holes and opening operations to remove small objects attached to the edge of the metal area. Ensure that the mask accurately covers the metal area and does not include non-target areas.

[0167] Step 3 is as follows: When selecting the standard deviation of the Gaussian filter, it should be determined based on the noise level and detail requirements of the image. For example, a preliminary filter is performed when the standard deviation is 1.0 to remove high-frequency noise, and then the standard deviation is adjusted to 1.5 or higher as needed for refinement to achieve a balance between smoothing and detail preservation.

[0168] Step 4 is as follows: When using the Sobel operator to calculate the gradient, select a convolution kernel size of 3x3 to maintain computational efficiency and accuracy of the result. The gradient magnitude of each pixel is calculated as the Euclidean norm of the gradient calculated by the Sobel operator in the x and y directions.

[0169] Preferably, step 5 is specifically as follows: when applying the gradient mask, in addition to simple pixel-level masking operations, the gradient value at the edge of the mask should also be checked to ensure that there is no sudden loss of gradient information at the mask boundary. This can be achieved by attenuating the gradient value within a certain range outside the mask edge.

[0170] Step 6 is as follows: In perspective transformation, feature point matching algorithms such as SIFT or ORB are used to identify and match feature points in the reference image and the new image. Then, the perspective transformation matrix is ​​calculated using these matching point pairs to ensure that the transformed mask is accurately aligned with the metal area of ​​the workpiece in the new image.

[0171] Step 7 is as follows: When repeating the gradient calculation on the new image, an adaptive algorithm can be introduced to adjust the parameters of the Gaussian filter and the Sobel operator. For example, the standard deviation of the Gaussian filter can be automatically adjusted according to the local contrast of the image, or the sensitivity of the Sobel operator can be adjusted according to the local gradient amplitude of the image.

[0172] Step 8 is specifically as follows: when performing gradient image difference calculation, an efficient numerical method is used, such as using a difference function in an image processing library, to calculate the difference between the two gradient images. The difference result can be quantified by calculating the absolute value or square difference of the difference image.

[0173] The method of the present invention improves the accuracy and efficiency of detecting changes in the metal region of a workpiece through precise gradient calculation and mask matching. Through perspective transformation and threshold setting, the method can quickly identify the changed region in the image, providing an effective solution for industrial detection. Specific embodiment eleven:

[0175] The difference between the eleventh embodiment of the present invention and the tenth embodiment is that:

[0176] Materials and Equipment:

[0177] Reference image: A high-resolution image containing the metal area of ​​the workpiece

[0178] New image: the image of the workpiece to be detected

[0179] Computer system: with image processing software (such as OpenCV)

[0180] step:

[0181] Step 1: Selection of reference image Select a high-definition reference image that contains the metal area of ​​the workpiece to be inspected, ensuring that the image quality meets the requirements of subsequent processing.

[0182] Step 2: Creation of the reference mask

[0183] Image segmentation: Otsu's method is used to perform threshold segmentation on the reference image and convert the image into a binary image, with the metal area in white and the non-metal area in black.

[0184] Morphological operations:

[0185] Apply closing operation to fill small holes.

[0186] Apply an opening operation to remove small objects clinging to the edges of the metal area.

[0187] Mask Generation: Ensure that the generated mask accurately covers the metal area and does not include non-target areas.

[0188] Step 3: Gaussian filtering Gaussian filtering is applied to the reference image, with a standard deviation of 1.0 initially selected to remove high-frequency noise, and then the standard deviation is adjusted to 1.5 or higher depending on the image detail requirements.

[0189] Step 4: Gradient calculation

[0190] Sobel operator: Use a 3x3 convolution kernel to calculate the gradients in the x and y directions respectively.

[0191] Gradient magnitude calculation: Calculate the gradient magnitude of each pixel and the Euclidean norm of the gradient calculated in the x and y directions using the Sobel operator.

[0192] Step 5: Gradient mask application Use the reference mask to mask the gradient map to retain the gradient information in the metal area. At the same time, check the gradient value at the edge of the mask and attenuate the gradient value within a certain range outside the mask edge to ensure a smooth transition of the gradient information at the boundary.

[0193] Step 6: Perspective transformation and mask positioning

[0194] Feature point matching: Use SIFT or ORB algorithm to identify and match feature points in the reference image and the new image.

[0195] Perspective Transformation: These matching points are used to calculate the perspective transformation matrix to accurately position the reference mask on the new image.

[0196] Step 7: Gradient calculation of the new image Repeat steps 3 and 4 for the new image to obtain the gradient map of the new image.

[0197] Step 8: Differential calculation of gradient map The difference between the reference image gradient map and the new image gradient map is calculated using the differential function in the image processing library, and the differential result is quantified by calculating the absolute value or square difference of the differential image.

[0198] Step 9: Threshold setting and abnormal region extraction Set a threshold to distinguish significant changes in gradient differences and extract regions with large gradient differences.

[0199] Step 10: Marking and reporting of abnormal areas The extracted abnormal areas are marked on the new image and a detection report is generated.

[0200] In the description of this specification, the description of reference terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction. In addition, the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. Any process or method description in the flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code including one or more executable instructions for implementing the steps of a custom logic function or process, and the scope of the preferred embodiment of the present invention includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by a person skilled in the art of the art to which the embodiments of the present invention belong. The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as a sequenced list of executable instructions for implementing the logic function, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or N wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM).In addition, the computer readable medium can even be paper or other suitable medium on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, then editing, interpreting or processing in other suitable ways as necessary, and then storing it in a computer memory. It should be understood that the various parts of the present invention can be implemented with hardware, software, firmware, or a combination thereof. In the above-mentioned embodiment, N steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented with hardware, as in another embodiment, any one of the following technologies known in the art or their combination can be used to implement: a discrete logic circuit with a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit with a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0201] The above is only a preferred implementation of a method for detecting cracks in automobile sheet metal parts. The protection scope of a method for detecting cracks in automobile sheet metal parts is not limited to the above embodiment. All technical solutions under this idea belong to the protection scope of the present invention. It should be pointed out that for those skilled in the art, several improvements and changes without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for detecting cracks in automobile sheet metal parts, characterized in that: The following steps are involved: Step 1: Select a reference image. Select a high-resolution image containing the metal area of ​​the workpiece as the reference image. Step 2: Create a reference mask and draw a mask that accurately covers the metal area of ​​the workpiece in the reference image; Step 3: Gaussian filtering, applying Gaussian filtering to the reference image, and convolution using a Gaussian kernel to smooth the image and reduce noise; Step 4: Gradient calculation: use the Sobel operator to obtain the gradients in the x and y directions of the reference image and calculate the composite gradient; Step 5: Gradient mask, use the mask created in step 2 to mask the gradient obtained in step 4 to retain the gradient information in the metal area; Step 6: Perspective transformation and mask positioning, input a new workpiece image, and position the reference mask on the new image through perspective transformation; Step 7: Gradient calculation of the new image. Repeat steps 3 and 4 for the new image to obtain the gradient map of the new image. Step 8: Gradient map difference calculation, calculating the difference between the reference image gradient map and the new image gradient map; Step 9: Threshold setting and abnormal region extraction: Set a threshold to distinguish significant changes in gradient differences and extract regions with large gradient differences. Step 10: Marking and reporting of abnormal areas. Mark the abnormal areas extracted in step 9 on the new image and generate a detection report.

2. The method according to claim 1, characterized in that: The step 2 is specifically as follows: When creating the reference mask, the metal area is determined by image segmentation technology, and the threshold is automatically calculated using Otsu's method to convert the image into a binary image; For the existing noise or incoherent areas, morphological closing operations are applied to fill small holes, and opening operations are applied to remove small objects attached to the edge of the metal area to ensure that the mask accurately covers the metal area and does not include non-target areas.

3. The method according to claim 2, characterized in that: Step 3 is as follows: When selecting the standard deviation of the Gaussian filter, it should be determined based on the noise level and detail requirements of the image. When the standard deviation is 1.0, preliminary filtering is performed to remove high-frequency noise. The standard deviation is then adjusted to 1.5 or higher as needed for refinement to achieve a balance between smoothing and detail retention.

4. The method according to claim 3, characterized in that: Step 4 is as follows: When using the Sobel operator to calculate the gradient, the convolution kernel size is selected as 3x3 to maintain computational efficiency and accuracy of the results. The gradient magnitude of each pixel is calculated as the Euclidean norm of the gradient calculated by the Sobel operator in the x and y directions.

5. The method according to claim 4, characterized in that: Step 5 is as follows: When applying gradient masking, in addition to simple pixel-level masking operations, the gradient values ​​at the mask edges should be checked to ensure that there is no sudden loss of gradient information at the mask boundary, which is achieved by attenuating the gradient values ​​within a certain range outside the mask edge.

6. The method according to claim 5, characterized in that: Step 6 is as follows: In perspective transformation, feature point matching algorithms such as SIFT or ORB are used to identify and match feature points in the reference image and the new image, and these matching point pairs are used to calculate the perspective transformation matrix to ensure that the transformed mask is accurately aligned with the metal area of ​​the workpiece in the new image.

7. The method according to claim 6, characterized in that: Step 8 is as follows: When performing gradient map difference calculation, an efficient numerical method is used to calculate the difference between two gradient maps using the difference function in the image processing library. The difference result is quantified by calculating the absolute value or square difference of the difference image.

8. A crack detection system for automobile sheet metal parts, characterized by: The system comprises: A reference image selection module, the reference image selection module selects a high-definition image containing a metal area of ​​a workpiece as a reference image; A reference mask creation module, the reference mask creation module draws a mask, the mask accurately covers the metal area of ​​the workpiece in the reference image; A Gaussian filter processing module, which applies Gaussian filtering to the reference image and performs convolution using a Gaussian kernel to smooth the image and reduce noise; Gradient calculation module: The gradient calculation module uses the Sobel operator to obtain the gradients of the reference image in the x and y directions respectively, and calculates the composite gradient; Gradient mask module, the gradient mask module uses the created mask to perform mask operation on the obtained gradient to retain the gradient information in the metal area; Perspective transformation and mask positioning module,The perspective transformation and mask positioning module inputs a new workpiece image and positions the reference mask on the new image through perspective transformation; A new image gradient calculation module calculates the new image to obtain a gradient map of the new image; A gradient map difference calculation module, wherein the gradient map difference calculation module calculates the difference between the reference image gradient map and the new image gradient map; The threshold setting and abnormal region extraction module sets a threshold value for distinguishing significant changes in gradient differences and extracting regions with large gradient differences; The abnormal area marking and reporting module marks the extracted abnormal area on the new image and generates a detection report.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to claims 1-7.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method of claims 1-7 is implemented.

Citation Information

Patent Citations

  • Foreign matter detection method for generator stator core steel sheet stacking platform

    CN110189301A

  • Automated inspection for sheet parts of arbitrary shape from manufactured film

    CN112889087A

  • Surface defect detection method, device and equipment

    CN112991251A

  • Automobile mold plane crack detection method based on image processing

    CN113240667A

  • Image processing method and device, equipment, storage medium and computer program product

    CN117011658A

Cited By

  • Image rigid registration method and device

    CN120219449A

  • Engine cylinder body and cylinder cover surface abnormal defect detection method based on traditional algorithm

    CN120471903A