Die casting surface defect detection method, equipment and medium

By combining vision technology with eddy current flaw detection technology, high-definition cameras and impedance analysis are used to achieve comprehensive detection of die casting surfaces and evaluation of the degree of defect impact, solving the problem of single detection methods in the existing technology, and improving the comprehensiveness and accuracy of detection.

CN120539152AActive Publication Date: 2025-08-26HUAQI NEW ENERGY TECH (JIANGSU) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510580874.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-26
Estimated Expiration
2045-05-07

AI Technical Summary

Technical Problem

In the prior art, the surface defect detection method of die castings is single, and it is impossible to fully capture the defect and quantitatively identify the degree of impact of the defect, resulting in the inability to prioritize effective repair of defects.

Method used

Combining visual technology and eddy current flaw detection technology, the detection images of the die casting surface are collected through high-definition cameras, and the suspected defect areas are analyzed, and the defect areas are analyzed in combination with the real and imaginary parts of the impedance to evaluate the degree of impact of the defect areas.

Benefits of technology

The comprehensive inspection of the surface of die-casting is achieved, which can quantitatively identify the degree of impact of defects and prioritize repairs based on the area of ​​defects, improving the comprehensiveness and accuracy of inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120539152A_ABST
    Figure CN120539152A_ABST
Patent Text Reader

Abstract

The invention discloses a die casting surface defect detection method and device and a medium, relates to the technical field of die casting detection, and solves the problem that a current die casting surface detection method is single and cannot comprehensively capture die casting surface defects, and the method comprises the following steps: a high-definition camera collects a detection image of a die casting surface under a fixed condition; detecting and analyzing the detection image of the surface of the die casting, and analyzing to obtain a suspected defect area of the surface of the die casting; acquiring impedance imaginary parts corresponding to all real coordinates of the surface of the die casting, calculating an impedance real part, and analyzing the impedance real part and the impedance imaginary parts to obtain a defect area of the surface of the die casting; and evaluating the influence degree of the defect area according to the area of the defect area. According to the method, a visual technology and an eddy current flaw detection technology are combined to realize comprehensive detection of the surface defects of the die casting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of nondestructive testing, and in particular relates to a method, equipment and medium for detecting surface defects of die castings. Background Art

[0002] Surface defect detection for die-cast parts involves inspecting the surface of die-cast parts using various non-destructive testing techniques to identify and locate potential defects. During the production process, die-cast parts may develop surface defects such as cracks, pores, shrinkage cavities, depressions, and protrusions due to factors such as cooling, pressure, or material quality. These defects can affect product quality and performance. Common inspection methods include visual inspection, eddy current testing, ultrasonic testing, infrared thermal imaging, and X-ray testing. These methods can effectively identify surface defects, ensure that die-cast parts meet quality standards, and improve product reliability and safety.

[0003] When die-casting parts are produced through die-casting, raised or sunken defects may appear on the surface of the parts. Existing methods for inspecting the surface of die-cast parts rely on a single inspection method, which makes it impossible to fully detect defects on the surface of die-cast parts. Furthermore, traditional inspection methods cannot quantitatively identify the impact of defects, making it impossible to prioritize repairs. To this end, the present invention provides a method, equipment and medium for detecting surface defects of die castings. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, device and medium for detecting surface defects of die castings to solve the problems raised in the above background technology.

[0005] The technical problems to be solved by the present invention are: How to combine visual technology with eddy current flaw detection technology to detect defects on the surface of die castings.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions: A method for detecting surface defects of a die casting, the method comprising: Step S1, a high-definition camera collects a detection image of the die-casting surface under fixed conditions; Step S2, performing inspection and analysis on the inspection image of the die-casting surface to obtain suspected defect areas on the die-casting surface; Step S3, obtaining the imaginary impedance parts corresponding to all real coordinates of the die-casting surface, calculating the real impedance parts, analyzing the real impedance parts and the imaginary impedance parts, and obtaining the defect areas on the die-casting surface; Step S4: evaluating the impact of the defective region based on the area of ​​the defective region.

