A Machine Vision-Based Defect Detection Method for Injection Molded Fuse Boxes

By establishing a standard model based on matching pixels and calculating material coefficients and partitioning coefficients, the problem of insufficient accuracy in the inspection of injection molded parts of fuse boxes was solved, achieving more efficient and accurate defect detection.

CN120163820BActive Publication Date: 2025-10-31DONGGUAN WELLMEI MOLD MFG CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510638788.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-10-31
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

In the existing technology, the accuracy of defect detection for injection molded fuse boxes is insufficient, and it cannot adapt to different types and structures of injection molded fuse boxes, resulting in inaccurate detection results.

Method used

By preprocessing the images of the injection molded fuse box, a standard model based on the coordinate changes of matched pixels and line fitting is established. The parts are divided into zones, and material coefficients and zone coefficients are obtained. Combining grayscale changes and pixel position relationships, the final degree of deformation and overall defect index are calculated for defect detection.

Benefits of technology

It improves the accuracy and applicability of defect detection, reduces the need for manual decision-making, expands the types of safe box injection molded parts that can be inspected, and enhances the accuracy of deformation detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163820B_ABST
    Figure CN120163820B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of image processing technology, specifically relating to a machine vision-based method for detecting defects in injection-molded fuse boxes. The method includes: performing pixel matching on an image of the injection-molded fuse box region; establishing a standard model of the injection-molded fuse box based on the matched pixels; dividing the image of the injection-molded fuse box region into several partitions, and comparing each partition with the standard model to obtain the preliminary deformation degree of each partition; combining the overall deformation characteristics of the injection-molded fuse box with the deformation characteristics of each partition, correcting the preliminary deformation degree of each partition to obtain the final deformation degree of each partition; and combining the final deformation degrees of all partitions to obtain the overall defect index of the injection-molded fuse box region image, thus completing the defect detection. This invention expands the application scope of defect detection for injection-molded fuse boxes and improves the accuracy of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a machine vision-based method for detecting defects in injection-molded fuse box parts. Background Technology

[0002] Fuse box injection molded parts are plastic components manufactured through injection molding processes, such as fuse boxes in the automotive industry, ECU housings, and sensor protection boxes. They are mainly used to protect, encapsulate, or fix electronic components, circuits, or other critical parts. Due to uneven cooling or material shrinkage, fuse box injection molded parts may deform, such as warping or denting. Therefore, in order to ensure the quality of fuse box injection molded parts, quality inspection is often required after injection molding.

[0003] To improve the efficiency of deformation detection for injection-molded fuse boxes, machine vision technology is currently commonly used to geometrically match batches of injection-molded fuse boxes with design models. The degree of deformation is determined based on the matching results, thereby judging whether the injection-molded fuse boxes are qualified. For example, Chinese patent application CN113484329A discloses a machine vision-based method and system for defect detection in injection-molded parts, which utilizes the distance deviation between the suspected defect edge and the feature edge of the injection-molded part for defect detection.

[0004] In determining the quality of a fuse box injection molded part based on the degree of deformation, a threshold is often required. When the degree of deformation is less than the threshold, the fuse box injection molded part can be marked as qualified. However, there are often various types of molded fuse box injection molded parts and different injection molding materials. This means that a single threshold cannot be applied to all types of fuse box injection molded parts. Furthermore, different areas of the same type of fuse box injection molded part can accept different degrees of deformation. This results in different threshold requirements even when performing deformation detection on the same type of fuse box injection molded part, ultimately leading to insufficient accuracy in defect detection of fuse box injection molded parts. Summary of the Invention

[0005] To address the technical problem of insufficient accuracy in detecting defects in injection-molded fuse box parts, this invention provides a machine vision-based method for detecting defects in injection-molded fuse box parts, comprising:

[0006] The image of the fuse box injection molded part is preprocessed to obtain the fuse box injection molded part area image. Pixel matching is performed on the fuse box injection molded part area image, and a standard model of the fuse box injection molded part is established based on the coordinate changes of the matched pixels and the linear fitting method. Based on the distance distribution of the matched pixels between the fuse box injection molded part area image and the standard model, the fuse box injection molded part area image is divided into several fuse box injection molded part partitions, and the preliminary deformation degree of each fuse box injection molded part partition is obtained. According to the preliminary deformation degree of the fuse box injection molded part area image, the material coefficient of the fuse box injection molded part is obtained. According to the grayscale changes and pixel position relationships of the fuse box injection molded part partitions, the partition coefficient of the fuse box injection molded part partitions is obtained. Combining the partition coefficient, the preliminary deformation degree, and the material coefficient of the fuse box injection molded part partitions, the final deformation degree of the fuse box injection molded part partitions is obtained. Based on the final deformation degree of the fuse box injection molded part partitions, the overall defect index of the fuse box injection molded part area image is obtained, and defect detection is completed.

