Automobile part quality visual detection method and system

By using multi-angle image processing and crack growth characteristic screening, the precise separation of turbocharger housing cracks from natural edges was achieved, solving the problem of misidentification in visual inspection and improving inspection efficiency and product quality.

CN120563446BActive Publication Date: 2026-05-19XIXIA ZHONGDE AUTOMOBILE PART CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIXIA ZHONGDE AUTOMOBILE PART CO LTD
Filing Date
2025-05-22
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing visual inspection technologies struggle to effectively distinguish between cracks and natural edges on turbocharger housings, leading to misidentification and quality assessment biases.

Method used

By acquiring multi-angle images and performing preprocessing, edge detection algorithms are used to extract edges. Crack growth characteristics are combined for screening, including curvature and gradient changes. Uniqueness evaluation values ​​and topological feature evaluation values ​​are calculated, mixed edges are segmented, and cracks and natural edges are accurately separated. Color marking is performed based on feature scores.

Benefits of technology

It improves crack recognition efficiency, avoids edge misjudgment, and ensures product quality and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120563446B_ABST
    Figure CN120563446B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image data processing, in particular to a quality visual detection method and system for automobile parts, which comprises the following steps: acquiring multiple original images of a target object; respectively pre-processing each original image to obtain multiple target images; respectively performing edge extraction on each target image to obtain all edges of each target image; respectively performing crack growth characteristic screening and confirmation on each edge to obtain cracks corresponding to each target image, wherein the crack growth characteristics include curvature variation and gradient variation; respectively evaluating each crack to obtain a feature score of each crack; and performing color marking on the image at the position of each crack according to the feature score of the crack to obtain a marked image containing color marking. In the application, the curvature and gradient variation characteristics of crack growth are comprehensively considered for accurate identification, the identification efficiency is improved through the feature score and the marking, the quality evaluation deviation caused by edge misjudgment is reduced, and the product quality and safety are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data processing technology, and specifically to a visual inspection method and system for the quality of automotive parts. Background Technology

[0002] In the automotive manufacturing industry, the quality of automotive components directly affects the performance, safety, and reliability of the entire vehicle. The turbocharger housing is one of the key components of a car engine, and its surface quality directly impacts the turbocharger's performance and reliability. Due to material factors and casting processes, cracks may appear in the turbocharger housing, affecting its quality compliance.

[0003] Visual inspection technology, as a highly efficient, accurate, and non-contact automated inspection method, is well-suited to the requirements of large-scale production of modern automotive parts. By rapidly acquiring image information of parts and utilizing image processing algorithms and computer technology for analysis and judgment, it achieves rapid and accurate quality inspection of parts, thereby improving production efficiency, reducing defect rates, and enhancing product quality stability, providing strong technical support for the development of the automotive manufacturing industry. However, in existing visual inspection methods, because crack edges and natural edge edges both appear as abrupt changes in grayscale values ​​in images, cracks and natural edges of the shell are often identified as edges during edge detection. Furthermore, the portion where a crack connects to a natural edge is easily identified as the same continuous edge. This misidentification severely interferes with the accurate assessment of cracks. Therefore, there is an urgent need for a visual inspection method for automotive parts quality that can effectively overcome the above problems. Summary of the Invention

[0004] To address the aforementioned technical problems, the present invention aims to provide a visual inspection method and system for the quality of automotive parts.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Firstly, this application provides a visual inspection method for the quality of automotive parts. The method includes: acquiring multiple original images of a target object, each original image corresponding to a shooting angle; preprocessing each original image to obtain multiple target images; extracting edges from each target image to obtain all edges of each target image; screening and confirming crack growth characteristics of each edge to obtain cracks corresponding to each target image, the crack growth characteristics including curvature change and gradient change; evaluating each crack to obtain a feature score for each crack; and color-marking the image at the location of each crack according to its feature score to obtain a color-marked image.

[0006] In conjunction with the first aspect, in one possible implementation, crack growth characteristics are screened and confirmed for each edge to obtain the crack corresponding to each target image, including: performing a disorder evaluation on each edge based on the disorder of crack growth to obtain a uniqueness evaluation value corresponding to each edge; classifying each edge as a crack, mixed edge, or natural edge based on the uniqueness evaluation value corresponding to each edge; confirming the segmentation point based on the difference between the two sides of each mixed edge; segmenting based on the segmentation point of each mixed edge to obtain a segmentation result; and performing a disorder evaluation on each edge in the segmentation result and classifying it as a crack or a natural edge.

[0007] In conjunction with the first aspect, in one possible implementation, a disorder evaluation is performed on each edge based on the disorder of crack growth to obtain a uniqueness evaluation value corresponding to each edge. This includes: calculating the curvature and gradient of each pixel on the edge; calculating the standard deviation based on the curvature values ​​of all pixels to obtain the curvature standard deviation corresponding to the edge; calculating the gradient magnitude based on the gradient of all pixels and calculating the standard deviation to obtain the magnitude standard deviation corresponding to the edge; statistically analyzing the gradient direction of each edge pixel based on the gradient of all pixels and calculating the angle between the gradient directions of two adjacent pixels to obtain the angle difference; calculating the standard deviation based on all angle differences to obtain the angle standard deviation corresponding to the edge; and calculating the uniqueness evaluation value corresponding to the edge based on the curvature standard deviation, magnitude standard deviation, and angle standard deviation corresponding to the edge.