[0007] Furthermore, the step S1 includes the following sub-steps: Step S11, setting the illumination angle between the light source and the surface of the die casting to 90°, and setting the shooting angle between the high-definition camera and the surface of the die casting to 90°; Step S12, lowering the shooting angle between the high-definition camera and the surface of the die-casting at a fixed angle, and synchronously lowering the illumination angle between the light source and the surface of the die-casting, while capturing a detection image of the surface of the die-casting each time the shooting angle and illumination angle are lowered, until the shooting angle is lowered to 0° and the shooting stops; Step S13: Adjust the illumination angle between the light source and the surface of the die-casting to 90°, adjust the shooting angle between the high-definition camera and the surface of the die-casting to 90°, and increase the shooting angle at a fixed angle. At the same time, the illumination angle between the light source and the surface of the die-casting is increased synchronously. At the same time, capture the detection image of the die-casting surface after each increase in the shooting angle and illumination angle, and stop shooting when the shooting angle increases to 180°.

[0008] Furthermore, step S2 includes the following sub-steps: Step S21: construct a two-dimensional coordinate system for the die-casting surface, obtain the real coordinates corresponding to the real coordinate points on the die-casting surface and the pixel coordinates (xi, yi) of all pixels in the detection image, as well as the corresponding RGB values, where i is the pixel number, i=1, 2, ..., n, and n is the maximum value of the pixel. The pixel coordinates are matched one by one with the real coordinates, and the pixel values ​​of all pixels in the detection image are converted into grayscale values ​​HDZ (xi, yi) using the grayscale formula, and then a grayscale detection image of the die-casting surface is constructed. The formula is as follows: HDZ(xi,yi)=0.3R(xi,yi)+0.59G(xi,yi)+0.11B(xi,yi); Step S22: merge the grayscale values ​​of the same pixel in all grayscale detection images to obtain a grayscale value sequence HDZ j (xi,yi)=[HDZ1(xi,yi),HDZ2(xi,yi),…,HDZ j (xi, yi)], j is the number of the grayscale detection image, j = 1, 2, ..., m, m is the maximum number of grayscale detection images; Step S23, traverse the grayscale values ​​of the pixels in any grayscale detection image to obtain the maximum grayscale value HDZ of the pixels in the corresponding grayscale detection image jmax and minimum grayscale value HDZ jmin , and then calculate the normalized grayscale value GYZ of all pixels in the grayscale detection image through the normalization formula j(xi, yi), and obtain the normalized image of the die casting surface. The formula is as follows: GYZ j (xi,yi)=[HDZ j (xi, yi)-HDZ jmin ] / [HDZ jmax -HDZ jmin ]; Step S24: Obtain the normalized grayscale value GYZ of any pixel in the current normalized image. j (xi, yi), and at the same time obtain the normalized grayscale value GYZ of the corresponding pixel of the previous normalized image j-1 (xi, yi) and the normalized grayscale value GYZ of the corresponding pixel in the next normalized image j+1 (xi, yi), the smooth gray value PHH of any pixel in the current normalized image is calculated by the median filter formula j (xi, yi), the formula is as follows: PHH j (xi,yi)=median[GYZ j-1 (xi, yi), GYZ j (xi, yi), GYZ j+1 (xi, yi)]; Step S25: Calculate the average brightness value LDJ of any pixel using the formula j (xi, yi) and brightness standard deviation BZC j (xi, yi), the brightness mean formula is as follows: ; The formula for brightness standard deviation is as follows: ; In step S26, if the brightness standard deviation is less than or equal to the defect threshold, no operation is performed; if the brightness standard deviation is greater than the defect threshold, the corresponding pixel point is determined to be a suspected defect point and the process proceeds to the next step.

[0009] Furthermore, the step S2 further includes the following sub-steps: Step S27: traverse the smoothed grayscale values ​​of the suspected defect points to obtain the maximum smoothed grayscale value, the minimum smoothed grayscale value and the median smoothed grayscale value, and calculate the grayscale difference HDC of the smoothed grayscale value by the summation and average formula. j (xi, yi), the formula is as follows: ; The median smooth gray value is specifically the median of the smooth gray values; Step S28: Set the corresponding convexity determination standard for determining convex defects on the die casting surface, and perform defect detection on the die casting surface according to the convexity determination standard. The convexity determination standard is as follows: When the maximum smoothed grayscale value of any suspected defect point is greater than or equal to the first maximum smoothed grayscale value, or the result of subtracting the maximum smoothed grayscale value from the median smoothed grayscale value is greater than or equal to the brightness offset threshold, or the grayscale difference of the smoothed grayscale values ​​is greater than or equal to the grayscale difference threshold, and two or more judgment conditions are met, the corresponding suspected defect point is determined to be a convex defect and the convex defect is repaired; if only one condition is met or none of them are met, step S3 is entered; Step S29: Set a corresponding depression determination standard for determining the depression defect on the die casting surface, and perform defect detection on the die casting surface according to the depression determination standard. The specific depression determination standard is as follows: When the brightness mean of any suspected defect point is less than or equal to the brightness threshold, or the maximum smooth grayscale value is less than or equal to the second maximum smooth grayscale value, or the median smooth grayscale value is less than or equal to the median smooth grayscale threshold and the brightness standard deviation is greater than or equal to the brightness standard deviation threshold, and two or more judgment conditions are met, the corresponding suspected defect point is determined to be a concave defect, and the concave defect is repaired; when only one condition is met or none of them are met, step S3 is entered.