[0007] This invention establishes a standard model based on actual images of the injection-molded area of ​​the fuse box. Compared to manually obtaining the design documents of the fuse box injection molded part, this invention reduces the manual decision-making process and avoids decision-making errors caused by missing or excessive design documents, thus improving the applicability of the defect detection method. In determining the degree of deformation of the fuse box injection molded part, this invention considers that the characteristics of the injection molded part's material and structure affect its ability to withstand deformation. Therefore, this invention analyzes the material coefficient and zoning coefficient of the fuse box injection molded part, improving the accuracy of deformation detection and thus enhancing the defect detection effect.

[0008] Preferably, the standard model of the fuse box injection molded part established based on the coordinate change of matching pixels and the straight line fitting method includes: acquiring a sequence of images of the fuse box injection molded part region; matching any two adjacent fuse box injection molded part region images using an image registration algorithm to obtain several matching pixels of the two adjacent fuse box injection molded part region images; acquiring the coordinates of any matching pixel; calculating the feature representation of any matching pixel based on the coordinate change of the matching pixel; performing edge detection on the first fuse box injection molded part region image to obtain several edges; using the feature representation of the pixels on the edge that are matching pixels as weights, performing a straight line fitting on all matching pixels on the edge using the weighted least squares method; and replacing the fitted straight line with the corresponding edge to obtain the standard model of the fuse box injection molded part.

[0009] Preferably, the step of calculating the feature representation of any matching pixel based on the coordinate change of the matching pixel includes: stacking all images of the fuse box injection molding area at a distance of 1 pixel; obtaining the coordinates of any matching pixel on the first fuse box injection molding area image; sequentially obtaining the coordinates of the corresponding matching pixels in all fuse box injection molding area images to obtain the coordinate sequence of the matching pixels; obtaining the spatial distance between any two adjacent coordinates in the coordinate sequence of the matching pixels; and adding the spatial distances of all adjacent coordinates to obtain the position change of the matching pixel. The negative correlation normalization process is then performed to obtain the feature representation of the matched pixels.

[0010] In this invention, the feature representation of matched pixels provides a basis for the establishment of a standard model. Matched pixels with stronger feature representation have stronger stability and are more suitable as pixels for establishing a standard model.

[0011] Preferably, the step of dividing the fuse box injection molded part area image into several fuse box injection molded part partitions based on the distance distribution of matching pixel points between the fuse box injection molded part area image and the standard model, and obtaining the preliminary deformation degree of each fuse box injection molded part partition, includes: performing edge detection on the fuse box injection molded part area image to obtain an edge image; projecting all edge pixels of the standard model onto the edge image; obtaining the minimum distance between any edge pixel on the edge image and a pixel of the standard model, denoted as the deformation distance of the edge pixel; using a clustering algorithm to cluster all edge pixels on the edge image to obtain several fuse box injection molded part partitions of the edge image; and summing the deformation distances of all edge pixels in any fuse box injection molded part partition, denoted as the preliminary deformation degree of the fuse box injection molded part partition.

[0012] In this invention, the initial deformation degree of the partition of the fuse box injection molded part characterizes the difference between the fuse box injection molded part and the standard model, and characterizes the degree of defect of the fuse box injection molded part, providing a basis for quantifying the degree of defect of the fuse box injection molded part.

[0013] Preferably, obtaining the material coefficient of the fuse box injection molded part based on the preliminary deformation degree of the image of the injection molded part area includes:

[0014] Obtain the chain code of all pixels in the injection molded part partition corresponding to the cluster with the largest average initial deformation in the image of the injection molded part area of ​​the fuse box; obtain the difference sequence of the chain code;

[0015] ;

[0016] In the formula, This indicates the material coefficient of the injection-molded fuse box; This indicates the number of images in the injection-molded area of ​​the fuse box; This represents the number of partitions in the fuse box injection molded part of the m-th image; The number of partitions in the injection-molded fuse box representing the cluster with the largest initial degree of deformation; This represents the sum of the numerical values ​​of the difference sequence of the chain codes of the pixels in the h-th partition of the fuse box injection molded part of the m-th image.

[0017] In this invention, the material coefficient of the fuse box injection molded part provides a basis for correcting the degree of deformation of the partition of the fuse box injection molded part. The material coefficient determines the degree of correction of the degree of deformation of the partition of the fuse box injection molded part. The larger the material coefficient, the greater the elasticity of the fuse box injection molded part, and the stronger its ability to accept deformation.