[0008] In conjunction with the first aspect, in one possible implementation, segmentation points are determined based on the differences between the two sides of each blending edge, including: calculating a topological feature evaluation value for each pixel based on the topological characteristics of each pixel on the blending edge; sequentially counting the widths of each pixel on the blending edge and its adjacent preset number of pixels to obtain a width set for each pixel, where the width is the number of pixels traversed by the target straight line segment, the target straight line segment being a straight line segment that passes through the pixel and is aligned with the gradient direction of the pixel, and the extended target straight line segment does not intersect the blending edge; calculating a width evaluation value for each pixel based on the standard deviation of the width set for each pixel; calculating a curvature evaluation value for each pixel based on the curvature changes of each pixel and its adjacent pixels; calculating a trend index for each pixel based on its topological feature evaluation value, width evaluation value, and curvature evaluation value; and determining a segmentation point based on the trend index for each pixel, where the trend index corresponding to the segmentation point is the maximum value.

[0009] In conjunction with the first aspect, in one possible implementation, the topological feature evaluation value of each pixel is calculated based on the topological characteristics of each pixel on the blending edge, including: counting the number of adjacent connected components of each pixel within the blending edge and the number of adjacent connected components of the blending edge to obtain the number of pixel connected components and the number of crack connected components; calculating the normal vector of each pixel within the blending edge; calculating the difference in normal vector angle between each pixel and its adjacent pixels, and summing them to obtain the normal difference; and calculating the topological feature evaluation value of each pixel based on the normal difference, the number of pixel connected components, and the number of crack connected components.

[0010] In conjunction with the first aspect, in one possible implementation, each crack is evaluated separately to obtain a feature score for each crack in each target image. This includes: calculating the width of each pixel and its standard deviation to obtain the standard deviation of the crack width, where the width is the number of pixels traversed by the target straight line segment, the target straight line segment being a straight line segment that passes through the pixel and is aligned with the gradient direction of the pixel, and the extended target straight line segment does not intersect the crack; calculating the edge chain code for each pixel and obtaining the average difference of the edge chain code for each pixel, where the average difference of the edge chain code is calculated by averaging the differences between the edge chain codes of a pixel and its adjacent pixels; and calculating the feature score based on the standard deviation of the crack width, the average difference of each pixel, and the crack width.

[0011] In conjunction with the first aspect, in one possible implementation, the preprocessing includes noise reduction, grayscale conversion, and sharpening.

[0012] Secondly, this application also provides a visual inspection system for automotive parts quality, comprising: an acquisition module for acquiring multiple original images of a target object, each original image corresponding to a shooting angle; a preprocessing module for preprocessing each original image to obtain multiple target images; an edge extraction module for extracting edges from each target image to obtain all edges of each target image; a filtering module for filtering and confirming crack growth characteristics of each edge to obtain cracks corresponding to each target image, the crack growth characteristics including curvature change and gradient change; a feature evaluation module for evaluating each crack to obtain a feature score for each crack; and a marking module for color-marking the image at the location of each crack according to its feature score to obtain a marked image with color marking.

[0013] In conjunction with the second aspect, in one possible implementation, the screening module includes: a disorder evaluation module, used to perform a disorder evaluation on each edge based on the disorder of crack growth, to obtain a uniformity evaluation value corresponding to each edge; a first classification module, used to classify each edge as a crack, a mixed edge, or a natural edge based on the uniformity evaluation value corresponding to each edge; a segmentation point confirmation module, used to confirm the segmentation point based on the difference between the two sides of each mixed edge; a segmentation module, used to segment each mixed edge based on the segmentation point, to obtain a segmentation result; and a second classification module, used to perform a disorder evaluation on each edge within the segmentation result and classify it as a crack or a natural edge.

[0014] In conjunction with the second aspect, in one possible implementation, the feature evaluation module includes: a first calculation module, used to count the width of each pixel and calculate the standard deviation to obtain the width standard deviation corresponding to the crack, wherein the width is the number of pixels passed through by the target straight line segment, the target straight line segment is a straight line segment that passes through the pixel and is in the same direction as the gradient of the pixel, and the extended target straight line segment does not intersect the crack; a second calculation module, used to calculate the edge chain code of each pixel respectively, and calculate the average difference of the edge chain code corresponding to each pixel, wherein the average difference of the edge chain code is calculated by averaging the differences between the edge chain codes of a pixel and its adjacent pixels; and a third calculation module, used to calculate the feature score based on the width standard deviation corresponding to the crack, the average difference of each pixel, and the width.

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

[0016] This invention identifies cracks by fully considering the curvature and gradient changes in crack growth. Based on the identified cracks, features are scored and marked, which effectively improves crack identification efficiency, avoids quality assessment deviations caused by edge misjudgment, and ensures product quality and safety. Attached Figure Description