[0010] Furthermore, step S3 includes the following sub-steps: Step S31, obtaining the real and imaginary impedance parts of all non-suspected defect points, and then averaging the real impedance parts of all non-suspected defect points to obtain an average real impedance part, and averaging the imaginary impedance parts of all non-suspected defect points to obtain an average imaginary impedance part; Step S32: subtract the real part of the impedance of all suspected defect points from the average real part of the impedance to obtain the real part change of the impedance of the corresponding suspected defect point, and subtract the imaginary part of the impedance of all suspected defect points from the average imaginary part of the impedance to obtain the imaginary part change of the impedance of the corresponding suspected defect point; Step S33: If the real part of the impedance change is greater than the real part of the impedance threshold, or the imaginary part of the impedance change is greater than the imaginary part of the impedance threshold, the corresponding suspected defect point is a defect point, and the process proceeds to the next step; If the real part of the impedance change is less than or equal to the real part of the impedance threshold, and the imaginary part of the impedance change is less than or equal to the imaginary part of the impedance threshold, the corresponding suspected defect point is not a defect point and no operation is performed.

[0011] Furthermore, the step S3 further includes the following sub-steps: Step S34: when any real coordinate point on the die-casting surface is not a defect point, the corresponding real coordinate point is recorded as 1; when any real coordinate point on the die-casting surface is a defect point, the corresponding real coordinate point is recorded as 0, and then a binary image of the die-casting surface is constructed; Step S35: merging adjacent defect points to construct a defect area; Step S36: Obtain the number of defect points in all defect areas, and use the number of defect points as the defect area of ​​the defect area.

[0012] Furthermore, the construction process of the defect area is: By connecting eight neighborhoods, it is detected whether there are defect points among the eight real coordinate points adjacent to any central real coordinate point. If there is a real coordinate point that is a defect point, the corresponding real coordinate point and the central real coordinate point are merged and recorded as a defect area; if there is no real coordinate point that is a defect point, no operation is performed.

[0013] Furthermore, step S4 includes the following sub-steps: Step S41: When the area of ​​the defective region falls within the first area range, the impact of the corresponding defective region is determined to be a severe defect, and the processing priority of the corresponding defective region is set to a high priority for processing; Step S42: When the area of ​​the defective region falls within the second area interval, the impact of the corresponding defective region is determined to be a medium defect, and the processing priority of the corresponding defective region is set to medium priority for processing; Step S43: When the area of ​​the defective region falls within the third area interval, the impact of the corresponding defective region is determined to be a mild defect, and the processing priority of the corresponding defective region is set to a low priority for processing; The endpoint value of the first area interval is greater than the endpoint value of the second area interval, and the endpoint value of the second area interval is greater than the endpoint value of the third area interval.

[0014] According to a second aspect, a computer device is provided, comprising: a memory storing a computer program; A processor is communicatively connected to the memory, and when the computer program is executed by the processor, the die casting surface defect detection method is implemented.

[0015] In a third aspect, a computer-readable storage medium stores a computer program thereon, wherein the program implements the die-casting surface defect detection method when executed by a processor.

[0016] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: The present invention uses a high-definition camera to collect detection images of the die-casting surface under fixed conditions, and then detects and analyzes the detection images of the die-casting surface, thereby analyzing and obtaining suspected defect areas on the die-casting surface. On the other hand, the imaginary impedance part corresponding to all real coordinates of the die-casting surface is obtained at the same time, and the real impedance part is calculated. The real impedance part and the imaginary impedance part are analyzed to obtain the defect area on the die-casting surface. Finally, the impact of the defect area is evaluated based on the area of ​​the defect area. The present invention combines visual technology with eddy current flaw detection technology to achieve comprehensive detection of surface defects of die-castings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0018] Figure 1 is a flow chart of the method of the present invention; Figure 2 A front view of a detection image of a die casting surface collected in the present invention; Figure 3 is an example diagram of the defect area in the present invention; Figure 4 It is a structural diagram of the computer device in the present invention. DETAILED DESCRIPTION

