Wire harness terminal quality detection method and system based on image processing

Through adaptive image processing methods, combined with grayscale change factors and gradient feature extraction factors, the denoising intensity is dynamically adjusted, which solves the problem of defect feature removal in traditional methods and achieves efficient and accurate quality inspection of wire harness terminals.

CN120807491AInactive Publication Date: 2025-10-17SHENZHEN QINBEN ELECTRONICS +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511248132.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-10-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional wire harness terminal image quality inspection methods easily lead to defect features being removed during the denoising process, affecting the inspection effect. In particular, effective inspection is difficult in cases where the wire harness terminal is poorly crimped or the core wire is exposed.

Method used

An adaptive image processing method is used to extract factors through grayscale change factor, corner feature and gradient change feature, combined with weight mapping factor and improved NLM denoising algorithm to dynamically adjust the denoising intensity, retain defect features and suppress noise.

Benefits of technology

It significantly improves the efficiency and accuracy of wire harness terminal quality inspection, can effectively identify minor defects such as poor crimping and exposed core wires, and improves the quality inspection effect of wire harness terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807491A_ABST
    Figure CN120807491A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of terminal quality detection, in particular to a wire harness terminal quality detection method and system based on image processing. The method comprises the following steps: acquiring a gray terminal image; calculating a gray level change factor, analyzing angular point features and gradient change features in the neighborhood of each edge line, and calculating a feature extraction factor in combination with the gray level change factor; constructing a weight mapping factor based on the feature extraction factor; using the weight mapping factor to improve an attenuation parameter in an NLM denoising algorithm to obtain an improved attenuation parameter; based on the improved attenuation parameter, using an NLM denoising algorithm to obtain a denoised gray-scale terminal image, and using a neural network to perform quality detection on a terminal in the gray-scale terminal image; the wire harness terminal quality detection efficiency is improved, and the wire harness terminal quality detection effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of terminal quality detection, in particular to a wire harness terminal quality detection method and system based on image processing. BACKGROUND

[0002] The wire harness is applied to the fields of aerospace, ships, radio communication equipment, high-speed rails and automobiles, and the wire harness terminal is an important part of the wire harness, is formed based on wire harness stripping and crimping of a contact terminal, in the wire harness assembly process, the wire harness stripping may have different lengths and the core wire may be scattered, and in the crimping process of the contact terminal and the wire harness, the quality problems of unsuccessful crimping, crimping to the tail and core wire leakage may occur, which may reduce the quality of the wire harness; the crimping quality of the terminal not only affects the contact resistance, but also relates to the conduction performance and durability, and therefore the quality control of the terminal is an important link in the wire harness manufacturing process.

[0003] However, in the actual production process, due to process parameter control, equipment precision, manual operation difference and other factors, the wire harness stripping link often has different stripping lengths, core wire scattering and twisted wire disorder, which affects the subsequent terminal crimping. In the terminal crimping link, there may be defects such as crimping to the tail, loose crimping, core wire leakage and unsuccessful crimping, which not only causes unstable electrical performance of the wire harness product, but also causes safety hazards caused by poor contact.

[0004] In the traditional detection of the image quality of the wire harness terminal, the uniform intensity filtering process irreversibly destroys the morphological characteristics of the defects, the high-frequency noise suppression process synchronously erases the edge gradient and texture details of the micro-defects, and the texture of the wire harness terminal appears distorted in the image; meanwhile, the global smoothing operation compresses the dynamic range of the low-contrast defects, which easily causes the defect features to be removed by denoising, thereby affecting the quality detection effect of the wire harness terminal. SUMMARY

[0005] In order to solve the problem that the fixed denoising effect is selected, the defect features are easily removed by denoising, and the quality detection effect of the wire harness terminal is affected, the application provides a wire harness terminal quality detection method and system based on image processing.