[0017] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating a visual inspection method for automotive parts quality provided in Embodiment 1 of the present invention.

[0019] Figure 2 This is a schematic diagram of a turbocharger housing according to Embodiment 1 of the present invention;

[0020] Figure 3 This is a schematic diagram of a crack on the turbocharger housing according to Embodiment 1 of the present invention;

[0021] Figure 4 This is a flowchart illustrating step S4 provided in one embodiment 1 of the present invention;

[0022] Figure 5 This is a flowchart illustrating step S5 provided in one embodiment 1 of the present invention;

[0023] Figure 6 This is a schematic diagram of the automotive parts quality visual inspection system described in Embodiment 2 of the present invention;

[0024] Figure 7 This is a schematic diagram of the screening module structure described in Embodiment 2 of the present invention;

[0025] Figure 8 This is a schematic diagram of the feature evaluation module structure described in Embodiment 2 of the present invention. Detailed Implementation

[0026] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a visual inspection method and system for automotive parts quality proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0028] Example 1:

[0029] The specific scheme of the visual inspection method for automotive parts quality provided by the present invention will be described in detail below with reference to the accompanying drawings.

[0030] Please see Figure 1 The diagram illustrates a flowchart of a visual inspection method for automotive parts quality provided in an embodiment of the present invention. Specifically, the method includes steps S1-S6.

[0031] S1. Obtain multiple original images of the target object, each original image corresponding to a shooting angle.

[0032] This embodiment uses the turbocharger housing as an example from automotive components. The turbocharger housing is one of the key components of an automotive engine, undertaking the important functions of connecting the turbine and the engine and withstanding the impact of high-temperature, high-pressure exhaust gases. Figure 2 As shown. This embodiment is also applicable to other automotive parts, such as crankshafts, engine blocks, transmission gears, and brake discs. These parts are prone to defects such as microcracks and porosity during casting and machining. The surface quality of the turbocharger housing directly affects the turbocharger's airtightness, heat transfer efficiency, and mechanical reliability. Therefore, to comprehensively acquire housing images, this embodiment uses multiple angles to ensure that all parts of the turbocharger housing are fully presented, including a front view (including the exhaust inlet flange), a side view (showing the water-cooling channel interface), a 45° elevation view (capturing the internal blade structure), and macro photography of the sealing surface, combined with original images acquired using a 20-megapixel CMOS sensor and a ring-shaped LED shadowless light source.

[0033] S2. Each of the original images is preprocessed to obtain multiple target images.

[0034] Meanwhile, to reduce noise interference and highlight the detailed features of the turbocharger housing, this embodiment performs multi-stage preprocessing on the original image. First, Gaussian filtering is used for noise reduction to eliminate salt-and-pepper noise caused by uneven ambient lighting. Then, histogram equalization is used to enhance contrast, making the edge texture of the housing clearer and more discernible. Next, the color image is converted into a 256-level grayscale image, and a weighted average method is used to retain effective feature information. During this process, image sharpening is performed simultaneously, and the edge features of key parts are enhanced using the Laplacian operator.

[0035] S3. Perform edge extraction on each of the target images to obtain all the edges of each target image.

[0036] It should be noted that in this embodiment, the Sobel edge detection algorithm is used to extract all edges in the target image. The Sobel algorithm is a classic image processing algorithm that calculates the spatial first-order gradient of the image's grayscale values, performs planar convolution on the image using 3×3 kernels in both the horizontal and vertical directions, and finally extracts edge features by calculating the gradient magnitude. For those skilled in the art, besides the Sobel edge detection algorithm, other edge detection algorithms can also be used, such as the Canny edge detection algorithm (which achieves high-precision edge localization through non-maximum suppression and double threshold detection), the Prewitt edge detection algorithm (which is sensitive to noise due to center-point difference operations), and the Roberts edge detection algorithm (a lightweight algorithm based on cross-difference operations). Those skilled in the art can choose according to actual conditions such as image resolution, noise level, and real-time requirements; no specific limitations are made in this embodiment.

[0037] Furthermore, in this embodiment, considering the influence of material factors (such as alloy composition inhomogeneity and microstructure porosity) and casting processes (including mold design accuracy, pouring temperature control, cooling rate, etc.) on the turbocharger housing during production, cracks may form on the turbocharger housing. Cracks may originate at a stress concentration point, such as a casting defect or machining mark, and then extend radially or in a network pattern. During this extension, the direction may deflect due to the influence of local stress distribution, and the crack width is generally narrow, varying along its length. The cracks appear as irregular thin strips on the housing, often accompanied by bifurcations. The crack manifestation is as follows: Figure 3 As shown. Furthermore, due to the complex three-dimensional geometry of the turbocharger housing (including the intake volute, exhaust flange, bearing housing, and other multi-curved structures), its surface has natural edges. These edges are process features formed during the casting process of the housing, used to connect different curved surfaces (such as the transition area between the volute spiral surface and the flange plane) or to enhance the structural strength of the housing through reinforcing ribs. When cracks appear in the housing, because both the crack edge (the fracture surface of the metal matrix) and the natural edge edge (the casting parting line) appear as abrupt changes in grayscale values ​​in the digital image (areas with gradient values ​​> 50), when using edge detection algorithms such as Sobel, both cracks and natural edges are treated as edge detection results, especially in low-contrast areas (signal-to-noise ratio < 3:1), which can easily lead to misjudgments.