[0019] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0020] Example 1: Please refer to Figure 1-Figure 3 As shown, the technical solution provided by the present invention is: a method for detecting surface defects of die castings, the method is specifically as follows: Step S1, such as Figure 2 As shown, the high-definition camera collects the inspection image of the die casting surface under fixed conditions; The acquisition device is a high-definition camera, which captures the inspection image of the die-casting surface. When the shooting angle between the high-definition camera and the die-casting surface is reduced, the illumination angle between the light source and the die-casting surface is synchronously reduced. In this embodiment, step S1 includes the following sub-steps: Step S11, setting the illumination angle between the light source and the surface of the die casting to 90°, and setting the shooting angle between the high-definition camera and the surface of the die casting to 90°; Step S12, lowering the shooting angle between the high-definition camera and the surface of the die-casting at a fixed angle, and synchronously lowering the illumination angle between the light source and the surface of the die-casting, while capturing a detection image of the surface of the die-casting each time the shooting angle and illumination angle are lowered, until the shooting angle is lowered to 0° and the shooting stops; Step S13: Adjust the illumination angle between the light source and the surface of the die-casting to 90°, adjust the shooting angle between the high-definition camera and the surface of the die-casting to 90°, and increase the shooting angle at a fixed angle. At the same time, the illumination angle between the light source and the surface of the die-casting is increased synchronously. At the same time, capture the detection image of the die-casting surface after each increase in the shooting angle and illumination angle, and stop shooting when the shooting angle increases to 180°.

[0021] Step S2, performing inspection and analysis on the inspection image of the die-casting surface to obtain suspected defect areas on the die-casting surface; In this embodiment, step S2 includes the following sub-steps: Step S21: construct a two-dimensional coordinate system for the die-casting surface, obtain the real coordinates corresponding to the real coordinate points on the die-casting surface and the pixel coordinates (xi, yi) of all pixels in the detection image, as well as the corresponding RGB values, where i is the pixel number, i=1, 2, ..., n, and n is the maximum value of the pixel. The pixel coordinates are matched one by one with the real coordinates, and the pixel values ​​of all pixels in the detection image are converted into grayscale values ​​HDZ (xi, yi) using the grayscale formula, and then a grayscale detection image of the die-casting surface is constructed. The formula is as follows: HDZ(xi,yi)=0.3R(xi,yi)+0.59G(xi,yi)+0.11B(xi,yi); Step S22: merge the grayscale values ​​of the same pixel in all grayscale detection images to obtain a grayscale value sequence HDZ j (xi,yi)=[HDZ1(xi,yi),HDZ2(xi,yi),…,HDZ j (xi, yi)], j is the number of the grayscale detection image, j = 1, 2, ..., m, m is the maximum number of grayscale detection images; Step S23, traverse the grayscale values ​​of the pixels in any grayscale detection image to obtain the maximum grayscale value HDZ of the pixels in the corresponding grayscale detection image jmax and minimum grayscale value HDZ jmin , and then calculate the normalized grayscale value GYZ of all pixels in the grayscale detection image through the normalization formula j (xi, yi), and obtain the normalized image of the die casting surface. The formula is as follows: GYZ j (xi,yi)=[HDZj (xi, yi)-HDZ jmin ] / [HDZ jmax -HDZ jmin ]; Step S24: Obtain the normalized grayscale value GYZ of any pixel in the current normalized image. j (xi, yi), and at the same time obtain the normalized grayscale value GYZ of the corresponding pixel of the previous normalized image j-1 (xi, yi) and the normalized grayscale value GYZ of the corresponding pixel in the next normalized image j+1 (xi, yi), the smooth gray value PHH of any pixel in the current normalized image is calculated by the median filter formula j (xi, yi), the formula is as follows: PHH j (xi,yi)=median[GYZ j-1 (xi, yi), GYZ j (xi, yi), GYZ j+1 (xi, yi)]; Step S25: Calculate the average brightness value LDJ of any pixel using the formula j (xi, yi) and brightness standard deviation BZC j (xi, yi), the brightness mean formula is as follows: ; The formula for brightness standard deviation is as follows: ; Step S26: If the brightness standard deviation is less than or equal to the defect threshold, no operation is performed; if the brightness standard deviation is greater than the defect threshold, the corresponding pixel is determined to be a suspected defect point and the process proceeds to the next step; The defect threshold is specifically the 99th percentile brightness standard deviation in the distribution of brightness standard deviation as the defect threshold; Step S27: traverse the smoothed grayscale values ​​of the suspected defect points to obtain the maximum smoothed grayscale value, the minimum smoothed grayscale value and the median smoothed grayscale value, and calculate the grayscale difference HDC of the smoothed grayscale value by the summation and average formula. j (xi, yi), the formula is as follows: ; The median smooth gray value is specifically the median of the smooth gray values; Step S28: Set the corresponding convexity determination standard for determining convex defects on the die casting surface, and perform defect detection on the die casting surface according to the convexity determination standard. The convexity determination standard is as follows: When the maximum smoothed grayscale value of any suspected defect point is greater than or equal to the first maximum smoothed grayscale value, or the result of subtracting the maximum smoothed grayscale value from the median smoothed grayscale value is greater than or equal to the brightness offset threshold, or the grayscale difference of the smoothed grayscale values ​​is greater than or equal to the grayscale difference threshold, and two or more judgment conditions are met, the corresponding suspected defect point is determined to be a convex defect and the convex defect is repaired; if only one condition is met or none of them are met, step S3 is entered; Step S29: Set the corresponding depression determination standard for determining the depression defect on the surface of the die casting, and perform defect detection on the surface of the die casting according to the depression determination standard. The specific depression determination standard is as follows: When the brightness mean of any suspected defect point is less than or equal to the brightness threshold, or the maximum smooth grayscale value is less than or equal to the second maximum smooth grayscale value, or the median smooth grayscale value is less than or equal to the median smooth grayscale threshold and the brightness standard deviation is greater than or equal to the brightness standard deviation threshold, and two or more judgment conditions are met, the corresponding suspected defect point is determined to be a concave defect, and the concave defect is repaired; when only one condition is met or none of them are met, step S3 is entered.