[0006] In the first aspect, the application provides a wire harness terminal quality detection method based on image processing, which adopts the following technical scheme: Collecting a wire harness terminal image for preprocessing to obtain a gray terminal image; selecting a neighborhood of each edge line in the gray terminal image, dividing a sub-neighborhood in the neighborhood and all regions in the sub-neighborhood, calculating the variance of the mean value of the gray values of all regions in the sub-neighborhood as a gray variation factor of the sub-neighborhood; analyzing the corner feature and gradient change feature in the neighborhood of each edge line and calculating a feature extraction factor in combination with the gray variation factor, to reflect the obvious degree of the terminal defect feature in the neighborhood; Based on the feature extraction factor, a weight mapping factor is constructed by a mapping function adaptively adjusted by a steepness adjustment coefficient, the steepness adjustment coefficient is determined according to the texture brightness difference of the neighborhood; the weight mapping factor is used to improve the attenuation parameter in the NLM denoising algorithm to obtain an improved attenuation parameter, the improved attenuation parameter is in a negative correlation relationship with the weight mapping factor; based on the improved attenuation parameter, the NLM denoising algorithm is used to obtain a denoised gray terminal image, and the neural network is used to detect the quality of the terminal in the gray terminal image.

[0007] The beneficial effect is that the gray change factor is used to capture the abnormal gray distribution caused by the metal gap and the light transmission phenomenon in the crimping area, and then the feature extraction factor of the fusion of the corner feature and the gradient feature is used to comprehensively represent the defect probability, and finally the NLM denoising strength is dynamically regulated based on the weight mapping factor, so that the noise is suppressed while the fragile defect feature is completely retained, and the problem of feature disappearance caused by traditional fixed denoising is solved.

[0008] Further, the neighborhood of each edge line in the gray terminal image comprises: using an edge detection algorithm to obtain an edge line composed of each edge pixel point in the gray terminal image, obtaining a midpoint of the edge line, and constructing a rectangular window with a preset length as the neighborhood of each edge line with the midpoint of the edge line as the center.

[0009] Further, the division of the sub-neighborhood in the neighborhood and all regions in the sub-neighborhood comprises: using an edge line to divide the neighborhood of the edge line into two sub-neighborhoods, and using a region growing segmentation algorithm to segment each sub-neighborhood to obtain all regions.

[0010] Further, the feature extraction factor is obtained by analyzing the characteristics of the corner points in the sub-neighborhood and the gradient change characteristics to calculate a first mean value and a second mean value. The calculation formula of the feature extraction factor is: ; in the formula, is the feature extraction factor of the neighborhood of each edge line; is the gray change factor of any one sub-neighborhood of each edge line after normalization, is the gray change factor of another sub-neighborhood of each edge line after normalization; is the first mean value of each edge line after normalization, is the second mean value of each edge line after normalization; is a preset tuning factor.

[0011] The beneficial effects are that the absolute difference value of the gray level change factor between the sub-neighborhoods reflects the gray level mutation intensity of the compression non-closed area, the deviation degree of the normalized first mean value from the 90-degree angle quantifies the geometric distortion to reflect the deformation degree of the rectangular core, and the normalized second mean value represents the edge gradient intensity to capture the sharpness of the reflective area, so that the feature extraction factor is constructed to make the defect area present a high response value.

[0012] Further, the method for obtaining the first mean value and the second mean value is that an angle point detection algorithm is used to obtain all angle points of each area, a fitting algorithm is used to perform quadrilateral fitting on all the angle points, the angles of the four corners in the quadrilateral are obtained, and the mean value of the angles of the four corners is calculated as the first mean value; a gradient operator is used to obtain the gradient amplitude of the gray value of the pixel points on the edge line of the quadrilateral, and the mean value of all the gradient amplitudes on the quadrilateral is taken as the second mean value.

[0013] Further, the method for obtaining the weight mapping factor is that For each edge line neighborhood, the difference between the feature extraction factor and the preset defect threshold value is calculated, and the multiplication result of the steepness adjustment coefficient is calculated, the calculation result of the exponential function with the natural constant as the base and the negative value of the multiplication result as the exponent is calculated, and the reciprocal of the sum result of the calculation result and the numerical value 1 is taken as the weight mapping factor of each edge line neighborhood.

