Automobile wire harness structure detection method based on image processing
Through image processing technology, gamma correction and color space conversion are improved, combined with multi-step image segmentation and multi-scale shape context technology, the existing automotive wire harness detection methods are solved, and efficient and accurate wire harness structure detection is achieved.
Patent Information
- Application Number
- CN202411789412.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-11
AI Technical Summary
The existing automotive wire harness detection methods rely on manual detection, and their efficiency and accuracy are easily affected by subjective factors, making it difficult to meet the detection needs of complex wire harness structures.
Using an image processing-based method, image contrast is enhanced through improved gamma correction and color space conversion, combining multi-step image segmentation technology and multi-scale shape context technology to achieve accurate detection of wire harness structure.
It improves detection efficiency and accuracy, can clearly distinguish complex wiring harness structures, accurately compare actual and preset structures, and make more accurate judgments, and overcomes the problems of low accuracy and low efficiency of traditional detection methods.
Smart Images

Figure BDA0005174951330000021 
Figure BDA0005174951330000023 
Figure BDA0005174951330000031
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to an automobile wiring harness structure detection method based on image processing. Background Art
[0002] At present, in the field of automobile manufacturing, the wiring harness, as the network body of the automobile circuit, plays a key role in connecting various electrical components and transmitting power and signals. The accuracy and integrity of its structure are directly related to whether the electrical system of the automobile can operate normally. The existing automobile wiring harness detection method mainly relies on manual detection, which has many disadvantages. Manual detection is inefficient. Faced with a large number of wiring harness products, the detection speed is slow and it is difficult to meet the needs of large-scale production. Moreover, the accuracy of manual detection is easily affected by subjective factors, and long-term work is prone to fatigue, resulting in misjudgment and missed judgment, thereby affecting product quality. In addition, with the continuous development of automobile technology, the wiring harness structure has become increasingly complex, and traditional detection methods have been difficult to adapt to this change. In recent years, image processing technology has been widely used in the field of industrial detection. It has the advantages of non-contact, high efficiency, and accuracy, and provides new ideas and methods for automobile wiring harness structure detection. Summary of the invention
[0003] In view of the technical problems existing in the above-mentioned background technology, the present invention proposes an automobile wiring harness structure detection method based on image processing, which is simple in method, easy to operate and can effectively improve detection efficiency and accuracy.
[0004] In order to achieve the above object, the technical solution adopted by the present invention comprises the following steps:
[0005] S1. First, for the captured image, improved gamma correction and color space conversion are used to enhance the contrast of the image and improve the visibility of the wire harness. The specific implementation is as follows:
[0006] S11. First, convert the image from RGB space to XYZ color space and normalize the RGB values to the [0,1] range: Convert RGB values to linear RGB values:
[0007] Where R liner , G liner , B liner is the linearized RGB value;
[0008] S12, then convert the linear RGB value to XYZ color space through the matrix:
[0009] S13. Then, the value of the XYZ color space can be converted into the Lab color space to further enhance the contrast of the image. The conversion formula of the Lab space is: Where X ref , Y ref , Z ref It is the standard white point;
[0010] S14. Improved gamma correction for the L channel in Lab space: Where L′ is the brightness value after gamma correction, L max is the maximum value of the L channel;
[0011] S15. Finally, the enhanced Lab image is converted back to RGB space. The conversion from Lab to XYZ is: The conversion from XYZ to RGB is:
[0012] S2. Use image processing technology to accurately segment the wire harness. Through image segmentation technology, extract the outline and morphological information of the wire harness, and perform geometric analysis and structural detection;
[0013] S3. Finally, edge information and morphological information are combined to help identify different types and structures of wire harnesses, and the wire harnesses are compared with preset templates to detect whether they meet the standard structural requirements.
[0014] Preferably, the function f in step S13 or S15 is a nonlinear function, which is defined as:
[0015] Preferably, the step S2 uses image segmentation technology to extract the outline and morphological information of the wire harness, and performs geometric analysis and structural detection in the following steps:
[0016] S21, firstly, perform multi-scale Gaussian filtering on the image to blur the image, and then perform convolution on the image to extract features at different scales;
[0017] S22, then remove small objects and impurities in the image through corrosion operation, so as to extract the details of the wire harness: the formula of corrosion operation is: Where I is the image, S x and S y represents the offset of the structural element in the x and y directions, and then expands the boundary by dilation, The morphological features of the wire bundle are extracted by combining corrosion and dilation;
[0018] S23, analyzing the connection structure, intersection and bending degree geometric features of the wire harness by a morphological filtering method, and extracting the geometric features of the wire harness;
[0019] S24, finally, the minimum rectangular boundary of the image contour is calculated by the minimum circumscribed rectangle, and the image contour point set is {(x i ,y i )}, the goal of the minimum enclosing rectangle is to solve the four boundaries of the rectangle so that all points are inside the rectangle:
[0020] Preferably, the template matching in step S3 is performed by comparing the similarity between the target and the template by combining the multi-scale shape context technology, which is specifically implemented as follows:
[0021] S31. First, select multiple scales σ i ;
[0022] S32. For each point set P at each scale i , calculate the shape context SC of the point set at this scale i (p): Where d(p,q) is the Euclidean distance between points p and q;
[0023] S33. Then calculate the weighted distance metric of the shape context at different scales, taking into account the influence of different regions in the image: Among them, D multi-scale (P image ,P template ) is a multi-scale weighted distance metric, D i (P image ,P template ) is the shape context distance at the i-th scale;
[0024] S34. Finally, the structure is tested by comparing the actual structure of the harness with the requirements of the preset template. The shape comparison and tolerance analysis are used to determine whether it is qualified. The structural compliance formula is: Feature i is the i-th feature of the target, is the i-th feature of the preset template.
[0025] Compared with the prior art, the advantages and positive effects of the present invention are that the improved gamma correction and color space conversion can improve image contrast and enhance the visibility of the wire harness, laying a solid foundation for accurate detection. The multi-step image segmentation technology can effectively filter out noise and impurities, accurately outline the shape of the wire harness, and provide accurate analysis data. The multi-scale shape context technology is used for template matching, which fully considers the characteristics of different scales, accurately compares the actual and preset structures, and makes judgments more accurate. DETAILED DESCRIPTION
[0026] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.
[0028] Example, in the automobile manufacturing industry, automobile wiring harness is a key component of automobile circuits, and the accuracy of its structure plays a decisive role in the normal operation of the automobile electrical system. With the continuous development of automobile technology, the structure of wiring harness is becoming increasingly complex, and the traditional detection method that relies on manual labor can no longer meet production needs.
[0029] First, in the detection of automobile wiring harness structure, the original captured image may have low contrast and poor visibility of the wiring harness, which will affect the subsequent accurate analysis and detection of the wiring harness structure, easily lead to misjudgment or missed judgment, and reduce the accuracy of detection. In order to improve the accuracy of automobile wiring harness structure detection, an improved gamma correction and color space conversion method is adopted. First, the image is converted from RGB space to XYZ color space, and the RGB value is normalized to the [0,1] range: Convert RGB values to linear RGB values: Where R liner , G liner , B liner is the linearized RGB value; then the linear RGB value is converted to the XYZ color space through the matrix: Then, for the value of the XYZ color space, it can be converted to the Lab color space to further enhance the contrast of the image. The conversion formula of the Lab space is: Where X ref , Y ref , Z ref is the standard white point; improved gamma correction is performed on the L channel in Lab space: Where L′ is the brightness value after gamma correction, L max is the maximum value of the L channel; finally, the enhanced Lab image is converted back to RGB space, and the conversion from Lab to XYZ is: The conversion from XYZ to RGB is: The f function mentioned here is a nonlinear function, defined as: After processing, for some wiring harness parts with similar colors and low contrast, the lines and structures that were originally difficult to distinguish can be clearly distinguished in the processed image, so that the subsequent analysis and detection of the wiring harness structure can be based on more accurate image information.
[0030] Then, accurately obtaining the contour and morphological information of the wiring harness is crucial to determine whether its structure meets the requirements. In order to accurately extract the contour, morphology and other information of the automotive wiring harness, image processing technology is used to accurately segment the wiring harness. Through image segmentation technology, the contour and morphological information of the wiring harness are extracted for geometric analysis and structural detection. First, a multi-scale Gaussian filter is used to blur the image, and then the image is convolved to extract features at different scales; then the small objects and impurities in the image are removed through corrosion operation, so as to extract the details of the wiring harness: the formula for corrosion operation is: Where I is the image, S x and S y represents the offset of the structural element in the x and y directions, and then expands the boundary by dilation, By combining corrosion and expansion, the morphological features of the wire harness are extracted; by using the morphological filtering method, the connection structure, intersection and bending degree geometric features of the wire harness are analyzed to extract the geometric features of the wire harness; finally, the minimum rectangular boundary of the image contour is calculated by the minimum circumscribed rectangle, and the image contour point set is {(x i ,y i )}, the goal of the minimum enclosing rectangle is to solve the four boundaries of the rectangle so that all points are inside the rectangle: This processing can accurately extract the outline and morphological information of the wire harness. For complex wire harness structures, the direction and branching of each wire harness can be accurately identified.
[0031] Finally, in order to accurately determine whether the automobile wiring harness structure meets the standard requirements, the edge information and morphological information are combined to help identify the different types and structures of the wiring harness, and compare the wiring harness with the preset template. First, multiple scales σ i ; For each point set P at each scale i , calculate the shape context of the point set at this scale where d(p,q) is the Euclidean distance between points p and q; we then compute the weighted distance metric for the shape context at different scales, taking into account the influence of different regions in the image: Among them, D multi-scale (P image ,P template ) is a multi-scale weighted distance metric, D i (P image ,P template) is the shape context distance at the i-th scale; finally, the structure is checked by comparing the actual structure of the harness with the requirements of the preset template, and the conformity is judged by shape comparison and tolerance analysis. The structural compliance formula is:
[0032] Feature i is the i-th feature of the target, is the i-th feature of the preset template. This method can accurately identify different types and structures of wire harnesses, and accurately compare the actual wire harnesses with the preset templates, overcoming the problems of low accuracy and low efficiency in traditional automotive wire harness detection methods, improving detection efficiency and accuracy, and ensuring the quality of automotive wire harnesses.
[0033] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for detecting automobile wiring harness structure based on image processing, characterized in that: The following steps are involved: S1. First, for the captured image, improved gamma correction and color space conversion are used to enhance the contrast of the image and improve the visibility of the wire harness. The specific implementation is as follows: S11. First, convert the image from RGB space to XYZ color space and normalize the RGB values to the [0,1] range: Convert RGB values to linear RGB values: Where R liner , G liner , B liner is the linearized RGB value; S12, then convert the linear RGB value to XYZ color space through the matrix: S13. Then, the value of the XYZ color space can be converted into the Lab color space to further enhance the contrast of the image. The conversion formula of the Lab space is: Where X ref , Y ref , Z ref It is the standard white point; S14. Improved gamma correction for the L channel in Lab space: Where L′ is the brightness value after gamma correction, L max is the maximum value of the L channel; S15. Finally, the enhanced Lab image is converted back to RGB space. The conversion from Lab to XYZ is: The conversion from XYZ to RGB is: S2. Use image processing technology to accurately segment the wire harness. Through image segmentation technology, extract the outline and morphological information of the wire harness, and perform geometric analysis and structural detection; S3. Finally, edge information and morphological information are combined to help identify different types and structures of wire harnesses, and the wire harnesses are compared with preset templates to detect whether they meet the standard structural requirements.
2. The method for detecting automobile wiring harness structure based on image processing according to claim 1, characterized in that: The function f in step S13 or S15 is a nonlinear function, which is defined as:
3. The method for detecting automobile wiring harness structure based on image processing according to claim 1, characterized in that: The step S2 uses image segmentation technology to extract the outline and morphological information of the wire harness, and performs geometric analysis and structural detection in the following steps: S21, firstly, perform multi-scale Gaussian filtering on the image to blur the image, and then perform convolution on the image to extract features at different scales; S22, then remove small objects and impurities in the image through corrosion operation, so as to extract the details of the wire harness: the formula of corrosion operation is: Where I is the image, S x and S y represents the offset of the structural element in the x and y directions, and then expands the boundary by dilation, The morphological features of the wire bundle are extracted by combining corrosion and dilation; S23, analyzing the connection structure, intersection and bending degree geometric features of the wire harness by a morphological filtering method, and extracting the geometric features of the wire harness; S24, finally, the minimum rectangular boundary of the image contour is calculated by the minimum circumscribed rectangle, and the image contour point set is {(x i ,y i )}, the goal of the minimum enclosing rectangle is to solve the four boundaries of the rectangle so that all points are inside the rectangle:
4. The method for detecting automobile wiring harness structure based on image processing according to claim 1, characterized in that: The template matching in step S3 is to compare the similarity between the target and the template by combining the multi-scale shape context technology, which is specifically implemented as follows: S31. First, select multiple scales σ i ; S32. For each point set P at each scale i , calculate the shape context SC of the point set at this scale i (p): Where d(p,q) is the Euclidean distance between points p and q; S33. Then calculate the weighted distance metric of the shape context at different scales, taking into account the influence of different regions in the image: Among them, D multi-scale (P image ,P template ) is a multi-scale weighted distance metric, D i (P image ,P template ) is the shape context distance at the i-th scale; S34. Finally, the structure is tested by comparing the actual structure of the harness with the requirements of the preset template. The shape comparison and tolerance analysis are used to determine whether it is qualified. The structural compliance formula is: Feature i is the i-th feature of the target, is the i-th feature of the preset template.