[0022] Step S3, obtaining the imaginary impedance parts corresponding to all real coordinates of the die-casting surface, calculating the real impedance parts, analyzing the real impedance parts and the imaginary impedance parts, and obtaining the defect areas on the die-casting surface; Among them, an alternating magnetic field is generated by applying an alternating current to the probe coil, which causes eddy currents to be generated in the die casting. The eddy currents generate reaction impedance inside and on the surface of the die casting, and the imaginary part of the impedance is detected by the sensor; the real part of the impedance is directly obtained by the sensor; Specifically, the total impedance is obtained by the formula Z=R+kX, where R is the real part of the impedance, X is the imaginary part of the impedance, both in ohms, and k is the unit of the imaginary part of the impedance in complex numbers; the real part of the impedance is specifically the actual energy loss value when the electrical energy in the circuit is converted into heat energy; the imaginary part of the impedance is specifically the value of energy storage and release in the circuit, and the size of the imaginary part of the impedance is related to the frequency and changes with the frequency of the alternating current; In this embodiment, step S3 includes the following sub-steps: Step S31, obtaining the real and imaginary impedance parts of all non-suspected defect points, and then averaging the real impedance parts of all non-suspected defect points to obtain an average real impedance part, and averaging the imaginary impedance parts of all non-suspected defect points to obtain an average imaginary impedance part; Step S32: subtract the real part of the impedance of all suspected defect points from the average real part of the impedance to obtain the real part change of the impedance of the corresponding suspected defect point, and subtract the imaginary part of the impedance of all suspected defect points from the average imaginary part of the impedance to obtain the imaginary part change of the impedance of the corresponding suspected defect point; Step S33: If the real part of the impedance change is greater than the real part of the impedance threshold, or the imaginary part of the impedance change is greater than the imaginary part of the impedance threshold, the corresponding suspected defect point is a defect point, and the process proceeds to the next step; If the change in the real part of the impedance is less than or equal to the real part threshold of the impedance, and the change in the imaginary part of the impedance is less than or equal to the imaginary part threshold of the impedance, the corresponding suspected defect point is not a defect point and no operation is performed; Step S34: when any real coordinate point on the die-casting surface is not a defect point, the corresponding real coordinate point is recorded as 1; when any real coordinate point on the die-casting surface is a defect point, the corresponding real coordinate point is recorded as 0, and then a binary image of the die-casting surface is constructed; Step S35, as Figure 3 As shown, adjacent defect points are merged to construct a defect area; Specifically, by connecting eight neighborhoods, detect whether there are defect points in the eight adjacent real coordinate points of any central real coordinate point. If there is a real coordinate point that is a defect point, the corresponding real coordinate point and the central real coordinate point are merged and recorded as a defect area; if there is no real coordinate point that is a defect point, no operation is performed; Step S36: Obtain the number of defect points in all defect areas, and use the number of defect points as the defect area of ​​the defect area.