[0014] The beneficial effects are that the weight mapping factor introduces the steepness adjustment coefficient, and the smooth mapping of the defect probability to the denoising weight is realized through the S-shaped curve.

[0015] Further, the steepness adjustment coefficient is the reciprocal of the contrast of the gray level co-occurrence matrix of each edge line neighborhood after normalization.

[0016] The beneficial effects are that the reciprocal of the contrast of the gray level co-occurrence matrix is taken as the steepness coefficient, the rough area of the texture is smoothly transitioned to reduce the misjudgment, the fine area of the texture is enhanced to increase the discrimination, and the physical properties of the terminal surface indentation are matched.

[0017] Further, the method for obtaining the improved attenuation parameter is that for each edge line neighborhood, the difference between the preset maximum attenuation parameter and the preset minimum attenuation parameter is calculated as a first difference value, the difference between the numerical value 1 and the weight mapping factor is calculated as a second difference value, the product of the first difference value and the second difference value is calculated, and the sum result of the preset minimum attenuation parameter and the product is taken as the improved attenuation parameter of each edge line neighborhood.

[0018] The beneficial effects are that the improved attenuation parameter and the weight mapping factor form a negative correlation relationship, the denoising strength is automatically reduced when the feature extraction factor indicates a high defect risk, and protective weak denoising is implemented in the suspected defect area.

[0019] Further, the preset maximum attenuation parameter and the preset minimum attenuation parameter are both obtained based on the noise intensity of the gray value of the pixel point in the neighborhood.

[0020] In a second aspect, the application provides an image processing-based wire harness terminal quality detection system, which adopts the following technical solution: The image processing-based wire harness terminal quality detection system comprises a processor and a memory, and the memory stores computer program instructions.

[0021] The image processing-based wire harness terminal quality detection method is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that the system is made of the memory and the processor, and is convenient to use.

[0022] The application has the following technical effects: Firstly, the application analyzes the edge line neighborhood characteristics of the gray terminal image, calculates the variance of the mean value of all region gray values in the sub-neighborhood as the gray change factor, and obtains the gray distribution abnormality feature caused by the metal gap or light transmission phenomenon in the poor crimping area; further, the feature extraction factor is calculated by comprehensively considering the corner feature and the gradient change feature, and three key physical features are fused: the absolute difference value of the gray change factor between the sub-neighborhoods reflects the gray mutation intensity of the closed area of the crimping, the deviation degree of the normalized first mean value from the 90-degree angle quantifies the geometric shape distortion, and the edge gradient intensity is represented by the normalized second mean value to reflect the sharpness of the wire core light area, and finally the feature extraction factor presents a high value response in the crimping defect area. Further, when the weight mapping factor is constructed based on the feature extraction factor, the steepness adjustment coefficient determined by the texture brightness difference is introduced, the coefficient controls the transition steepness of the inverse function of the gray co-occurrence matrix contrast through the adaptive function, ensures the gentle mapping in the rough texture area to avoid misjudgment, and enhances the discrimination in the delicate texture area; finally, the weight mapping factor and the improved attenuation parameter form a negative correlation, and the spatial feature information is converted into a denoising intensity control signal: when the feature extraction factor indicates a high defect risk, the weight mapping factor tends to 1, the improved attenuation parameter is driven to approach the minimum value, and weak denoising is implemented in the suspected defect area to completely retain the defect feature; otherwise, strong denoising is applied in the background or non-key area to suppress noise. While suppressing noise, the application maximizes the morphological characteristics of defects, inputs the optimized denoising image into the neural network classifier, significantly improves the detection rate of subtle defects such as poor crimping and exposed core wire, improves the quality detection efficiency of the wire harness terminal, and improves the quality detection effect of the wire harness terminal. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1is a method flowchart of a harness terminal quality detection method based on image processing of the present application; Figure 2 is a schematic diagram of a crimping deficiency of a harness terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] The embodiment of the present application discloses a harness terminal quality detection method based on image processing, acquires a gray terminal image; calculates a gray change factor, analyzes the corner point features and gradient change features in the neighborhood of each edge line, combines the gray change factor, and calculates a feature extraction factor; constructs a weight mapping factor based on the feature extraction factor; improves the attenuation parameter in the NLM denoising algorithm using the weight mapping factor to obtain an improved attenuation parameter; acquires a denoised gray terminal image based on the improved attenuation parameter using the NLM denoising algorithm, and uses a neural network to detect the quality of the terminal in the gray terminal image; improves the efficiency of the harness terminal quality detection and improves the effect of the harness terminal quality detection.