[0018] Preferably, obtaining the partition coefficient of the fuse box injection molded part partition based on the grayscale change and pixel position relationship of the partition includes: obtaining the structural correlation degree of any fuse box injection molded part partition based on the grayscale change of the partition; obtaining the deformation consistency of any fuse box injection molded part partition based on the pixel position relationship of the partition; and recording the product of the structural correlation degree and deformation consistency of any fuse box injection molded part partition as the partition coefficient of the fuse box injection molded part partition.

[0019] The partition coefficient of this invention takes into account the structural differences of different areas of the fuse box injection molded part, and applies a larger partition coefficient to the partition that can accept greater deformation, so as to ensure the accuracy of the calculation of the degree of deformation and thus improve the accuracy of defect detection of the fuse box injection molded part.

[0020] Preferably, the step of obtaining the structural correlation degree of any fuse box injection molded part partition based on the grayscale change of the partition includes: obtaining a number of pixels at equal intervals for any fuse box injection molded part partition, denoted as marked pixels; drawing the normal line of the edge for any marked pixel, and obtaining a number of neighboring pixels of the marked pixel on the normal line; taking the difference between the grayscale values ​​of any two adjacent neighboring pixels and taking the absolute value, denoted as the grayscale difference between the two adjacent neighboring pixels; adding the grayscale differences of all adjacent neighboring pixels of all marked pixels and performing negative correlation normalization processing to obtain the structural correlation degree of the fuse box injection molded part partition.

[0021] This invention analyzes the structural correlation of the partitions of the fuse box injection molding part. When the partitions of the fuse box injection molding part are closely related to the whole structure, the partitions of the fuse box injection molding part can accept a lower degree of deformation due to the stability requirements of the whole structure. This provides a basis for the partition coefficient of the fuse box injection molding part.

[0022] Preferably, the step of obtaining the deformation consistency of any fuse box injection molded part partition based on the pixel position relationship of the partition includes: obtaining the deformation distance of all edge pixels of any fuse box injection molded part partition to form a deformation distance sequence; establishing two windows of the same size, denoted as target windows; when the target window size is w, sliding the target window to ensure that no elements overlap in the target window; calculating the DTW distance of the deformation distance sequence of edge pixels in the target window, and recording the deformation distance sequence of edge pixels in the target window with the minimum DTW distance as the consistent subsequence when the window size is w; comparing the window size w with the DTW distance of the consistent subsequence of the corresponding window size, obtaining the window with the maximum ratio and the corresponding ratio, and recording the ratio as the deformation consistency of the fuse box injection molded part partition.

[0023] Preferably, the final deformation degree of the partition of the fuse box injection molded part is obtained by combining the partition coefficient, the initial deformation degree, and the material coefficient of the fuse box injection molded part, satisfying the expression:

[0024] ;

[0025] in, This indicates the final degree of deformation of any section of the injection-molded fuse box; This indicates the initial degree of deformation of the injection-molded parts of the fuse box; This indicates the material coefficient of the injection-molded fuse box; This represents the partition coefficient of the injection-molded fuse box.

[0026] In this invention, the final deformation degree of the partition of the fuse box injection molded part directly reflects the deformation degree of each area of ​​the fuse box injection molded part. It takes into account the material coefficient and the partition coefficient, and provides a basis for accurately judging the quality of the fuse box injection molded part.

[0027] Preferably, the overall defect index of the injection-molded area image of the fuse box satisfies the expression:

[0028] ;

[0029] In the formula, This represents the overall defect index of any injection-molded area of ​​a fuse box; This indicates the number of partitions in the fuse box injection molding area; This indicates the final degree of deformation of the h-th fuse box injection molded part section; This indicates the maximum final deformation degree of all injection-molded parts of the fuse box.

[0030] This invention obtains the overall defect index of the injection molded area image of the fuse box, and describes the defects of the fuse box injection mold as a whole, making the defect detection of the fuse box injection mold more accurate.

[0031] The beneficial effects of this invention are as follows:

[0032] (1) This invention expands the scope of application for defect detection of injection molded parts of fuse boxes and improves the accuracy of defect detection of injection molded parts of fuse boxes;

[0033] (2) The standard model of the present invention helps to reduce the need for manual decision-making and expands the types of safe box injection molded parts that can be used in the present invention;

[0034] (3) The present invention takes into account the material and structural characteristics of the safe box injection molded parts, calculates the material coefficient and partition coefficient of the safe box injection molded parts, and uses them to correct the calculation of the deformation degree of the safe box injection molded parts, thereby improving the accuracy of defect detection of the safe box injection molded parts.

[0035] (4) In this invention, the overall defect index of the image of the injection molded part of the fuse box describes the defects of the injection molded part of the fuse box as a whole, making the defect detection of the injection molded part of the fuse box more accurate. Attached Figure Description