[0023] Step S4, evaluating the impact of the defective area based on the area of ​​the defective area; In this embodiment, step S4 includes the following sub-steps: Step S41: When the area of ​​the defective region falls within the first area range, the impact of the corresponding defective region is determined to be a severe defect, and the processing priority of the corresponding defective region is set to a high priority for processing; Step S42: When the area of ​​the defective region falls within the second area interval, the impact of the corresponding defective region is determined to be a medium defect, and the processing priority of the corresponding defective region is set to medium priority for processing; Step S43: When the area of ​​the defective region falls within the third area interval, the impact of the corresponding defective region is determined to be a mild defect, and the processing priority of the corresponding defective region is set to a low priority for processing; The endpoint value of the first area interval is greater than the endpoint value of the second area interval, and the endpoint value of the second area interval is greater than the endpoint value of the third area interval.

[0024] In this application, if a corresponding calculation formula appears, the above calculation formula is dimensionless and its numerical calculation is performed. The weight coefficient, proportional coefficient and other coefficients in the formula are set to a result value obtained by quantifying each parameter. Regarding the size of the weight coefficient and the proportional coefficient, as long as it does not affect the proportional relationship between the parameter and the result value, it is acceptable.

[0025] Example 2: Figure 4 The following is a schematic diagram of the structure of a computer device, such as Figure 4 As shown, the computer device may include: a processor, a communications interface, a memory, and a communications bus, wherein the processor, the communications interface, and the memory communicate with each other via the communications bus. The processor may call logic instructions in the memory to execute a method for detecting surface defects of die-castings, the method comprising: using a high-definition camera to capture inspection images of the die-casting surface under fixed conditions; performing inspection and analysis on the inspection images of the die-casting surface to obtain suspected defect areas on the die-casting surface; obtaining the imaginary impedance parts corresponding to all real coordinates of the die-casting surface, calculating the real impedance parts, analyzing the real and imaginary impedance parts to obtain defect areas on the die-casting surface; and assessing the impact of the defect areas based on the area of ​​the defect areas.

[0026] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0027] Example 3: The present application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute a die-casting surface defect detection method provided by the above methods, the method including: a high-definition camera collects a detection image of the die-casting surface under fixed conditions; the detection image of the die-casting surface is detected and analyzed to obtain a suspected defect area on the die-casting surface; the imaginary part of the impedance corresponding to all real coordinates of the die-casting surface is obtained, and the real part of the impedance is calculated, and the real part of the impedance is analyzed to obtain the defect area on the die-casting surface; and the degree of influence of the defect area is evaluated based on the area of ​​the defect area.

[0028] Embodiment 4: The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute a method for detecting surface defects of die-castings provided above, the method comprising: using a high-definition camera to capture a detection image of the surface of the die-casting under fixed conditions; performing detection and analysis on the detection image of the surface of the die-casting, and obtaining a suspected defect area on the surface of the die-casting; obtaining the imaginary part of the impedance corresponding to all real coordinates of the surface of the die-casting, and calculating the real part of the impedance, analyzing the real part and the imaginary part of the impedance, and obtaining a defect area on the surface of the die-casting; and evaluating the degree of influence of the defect area based on the area of ​​the defect area.

[0029] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0030] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. Step S1: A high-definition camera captures inspection images of the die-casting surface under fixed conditions; Step S2, performing inspection and analysis on the inspection image of the die-casting surface to obtain suspected defect areas on the die-casting surface; Step S3, obtaining the imaginary impedance parts corresponding to all real coordinates of the die-casting surface, calculating the real impedance parts, analyzing the real and imaginary impedance parts, and obtaining defect areas on the die-casting surface; Step S4: evaluating the impact of the defective region based on the area of ​​the defective region.