[0025] REFERENCE Figure 1 The harness terminal quality detection method based on image processing includes steps S1-S3.

[0026] S1: Collects a harness terminal image for preprocessing to acquire a gray terminal image.

[0027] For the harness terminal, a cmos camera is used to acquire a harness terminal image. In order to facilitate subsequent analysis, the harness terminal image is preprocessed. In an embodiment of the present application, a mean filter denoising algorithm is used to denoise the harness terminal image. The implementer can select other denoising methods based on the actual situation. The denoised harness terminal image is subjected to gray scale processing to acquire a gray terminal image.

[0028] S2: Selects the neighborhood of each edge line in the gray terminal image, divides the sub-neighborhood and all regions in the sub-neighborhood, calculates the variance of the mean value of the gray values of all regions in the sub-neighborhood as the gray change factor of the sub-neighborhood; analyzes the corner point features and gradient change features in the neighborhood of each edge line and calculates the feature extraction factor combined with the gray change factor, which reflects the degree of obviousness of the terminal defect features in the neighborhood; based on the feature extraction factor, a weight mapping factor is constructed through a mapping function that is adaptively adjusted by a steepness adjustment coefficient, and the steepness adjustment coefficient is determined according to the texture brightness difference of the neighborhood.

[0029] In the process of crimping the wire harness terminal, the quality of the wire harness terminal material directly affects the quality of the wire harness. The defects of the wire harness terminal have the condition of abnormal crimping quality. The present application analyzes the characteristics of the poor crimping of the wire harness terminal. When the wire harness terminal has poor crimping, the area of insufficient crimping is usually not closed or has a high intermetallic gap in the image, which causes the geometry of the terminal in the crimping area to deviate from the standard, and the performance in the image is a gap that is not completely crimped, which affects the symmetry and stability of the local image. At the same time, due to the incomplete crimping of the metal surface in the insufficient crimping area, the local gray scale shows a relatively uniform and bright feature. It may be due to the high reflectivity of the uncrimped area that the light transmission phenomenon occurs. Therefore, the gray scale of the insufficient crimping area changes smoothly, and there is no significant shadow or light spot. Finally, when the crimping is insufficient, the metal surface lacks indentation and texture. Therefore, the texture intensity of this area is weak, the spatial frequency of the texture is low, and it shows a relatively smooth or no obvious stripe. The insufficient crimping of the wire harness terminal is shown in FIG. Figure 2

[0030] Based on the above analysis, for the gray terminal image, an edge detection algorithm is used to obtain the edge lines composed of each edge pixel point in the gray terminal image. The edge detection algorithm used in an embodiment of the present application is the canny edge detection algorithm, and the implementer can select other edge detection algorithms based on the actual situation. The midpoint of each edge line in the gray terminal image is obtained. At the same time, for the midpoint of each edge line, a rectangular window with a side length of n is constructed as the neighborhood of each edge line with the midpoint of the edge line as the center. In an embodiment of the present application, the value of n is 10, and the implementer can select other values based on the actual situation.

[0031] When the wire harness terminal has insufficient crimping, the area of the crimping that is not closed will expose the area of the wire core, which will cause different image features on both sides of the edge line of the crimping shell. One side of the edge line shows the area of the shell, and the other side of the edge line shows the exposed wire core. The outer surface of the wire core will show an elongated high-reflectivity area in the image. Therefore, for the neighborhood of the edge line, the edge line is used to divide the neighborhood of the edge line into two sub-neighborhoods, and a region growing segmentation algorithm is used to segment each sub-neighborhood to obtain all regions. In an embodiment of the present application, the seed points are randomly sampled, and the region growing criterion is that when the absolute value of the difference between the gray scale values of the pixel to be investigated and the seed point is less than a preset difference threshold, it is included in the region. In an embodiment of the present application, the value of the preset difference threshold is 10, and the implementer can select other values based on the actual situation. The growing neighborhood is a 4-neighborhood, and the growth stops when there are no more adjacent pixels that meet the criterion. The specific growth process is a known technology, and will not be described here.