[0036] Figure 1 This is a flowchart illustrating a machine vision-based defect detection method for injection-molded fuse boxes according to the present invention.

[0037] Figure 2 This is a schematic diagram showing a grayscale image of the injection-molded fuse box.

[0038] Figure 3 This is a schematic diagram showing images of all the injection-molded areas of the fuse box;

[0039] Figure 4 This is a schematic representation of a standard model of a fuse box injection molded part. Detailed Implementation

[0040] This invention discloses a machine vision-based method for detecting defects in injection-molded fuse box parts, referring to... Figure 1 This includes steps S1-S4:

[0041] S1: Preprocess the image of the fuse box injection molded part to obtain the image of the fuse box injection molded part area.

[0042] Sampling points are set up on a transparent conveyor belt, and an industrial camera is mounted above each sampling point. The industrial camera captures images of the fuse box injection molded parts arriving at the sampling points, obtaining images of the fuse box injection molded parts. These images contain only the fuse box injection molded parts and the background, and are RGB images. To reduce subsequent computational load, the RGB image is converted to a grayscale image. A schematic diagram of the grayscale image of the fuse box injection molded parts is shown below. Figure 2 .

[0043] Semantic segmentation is performed on all fuse box injection molded part images to obtain images of all fuse box injection molded part regions that contain only the fuse box injection molded part and exclude the background. Specifically:

[0044] The semantic segmentation network takes grayscale images of all fuse box injection molded parts as input and outputs binary images of fuse box injection molded parts. The dataset for the semantic segmentation network consists of grayscale images of different fuse box injection molded parts. The dataset is labeled as follows: pixels belonging to fuse box injection molded parts are labeled as 1, and pixels belonging to the background are labeled as 0. The loss function of the semantic segmentation network is the cross-entropy loss function.

[0045] The grayscale image of the fuse box injection molded part is input into the trained semantic segmentation network, and the output is a binary image of the fuse box injection molded part. The pixels in the grayscale image of the fuse box injection molded part that are marked as 1 in the binary image of the fuse box injection molded part constitute the region image of the fuse box injection molded part.

[0046] At this point, several images of the injection-molded areas of the fuse box have been obtained.

[0047] S2: Perform pixel matching on the image of the fuse box injection molded part area, and establish a standard model of the fuse box injection molded part based on the coordinate changes of the matched pixels and the straight line fitting method; based on the distance distribution of the matched pixels between the fuse box injection molded part area image and the standard model, divide the fuse box injection molded part area image into several fuse box injection molded part partitions, and obtain the preliminary deformation degree of each fuse box injection molded part partition.

[0048] It should be noted that geometric matching is a pattern matching method based on geometric information such as the shape, edges, and contours of an object. Fuse box injection molded parts are often complex objects with clear contours. Therefore, by matching the image of the fuse box injection molded part with the design model and then judging the degree of deformation based on the matching results, the design model often needs to be manually determined. When there are many models or when a model is missing, the matching efficiency will be affected. Therefore, this invention performs pixel-by-pixel matching on images of mass-produced fuse box injection molded parts. Based on the matching results and pixel-by-pixel fitting, a standard model is established, which can improve the applicability of the defect detection of this invention and improve the efficiency of this invention in detecting the degree of deformation of fuse box injection molded parts.

[0049] It should be further explained that after obtaining the standard model, comparing the image of the fuse box injection molded part area with the standard model at the pixel scale can reveal the pixel-level differences between the fuse box injection molded part and the standard model. While pixel-level comparison ensures detection accuracy, it cannot determine the overall deformation degree of the fuse box injection molded part. Considering that deformation often occurs regionally, this invention clusters the pixels, dividing the fuse box injection molded part area image into several partitions. Based on the overall pixel differences within each partition, the preliminary deformation degree of all partitions of the fuse box injection molded part can be obtained.

[0050] Specifically, an image sequence of the injection molded area of ​​the fuse box is obtained, and an image registration algorithm is used to match any two adjacent images of the injection molded area of ​​the fuse box to obtain several matching pixels of the two adjacent images of the injection molded area of ​​the fuse box, and the coordinates of any matching pixel are obtained.

[0051] Preferably, the feature representation of any matching pixel is calculated based on the coordinate changes of the matching pixel:

[0052] It should be noted that the more stable the coordinates of the matching key points are, the more stable the structure on the fuse box injection molded part is, and the better it can represent the fuse box injection molded part, thus making it more suitable as a pixel point for building a standard model.