2. A method for detecting surface defects of die castings according to claim 1, characterized in that: The step S1 includes the following sub-steps: Step S11, setting the illumination angle between the light source and the surface of the die casting to 90°, and setting the shooting angle between the high-definition camera and the surface of the die casting to 90°; Step S12, lowering the shooting angle between the high-definition camera and the surface of the die-casting at a fixed angle, and synchronously lowering the illumination angle between the light source and the surface of the die-casting, while capturing a detection image of the surface of the die-casting each time the shooting angle and illumination angle are lowered, until the shooting angle is lowered to 0° and the shooting stops; Step S13: Adjust the illumination angle between the light source and the surface of the die-casting to 90°, adjust the shooting angle between the high-definition camera and the surface of the die-casting to 90°, and increase the shooting angle at a fixed angle. At the same time, the illumination angle between the light source and the surface of the die-casting is increased synchronously. At the same time, capture the detection image of the die-casting surface after each increase in the shooting angle and illumination angle, and stop shooting when the shooting angle increases to 180°.

3. A method for detecting surface defects of die castings according to claim 2, characterized in that: The step S2 includes the following sub-steps: Step S21: construct a two-dimensional coordinate system for the die-casting surface, obtain the real coordinates corresponding to the real coordinate points on the die-casting surface and the pixel coordinates (xi, yi) of all pixels in the detection image, as well as the corresponding RGB values, where i is the pixel number, i=1, 2, ..., n, and n is the maximum value of the pixel. The pixel coordinates are matched one by one with the real coordinates, and the pixel values ​​of all pixels in the detection image are converted into grayscale values ​​HDZ (xi, yi) using the grayscale formula, and then a grayscale detection image of the die-casting surface is constructed. The formula is as follows: HDZ(xi,yi)=0.3R(xi,yi)+0.59G(xi,yi)+0.11B(xi,yi); Step S22: merge the grayscale values ​​of the same pixel in all grayscale detection images to obtain a grayscale value sequence HDZ j (xi,yi)=[HDZ1(xi,yi),HDZ2(xi,yi),…,HDZ j (xi, yi)], j is the number of the grayscale detection image, j = 1, 2, ..., m, m is the maximum number of grayscale detection images; Step S23, traverse the grayscale values ​​of the pixels in any grayscale detection image to obtain the maximum grayscale value HDZ of the pixels in the corresponding grayscale detection image jmax and minimum grayscale value HDZ jmin , and then calculate the normalized grayscale value GYZ of all pixels in the grayscale detection image through the normalization formula j (xi, yi), and obtain the normalized image of the die casting surface. The formula is as follows: GYZ j (xi,yi)=[HDZ j (xi, yi)-HDZ jmin ] / [HDZ jmax -HDZ jmin ]; Step S24: Obtain the normalized grayscale value GYZ of any pixel in the current normalized image. j (xi, yi), and at the same time obtain the normalized grayscale value GYZ of the corresponding pixel of the previous normalized image j-1 (xi, yi) and the normalized grayscale value GYZ of the corresponding pixel in the next normalized image j+1 (xi, yi), the smooth gray value PHH of any pixel in the current normalized image is calculated by the median filter formula j (xi, yi), the formula is as follows: PHH j (xi,yi)=median[GYZ j-1 (xi, yi), GYZ j (xi, yi), GYZ j+1 (xi, yi)]; Step S25: Calculate the average brightness value LDJ of any pixel using the formula j (xi, yi) and brightness standard deviation BZC j (xi, yi), the brightness mean formula is as follows: ; The formula for brightness standard deviation is as follows: ; In step S26, if the brightness standard deviation is less than or equal to the defect threshold, no operation is performed; if the brightness standard deviation is greater than the defect threshold, the corresponding pixel point is determined to be a suspected defect point and the process proceeds to the next step.