[0032] ​For each sub-neighborhood in the neighborhood of each edge line, the variance of the average of the gray values of the pixels in all regions in the sub-neighborhood is calculated as the gray level change factor of each sub-neighborhood of each edge line; all corner points of each region are obtained using the Harris corner point detection algorithm, and the angles of the four corners in the quadrilateral are obtained by performing quadrilateral fitting on all the corner points using the least square method, and the average of the angles of the four corners is calculated as a first average, and at the same time, the gradient amplitude of the gray values of the pixels on the edge line of the quadrilateral is obtained using the Sobel gradient operator, and the average of all the gradient amplitudes on the quadrilateral is taken as a second average.

[0033] Based on the above analysis, a feature extraction factor is constructed, and the calculation formula is: In the formula, is the feature extraction factor of the neighborhood of each edge line; is the gray level change factor of a normalized arbitrary sub-neighborhood of each edge line, is the gray level change factor of another normalized sub-neighborhood of each edge line; is the first average of the normalized each edge line, is the second average of the normalized each edge line; is a preset tuning factor to prevent the denominator from being 0, and in an embodiment of the present application, the value of is 0.01, and other values can be selected based on actual conditions.

[0034] It should be noted that based on the above analysis, when the wire harness terminal may have a compression deficiency defect, the feature presented in the image is that one side of the edge line of the outer skin region is the outer skin region, and the other side is the bare core region. Since the core is relatively chaotic, it appears to have a large variation in gray value when exposed in the image. At this time, in the regions on both sides of the edge line of the outer skin, the gray value change of one side region is more obvious, and the gray value change of the other side region is more gentle. At this time, the value of is large, and there is a reflective area on the core. Since the core is long and rectangular in shape in the image, the edges of the rectangle are more obvious, and the gradient value of the pixels on the edges is large, the value of the fitted quadrilateral in the image is closer to a rectangle, i.e. the value of

[0035] Further, when the region in the image presents a feature that can be a defect, a smaller weight should be given when denoising to prevent the feature of the defect in the image from being over-denoised, thereby removing the feature of the defect and affecting the effect of subsequent quality detection on the wire harness terminal. Therefore, the weight mapping factor is obtained based on the feature extraction factor, and the formula is: ; in the formula, the weight mapping factor of the neighborhood of each edge line; the feature extraction factor of the neighborhood of each edge line, represents the calculation result of the exponential function with the natural constant e as the base, is a preset defect threshold, in an embodiment of the present application, the value of the preset defect threshold is 0.8, and other values can be selected by the implementer based on the actual situation, is a steepness adjustment coefficient.

[0036] In the present application, the steepness adjustment coefficient is the reciprocal of the contrast of the gray level co-occurrence matrix of the normalized neighborhood of each edge line. The implementer can select other parameters that can reflect the indentation and texture as the steepness adjustment coefficient based on the actual situation.

[0037] It should be noted that the present application assigns different weights to the feature presentation of different regions based on the weight mapping factor. When is higher than the preset defect threshold, the neighborhood region of the edge line is suspected to be a defect region, at this time, the value is closer to the value 1; otherwise, the value is closer to the value 0, and the smooth transition takes into account the robustness and accuracy without manual segmentation; at the same time, the steepness adjustment coefficient controls the steepness of the mapping based on the degree of indentation and texture in the edge line. When the indentation and texture in the edge line are more obvious, the possibility of the region appearing to be insufficiently pressed is smaller, and at this time, the steepness of the mapping is lower, and the value of the weight mapping factor finally obtained by the feature extraction factor of the same degree is smaller; otherwise, the value of the weight mapping factor obtained is larger.