[0038] Therefore, in this embodiment, step S4 is also required to separate the crack from the natural edge.

[0039] S4. Crack growth characteristics are screened and confirmed for each edge to obtain the crack corresponding to each target image. The crack growth characteristics include curvature change and gradient change.

[0040] In this embodiment, considering that the curvature of natural edges is often constant or very small due to their regular geometric shape (straight line, arc) and regular casting texture (the curvature of a straight line is 0, and the curvature of an arc is a fixed value), the average curvature of the pixels corresponding to the natural edge is close to a fixed value and the standard deviation of curvature is small. In contrast, crack edges are irregular in shape, meandering, with large curvature variations, no fixed average curvature, and a typically large standard deviation of curvature. Furthermore, cracks generally appear on a certain surface. Therefore, in this embodiment, cracks and natural edges will be separated based on their irregular development characteristics and location. See details in [link to documentation]. Figure 4 It uses any image as an example to illustrate how to separate cracks and natural edges, specifically including steps S41-S43.

[0041] S41. Based on the disorder of crack growth, perform a disorder evaluation on each edge to obtain a uniqueness evaluation value corresponding to each edge.

[0042] Specifically, the disorder mentioned in this step refers to the irregular shape, tortuous direction, and large curvature variation of crack edges. In a grayscale image, the grayscale value abrupt changes at natural edges are relatively regular, their grayscale gradient amplitude is more stable, and their directional changes are also relatively regular, changing along the edge's direction. This indicates that the gradient direction between adjacent pixels exhibits a constant or linear variation. However, the grayscale gradient amplitude and directional changes at crack edges are more complex because the grayscale within a crack is non-uniform. Its amplitude standard deviation and directional change indicators often differ significantly from those of natural edges. Comparing these characteristics can help in the initial identification of crack edges. For details, please refer to steps S411-S417 on how to calculate the uniqueness evaluation value.

[0043] S411. Calculate the curvature and gradient of each pixel on the edge.

[0044] Regarding the gradient calculation mentioned in this step, it follows the standard Sobel or Prewitt operator implementation process, specifically including constructing a 3×3 convolution kernel for horizontal / vertical difference operations, gradient magnitude synthesis, and thresholding, which will not be elaborated in this embodiment. Meanwhile, the curvature of each pixel mentioned in this step can be obtained through the following steps: select the three adjacent pixels to the left and right of the pixel, for a total of seven pixels; then fit a quadratic curve to the seven pixels using the least squares method; finally, use the curvature of the fitted quadratic curve as the curvature value of the pixel. It should be noted that the number of adjacent pixels selected for curvature calculation can be flexibly adjusted according to requirements. This embodiment does not impose specific limitations on this.

[0045] S412. Calculate the standard deviation based on the curvature values ​​of all pixels to obtain the standard deviation of curvature corresponding to the edge.

[0046] S413. Calculate the gradient magnitude based on the gradient of all pixels and perform standard deviation calculation to obtain the magnitude standard deviation corresponding to the edge.

[0047] S414. Based on the gradient of all pixels, the gradient direction of each edge pixel is statistically analyzed, and the angle between the gradient directions of two adjacent pixels is calculated to obtain the angle difference.

[0048] S415. Calculate the standard deviation based on all angle differences to obtain the angle standard deviation corresponding to the edge.

[0049] S416. The uniqueness evaluation value corresponding to the edge is calculated based on the standard deviation of curvature, standard deviation of amplitude, and standard deviation of angle corresponding to the edge.

[0050] In this embodiment, the calculation function for the uniqueness evaluation value is as follows:

[0051]

[0052] Among them, P x This represents the uniqueness evaluation value corresponding to the x-th edge; exp() represents an exponential function with the natural constant e as the base. This represents the standard deviation of the curvature values ​​of all pixels on the x-th edge, i.e., the curvature standard deviation mentioned above. This represents the standard deviation of the gradient magnitude of all pixels on the x-th edge, i.e., the magnitude standard deviation mentioned above. The standard deviation of the angular difference in the gradient direction between two adjacent pixels on the x-th edge is the aforementioned angular standard deviation.

[0053] In the above calculation function, This represents the curvature change of the x-th edge. A larger value indicates that the edge exhibits an unstable and irregular geometric shape change; similarly, and It can represent the change state of the x-th edge in terms of gray value. The larger the value, the more likely the edge is to be a crack. It is the uneven gray value inside that leads to a large amplitude standard deviation and angle standard deviation.

[0054] S42. Classify each edge as a crack, mixed edge, or natural edge based on the uniqueness evaluation value corresponding to each edge.