4. A method for detecting surface defects of die castings according to claim 3, characterized in that: The step S2 further includes the following sub-steps: Step S27: traverse the smoothed grayscale values ​​of the suspected defect points to obtain the maximum smoothed grayscale value, the minimum smoothed grayscale value and the median smoothed grayscale value, and calculate the grayscale difference HDC of the smoothed grayscale value by the summation and average formula. j (xi, yi), the formula is as follows: ; The median smooth gray value is specifically the median of the smooth gray values; Step S28: Set the corresponding convexity determination standard for determining convex defects on the die casting surface, and perform defect detection on the die casting surface according to the convexity determination standard. The convexity determination standard is as follows: When the maximum smoothed grayscale value of any suspected defect point is greater than or equal to the first maximum smoothed grayscale value, or the result of subtracting the maximum smoothed grayscale value from the median smoothed grayscale value is greater than or equal to the brightness offset threshold, or the grayscale difference of the smoothed grayscale values ​​is greater than or equal to the grayscale difference threshold, and two or more judgment conditions are met, the corresponding suspected defect point is determined to be a convex defect and the convex defect is repaired; if only one condition is met or none of them are met, step S3 is entered; Step S29: Set a corresponding depression determination standard for determining the depression defect on the die casting surface, and perform defect detection on the die casting surface according to the depression determination standard. The specific depression determination standard is as follows: When the brightness mean of any suspected defect point is less than or equal to the brightness threshold, or the maximum smooth grayscale value is less than or equal to the second maximum smooth grayscale value, or the median smooth grayscale value is less than or equal to the median smooth grayscale threshold and the brightness standard deviation is greater than or equal to the brightness standard deviation threshold, and two or more judgment conditions are met, the corresponding suspected defect point is determined to be a concave defect, and the concave defect is repaired; when only one condition is met or none of them are met, step S3 is entered.

5. The method for detecting surface defects of die castings according to claim 4, characterized in that: The step S3 includes the following sub-steps: Step S31, obtaining the real and imaginary impedance parts of all non-suspected defect points, and then averaging the real impedance parts of all non-suspected defect points to obtain an average real impedance part, and averaging the imaginary impedance parts of all non-suspected defect points to obtain an average imaginary impedance part; Step S32: subtract the real part of the impedance of all suspected defect points from the average real part of the impedance to obtain the real part change of the impedance of the corresponding suspected defect point, and subtract the imaginary part of the impedance of all suspected defect points from the average imaginary part of the impedance to obtain the imaginary part change of the impedance of the corresponding suspected defect point; Step S33: If the real part of the impedance change is greater than the real part of the impedance threshold, or the imaginary part of the impedance change is greater than the imaginary part of the impedance threshold, the corresponding suspected defect point is a defect point, and the process proceeds to the next step; If the real part of the impedance change is less than or equal to the real part of the impedance threshold, and the imaginary part of the impedance change is less than or equal to the imaginary part of the impedance threshold, the corresponding suspected defect point is not a defect point and no operation is performed.

6. A method for detecting surface defects of die castings according to claim 5, characterized in that: The step S3 further includes the following sub-steps: Step S34: when any real coordinate point on the die-casting surface is not a defect point, the corresponding real coordinate point is recorded as 1; when any real coordinate point on the die-casting surface is a defect point, the corresponding real coordinate point is recorded as 0, and then a binary image of the die-casting surface is constructed; Step S35: merging adjacent defect points to construct a defect area; Step S36: Obtain the number of defect points in all defect areas, and use the number of defect points as the defect area of ​​the defect area.

7. A method for detecting surface defects of die castings according to claim 6, characterized in that: The construction process of the defect area is: By connecting eight neighborhoods, detect whether there are defect points in the eight adjacent real coordinate points of any central real coordinate point. If there is a real coordinate point that is a defect point, the corresponding real coordinate point and the central real coordinate point are merged and recorded as a defect area; If there is no real coordinate point as a defect point, no operation will be performed.

8. The method for detecting surface defects of die castings according to claim 7, characterized in that: The step S4 includes the following sub-steps: Step S41: When the area of ​​the defective region falls within the first area range, the impact of the corresponding defective region is determined to be a severe defect, and the processing priority of the corresponding defective region is set to a high priority for processing; Step S42: When the area of ​​the defective region falls within the second area interval, the impact of the corresponding defective region is determined to be a medium defect, and the processing priority of the corresponding defective region is set to medium priority for processing; Step S43: When the area of ​​the defective region falls within the third area interval, the impact of the corresponding defective region is determined to be a mild defect, and the processing priority of the corresponding defective region is set to a low priority for processing; The endpoint value of the first area interval is greater than the endpoint value of the second area interval, and the endpoint value of the second area interval is greater than the endpoint value of the third area interval.

9. A computer device, characterized in that: The computer device comprises: a memory storing a computer program; A processor is communicatively connected to the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Galvanized strip steel surface quality detection system based on vision and vortex

    CN119198777A

  • Eddy current defect detection method based on multi-direction scanning, electronic equipment and readable storage medium

    CN119322110A

  • Photovoltaic panel surface defect detection method and system based on physical property analysis

    CN120404847A

  • Manufacturing method of plated wire rod and manufacturing apparatus of plated wire rod

    US20210193350A1

  • Image defect determining method and apparatus, and electronic device and storage medium

    WO2021146935A1