[0038] Step S3: using the weight mapping factor to improve the attenuation parameter in the NLM denoising algorithm to obtain an improved attenuation parameter, the improved attenuation parameter and the weight mapping factor are in a negative correlation relationship; using the NLM denoising algorithm based on the improved attenuation parameter to obtain a denoised gray terminal image, and using a neural network to perform quality detection on the terminal in the gray terminal image.

[0039] The weight mapping factor is used to improve the attenuation parameter in the NLM denoising algorithm, and the calculation formula is: ; in the formula, is the improved attenuation parameter of the neighborhood of each edge line, is a preset minimum attenuation parameter, a preset maximum attenuation parameter, a weight map factor of a neighborhood of each edge line.

[0040] In an embodiment of the present application, the preset maximum attenuation parameter is a product of a standard deviation of noise of all pixel gray values in the neighborhood and a value of 1.15, and the preset minimum attenuation parameter is a product of the standard deviation of noise of all pixel gray values in the neighborhood and a value of 0.6. Other values can be selected by the implementer based on actual conditions. In addition, the present application uses a Laplacian convolution estimation method to obtain the standard deviation of noise of all pixel gray values in the neighborhood. The specific calculation steps are known techniques and will not be described here.

[0041] It should be noted that, The closer to the value of 1, the greater the possibility of defects. At this time The smaller the value of the, the more features of the defects that are presented in the image are preserved, and only slight denoising is performed in the neighborhood. Conversely, the smaller the possibility of defects, the more denoising needs to be enhanced.

[0042] At this point, the gray terminal image after denoising is obtained. The gray terminal image after denoising is input into the trained convolutional neural network model. The model automatically extracts terminal morphology, solder joint integrity, and surface flaw features, and determines whether the quality is qualified based on the output classification result. Specifically, in an embodiment of the present application, in the convolutional neural network, the input terminal image first passes through three convolution modules that are deepened layer by layer. Each module is composed of a convolution kernel with a size of 3x3, a step of 1, moderate padding, and ReLU activation. The number of convolution kernels develops from 32, 64 to 128 to extract multi-level features. Each module is followed by a 2x2 max pooling to compress the feature map. Then, two fully connected layers (containing 256 and 64 neurons, respectively) are used to integrate spatial information, and a Dropout with a proportion of 0.5 is added before output to prevent overfitting. During training, the Adam optimizer is used with an initial learning rate of 0.001 and a learning rate decay strategy. The batch size is 32, and the loss function is cross-entropy to ensure accurate differentiation between qualified and unqualified terminal quality under limited samples. For the above parameters, the implementer can select other values based on actual conditions.

[0043] The embodiment of the present application also discloses a wire harness terminal quality detection system based on image processing, which comprises a processor and a memory. The memory stores computer program instructions. When the computer program instructions are executed by the processor, the wire harness terminal quality detection method based on image processing according to the present application is realized.

[0044] The above system also includes a communication bus and a communication interface and other components familiar to those skilled in the art. Their settings and functions are known in the art, and therefore will not be described here.

[0045] The above are all preferred embodiments of the present application, and do not limit the protection scope of the present application, so that: all equivalent changes made according to the structure, shape, principle of the present application should be covered in the protection scope of the present application.

Claims

1. A wire harness terminal quality detection method based on image processing, characterized in that: The method comprises the following steps: collecting a wiring harness terminal image and performing preprocessing to obtain a grayscale terminal image; selecting a neighborhood of each edge line in the grayscale terminal image, dividing the neighborhood into sub-neighborhoods and all regions in the sub-neighborhoods, and calculating the variance of the grayscale value means of all regions in the sub-neighborhoods as a grayscale variation factor of the sub-neighborhoods; analyzing corner point features and gradient variation features in the neighborhood of each edge line and calculating a feature extraction factor in combination with the grayscale variation factor to reflect the degree of obviousness of terminal defect features in the neighborhood; Based on the feature extraction factor, a weight mapping factor is constructed by a mapping function adaptively adjusted by a steepness adjustment coefficient, wherein the steepness adjustment coefficient is determined according to the texture brightness difference of the neighborhood; and an attenuation parameter in the NLM denoising algorithm is improved using the weight mapping factor to obtain an improved attenuation parameter, wherein the improved attenuation parameter is negatively correlated with the weight mapping factor. Based on the improved attenuation parameters, the NLM denoising algorithm is used to obtain the denoised grayscale terminal image, and the neural network is used to perform quality detection on the terminals in the grayscale terminal image.