[0055] Furthermore, in this embodiment, it is also considered that when a crack appears on a natural edge of the shell, the edges will intersect, so the crack and the natural edge may be judged as the same edge. Therefore, in this step, edges with a unity evaluation value less than or equal to 0.2 are judged as natural edges; edges with a unity evaluation value greater than 0.2 and a unity evaluation value less than or equal to 0.5 are judged as mixed edges; and edges with a unity evaluation value greater than 0.5 are judged as cracks.

[0056] Therefore, based on the above analysis results, in this embodiment, it is also necessary to find the dividing point in the mixed edge to accurately separate the crack and the natural edge, see steps S43-S45 for details.

[0057] S43. The segmentation point is determined based on the difference between the two sides of each mixed edge.

[0058] In this embodiment, it is considered that in the mixed edge, natural edges and cracks have the distinguishing feature of uniform width, and that the curvature and gradient of pixels may have a large variation trend on both sides of the dividing point. Furthermore, natural edges typically serve as boundaries between different faces or components of the shell, and the connected regions are usually well-defined and conform to the shell structure design, with a relatively fixed and stable number of connected regions. However, if a crack edge combines with a natural edge, it may disrupt this normal connectivity, connecting to some small connected regions that should not be connected, or causing an abnormal number of connected regions. Therefore, in this embodiment, the dividing point is determined based on the above analysis, as detailed in steps S431-S436, which calculates the dividing point of one of the mixed edges.

[0059] S431. Calculate the topological feature evaluation value of each pixel based on the topological characteristics of each pixel on the mixed edge.

[0060] As the analysis results above show, natural edges and cracks differ in width, curvature, gradient, and connected domains. Therefore, in this example, please refer to steps S4311-S4314.

[0061] S4311. Count the number of connected components adjacent to each pixel point within the mixed edge and the number of connected components adjacent to the mixed edge to obtain the number of pixel connected components and the number of crack connected components.

[0062] S4312. Calculate the normal vector of each pixel within the blended edge.

[0063] S4313. Calculate the difference in normal vector angle between each pixel and its adjacent pixels, and sum them to obtain the normal difference value.

[0064] It should be noted that the method for calculating the normal vector of each pixel in this step is existing technology and will not be described again in this step.

[0065] S4314. Calculate the topological feature evaluation value of each pixel based on the normal difference, the number of pixel connected components, and the number of crack connected components.

[0066] The calculation function for the topological feature evaluation value in this step is as follows:

[0067]

[0068] In the formula, Q y,i C represents the topological feature evaluation value of the i-th pixel on the y-th blending edge; y,i This represents the number of connected components adjacent to the i-th pixel on the y-th edge, i.e., the number of pixel connected components mentioned above; C y This represents the number of adjacent connected regions connected by the y-th mixed edge, i.e., the number of crack connected regions mentioned above; n y,i This represents the normal difference value corresponding to the i-th pixel on the y-th blending edge.

[0069] In the above calculation function, This indicates that the smaller the difference between the number of connected components connected to the i-th pixel on the y-th mixed edge and the total number of connections on the edge, the more likely the current pixel is to act as a natural edge, possessing the characteristic of separating connected components on both sides. Cracks, in essence, are fractures or defects on the material surface, and their geometric characteristics lead to discontinuities (abrupt changes) in the local surface normal direction. In contrast, the normal direction change of natural edges (such as shell seams and structural boundaries) is continuous and conforms to the design geometry. This can be achieved by analyzing the pixels at the intersection points. The change in the normal direction it represents can quantify the topological features of this pixel.

[0070] S432. Sequentially count the width of each pixel on the blending edge and the width of its adjacent preset number of pixels to obtain the width set of each pixel. The width is the number of pixels that the target line segment passes through. The target line segment is a line segment that passes through the pixel and is in the same direction as the gradient of the pixel. The target line segment does not intersect the blending edge after being extended.

[0071] S433. Calculate the standard deviation based on the width set of each pixel to obtain the width evaluation value corresponding to each pixel.

[0072] S434. Calculate the curvature evaluation value of each pixel based on the curvature change of each pixel and its adjacent pixels.

[0073] In this implementation, the curvature evaluation value can be obtained by fitting a preset number of adjacent pixels using the least squares method, resulting in multiple fitting residuals; the maximum value among the fitting residuals is extracted as the curvature evaluation value. This measures the significance of the curvature change at the segmentation point. Specifically, the preset number can be 6, distributed as three to the left and three to the right of the pixel, for a total of 7 pixels.

[0074] S435. Calculate the change trend index of each pixel based on the topological feature evaluation value, width evaluation value, and curvature evaluation value of each pixel.

[0075] The formula for calculating the trend indicator in this step is as follows:

[0076] W y,i =P y,i ×σ(w y,i )×Q y,i .

[0077] Among them, W y,i P represents the trend index of change of the i-th pixel on the y-th blending edge; y,i σ(w) represents the maximum value of the fitting residuals of the i-th pixel and its neighboring pixels on the y-th blending edge, i.e., the curvature evaluation value; y,i Q represents the width evaluation value corresponding to the i-th pixel on the y-th blending edge; y,i This represents the topological feature evaluation value of the i-th pixel on the y-th mixed edge.