[0053] Overlay all images of the injection molded parts of the fuse box at a distance of 1 pixel; obtain the coordinates of any matching pixel on the first image of the injection molded parts of the fuse box; sequentially obtain the coordinates of the corresponding matching pixels in all images of the injection molded parts of the fuse box to obtain the coordinate sequence of the matching pixels; obtain the spatial distance between any two adjacent coordinates in the coordinate sequence of the matching pixels.

[0054] like Figure 3 This is a schematic diagram of all the images of the injection molded areas of the fuse box, where point B is the Bth matching pixel on the first injection molded area image of the fuse box, and the arrow direction indicates the coordinates of the Bth matching pixel in all the injection molded area images of the fuse box.

[0055] The feature representation of any matched pixel satisfies the expression:

[0056] ;

[0057] In the formula, This represents the feature representation of any matched pixel. This indicates the number of images in the injection-molded area of ​​the fuse box; This represents the spatial distance between the coordinates of the matched pixel points in the (m+1)th and mth fuse box injection molded part areas of the image.

[0058] In the formula, This represents the sum of the spatial distances between all adjacent coordinates of the matched pixel, indicating the positional change of the pixel. The larger the value, the more drastic the change in the position of the matched pixel, resulting in poorer stability and weaker feature performance.

[0059] It should be noted that since the injection molded part of the fuse box is a relatively neat multi-frame object, the matching pixels are also pixels that can better represent the frame structure. By performing linear fitting on the matching pixels, a standard structure can be obtained and used as a standard model.

[0060] Preferably, edge detection is performed on the image of the first fuse box injection molding area to obtain several edges. Using the feature representation of the pixels matching the edges as weights, a weighted least squares method is used to fit a straight line to all matching pixels on the edges. The fitted line is then replaced with the corresponding edge to obtain the standard model of the fuse box injection molding. A schematic diagram of the standard model is shown below. Figure 4 It should be noted that the length of the fitted line used for replacement is the same as the length of the corresponding edge.

[0061] Preferably, edge detection is performed on the image of the fuse box injection molding area to obtain an edge image. All edge pixels of the standard model are projected onto the edge image, and the minimum distance between any edge pixel in the edge image and the standard model pixel is obtained, which is recorded as the deformation distance of the edge pixel. A clustering algorithm is used to cluster all edge pixels in the edge image to obtain several fuse box injection molding partitions of the edge image. The deformation distances of all edge pixels in any fuse box injection molding partition are added together and recorded as the preliminary deformation degree of the fuse box injection molding partition.

[0062] It should be noted that the edge detection method and clustering algorithm are set by the implementers according to the actual implementation situation, and there are no restrictions on the specifics. For example, the Canny operator can be used for edge detection, and the K-means algorithm can be used for clustering. There are no restrictions on the specific value of K. For example, if K is 3, the fuse box injection molded part can be divided into level 1 deformation partition, level 2 deformation partition, and level 3 deformation partition.

[0063] At this point, the preliminary deformation degree of all fuse box injection molded parts in the image of the fuse box injection molded part area has been obtained.

[0064] S3: Based on the initial deformation degree of the fuse box injection molded part area image, obtain the material coefficient of the fuse box injection molded part; based on the grayscale changes and pixel position relationships of the fuse box injection molded part partitions, obtain the partition coefficient of the fuse box injection molded part partitions; combining the partition coefficient of the fuse box injection molded part partitions, the initial deformation degree, and the material coefficient of the fuse box injection molded part, obtain the final deformation degree of the fuse box injection molded part partitions.

[0065] It should be noted that the differences between various injection-molded fuse box parts lie in the injection molding materials and structures. Without affecting quality, different injection molding materials have varying degrees of tolerance for deformation. For example, rigid materials can tolerate less deformation, while elastic materials can tolerate more. Furthermore, different structures on a single type of fuse box injection-molded part also have different degrees of tolerance for deformation. For instance, a frame-shaped structure with only one edge connected to the fuse box injection-molded part is often more prone to deformation and has a greater tolerance for deformation. Therefore, this invention corrects the initial deformation degree of the partitions by analyzing the material coefficients and area coefficients of the fuse box injection-molded parts, ensuring the accuracy of the deformation calculation for the fuse box injection-molded parts.

[0066] It should be noted that injection molded parts with lower elasticity are less prone to deformation, and the curvature of the deformation will be smaller than that of injection molded parts with higher elasticity. Injection molded parts with higher elasticity are more prone to deformation. Therefore, the material coefficient can be obtained based on the initial deformation degree of all sections of the fuse box injection molded part. Materials with greater elasticity should have a smaller material coefficient to accept greater deformation.

[0067] Specifically, based on the initial deformation degree of the injection molded area image of the fuse box, the material coefficient of the injection molded part is obtained:

[0068] Obtain the chain code of all pixels in the injection molded part region corresponding to the cluster with the largest average initial deformation in the image of the fuse box; obtain the difference sequence of the chain code. It should be noted that when the deformation is a straight line, the difference sequence value of the chain code is smaller, while when the curvature is larger, the difference sequence value will be larger.

[0069] ;

[0070] In the formula, This indicates the material coefficient of the injection-molded fuse box; This indicates the number of images in the injection-molded area of ​​the fuse box; This represents the number of partitions in the fuse box injection molded part of the m-th image; The number of partitions in the injection-molded fuse box representing the cluster with the largest initial degree of deformation; This represents the sum of the numerical values ​​of the difference sequence of the chain codes of the pixels in the h-th partition of the fuse box injection molded part of the m-th image.

[0071] In the formula, This represents the percentage of all maximum deformation zones in the image of the m-th fuse box injection molded part. The larger this value, the more maximum deformation zones there are in the image of the m-th fuse box injection molded part, indicating that the overall deformation is more widespread, thus making it more likely to be a highly elastic material, and therefore the material coefficient is smaller. This represents the sum of the differential sequences of the chain codes for all fuse box injection molded parts. The larger this value, the greater the curvature of all fuse box injection molded parts in the m-th fuse box injection molded part area image, and therefore the greater the possibility of it being a highly elastic material, resulting in a smaller material coefficient.

[0072] Preferably, the structural correlation degree of any partition of the fuse box injection molded part is obtained based on the grayscale changes of the partitions:

[0073] For any injection-molded fuse box part, divide it into sections and obtain a number of pixels at equal intervals, denoted as marker pixels. Draw the normal to the edge of any marker pixel, and obtain a number of neighboring pixels on the normal. It should be noted that the number of obtained pixels is set by the implementer according to the actual implementation situation, and there is no specific limit. For example, the distance interval can be set to 5 pixels. The neighboring pixels include a number of pixels in the left neighboring area and a number of pixels in the right neighboring area, and the number of pixels taken from the two neighboring areas is equal. The specific number is not limited and can be set to 10 pixels.

[0074] ;

[0075] In the formula, This indicates the degree of structural correlation between the partitions of any injection-molded fuse box; This indicates the number of marker pixels on the edge of the partition of the fuse box injection molded part; This indicates the number of neighboring pixels of the a-th marked pixel on the edge of the partition of the fuse box injection molded part; , This represents the grayscale value of the (k+1)th and (k)th neighboring pixels of the a-th marked pixel on the edge of the partition of the injection molded part of the fuse box.

[0076] In the formula, This represents the grayscale difference between two adjacent neighboring pixels of the a-th marked pixel. The sum of the grayscale differences of all neighboring pixels of the a-th marked pixel represents the grayscale change of neighboring pixels on the normal of the marked pixel. The larger the value, the more obvious the grayscale change, indicating that the structural change of the fuse box injection molded part is large, and the structural correlation of the partition is small. This represents the sum of the structural changes of all marked pixels, reflecting the degree of structural correlation between the partitions of the fuse box injection molded part.

[0077] Preferably, the deformation consistency of any partition of the fuse box injection molded part is obtained based on the pixel position relationship of the partition:

[0078] Obtain the deformation distance of all edge pixels of any partition of the injection molded part of the fuse box, and construct a deformation distance sequence.

[0079] It should be noted that in the deformation distance sequence, if there are segments with consistent deformation in the partition of the fuse box injection molded part, then there are subsequences with similar changes in the deformation distance sequence. By adding a window, the deformation distance subsequences within the window can be matched to obtain the similarity between the atomic sequence and the moving subsequence during the window movement. If there are subsequences with high similarity, it indicates that the deformation consistency of the partition of the fuse box injection molded part is high.

[0080] Two windows of the same size are established, denoted as target windows. When the target window size is w, the target window is slid to ensure that no elements overlap. The DTW distance of the deformation distance sequence of edge pixels within the target window is calculated. The deformation distance sequence of edge pixels within the target window with the smallest DTW distance is denoted as the consistent subsequence when the window size is w. The window size w is compared with the DTW distance of the consistent subsequence of the corresponding window size. The window with the largest ratio and the corresponding ratio are obtained. This ratio is denoted as the deformation consistency of the partition of the fuse box injection molded part.

[0081] Preferably, the product of the structural correlation degree and deformation consistency of any partition of the injection molded fuse box is recorded as the partition coefficient of the partition of the injection molded fuse box.

[0082] It should be noted that for any partitioned fuse box injection part, the larger the material coefficient and the larger the partition coefficient, the greater the fuse box injection part's ability to accept deformation. The degree of deformation should be reduced to correct the degree of deformation and ensure the accuracy of the injection part's inspection.

