Visual inspection method and system for quality of automobile parts
Through multi-angle image processing and crack growth characteristic screening, the cracks and natural edges on the turbocharger housing are accurately distinguished, which solves the problem of misidentification in visual inspection and improves detection efficiency and product quality.
Patent Information
- Application Number
- CN202510666227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-05-22
AI Technical Summary
Existing visual inspection technologies are difficult to effectively distinguish cracks on turbocharger housing from natural edges, resulting in misidentification and quality assessment deviations.
By acquiring multi-angle images, after pre-processing, the edge detection algorithm is used to extract edges, and the crack growth characteristics are screened to confirm cracks, including curvature changes and gradient changes, calculating the singleness evaluation value and topological feature evaluation value, segmenting the mixed edges, performing feature scoring and color marking.
Improve crack recognition efficiency, avoid edge misjudgment, and ensure product quality and safety.
Smart Images

Figure CN120563446A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a method and system for visually inspecting the quality of automobile parts. Background Art
[0002] In the automotive manufacturing industry, the quality of auto parts directly impacts the performance, safety, and reliability of the entire vehicle. The turbocharger housing is a key component of the automotive engine, and its surface quality directly affects the performance and reliability of the turbocharger. Due to material factors and the casting process, cracks may occur in the turbocharger housing, affecting its quality compliance.
[0003] As an efficient, accurate, non-contact automated inspection method, visual inspection technology is well suited to the requirements of large-scale production of modern automotive parts. By quickly acquiring image information of parts and analyzing and judging them using image processing algorithms and computer technology, it can achieve rapid and accurate detection of part quality, thereby improving production efficiency, reducing defective rates, and enhancing the stability of product quality, providing strong technical support for the development of the automotive manufacturing industry. However, in existing visual inspection methods, since both crack edges and natural edge edges appear as sudden changes in grayscale values in the image, during edge detection, both the crack and the natural edge of the shell are identified as edges, and the portion connecting the crack and the natural edge line can easily be identified as the same continuous edge. This misidentification can seriously interfere with the accurate assessment of cracks. Therefore, there is an urgent need for a visual inspection method for automotive part quality that can effectively overcome the above problems. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a method and system for visual inspection of automobile parts quality.
[0005] In order to achieve the above-mentioned objectives, the technical solutions adopted by the present invention are as follows: In the first aspect, the present application provides a method for visual inspection of the quality of automotive parts, the method comprising: 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; performing edge extraction on each target image to obtain all edges of each target image; screening and confirming the crack growth characteristics of each edge to obtain the crack corresponding to each target image, the crack growth characteristics including curvature change and gradient change; evaluating each crack to obtain a characteristic score for each crack; and color-marking the image at the location of each crack according to the characteristic score of the crack to obtain a marked image containing the color mark.
[0006] In combination with the first aspect, in a possible implementation method, each edge is screened for crack growth characteristics to confirm the crack corresponding to each target image, including: performing a disorder evaluation on each edge according to the disorder of crack growth to obtain a simplicity evaluation value corresponding to each edge; classifying each edge as a crack, a mixed edge or a natural edge according to the simplicity evaluation value corresponding to the edge; confirming the segmentation point according to the difference between the two sides of each mixed edge; performing segmentation according to the segmentation point of each mixed edge to obtain a segmentation result; performing a disorder evaluation on each edge in the segmentation result and classifying it as a crack or a natural edge.
[0007] In combination with the first aspect, in a possible implementation method, each of the edges is disorderly evaluated according to the disorder of crack growth to obtain a singularity evaluation value corresponding to each edge, including: calculating the curvature and gradient of each pixel point on the edge respectively; performing standard deviation calculation based on the curvature values of all pixel points to obtain the curvature standard deviation corresponding to the edge; calculating the gradient amplitude based on the gradient of all pixel points, and performing standard deviation calculation to obtain the amplitude standard deviation corresponding to the edge; counting the gradient direction of each edge pixel point based on the gradient of all pixel points, and calculating the gradient direction angle between two adjacent pixel points to obtain the angle difference; performing standard deviation calculation based on all angle differences to obtain the angle standard deviation corresponding to the edge; and calculating the singularity evaluation value corresponding to the edge based on the curvature standard deviation, amplitude standard deviation, and angle standard deviation corresponding to the edge.
[0008] In combination with the first aspect, in a possible implementation method, the segmentation point is confirmed based on the difference change on both sides of each mixed edge, including: calculating the topological feature evaluation value of each pixel point based on the topological characteristics of each pixel point on the mixed edge; sequentially counting the widths corresponding to each pixel point on the mixed edge and a preset number of adjacent pixel points to obtain a width set of each pixel point, where the width is the number of pixels passed by the target straight line segment, and the target straight line segment is a straight line segment passing through the pixel point and aligned with the gradient direction of the pixel point, and the target straight line segment does not intersect with the mixed edge after extension; calculating the standard deviation based on the width set of each pixel point to obtain the width evaluation value corresponding to each pixel point; calculating the curvature evaluation value of each pixel point based on the curvature change of each pixel point and the adjacent pixel points; calculating the change trend index of each pixel point based on the topological feature evaluation value, width evaluation value, and curvature evaluation value of each pixel point; judging the segmentation point based on the change trend index of each pixel point, and the change trend index corresponding to the segmentation point is the maximum value.
[0009] In combination with the first aspect, in a possible implementation method, a topological feature evaluation value of each pixel point is calculated based on the topological characteristics of each pixel point on the mixed edge, including: counting the number of connected domains adjacent to each pixel point in the mixed edge and the number of connected domains adjacent to the mixed edge to obtain the number of pixel connected domains and the number of crack connected domains; respectively calculating the normal vector of each pixel point in the mixed edge; respectively calculating the normal vector angle difference between each pixel point and the adjacent pixel points, and summing them to obtain the normal difference; and calculating the topological feature evaluation value of each pixel point based on the normal difference, the number of pixel connected domains and the number of crack connected domains.
[0010] In combination with the first aspect, in a possible implementation method, each crack is evaluated separately to obtain a feature score for each crack in each target image, including: counting the width of each pixel point and performing standard deviation calculation to obtain the standard deviation of the width corresponding to the crack, where the width is the number of pixels passed by the target straight line segment, the target straight line segment is a straight line segment passing through the pixel point and collinear with the gradient direction of the pixel point, and the target straight line segment does not intersect with the crack after extension; calculating the edge chain code of each pixel point separately, and obtaining the average difference of the edge chain code corresponding to each pixel point, where the average difference of the edge chain code is obtained by calculating the mean of the difference between the edge chain code of a pixel point and the adjacent pixel points; and obtaining a feature score based on the standard deviation of the width corresponding to the crack, the average value of the difference corresponding to each pixel point, and the width calculation.
[0011] In combination with the first aspect, in a possible implementation, the preprocessing includes denoising, grayscale conversion, and sharpening.
[0012] In the second aspect, the present application also provides a visual inspection system for the quality of automotive parts, including: 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 of the original images to obtain multiple target images; an edge extraction module for performing edge extraction on each of the target images to obtain all edges of each of the target images; a screening module for screening each edge for crack growth characteristics to confirm the crack corresponding to each of the target images, wherein the crack growth characteristics include curvature changes and gradient changes; 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 of the location of each crack according to its feature score to obtain a marked image containing a color mark.
[0013] In combination with the second aspect, in a possible implementation, the screening module includes: a disorder evaluation module, which is used to perform disorder evaluation on each of the edges according to the disorder of crack growth to obtain a simplicity evaluation value corresponding to each edge; a first classification module, which is used to classify each edge as a crack, a mixed edge or a natural edge according to the simplicity evaluation value corresponding to each edge; a segmentation point confirmation module, which is used to confirm the segmentation point based on the difference changes on both sides of each mixed edge; a segmentation module, which is used to perform segmentation according to the segmentation point of each mixed edge to obtain a segmentation result; a second classification module, which is used to perform disorder evaluation on each edge in the segmentation result and classify it as a crack or a natural edge.
[0014] In combination with the second aspect, in a possible implementation method, the feature evaluation module includes: a first calculation module, which is used to count the width of each pixel point and perform standard deviation calculation to obtain the standard deviation of the width corresponding to the crack, where the width is the number of pixels passed by the target straight line segment, and the target straight line segment is a straight line segment passing through the pixel point and collinear with the gradient direction of the pixel point, and the target straight line segment does not intersect with the crack after extension; a second calculation module, which is used to calculate the edge chain code of each pixel point respectively, and calculate the average difference of the edge chain code corresponding to each pixel point, where the average difference of the edge chain code is obtained by calculating the mean of the difference between the edge chain code of a pixel point and the adjacent pixel points; a third calculation module, which is used to calculate the feature score based on the standard deviation of the width corresponding to the crack, the average value of the difference corresponding to each pixel point, and the width.
[0015] The present invention has the following beneficial effects:
[0016] This invention specifically identifies cracks by fully considering the curvature and gradient changes of crack growth. It then scores and labels the identified cracks based on their characteristics. This effectively improves crack identification efficiency, avoids quality assessment bias caused by edge misjudgment, and ensures product quality and safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A schematic flow chart of a method for visually inspecting the quality of automotive parts provided in Example 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 a turbocharger housing according to Embodiment 1 of the present invention;
[0021] Figure 4 This is a flow chart of step S4 provided in Example 1 of the present invention;
[0022] Figure 5 This is a flow chart of step S5 provided in Example 1 of the present invention;
[0023] Figure 6 This is a schematic structural diagram of the automotive parts quality visual inspection system described in Example 2 of the present invention;
[0024] Figure 7 This is a schematic structural diagram of the screening module described in Example 2 of the present invention;
[0025] Figure 8 Schematic diagram of the feature evaluation module structure described in Example 2 of the present invention. DETAILED DESCRIPTION
[0026] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a method and system for visually inspecting automotive parts quality, including its specific implementation, structure, features, and effectiveness. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0027] Unless defined otherwise, 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 belongs.
[0028] Example 1:
[0029] The specific scheme of the visual inspection method for automobile parts quality provided by the present invention is described in detail below with reference to the accompanying drawings.
[0030] See also Figure 1 , which shows a flow chart of a method for visually inspecting the quality of automobile parts provided by an embodiment of the present invention. Specifically, the method includes steps S1 to S6.
[0031] S1. Acquire multiple original images of a target object, each of the original images corresponding to a shooting angle.
[0032] In this embodiment, the turbocharger housing of an automobile part is used as an example. The turbocharger housing is one of the key components of the automobile engine. It has the important functions of connecting the turbine and the engine and withstanding the impact of high-temperature and high-pressure exhaust gas. Figure 2 As shown. At the same time, this embodiment is also applicable to other automotive parts, such as: crankshafts, engine blocks, transmission gears, brake discs and other key components. These parts are prone to defects such as microcracks and pores during the casting and machining process. The surface quality of the turbocharger housing directly affects the airtightness, heat conduction efficiency and mechanical reliability of the turbocharger. Therefore, in order to fully capture the housing image, this embodiment shoots from multiple angles to ensure that all parts of the turbocharger housing can be fully presented, including a front view (including the exhaust gas inlet flange), a side view (showing the water cooling channel interface), a 45° elevation view (capturing the internal blade structure) and a macro shot of the sealing surface, with the original image obtained by a CMOS sensor with a resolution of 20 million pixels and a ring LED shadowless light source.
[0033] S2. Preprocess each of the original images to obtain multiple target images.
[0034] To reduce noise interference and highlight the detailed features of the turbocharger housing, this example performs a multi-stage preprocessing on the original image. First, a Gaussian filter algorithm is used for denoising, eliminating salt-and-pepper noise caused by uneven ambient lighting. Histogram equalization is then used to enhance contrast, making the housing's edge texture more distinct. The color image is then converted to a 256-level grayscale image, using a weighted average method to preserve effective feature information. Image sharpening is also performed simultaneously during this process, using the Laplacian operator to enhance edge features in key areas.
[0035] S3. Perform edge extraction on each target image to obtain all 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. By calculating the spatial first-order gradient of the image grayscale value, a 3×3 convolution kernel is used to perform planar convolution on the image in the horizontal and vertical directions, and finally edge feature extraction is achieved by gradient amplitude calculation. At the same time, for those skilled in the art, in addition to the Sobel edge detection algorithm, other edge detection algorithms such as the Canny edge detection algorithm (which achieves high-precision edge positioning through non-maximum suppression and dual threshold detection), the Prewitt edge detection algorithm (which uses a center point difference operation that is more sensitive to noise), and the Roberts edge detection algorithm (a lightweight algorithm based on a cross-difference operation) can also be used. Those skilled in the art can make a choice based on actual conditions such as image resolution, noise level, and real-time requirements, and no specific restrictions are made in this embodiment.
[0037] Furthermore, in this embodiment, it is taken into account that the turbocharger housing is affected by material factors (such as alloy composition heterogeneity, microstructure porosity, etc.) and casting processes (including parameters such as mold design accuracy, pouring temperature control, and cooling rate) during the production process, which may lead to the generation of cracks on the turbocharger housing. The cracks may start at a certain stress concentration point, such as a casting defect or a processing mark, and then extend radially or in a network pattern to the surrounding area. During the extension process, due to the influence of local stress distribution, its direction will be deflected, and the width of the crack is generally narrow, and the width will vary along the entire length direction. The cracks appear as irregular thin strips on the housing, often accompanied by bifurcation characteristics. The performance of the cracks is as follows: Figure 3 As shown. In addition, because the turbocharger housing has a complex three-dimensional geometric shape (including multi-curved structures such as the intake volute, exhaust flange, and bearing seat), there are natural edges on its surface. These edges are process features formed during the casting process of the housing and are used to connect different curved parts (such as the transition zone between the spiral surface of the volute and the flange plane) or to enhance the structural strength of the housing through the form of reinforcing ribs. When cracks appear in the housing, since both the crack edge (the fracture surface of the metal matrix) and the natural edge (the casting parting line) appear as a sudden change in grayscale value in the digital image (the area with a gradient value > 50), when using edge detection algorithms such as Sobel, both the crack and the natural edge will be detected as edge results, which is prone to misjudgment, especially in low-contrast areas (when the signal-to-noise ratio is <3:1).
[0038] Therefore, in this embodiment, step S4 is also required to separate the above cracks from the natural edges.
[0039] S4. Screening each edge for crack growth characteristics to confirm the crack corresponding to each target image, wherein the crack growth characteristics include curvature change and gradient change.
[0040] In this embodiment, it is taken into account that the natural edge has a regular geometric shape (straight line, circular arc) and a regular casting texture, and its curvature is often constant or changes very little (the curvature of a straight line is 0, and the curvature of an arc is a fixed value). Therefore, the average curvature of the pixel points on the edge corresponding to the natural edge is close to a fixed value and the standard deviation of the curvature is small. However, the shape of the crack edge is irregular and the direction is tortuous. Its curvature varies greatly, the average curvature has no fixed pattern, and the standard deviation of the curvature is usually large. And the location where the crack appears is generally on a certain surface. Therefore, in this embodiment, the crack and the natural edge will be separated by the irregular development characteristics of the crack and the location where it is located. For details, please refer to Figure 4 , which takes any image as an example to describe how to separate cracks and natural edges therein, specifically including steps S41 to S43.
[0041] S41. Perform disorder evaluation on each edge according to the disorder of crack growth to obtain a uniqueness evaluation value corresponding to each edge.
[0042] Specifically, the disorder mentioned in this step refers to the characteristics of the irregular shape of the crack edge, the tortuous direction, and the large change in curvature. In the grayscale image, the grayscale value mutation of the natural edge is relatively regular, the grayscale gradient amplitude is more stable, and the direction change is also relatively regular, changing along the direction of the edge, which means that the gradient direction of the two adjacent pixels has a constant or linear change pattern. The grayscale gradient amplitude and direction change of the crack edge are relatively complex, because the grayscale inside the crack is not uniform, and its amplitude standard deviation and direction change index are often significantly different from those of the natural edge. By comparing these features, it can assist in the preliminary judgment that the edge is a crack. For details, please refer to the process of how to calculate the singleness evaluation value in steps S411-S417.
[0043] S411. Calculate the curvature and gradient of each pixel on the edge respectively.
[0044] Regarding the gradient calculation mentioned in this step, it is obtained by following the standard Sobel operator or Prewitt operator implementation process, which specifically includes constructing a 3×3 convolution kernel to perform horizontal / vertical differential operations, gradient amplitude synthesis and thresholding processing, etc., which will not be repeated in this embodiment. At the same time, the curvature of each pixel mentioned in this step can be obtained by the following steps: select 3 pixel points adjacent to the left and right of the pixel point, a total of 7 pixel points; then fit a quadratic curve to the 7 pixel points by the least squares method; finally, use the curvature of the fitted quadratic curve as the curvature value of the pixel point. At the same time, it should be noted that the number of adjacent pixel points on the left and right is selected when calculating the curvature, which can be flexibly adjusted according to needs. No specific restrictions are made in this embodiment.
[0045] S412: Calculate the standard deviation based on the curvature values of all pixels to obtain the curvature standard deviation corresponding to the edge.
[0046] S413: Calculate the gradient amplitude based on the gradients of all pixels, and perform standard deviation calculation to obtain the amplitude standard deviation corresponding to the edge.
[0047] S414: Calculate the gradient direction of each edge pixel based on the gradients of all pixels, and calculate the angle between the gradient directions of two adjacent pixels to obtain an 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 , calculating a uniqueness evaluation value corresponding to the edge based on the curvature standard deviation, amplitude standard deviation, and angle standard deviation corresponding to the edge.
[0050] In this embodiment, the calculation function of the singleness evaluation value is as follows:
[0051]
[0052] Among them, P x represents the singleness evaluation value corresponding to the xth edge; exp() represents the exponential function with the natural constant e as the base; Represents the standard deviation of the curvature values of all pixels on the x-th edge, that is, the above-mentioned curvature standard deviation; Represents the standard deviation of the gradient amplitude of all pixels on the x-th edge, that is, the amplitude standard deviation mentioned above; Indicates the standard deviation of the angular difference in the gradient direction between two adjacent pixels on the x-th edge, that is, the above-mentioned angular standard deviation.
[0053] In the above calculation function, Indicates the curvature change of the x-th edge. The larger the value, the more likely it is that the edge is unstable and irregular in direction, with irregular geometric shape. Similarly, and It can represent the change state of the grayscale value of the xth edge. The larger the value, the more likely it is that the edge is a crack. It is the uneven grayscale inside that leads to large amplitude standard deviation and angle standard deviation.
[0054] S42. Classify each edge into a crack, a mixed edge, or a natural edge according to the corresponding singleness evaluation value.
[0055] Furthermore, this embodiment also considers that when a crack appears on a natural edge of the shell, the edges may intersect, potentially leading to the crack and the natural edge being identified as the same edge. Therefore, in this step, edges with a singleness evaluation value less than or equal to 0.2 are identified as natural edges; edges with a singleness evaluation value greater than 0.2 and less than or equal to 0.5 are identified as mixed edges; and edges with a singleness evaluation value greater than 0.5 are identified as cracks.
[0056] Therefore, based on the above analysis results, in this embodiment, it is also necessary to find segmentation points in the mixed edge to accurately separate the cracks and natural edges, as detailed in steps S43 to S45.
[0057] S43, confirming the segmentation points according to the difference changes on both sides of each mixed edge.
[0058] In this embodiment, it is taken into account that in the mixed edge, natural edges and cracks have distinguishing characteristics of whether the width is uniform, and on both sides of the separation point, the curvature and gradient of the pixel points may have a large variation trend. In addition, natural edges usually serve as boundaries between different surfaces or components of the shell, and the connected connected areas are often relatively clear and in line with the shell structure design, and the number of connected areas is relatively fixed and stable. If the crack edge is combined with the natural edge, it may destroy this normal connectivity relationship, connecting to some small connected areas that should not be connected or making the number of connected areas abnormal. Therefore, in this embodiment, the segmentation point is confirmed based on the above analysis. See steps S431-S436 for details on the process of calculating the segmentation point of one of the mixed edges.
[0059] S431. Calculate a topological feature evaluation value of each pixel point based on the topological feature of each pixel point on the mixed edge.
[0060] As shown in the above analysis results, natural edges and cracks have differences in width, curvature, gradient, and connected domain. Therefore, in this example, refer to steps S4311 to S4314.
[0061] S4311. Count the number of connected domains adjacent to each pixel point in the mixed edge and the number of connected domains adjacent to the mixed edge to obtain the number of pixel connected domains and the number of crack connected domains.
[0062] S4312. Calculate the normal vector of each pixel point within the mixed edge respectively.
[0063] S4313. Calculate the normal vector angle difference between each pixel point and the adjacent pixel points respectively, and sum them up to obtain the normal difference.
[0064] It should be noted that the method for calculating the normal vector of each pixel point in this step is an existing technology and will not be repeated in this step.
[0065] S4314. Calculate a topological feature evaluation value for each pixel point based on the normal difference, the number of pixel connected domains, and the number of crack connected domains.
[0066] In this step, the calculation function of the topological feature evaluation value is as follows:
[0067]
[0068] Where Q y,i represents the topological feature evaluation value of the i-th pixel on the y-th mixed edge; C y,i represents the number of connected domains adjacent to the i-th pixel on the y-th edge, that is, the number of pixel connected domains mentioned above; C y represents the number of connected domains connected by the yth mixed edge, that is, the number of crack connected domains mentioned above; n y,i Indicates the normal difference corresponding to the i-th pixel on the y-th blended edge.
[0069] In the above calculation function, It means that when the difference between the number of connected domains connected to the i-th pixel on the y-th mixed edge and the number of overall connections of the edge is smaller, the current pixel is more likely to be a natural edge with the characteristics of separating the connected domains on both sides; while a crack is essentially a break or defect on the surface of a material, its geometric characteristics will lead to discontinuity (mutation) in the direction of the local surface normal, while the normal direction of a natural edge (such as a shell seam or a structural boundary) is continuous and conforms to the design geometry. By analyzing the pixel points at the intersection The change in normal direction represented by it can quantify the topological characteristics of this pixel point.
[0070] S432. Count the widths of each pixel point on the mixed edge and a preset number of adjacent pixel points in sequence to obtain a set of widths of each pixel point, where the width is the number of pixel points passed by the target straight line segment, and the target straight line segment is a straight line segment passing through the pixel point and aligned with the gradient direction of the pixel point, and the target straight line segment does not intersect with the mixed edge after extension.
[0071] S433 , calculating the standard deviation based on the width set of each pixel to obtain a width evaluation value corresponding to each pixel.
[0072] S434 , calculating a curvature evaluation value of each pixel point based on the curvature changes of each pixel point and adjacent pixel points.
[0073] In this implementation, the curvature evaluation value can be calculated by fitting a predetermined number of adjacent pixels using the least squares method, obtaining multiple fitting residuals. The maximum value among these fitting residuals is then extracted as the curvature evaluation value. This is used to measure the significance of the curvature change at the segmentation point. Specifically, the predetermined number can be six, with three pixels located to the left and three to the right of the pixel, for a total of seven pixels.
[0074] S435. Calculate the change trend index of each pixel point based on the topological feature evaluation value, width evaluation value, and curvature evaluation value of each pixel point.
[0075] The calculation function of the change 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 Represents the change trend index of the i-th pixel on the y-th mixed edge; P y,i It represents the maximum value of the fitting residual of the ith pixel and its adjacent pixels on the yth mixed edge, that is, the curvature evaluation value; σ(w y,i ) represents the width evaluation value corresponding to the i-th pixel point on the y-th mixed edge; Q y,i 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 value between the pixels at the position of the i-th pixel point, which reflects the significance of the curvature change as a segmentation point, and the standard deviation σ(w y,i ) is larger, indicating that the range of change of the edge width of the pixel within the interval is larger, the edge width is more unstable, that is, the larger the change trend index of the current pixel point. At the same time, and Q y,i It shows that 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 serves as a segmentation 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 mixed edge, the above method can effectively quantify the change trend index of each pixel on the mixed edge. The change trend index of each pixel reflects the degree of change fluctuation of the pixel on the edge. The larger the change trend index of a pixel, the more significant the change of the edge relative to the other pixels on both sides is, and therefore the greater the possibility of the pixel being used as a segmentation point. Therefore, the segmentation point can be determined based on the change trend index.
[0080] S436 , determining a segmentation point based on a change trend index of each pixel point, wherein the change trend index corresponding to the segmentation point is a maximum value.
[0081] S44. Segmentation is performed according to the segmentation points of each mixed edge to obtain a segmentation result.
[0082] S45. Perform disordered 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 is the method of step S41, and the classification is the method of step S42. This step will not be repeated.
[0084] S5. Evaluate each crack separately to obtain a characteristic score for each crack.
[0085] Through the above steps, all the segmented edges are processed. Each edge is composed of only one component. The edges of the cracks are irregular, and their directions may be curved, bifurcated, and have burrs. At the same time, the width of the extension is also different. Therefore, in this embodiment, the characteristic score of each crack is measured to provide a quantitative division basis for the subsequent color labeling. Specifically, see Figure 5 , the figure shows that this step S5 includes steps S51 to S53.
[0086] S51. Count the width of each pixel point and calculate the standard deviation to obtain the standard deviation of the width corresponding to the crack, where the width is the number of pixels passed by the target straight line segment, and the target straight line segment is a straight line segment passing through the pixel point and aligned with the gradient direction of the pixel point. The target straight line segment does not intersect with the crack after extension.
[0087] S52. Calculate the edge chain code of each pixel point respectively, and calculate the average difference of the edge chain code corresponding to each pixel point. The average difference of the edge chain code is obtained by calculating the average of the difference between the edge chain code of a pixel point and the edge chain code of the adjacent pixel points.
[0088] S53. Calculate a feature score based on the standard deviation of the crack width, the average value of the difference corresponding to each pixel point, and the width.
[0089] The calculation function of the feature score in this step is as follows:
[0090]
[0091] Where G a represents the characteristic score of the ath crack; σ(w a ) represents the standard deviation of the width of the crack a; w a,b Indicates the width of the bth pixel of the ath edge; Δl a,b They represent the average difference of the edge chain code corresponding to the b-th pixel point of the a-th edge; n 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, when the standard deviation of the width of the edge a is large, it means that it has obvious width non-uniformity, which is consistent with the crack growth characteristics; when the width of all pixels of the edge a and the average difference of the edge chain code are larger, it means that the edge width is larger and the edge direction is more tortuous, reflecting the more serious crack characteristics of the edge. Therefore, G obtained by the above calculation function is a The larger it is, the more severe the crack will be.
[0093] S6. Mark the image of the location of each crack with a color according to the characteristic score of the crack to obtain a marked image with the color mark.
[0094] In this step, cracks are marked with different line thicknesses or colors according to the feature scores, and the marking results are superimposed on the original image stream captured by the industrial camera to obtain a marked image.
[0095] Specifically, in this step, i.e., according to the size of feature scoring, different line thicknesses and different colors are adopted to mark the crackles of different feature scorings. For example, about line, there are three specifications of thick (3px), medium (2px) and thin (1px), about color, there are three specifications of red, orange and green, a total of nine grades. Then the feature scoring after normalization is divided into nine grades by 8 dividing points, such as 0.125, 0.15, 0.175, 0.2, 0.25, 0.3, 0.35, 0.4. Then color and line thickness are adopted to carry out dual channel marking, wherein color marking is about to change color of crack position pixel point and adopts Gaussian fuzzy algorithm to realize edge feathering effect. Synchronously, annotated legend explanation frame is generated on the marked image, and crack position coordinates (based on the XYZ value of world coordinate system) and feature scoring (keeping three decimal places) are displayed in real time. The above-mentioned implementation is all realized by the QCustomPlot component of QT framework, and the interface display mode is not repeated in the present embodiment.
[0096] In this embodiment, during the crack detection process, the specific situation where cracks intersect with natural edges is taken into account. The unique distinguishing features of mixed edges are utilized, including curvature, gradient, and connected domains. Based on these features, we can accurately find the optimal segmentation point where the crack intersects with the natural edge, and perform the crack segmentation operation accordingly. Furthermore, each crack is analyzed and assigned a corresponding feature score based on these features. Finally, cracks with different feature scores are appropriately marked based on the correspondence between the feature score and the mark color. This method significantly improves the efficiency of crack recognition and effectively avoids quality assessment deviations caused by edge misjudgment, thereby ensuring product quality and safety.
[0097] Example 2:
[0098] like Figure 6 As shown, this embodiment provides a visual inspection system for automobile parts quality, the system comprising:
[0099] The acquisition module is used to acquire multiple original images of the target object, each of the original images corresponding to a shooting angle.
[0100] The preprocessing module is used to preprocess each of the original images to obtain multiple target images.
[0101] The edge extraction module is used to extract edges from each target image to obtain all edges of each target image.
[0102] The screening module is used to screen each edge for crack growth characteristics to confirm the crack corresponding to each target image, wherein 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] The marking module is used to color-mark the image of the location of each crack according to the characteristic score of the crack to obtain a marked image containing the color mark.
[0105] See also Figure 7 , the figure shows that the screening module includes:
[0106] The disorder evaluation module is used to perform disorder evaluation on each edge according to the disorder of crack growth, and obtain a singleness evaluation value corresponding to each edge.
[0107] The first classification module is used to classify each edge into a crack, a mixed edge or a natural edge according to the singleness evaluation value corresponding to each edge.
[0108] The segmentation point confirmation module is used to confirm the segmentation point according to the difference changes on both sides of each mixed edge.
[0109] The segmentation module is used to perform segmentation according to the segmentation points of each mixed edge to obtain a segmentation result.
[0110] The second classification module is used to perform disordered evaluation on each edge in the segmentation result and classify it as crack or natural edge.
[0111] See also 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 point and perform standard deviation calculation to obtain the standard deviation of the width corresponding to the crack, where the width is the number of pixels passed by the target straight line segment, and the target straight line segment is a straight line segment passing through the pixel point and aligned with the gradient direction of the pixel point, and the target straight line segment does not intersect with the crack after extension.
[0113] The second calculation module is used to calculate the edge chain code of each pixel point respectively, and calculate the average difference of the edge chain code corresponding to each pixel point. The average difference of the edge chain code is obtained by calculating the average of the difference between the edge chain code of a pixel point and its adjacent pixels.
[0114] The third calculation module is used to calculate the feature score based on the standard deviation of the width corresponding to the crack, the average value of the difference corresponding to each pixel point, and the width.
[0115] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0116] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain 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, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A method for visual inspection of automobile parts quality, characterized in that: The method comprises: Acquire multiple original images of the target object, each original image corresponding to a shooting angle; Preprocessing each of the original images to obtain multiple target images; Performing edge extraction on each of the target images to obtain all edges of each of the target images; Performing crack growth characteristic screening on each edge to confirm the crack corresponding to each target image, wherein the crack growth characteristic includes curvature change and gradient change; Each crack is evaluated separately to obtain a characteristic score for each crack; The image at the location of each crack is color-marked according to the characteristic score of the crack to obtain a color-marked marked image.
2. The method for visual inspection of automobile parts quality according to claim 1, characterized in that: Perform crack growth characteristic screening on each edge to confirm the crack corresponding to each target image, including: Performing disorder evaluation on each edge according to the disorder of crack growth to obtain a singleness evaluation value corresponding to each edge; Classifying each edge as a crack, a mixed edge, or a natural edge according to the singularity evaluation value corresponding to the edge; The segmentation points are determined based on the difference between the two sides of each mixed edge; Perform segmentation according to the segmentation point of each mixed edge to obtain a segmentation result; Each edge in the segmentation result is evaluated separately and classified as a crack or a natural edge.
3. The method for visual inspection of automobile parts quality according to claim 2, characterized in that: A disorder evaluation is performed on each edge according to the disorder of crack growth to obtain a uniqueness evaluation value corresponding to each edge, including: Calculate the curvature and gradient of each pixel on the edge respectively; Calculate the standard deviation based on the curvature values of all pixels to obtain the curvature standard deviation corresponding to the edge; Calculate the gradient amplitude based on the gradient of all pixels, and calculate the standard deviation to obtain the amplitude standard deviation corresponding to the edge; Based on the gradient statistics of all pixels, the gradient direction of each edge pixel is calculated, and the angle between the gradient directions of two adjacent pixels is calculated to obtain the angle difference; Calculate the standard deviation based on all angle differences to obtain the angle standard deviation corresponding to the edge; The uniqueness evaluation value corresponding to the edge is obtained by calculating the curvature standard deviation, amplitude standard deviation, and angle standard deviation corresponding to the edge.
4. The method for visual inspection of automobile parts quality according to claim 2, characterized in that: The segmentation points are determined based on the difference between the two sides of each mixed edge, including: The topological feature evaluation value of each pixel point is calculated based on the topological characteristics of each pixel point on the mixed edge; Sequentially counting the widths of each pixel point on the mixed edge and a preset number of adjacent pixels, obtaining a set of widths for each pixel point, where the width is the number of pixels passed by a target straight line segment, the target straight line segment being a straight line segment passing through the pixel point and collinear with the gradient direction of the pixel point, and the target straight line segment does not intersect the mixed edge after extension; The standard deviation of the width set of each pixel is calculated 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 point is calculated based on the topological feature evaluation value, width evaluation value, and curvature evaluation value of each pixel point; A segmentation point is determined based on a change trend index of each pixel point, and the change trend index corresponding to the segmentation point is a maximum value.
5. The method for visual inspection of automobile parts quality according to claim 4, characterized in that: The topological feature evaluation value of each pixel point is calculated based on the topological characteristics of each pixel point on the mixed edge, including: Counting the number of connected domains adjacent to each pixel point in the mixed edge and the number of connected domains adjacent to the mixed edge to obtain the number of pixel connected domains and the number of crack connected domains; Calculating the normal vector of each pixel point within the mixed edge respectively; Calculate the normal vector angle difference between each pixel and its adjacent pixels respectively, and sum them up to get the normal difference; The topological feature evaluation value of each pixel point is calculated based on the normal difference, the number of pixel connected domains and the number of crack connected domains.
6. The method for visual inspection of automobile parts quality according to claim 1, characterized in that: Each crack is evaluated separately to obtain a characteristic score for each crack in each target image, including: The width of each pixel is counted and the standard deviation is calculated to obtain the standard deviation of the width corresponding to the crack. The width is the number of pixels passed by the target straight line segment. The target straight line segment is a straight line segment passing through the pixel and aligned with the gradient direction of the pixel. The target straight line segment does not intersect the crack after extension. Calculate the edge chain code of each pixel point respectively, and calculate the average difference of the edge chain codes corresponding to each pixel point. The average difference of the edge chain code is obtained by calculating the average of the differences between the edge chain codes of a pixel point and its adjacent pixels; The feature score is calculated based on the standard deviation of the crack width, the average value of the difference corresponding to each pixel point, and the width.
7. The method for visually inspecting the quality of automobile parts according to claim 1, characterized in that: The preprocessing includes denoising, grayscale conversion and sharpening.
8. A visual inspection system for automobile parts quality, characterized in that: include: An acquisition module is used to acquire multiple original images of the target object, each original image corresponding to a shooting angle; A preprocessing module, configured to preprocess each of the original images to obtain multiple target images; An edge extraction module, configured to extract edges from each target image to obtain all edges of each target image; A screening module, configured to screen each edge for crack growth characteristics to confirm the crack corresponding to each target image, wherein the crack growth characteristics include curvature change and gradient change; A feature evaluation module is used to evaluate each crack separately and obtain a feature score for each crack; The marking module is used to color-mark the image of the location of each crack according to the characteristic score of the crack to obtain a marked image containing the color mark.
9. The automotive parts quality visual inspection system according to claim 8, characterized in that: The screening module includes: a disorder evaluation module, configured to perform disorder evaluation on each edge according to the disorder of crack growth, and obtain a singleness evaluation value corresponding to each edge; A first classification module is used to classify each edge into a crack, a mixed edge or a natural edge according to the singleness evaluation value corresponding to the edge; A segmentation point confirmation module is used to confirm the segmentation point according to the difference changes on both sides of each mixed edge; A segmentation module, configured to perform segmentation according to the segmentation points of each mixed edge to obtain a segmentation result; The second classification module is used to perform disordered evaluation on each edge in the segmentation result and classify it as crack or natural edge.
10. The automotive parts quality visual inspection system according to claim 8, characterized in that: The feature evaluation module includes: A first calculation module is configured to count the width of each pixel and calculate the standard deviation to obtain the standard deviation of the width corresponding to the crack, where the width is the number of pixels passed by a target straight line segment, and the target straight line segment is a straight line segment passing through the pixel and aligned with the gradient direction of the pixel, and the target straight line segment does not intersect the crack after extension; The second calculation module is used to calculate the edge chain code of each pixel point respectively, and calculate the average difference of the edge chain codes corresponding to each pixel point, where the average difference of the edge chain codes of a pixel point and its adjacent pixels is calculated; The third calculation module is used to calculate the feature score based on the standard deviation of the width corresponding to the crack, the average value of the difference corresponding to each pixel point, and the width.
Citation Information
Patent Citations
Crack detection method with image gradient direction histogram and watershed method conflated
CN104008553A
Automobile body welding seam detection method and system based on machine vision
CN119574571A
Mining part processing quality detection method, device and system
CN119648648A
Bridge crack detection method and system
CN119763095A
Methods and systems for automatically identifying the Schwalbe's line
US10123691B1
Cited By
Synchronous flaw detection method and system for inner ring and outer ring of bearing
CN121482019A
Automobile part quality detection method and system based on machine learning
CN121544540A
Machine learning based method and system for quality detection of automotive parts
CN121544540B