[0078] In the above calculation function, P y,i The larger the value, the greater the difference in curvature values ​​between pixels at the i-th pixel location. This reflects the significance of the curvature change at the i-th pixel as a dividing point, and also indicates the standard deviation σ(w) of the pixel's edge width. y,i The larger the value of Q, the greater the range of variation in the edge width within that interval, indicating more unstable edge width and a stronger trend in the current pixel's change. Simultaneously, Q... y,i The topological feature evaluation value of the i-th pixel on the y-th mixed edge can reflect the degree to which the current pixel acts as a dividing point in the spatial structure. When the topological feature evaluation value is larger, the edges on both sides of the current pixel are more likely to be two different components, that is, the change trend index of the current pixel is larger.

[0079] In summary, for each blending edge, the above method effectively quantifies the trend index of each pixel on the blending edge. The trend index of each pixel reflects the degree of fluctuation of that pixel on its corresponding edge. A larger trend index indicates a more significant change relative to other pixels on either side of the edge, thus increasing the likelihood that the pixel is a segmentation point. Therefore, segmentation points can be determined based on the trend index.

[0080] S436. The segmentation point is determined based on the change trend index of each pixel, and the change trend index corresponding to the segmentation point is the maximum value.

[0081] S44. Segment according to the segmentation point of each of the mixed edges to obtain the segmentation result.

[0082] S45. Perform unordered evaluation on each edge in the segmentation result and classify it as a crack or a natural edge.

[0083] It should be noted that the disordered evaluation mentioned in this step refers to the method in step S41, and the classification refers to the method in step S42. These will not be elaborated upon further in this step.

[0084] S5. Evaluate each crack separately to obtain a characteristic score for each crack.

[0085] Through the above steps, all segmented edges are processed. Each edge consists of only one component. The edges of the cracks are irregular, and their direction may be curved or forked, with burrs, and their widths vary. Therefore, in this embodiment, the aim is to provide a quantitative basis for subsequent color labeling by measuring the feature score of each crack. Specifically, see [link to relevant documentation]. Figure 5 The figure shows that step S5 includes steps S51-S53.

[0086] S51. Calculate the standard deviation of the width of each pixel to obtain the standard deviation of the crack width. The width is the number of pixels that the target straight line segment passes through. The target straight line segment is a straight line segment that passes through the pixel and is in the same direction as the gradient of the pixel. The target straight line segment does not intersect the crack after being extended.

[0087] S52. Calculate the edge chain code for each pixel and calculate the average difference of the edge chain code for each pixel. The average difference of the edge chain code is calculated by averaging the differences between the edge chain codes of a pixel and its adjacent pixels.

[0088] S53. The feature score is calculated based on the standard deviation of the width corresponding to the crack, the average difference of each pixel, and the width.

[0089] The feature score calculation function in this step is as follows:

[0090]

[0091] In the formula, G a The characteristic score representing the a-th crack; σ(w a ) represents the standard deviation of the width corresponding to the a-th crack; w a,b Δl represents the width of the b-th pixel of the a-th edge; a,b Let n represent the average difference of the edge chain code corresponding to the b-th pixel of the a-th edge; a represents the total number of pixels in the a-th crack; norm represents the maximum-minimum normalization function.

[0092] In the above calculation formula, a larger standard deviation of the width of the a-th edge indicates significant width non-uniformity, consistent with crack growth characteristics. A larger width of all pixels and a larger average difference in the edge chain code of the a-th edge indicate a wider and more tortuous edge, reflecting more severe crack characteristics. Therefore, G obtained through the above calculation function... a The larger the size, the more severe the cracks.

[0093] S6. Mark the image of the location of each crack with color according to the feature score of each crack to obtain a marked image with color marking.

[0094] In this step, cracks are marked with different line thicknesses or colors based on the feature scores. The marking results are then overlaid on the raw image stream acquired by the industrial camera to obtain a marked image.

[0095] Specifically, in this step, cracks with different feature scores are marked using different line thicknesses and colors based on the size of the feature score. For example, there are three specifications for the line thickness (3px), medium (2px), and thin (1px), and three specifications for the color (red, orange, and green), for a total of nine levels. Then, the normalized feature score is divided into nine levels through eight dividing points, such as 0.125, 0.15, 0.175, 0.2, 0.25, 0.3, 0.35, and 0.4. Then, dual-channel marking is performed using color and line thickness. The color marking involves changing the color of the pixel where the crack is located and using a Gaussian blur algorithm to achieve an edge feathering effect. Simultaneously, a label legend box is generated on the marked image, displaying the crack location coordinates (XYZ values ​​based on the world coordinate system) and the feature score (retaining three decimal places) in real time. The above implementation is all implemented using the QCustomPlot component of the QT framework, and the interface display method will not be described in detail in this embodiment.

[0096] In this embodiment, the specific case of cracks intersecting with natural edges is considered during crack detection. The unique distinguishing features of mixed edges are utilized, including curvature, gradient, and connected components. Based on these features, the optimal segmentation point where the crack intersects with the natural edge can be accurately identified, and crack segmentation is performed accordingly. Furthermore, each crack is analyzed, and a corresponding feature score is assigned based on these features. Finally, based on the correspondence between feature scores and marker colors, cracks with different feature scores are appropriately marked. This method significantly improves crack recognition efficiency, effectively avoids quality assessment deviations caused by edge misjudgment, and thus ensures product quality and safety.