[0083] Preferably, by combining the partition coefficient of the safe box injection molded part, the initial deformation degree, and the material coefficient of the safe box injection molded part, the final deformation degree of the safe box injection molded part is obtained, satisfying the expression:

[0084] ;

[0085] in, This indicates the final degree of deformation of any section of the injection-molded fuse box; This indicates the initial degree of deformation of the injection-molded parts of the fuse box; This indicates the material coefficient of the injection-molded fuse box; This represents the partition coefficient of the injection-molded fuse box.

[0086] At this point, the final deformation degree of all fuse box injection molded parts in the image of the fuse box injection molded part area has been obtained.

[0087] S4: Based on the final deformation degree of the injection molded part of the fuse box, obtain the overall defect index of the injection molded part area image of the fuse box to complete the defect detection.

[0088] It should be noted that determining the quality of a fuse box injection molded part requires not only assessing the quality of each individual section but also considering the overall component. Sections with significant deformation, or a large number of deformed sections, will affect the overall quality of the fuse box injection molded part. Therefore, this invention combines the final deformation degree of all sections to obtain the overall defect index of the fuse box injection molded part and establishes a passing threshold to complete defect detection.

[0089] Specifically, based on the final deformation degree of the injection molded parts of the fuse box, the overall defect index of the injection molded parts area image is obtained:

[0090] ;

[0091] In the formula, This represents the overall defect index of any injection-molded area image of a fuse box; The number of partitions in the fuse box injection molded part area image represents the number of partitions in the fuse box injection molded part area image. This indicates the final degree of deformation of the h-th fuse box injection molded part section; This indicates the maximum final deformation degree of all injection-molded parts of the fuse box.

[0092] At this point, the overall defect index of all injection-molded areas of the fuse box has been obtained.

[0093] When the overall defect index exceeds the preset threshold, the image of the fuse box injection molded part area is recorded as a defect image, and the corresponding fuse box injection molded part is recorded as a defective fuse box injection molded part, thus completing the defect detection.

[0094] It should be noted that the threshold is set by the implementers based on the actual implementation situation, and there are no specific restrictions. For example, the threshold may be 0.5.

[0095] This completes the defect detection of the injection molded parts of the fuse box.

[0096] While various embodiments of the invention have been shown and described in this specification, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention.

[0097] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A machine vision-based method for detecting defects in injection-molded fuse box parts, characterized in that, include: Preprocess the image of the injection molded fuse box to obtain an image of the injection molded fuse box area; Pixel matching is performed on the image of the injection molded area of ​​the fuse box. A standard model of the injection molded fuse box is established based on the coordinate changes of the matched pixels and the straight line fitting method. Based on the distance distribution of matching pixels between the fuse box injection molded part area image and the standard model, the fuse box injection molded part area image is divided into several fuse box injection molded part partitions, and the preliminary deformation degree of each fuse box injection molded part partition is obtained. Based on the initial deformation degree of the fuse box injection molded part area image, the material coefficient of the fuse box injection molded part is obtained, including: obtaining the chain code of the pixels of all fuse box injection molded part partitions corresponding to the cluster with the largest average initial deformation degree of the fuse box injection molded part area image; obtaining the difference sequence of the chain code; ; In the formula, This indicates the material coefficient of the injection-molded fuse box; This indicates the number of images in the injection-molded area of ​​the fuse box; This represents the number of partitions in the fuse box injection molded part of the m-th image; The number of partitions in the injection-molded fuse box representing the cluster with the largest initial degree of deformation; This represents the sum of the difference sequences of the chain codes of the pixels in the h-th partition of the fuse box injection molded part of the m-th image; Based on the grayscale changes and pixel position relationships of the fuse box injection molded parts, the partition coefficients of the fuse box injection molded parts are obtained, including: obtaining the structural correlation degree of any fuse box injection molded parts partition based on the grayscale changes of the fuse box injection molded parts partition; and obtaining the deformation consistency of any fuse box injection molded parts partition based on the pixel position relationships of the fuse box injection molded parts partition. The product of the structural correlation and deformation consistency of any partition of the injection molded fuse box is denoted as the partition coefficient of the partition of the injection molded fuse box. By combining the partition coefficient, initial deformation degree, and material coefficient of the safe box injection molded part, the final deformation degree of the safe box injection molded part partition is obtained. Based on the final deformation degree of the injection molded parts of the fuse box, the overall defect index of the injection molded parts area image is obtained to complete the defect detection.

2. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 1, characterized in that, The method for establishing a standard model of the fuse box injection molded part based on the coordinate changes of matched pixels and line fitting includes: A sequence of images of the injection-molded fuse box region is obtained. An image registration algorithm is used to match any two adjacent images of the injection-molded fuse box region to obtain several matching pixels. The coordinates of any matching pixel are obtained, and the feature representation of any matching pixel is calculated based on the coordinate changes. Edge detection is performed on the first image of the injection-molded fuse box region to obtain several edges. Using the feature representation of the pixels on the edges that are matching pixels as weights, a weighted least squares method is used to fit a straight line to all matching pixels on the edges. The fitted line is then replaced with the corresponding edge to obtain the standard model of the injection-molded fuse box.

3. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 2, characterized in that, The calculation of the feature representation of any matching pixel based on the coordinate changes of the matching pixel includes: Overlay all images of the fuse box injection molding area at 1-pixel intervals; obtain the coordinates of any matching pixel in the first fuse box injection molding area image; sequentially obtain the coordinates of corresponding matching pixels in all fuse box injection molding area images to obtain the coordinate sequence of the matching pixels; obtain the spatial distance between any two adjacent coordinates in the coordinate sequence of the matching pixels; sum the spatial distances of all adjacent coordinates to obtain the position change of the matching pixel. The negative correlation normalization process is then performed to obtain the feature representation of the matched pixels.

4. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 1, characterized in that, The distance distribution of matching pixels between the fuse box injection molded part area image and the standard model is used to divide the fuse box injection molded part area image into several fuse box injection molded part partitions, and to obtain the preliminary deformation degree of each fuse box injection molded part partition, including: Edge detection is performed on the image of the fuse box injection molded part area to obtain an edge image. All edge pixels of the standard model are projected onto the edge image, and the minimum distance between any edge pixel in the edge image and the standard model pixel is obtained, which is recorded as the deformation distance of the edge pixel. A clustering algorithm is used to cluster all edge pixels in the edge image to obtain several fuse box injection molded part partitions of the edge image. The deformation distances of all edge pixels in any fuse box injection molded part partition are added together, which is recorded as the initial deformation degree of the fuse box injection molded part partition.

5. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 1, characterized in that, The step of obtaining the structural correlation degree of any partition of the injection molded fuse box based on the grayscale changes of the partitions includes: For any partition of the fuse box injection molded part, obtain several pixels at equal intervals, and record them as marked pixels. Draw the edge normal of any marked pixel and obtain several neighboring pixels of the marked pixel on the normal. Take the difference between the gray values ​​of any two adjacent neighboring pixels and take the absolute value, which is recorded as the gray value difference between the two adjacent neighboring pixels. Add the gray value differences of all adjacent neighboring pixels of all marked pixels and perform negative correlation normalization processing to obtain the structural correlation degree of the partition of the fuse box injection molded part.

6. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 1, characterized in that, The step of obtaining the deformation consistency of any partition of the fuse box injection molded part based on the pixel position relationship of the partition includes: Obtain the deformation distances of all edge pixels in any fuse box injection molded part partition, forming a deformation distance sequence; establish two windows of the same size, denoted as target windows. When the target window size is w, slide the target window to ensure that no elements overlap; calculate the DTW distance of the deformation distance sequence of edge pixels within the target window, and denote the deformation distance sequence of edge pixels within the target window with the minimum DTW distance as the consistent subsequence when the window size is w; compare the window size w with the DTW distance of the consistent subsequence of the corresponding window size, obtain the window with the maximum ratio and the corresponding ratio, and denote the ratio as the deformation consistency of the fuse box injection molded part partition.

7. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 1, characterized in that, The final deformation degree of the safe box injection molded part is obtained by combining the partition coefficient, the initial deformation degree, and the material coefficient of the safe box injection molded part, which satisfies the expression: ; in, This indicates the final degree of deformation of any section of the injection-molded fuse box; This indicates the initial degree of deformation of the injection-molded parts of the fuse box; This indicates the material coefficient of the injection-molded fuse box; This represents the partition coefficient of the injection-molded fuse box.

8. The method for defect detection of injection-molded fuse box parts based on machine vision according to claim 1, characterized in that, The overall defect index of the injection molded area image of the fuse box satisfies the expression: ; In the formula, This represents the overall defect index of any injection-molded area of ​​a fuse box; This indicates the number of partitions in the fuse box injection molding area; This indicates the final degree of deformation of the h-th fuse box injection molded part section; This indicates the maximum final deformation degree of all injection-molded parts of the fuse box.

Citation Information

Patent Citations

  • Injection molding part defect detection method and system based on machine vision

    CN113484329A

  • Aluminum material image defect detection method based on self-adaptive anchor frame

    CN112085735A

  • Intelligent detection system suitable for new material ceramic tool

    CN113640305A