2. The wire harness terminal quality detection method based on image processing according to claim 1, characterized in that: The selection of the neighborhood of each edge line in the grayscale terminal image includes: using an edge detection algorithm to obtain the edge line composed of each edge pixel point in the grayscale terminal image, obtaining the midpoint of the edge line, and constructing a rectangular window with a preset length as the neighborhood of each edge line with the midpoint of the edge line as the center.

3. The wire harness terminal quality detection method based on image processing according to claim 1, characterized in that: The dividing of the neighborhood into sub-neighborhoods and all regions in the sub-neighborhoods includes: using an edge line to divide the neighborhood of the edge line into two sub-neighborhoods, and using a region growing segmentation algorithm to segment each sub-neighborhood to obtain all regions.

4. The wire harness terminal quality detection method based on image processing according to claim 1, characterized in that: The method for obtaining the feature extraction factor is: analyzing the features of the corner points and the gradient change features in the sub-neighborhood to calculate the first mean and the second mean; The calculation formula of the feature extraction factor is: Where, is the feature extraction factor of the neighborhood of each edge line; is the grayscale change factor of any sub-neighborhood of each edge line after normalization, is the grayscale change factor of another sub-neighborhood of each edge line after normalization; is the first mean of each edge line after normalization, is the second mean of each edge line after normalization; is the preset parameter factor.

5. The wire harness terminal quality detection method based on image processing according to claim 4, characterized in that: The method for obtaining the first mean and the second mean is: using a corner detection algorithm to obtain all corner points in each area, using a fitting algorithm to perform quadrilateral fitting on all corner points, obtaining the angles of the four corners in the quadrilateral, and calculating the mean of the angles of the four corners as the first mean; using a gradient operator to obtain the gradient amplitude of the grayscale value of the pixel points on the edge line of the quadrilateral, and taking the mean of all the gradient amplitudes on the quadrilateral as the second mean.

6. The wire harness terminal quality detection method based on image processing according to claim 1, characterized in that: The method for obtaining the weight mapping factor is: For the neighborhood of each edge line, the difference between the feature extraction factor and the preset defect threshold and the multiplication result of the steepness adjustment coefficient are calculated, and the calculation result of the exponential function with the natural constant as the base and the negative value of the multiplication result as the exponent is calculated. The reciprocal of the sum of the calculation result and the value 1 is used as the weight mapping factor of the neighborhood of each edge line.

7. The wire harness terminal quality detection method based on image processing according to claim 6, characterized in that: The steepness adjustment coefficient is the reciprocal of the contrast of the normalized gray level co-occurrence matrix of the neighborhood of each edge line.

8. The wire harness terminal quality detection method based on image processing according to claim 1, characterized in that: The method for obtaining the improved attenuation parameter is as follows: for the neighborhood of each edge line, the difference between the preset maximum attenuation parameter and the preset minimum attenuation parameter is calculated as the first difference, the difference between the numerical value 1 and the weight mapping factor is calculated as the second difference, the product of the first difference and the second difference is calculated, and the sum of the preset minimum attenuation parameter and the product is used as the improved attenuation parameter of the neighborhood of each edge line.

9. The wire harness terminal quality detection method based on image processing according to claim 8, characterized in that: The preset maximum attenuation parameter and the preset minimum attenuation parameter are both obtained based on the noise intensity of the grayscale values ​​of the pixels in the neighborhood.

10. The wire harness terminal quality detection system based on image processing is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the wire harness terminal quality detection method based on image processing according to any one of claims 1 to 9 is implemented.