[0097] Example 2:

[0098] like Figure 6 As shown, this embodiment provides a visual inspection system for automotive parts quality, the system comprising:

[0099] The acquisition module is used to acquire multiple original images of the target object, each of which corresponds to a shooting angle.

[0100] The preprocessing module is used to preprocess each of the original images to obtain multiple target images.

[0101] An edge extraction module is used to extract edges from each of the target images to obtain all the edges of each target image.

[0102] The filtering module is used to filter and confirm the crack growth characteristics of each edge to obtain the crack corresponding to each target image. The crack growth characteristics include curvature change and gradient change.

[0103] The feature evaluation module is used to evaluate each crack separately and obtain a feature score for each crack.

[0104] A marking module is used to color-mark the image of the location of each crack according to the feature score of each crack, so as to obtain a marked image with color marking.

[0105] See Figure 7 The figure shows that the filtering module includes:

[0106] The disorder evaluation module is used to perform a disorder evaluation on each edge based on the disorder of crack growth, and obtain a uniqueness evaluation value corresponding to each edge.

[0107] The first classification module is used to classify each edge as a crack, mixed edge, or natural edge based on the uniqueness evaluation value corresponding to each edge.

[0108] The segmentation point confirmation module is used to confirm the segmentation point based on the difference between the two sides of each blending edge.

[0109] The segmentation module is used to segment the edges based on the segmentation points of each of the mixed edges to obtain the segmentation results.

[0110] The second classification module is used to perform unordered evaluation on each edge in the segmentation result and classify it as a crack or a natural edge.

[0111] See Figure 8 The figure shows that the feature evaluation module includes:

[0112] The first calculation module is used to count the width of each pixel and calculate the standard deviation to obtain the width standard deviation corresponding to the crack. The width is the number of pixels that the target straight line segment passes through. The target straight line segment is a straight line segment that passes through the pixel and is in the same line as the gradient direction of the pixel. The target straight line segment, after being extended, does not intersect with the crack.

[0113] The second calculation module is used to calculate the edge chain code of each pixel and calculate the average difference of the edge chain code corresponding to each pixel. The average difference of the edge chain code is calculated by averaging the differences between the edge chain codes of a pixel and its adjacent pixels.

[0114] The third calculation module is used to calculate the feature score based on the standard deviation of the crack width, the average difference of each pixel, and the width.

[0115] It should be noted that the specific methods by which each module performs operations in the system described in the above embodiments have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0116] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0117] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A visual inspection method for the quality of automotive parts, characterized in that, The method includes: Acquire multiple original images of the target object, each original image corresponding to a shooting angle; Each of the original images is preprocessed to obtain multiple target images; Edge extraction is performed on each of the target images to obtain all edges of each target image; Cracks corresponding to each target image are obtained by screening and confirming the crack growth characteristics of each edge, including: Based on the disorder of crack growth, each edge is evaluated for disorder, and a uniqueness evaluation value is obtained for each edge. Each edge is classified as a crack, mixed edge, or natural edge based on the uniqueness evaluation value corresponding to it. The segmentation points are determined based on the differences between the two sides of each blending edge, including: The number of connected components adjacent to each pixel within the blended edge and the number of connected components adjacent to the blended edge are counted to obtain the number of pixel connected components and the number of crack connected components. Calculate the normal vector of each pixel within the blended edge; Calculate the difference in normal vector angle between each pixel and its adjacent pixels, and sum them to obtain the normal difference value; The topological feature evaluation value of each pixel is calculated based on the normal difference, the number of pixel connected components, and the number of crack connected components. The width of each pixel on the blending edge and its adjacent preset number of pixels are counted sequentially to obtain the width set of each pixel. The width is the number of pixels that the target line segment passes through. The target line segment is a line segment that passes through the pixel and is in the same line as the gradient direction of the pixel. The target line segment does not intersect the blending edge after being extended. The standard deviation is calculated based on the width set of each pixel to obtain the width evaluation value corresponding to each pixel; The curvature evaluation value of each pixel is calculated based on the curvature change of each pixel and its adjacent pixels. The change trend index of each pixel is calculated based on the topological feature evaluation value, width evaluation value, and curvature evaluation value of each pixel. The segmentation point is determined based on the change trend index of each pixel, and the change trend index corresponding to the segmentation point is the maximum value. The segmentation is performed based on the segmentation points of each of the mixed edges to obtain the segmentation result; Each edge within the segmentation result is evaluated for disorder and classified as either a crack or a natural edge; the crack growth characteristics include curvature variation and gradient variation. Each crack was evaluated separately, and a characteristic score for each crack was obtained; Based on the feature score of each crack, the image of its location is color-coded to obtain a coded image.

2. The visual inspection method for automotive parts quality according to claim 1, characterized in that, Based on the disorder of crack growth, a disorder assessment is performed on each edge to obtain a uniqueness evaluation value corresponding to each edge, including: Calculate the curvature and gradient of each pixel on the edge; The standard deviation of curvature corresponding to the edge is obtained by calculating the standard deviation of curvature based on the curvature values ​​of all pixels. The gradient magnitude is calculated based on the gradient of all pixels, and the standard deviation is calculated to obtain the magnitude standard deviation corresponding to the edge. Based on the gradient of all pixels, the gradient direction of each edge pixel is statistically analyzed, and the angle difference between the gradient directions of two adjacent pixels is calculated. The standard deviation is calculated based on all angle differences to obtain the angle standard deviation corresponding to the edge. The uniqueness evaluation value corresponding to the edge is calculated based on the standard deviation of curvature, standard deviation of amplitude, and standard deviation of angle corresponding to the edge.

3. The visual inspection method for automotive parts quality according to claim 1, characterized in that, Each crack is evaluated individually to obtain a feature score for each crack within each target image, including: The width of each pixel is counted and the standard deviation is calculated to obtain the standard deviation of the crack width. The width is the number of pixels that the target straight line segment passes through. The target straight line segment is a straight line segment that passes through the pixel and is in the same line as the gradient direction of the pixel. The target straight line segment, when extended, does not intersect with the crack. The edge chain code of each pixel is calculated separately, and the average difference of the edge chain code corresponding to each pixel is calculated. The average difference of the edge chain code is calculated by averaging the differences between the edge chain codes of a pixel and its adjacent pixels. The feature score is calculated based on the standard deviation of the crack width, the average difference of each pixel, and the crack width.

4. The visual inspection method for automotive parts quality according to claim 1, characterized in that, The preprocessing includes noise reduction, grayscale conversion, and sharpening.

5. A visual inspection system for automotive parts quality, characterized in that, include: The acquisition module is used to acquire multiple original images of the target object, each of which corresponds to a shooting angle; The preprocessing module is used to preprocess each of the original images to obtain multiple target images; An edge extraction module is used to extract edges from each of the target images to obtain all edges of each target image; The filtering module is used to filter and confirm the crack growth characteristics of each edge to obtain the crack corresponding to each target image. The crack growth characteristics include curvature change and gradient change. The feature evaluation module is used to evaluate each crack separately and obtain a feature score for each crack; A marking module is used to color-mark the image of the location of each crack according to the feature score of each crack, so as to obtain a marked image with color marking; The filtering module includes: The disorder evaluation module is used to perform a disorder evaluation on each edge based on the disorder of crack growth, and obtain a uniqueness evaluation value corresponding to each edge. The first classification module is used to classify each edge as a crack, mixed edge, or natural edge based on the uniqueness evaluation value corresponding to each edge. The segmentation point confirmation module is used to confirm the segmentation point based on the difference between the two sides of each blending edge; The segmentation point confirmation module is specifically used to count the number of connected components adjacent to each pixel point within the mixed edge and the number of connected components adjacent to the mixed edge to obtain the number of pixel connected components and the number of crack connected components. Calculate the normal vector of each pixel within the blended edge; Calculate the difference in normal vector angle between each pixel and its adjacent pixels, and sum them to obtain the normal difference value; The topological feature evaluation value of each pixel is calculated based on the normal difference, the number of pixel connected components, and the number of crack connected components. The width of each pixel on the blending edge and its adjacent preset number of pixels are counted sequentially to obtain the width set of each pixel. The width is the number of pixels that the target line segment passes through. The target line segment is a line segment that passes through the pixel and is in the same line as the gradient direction of the pixel. The target line segment does not intersect the blending edge after being extended. The standard deviation is calculated based on the width set of each pixel to obtain the width evaluation value corresponding to each pixel; The curvature evaluation value of each pixel is calculated based on the curvature change of each pixel and its adjacent pixels. The change trend index of each pixel is calculated based on the topological feature evaluation value, width evaluation value, and curvature evaluation value of each pixel. The segmentation point is determined based on the change trend index of each pixel, and the change trend index corresponding to the segmentation point is the maximum value. The segmentation module is used to segment the edges based on the segmentation points of each of the mixed edges to obtain the segmentation results; The second classification module is used to perform unordered evaluation on each edge in the segmentation result and classify it as a crack or a natural edge.

6. The automotive parts quality visual inspection system according to claim 5, characterized in that, The feature evaluation module includes: The first calculation module is used to count the width of each pixel and calculate the standard deviation to obtain the width standard deviation corresponding to the crack. The width is the number of pixels that the target straight line segment passes through. The target straight line segment is a straight line segment that passes through the pixel and is in the same line as the gradient direction of the pixel. The target straight line segment does not intersect the crack after being extended. The second calculation module is used to calculate the edge chain code of each pixel and calculate the average difference of the edge chain code corresponding to each pixel. The average difference of the edge chain code is calculated by averaging the differences between the edge chain codes of a pixel and its adjacent pixels. The third calculation module is used to calculate the feature score based on the standard deviation of the crack width, the average difference of each pixel, and the width.