A visual-based motor wire harness connection site anomaly detection method and system

CN122597356APending Publication Date: 2026-08-18XUZHOU CHICHENG ELECTROMECHANICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610760605.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0006]针对上述存在的技术不足,本发明的目的是提出一种基于视觉的电机线束连接部位异常检测方法,旨在解决现有技术中主要依赖单一检测置信度进行判定的方法,尤其是在金属壳体强反光、油污附着及线束阴影叠加等复杂工况下,难以稳定区分真实结构异常与光照伪影干扰的技术问题

Benefits of technology

[0018]The beneficial effects of this invention are as follows: By constructing an illumination state model based on brightness statistical constraints and performing adaptive brightness correction and structure preservation preprocessing accordingly, this invention can effectively suppress the interference of illumination artifacts on the detection results under complex illumination conditions such as strong reflection of metal shells, oil stains, and superposition of wire harness shadows, and improve the recognizability and stability of real structural features in the image of wire harness connection parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597356A_ABST
    Figure CN122597356A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of motor assembly quality image detection, and discloses a visual-based motor wire harness connection part abnormality detection method and system, wherein the method comprises the following steps: acquiring a motor wire harness connection part image; constructing a connection part illumination state vector; performing adaptive brightness correction; suppressing reflection and pollution interference; determining an effective wire harness connection part area; and outputting a wire harness connection abnormality detection result. Compared with the method in the prior art which mainly relies on single detection confidence for judgment, especially under complex working conditions such as strong reflection of a metal shell, oil stain adhesion and wire harness shadow superposition, the technical problem that it is difficult to stably distinguish between real structure abnormality and illumination artifact interference is solved. Due to the introduction of adaptive brightness correction and the joint mechanism based on attention enhancement target detection and assembly geometric constraint, the accuracy of motor wire harness connection part abnormality detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology for motor assembly quality, and in particular to a vision-based method and system for detecting anomalies in motor wiring harness connection parts. Background Technology

[0002] Currently, in electric vehicle motor assembly lines, quality inspection of wiring harness connections typically relies on manual visual inspection or vision inspection methods based on industrial cameras. These vision inspection methods often employ image acquisition under fixed lighting conditions, combined with threshold segmentation, edge detection, or general object detection models to determine the wiring harness connection status.

[0003] However, in actual production environments, the motor wiring harness connection points are typically located in recessed areas of the metal casing. Influenced by factors such as specular reflection from the metal surface, residual oil from the assembly process, and shadows cast by the wiring harness itself, the local brightness distribution of the connection area exhibits strong non-uniformity. Under these complex lighting conditions, existing detection methods based on fixed brightness thresholds or uniform image enhancement parameters struggle to simultaneously suppress reflections and enhance dark areas. This can easily lead to misjudging bright areas as structural anomalies or masking genuine anomalies under lighting artifacts.

[0004] In addition, some existing technologies mainly rely on the confidence results output by the target detection model to determine the pass rate during the detection stage, without fully combining the assembly geometric consistency and structural integrity characteristics of the wire harness connection parts. This results in unclear boundary for anomaly judgment in scenarios such as slight offset of connection position, incomplete insertion or structural missing, which poses a risk of false detection and missed detection and makes it difficult to meet the stability and accuracy requirements of motor assembly production lines.

[0005] Therefore, there is an urgent need for a detection method that can stably extract the true structural features of the wiring harness connection parts under complex lighting and pollution interference conditions, and combine assembly geometric constraints to achieve refined anomaly judgment, so as to improve the accuracy and engineering applicability of anomaly detection of wiring harness connection parts in electric vehicle motors. Summary of the Invention

[0006] To address the aforementioned technical shortcomings, the present invention aims to propose a vision-based method for detecting anomalies in motor wiring harness connections. This method addresses the problem that existing technologies, which primarily rely on a single detection confidence level for judgment, struggle to reliably distinguish between genuine structural anomalies and lighting artifacts, especially under complex conditions such as strong reflections from metal casings, oil stains, and overlapping wiring harness shadows.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides a vision-based method for detecting abnormalities in motor wiring harness connection parts.

[0008] The vision-based method for detecting anomalies in motor wiring harness connections includes: Step S10: Obtain an image of the motor wiring harness connection area. Based on the image of the motor wiring harness connection area, construct the illumination state vector of the connection area using an illumination state modeling mechanism based on brightness statistical constraints. ; Step S20: Based on the illumination state vector of the connection part, an adaptive brightness correction mechanism is used to perform piecewise Gamma correction and local contrast enhancement tasks, and the illumination-corrected image is output. ; Step S30: Image correction based on illumination A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. ; Step S40: Preprocess the image based on structure preservation A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. ; Step S50: Based on the effective wire harness connection area Perform anomaly detection and output the results of harness connection anomaly detection.

[0009] Preferably, in step S10, an image of the motor wiring harness connection point is acquired, and an illumination state vector of the connection point is constructed based on the image of the motor wiring harness connection point using an illumination state modeling mechanism based on brightness statistical constraints. The steps specifically include: Step S101: Acquire an image of the motor wiring harness connection area, including the motor metal housing and the wiring harness connection area, using an industrial camera installed at the inspection station of the motor assembly line. ; Step S102: Use the brightness separation color space transformation method to transform the image of the motor wiring harness connection area. Convert to a luminance-separated color space to obtain the luminance component image. ; Step S103: Based on the brightness component image Calculate the overall average brightness of the image Luminance variance and luminance component kurtosis And based on the overall average brightness of the image Luminance variance and luminance component kurtosis The illumination state vector of the connection part is constructed using a vector construction method based on the normalized mapping of luminance statistics. .

[0010] Preferably, in step S20, an adaptive brightness correction mechanism is used to perform piecewise Gamma correction and local contrast enhancement based on the illumination state vector of the connection part, and an illumination-corrected image is output. The steps specifically include: Step S201: Based on the overall average brightness of the image and brightness variance Set the first brightness segment threshold Second brightness segment threshold ; and based on the kurtosis of the luminance component Set a set of piecewise Gamma correction coefficients ;in, This refers to the brightness segmentation adjustment coefficient; The Gamma correction factor is less than 1; The Gamma correction factor is equal to 1; The Gamma correction factor is greater than 1; Step S202: Process the luminance component image For any pixel position (x, y) with x-coordinate and y-coordinate, perform piecewise Gamma processing and output the Gamma correction coefficient. Based on the Gamma correction coefficient Gamma mapping is performed on the pixel brightness at pixel position (x, y) to generate an enhanced brightness image; Step S203: In the brightness separation color space, combine the enhanced brightness image with the image of the motor wiring harness connection area. The image is then fused and reconstructed to obtain the illumination-corrected image. .

[0011] Preferably, in step S202, the Gamma correction coefficient The formula is expressed as: ;in, This represents the pixel brightness value at pixel position (x, y).

[0012] Preferably, in step S30, the illumination-corrected image is... A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. The steps specifically include: Step S301: Image correction based on illumination The specular candidate mask Msp is obtained by combining brightness saturation threshold and gradient abrupt change judgment method; Step S302: Image correction based on illumination A trained lightweight semantic segmentation network is used to identify low-saturation and low-texture regions to obtain oil stain candidate masks Mol; Step S303: Within the union region of the specular candidate mask Msp and the oil stain candidate mask Mol, perform smoothing suppression processing on the non-structural principal directions while keeping the gradient in the edge directions unchanged, and maintain the structure of the output image as shown in the preprocessed image. .

[0013] Preferably, in step S40, the structure-preserving preprocessed image is used. A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. The steps specifically include: Step S401: Preserve the structure from the preprocessed image The input is fed into a target detection network that incorporates channel attention and multi-scale feature fusion structures, and the output is a set of detection boxes. and the corresponding set of detection confidence scores ; Step S402: Obtain the set of standard inspection boxes from the preset production line standard assembly template. According to the standard testing area With the set of detection boxes The cross-union ratio (CUI) of the i-th detection box is calculated using a geometric consistency method based on region overlap. ; Step S403: When the i-th detection box satisfies and When determining that the pixel corresponding to the i-th detection box belongs to the valid wire harness connection region, the valid wire harness connection region is finally output. ;in, To detect the confidence threshold; The assembly geometry consistency threshold; Let be the detection confidence level corresponding to the i-th detection box.

[0014] Preferably, in step S50, based on the effective wire harness connection area... The steps for performing anomaly detection and outputting the results of harness connection anomaly detection include: Step S501: Targeting the effective wire harness connection area Perform pixel-level structural segmentation to obtain the mask of the connected structural region; Step S502: Accumulate and calculate the actual structural area based on the area calculation method of pixel accumulation according to the mask of the connected structure region. The actual structural area With the preset standard structural area A structural deviation index is constructed using a normalization method based on area ratio. ; Step S503: Obtain the average detection confidence level corresponding to the mask of the connected structure region. Based on the average detection confidence level and structural deviation index An anomaly scoring function is constructed using a weighted linear mapping method. The anomaly scoring function outputs anomaly scoring function value. When the anomaly scoring function value exceeds the preset anomaly scoring threshold, it is determined that there is an anomaly in the corresponding wire harness connection part, and the wire harness connection anomaly detection result is output.

[0015] The present invention also provides a vision-based abnormality detection system for motor wiring harness connection parts, comprising: The illumination state modeling module is used to acquire images of the motor wiring harness connection points. Based on these images, an illumination state modeling mechanism based on luminance statistical constraints is used to construct illumination state vectors for the connection points. ; The adaptive brightness correction module is used to perform piecewise Gamma correction and local contrast enhancement based on the illumination state vector of the connection point using an adaptive brightness correction mechanism, and outputs an illumination-corrected image. ; Structure-preserving preprocessing module for illumination-corrected images A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. ; The effective region determination module is used for preprocessing images based on structure preservation. A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. ; The anomaly detection module is used to determine the location of valid wire harness connections. Perform anomaly detection and output the results of harness connection anomaly detection.

[0016] The present invention also provides a vision-based motor wiring harness connection abnormality detection device, comprising: a memory, a processor, and a vision-based motor wiring harness connection abnormality detection program stored in the memory and executable on the processor. When the vision-based motor wiring harness connection abnormality detection program is executed by the processor, a vision-based motor wiring harness connection abnormality detection method is implemented.

[0017] The present invention also provides a computer program product, including a vision-based motor wiring harness connection anomaly detection program, wherein the vision-based motor wiring harness connection anomaly detection program, when executed by a processor, implements the vision-based motor wiring harness connection anomaly detection method.

[0018] The beneficial effects of this invention are as follows: By constructing an illumination state model based on brightness statistical constraints and performing adaptive brightness correction and structure preservation preprocessing accordingly, this invention can effectively suppress the interference of illumination artifacts on the detection results under complex illumination conditions such as strong reflection of metal shells, oil stains, and superposition of wire harness shadows, and improve the recognizability and stability of real structural features in the image of wire harness connection parts.

[0019] This invention combines attention-enhanced target detection results with assembly geometric consistency constraints and structural area deviations for anomaly determination, avoiding reliance solely on detection confidence for simple acceptance judgments. This significantly narrows the anomaly determination boundary, reduces the probability of false detections and missed detections, and improves the accuracy and engineering applicability of anomaly detection at electric vehicle motor wiring harness connection points. Attached Figure Description

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

[0021] Figure 1 This is a flowchart illustrating the first embodiment of a vision-based method for detecting abnormalities in motor wiring harness connections according to the present invention.

[0022] Figure 2 This is a schematic diagram of a vision-based method for detecting abnormalities in motor wiring harness connections according to the present invention. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the vision-based method for detecting anomalies in motor wiring harness connection parts according to the present invention. The first embodiment of the vision-based method for detecting anomalies in motor wiring harness connection parts according to the present invention is presented.

[0025] In the first embodiment, the vision-based method for detecting abnormalities in motor wiring harness connections includes: Step S10: Obtain an image of the motor wiring harness connection area. Based on the image of the motor wiring harness connection area, construct the illumination state vector of the connection area using an illumination state modeling mechanism based on brightness statistical constraints. ; It should be noted that the "illuminance state modeling mechanism based on luminance statistical constraints" in this step refers to the following: In view of the actual situation where there is uneven luminance distribution and both local overbrightness and local underbrightness in the image of the motor wiring harness connection part, the statistical features of the image luminance components are extracted and constrained to form a state description information that can characterize the overall illuminance status of the current detection image. The luminance statistical features include at least statistical quantities that reflect the overall luminance level, the degree of luminance dispersion, and the concentration of luminance distribution, which are used to characterize the comprehensive impact of metal shell reflection, oil stains, and shadow areas on the image luminance distribution.

[0026] Understandably, by introducing illumination state modeling in this step, it is possible to clearly distinguish between "appearance differences caused by changes in illumination conditions" and "structural differences caused by abnormal wire harness connections" in subsequent image processing and anomaly detection. This allows subsequent processing to no longer rely on fixed image enhancement parameters or a single judgment threshold, but to make targeted adjustments based on the current illumination state of the image, which helps to improve the ability to preserve the true structural features of wire harness connection parts under complex working conditions.

[0027] For example, in the actual inspection process of a motor assembly line, when there is obvious specular reflection on the surface of the motor housing, and the wiring harness connection area is partially obscured by the wiring harness itself or surrounding structures, forming a shadow, directly using a uniform image enhancement method may easily lead to the reflective area being misidentified as an abnormal area, or make it difficult to show the real connection defects in the shadow area. However, by modeling the image lighting state through this step, it can be identified that the current image belongs to a complex lighting state of "coexistence of reflection and shadow", so that the subsequent processing can be adjusted for this state, thereby more stably extracting the real appearance features of the wiring harness connection area in the actual scene and improving the overall inspection effect.

[0028] Step S20: Based on the illumination state vector of the connection part, an adaptive brightness correction mechanism is used to perform piecewise Gamma correction and local contrast enhancement tasks, and the illumination-corrected image is output. ; It should be noted that in this step, "using an adaptive brightness correction mechanism based on the illumination state vector of the connection part to perform piecewise Gamma correction and local contrast enhancement tasks" means that, based on the obtained illumination state vector of the connection part, instead of using fixed parameters or a uniform strategy to enhance the image as a whole, differentiated brightness adjustment and contrast enhancement processing are applied to pixels in different brightness ranges according to the brightness distribution characteristics reflected by the illumination state vector, so as to simultaneously take into account the correction needs of bright reflective areas and low-brightness shadow areas in the same image.

[0029] It should be understood that, compared to the global gamma correction or single contrast enhancement methods commonly used in traditional technologies, this invention does not assume uniform overall lighting conditions in this step. Instead, it fully considers the actual working condition of "coexistence of local strong reflections and local shadows" at the motor harness connection point. By using a segmented processing method, it reduces the interference of extreme lighting areas on the overall enhancement effect. From the process design, it avoids the contradictory problem in traditional methods where "suppressing reflections makes dark areas darker and enhancing dark areas makes reflections brighter," thereby improving the stability of image correction under complex lighting conditions.

[0030] For example, in actual testing scenarios on motor assembly lines, when the surface of the motor's metal casing produces significant high-brightness reflections due to the lighting angle, while the wiring harness connection area is in a shadow area due to structural obstruction, directly using a uniform brightness enhancement method often results in overexposure in the reflective area and insufficient detail in the shadow area. However, by performing adaptive brightness correction based on the illumination state vector in this step, the local contrast of the wiring harness connection area can be enhanced while suppressing the brightness of the casing's reflections, making the outline of the connection area clearer, which is more conducive to subsequent anomaly detection in actual testing.

[0031] Step S30: Image correction based on illumination A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. ; It should be noted that the "structure preservation mechanism based on the joint constraint of specular highlights and oil stains" in this step refers to the following: based on the image after brightness correction, for the specular reflection areas of the metal shell and the oil stains formed during the assembly process that may still exist in the image of the motor harness connection part, the above two types of interference areas are jointly identified and constrained. While suppressing their adverse effects on image quality, the true structural edges and geometric contours of the harness connection part are preserved as much as possible, thereby obtaining a preprocessed image that is more suitable for subsequent detection.

[0032] Understandably, by introducing the joint constraints of highlights and oil stains in this step, the interference of unstructured brightness anomalies on image texture and edge information can be effectively reduced, making the preprocessed image smoother in overall appearance, while still maintaining clear contours and continuity at key structural locations. This structure-preserving preprocessing method helps subsequent target detection and region determination processes to more stably focus on the wire connection points themselves, rather than being misled by reflective spots or oil stain noise.

[0033] Step S40: Preprocess the image based on structure preservation A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. ; It should be noted that in this step, "the task of determining the validity of the region based on the joint mechanism of attention-enhanced target detection and assembly geometric constraints" means that, based on the image after the structure preservation preprocessing is completed, the target detection and localization of the wire harness connection part is first performed, and then, based on the preset assembly geometric constraints, the validity screening of the detected candidate regions is performed to eliminate invalid detection results caused by lighting artifacts, background structures or non-target regions.

[0034] Understandably, by introducing an attention-enhanced target detection mechanism in this step, the detection process can focus more on the key structural features of the wire harness connection parts in the image, reducing the impact of background interference areas on the detection results. At the same time, by combining assembly geometric constraints to further determine the candidate regions, it is possible to effectively avoid misjudgments caused by relying solely on detection confidence, making the final output effective wire harness connection parts regions more consistent with the real assembly state in terms of position, shape, and scale.

[0035] It should be understood that, compared to relying solely on the output of the target detection model for region determination, this invention introduces assembly geometric constraints as auxiliary determination conditions in this step. This allows the determination of region validity to consider not only the confidence information of the detection model, but also the assembly consistency between the wiring harness connection and the motor structure. As a result, even when there is a slight offset or background interference in the detection results, it can still maintain high determination reliability and reduce the probability of false detection and missed detection.

[0036] Step S50: Based on the effective wire harness connection area Perform anomaly detection and output the results of harness connection anomaly detection.

[0037] It should be noted that in this step, "determining anomalies based on the effective wire harness connection area" means that, after determining the effective wire harness connection area, the entire image is no longer generalized for judgment. Instead, only the area directly related to the wire harness connection structure is used to determine whether the wire harness connection status is abnormal, based on the structural integrity and appearance consistency characteristics within that area. This avoids irrelevant background areas interfering with the anomaly determination results.

[0038] Understandably, by focusing anomaly detection only on the effective wiring harness connection area, the detection process can be more focused on the wiring harness terminals, insertion positions and their surrounding structural features. This makes it easier to capture abnormal feature changes in scenarios such as incomplete connection, incomplete insertion or structural defects, and improves the ability of anomaly detection results to reflect actual assembly quality.

[0039] For example, in the actual inspection process of the motor assembly line, when there are abnormalities such as incomplete insertion or partial missing parts in the wiring harness connection, the abnormalities are usually concentrated in the structural discontinuity or appearance changes in the wiring harness terminal area. By performing abnormality judgment only on the effective wiring harness connection area, this step can still stably identify such abnormalities under complex background and lighting conditions, and output clear wiring harness connection abnormality detection results, which is convenient for subsequent quality control and processing.

[0040] Example 2: Furthermore, the present invention provides a vision-based motor wiring harness connection anomaly detection system, which employs a vision-based motor wiring harness connection anomaly detection method from the above embodiments, and can solve the technical problem of vision-based motor wiring harness connection anomaly detection. Compared with the prior art, the beneficial effects of the vision-based motor wiring harness connection anomaly detection system provided by the present invention are the same as those of the vision-based motor wiring harness connection anomaly detection method provided in the above embodiments, and other technical features of the vision-based motor wiring harness connection anomaly detection system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0041] Example 3: This invention provides a vision-based abnormality detection device for motor wiring harness connection points. Please refer to... Figure 2A vision-based motor wiring harness connection anomaly detection device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the vision-based motor wiring harness connection anomaly detection method described in Embodiment 1 above. The vision-based motor wiring harness connection anomaly detection device in this embodiment of the invention may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. This vision-based motor wiring harness connection anomaly detection device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the invention. A vision-based motor wiring harness connection anomaly detection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the vision-based motor wiring harness connection anomaly detection device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An I / O interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows a vision-based motor wiring harness connection anomaly detection device to communicate wirelessly or wiredly with other devices to exchange data. While the figures show a vision-based motor wiring harness connection anomaly detection device with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0042] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the vision-based method for detecting anomalies in motor wiring harness connection points as described above. The computer program product provided by this invention can solve the technical problem of vision-based detection of anomalies in motor wiring harness connection points. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the vision-based method for detecting anomalies in motor wiring harness connection points provided in the above embodiments, and will not be repeated here.

[0043] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.

[0044] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0045] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A vision-based method for detecting anomalies in motor wiring harness connections, characterized in that, The methods include: Step S10: Obtain an image of the motor wiring harness connection area. Based on the image of the motor wiring harness connection area, construct the illumination state vector of the connection area using an illumination state modeling mechanism based on brightness statistical constraints. ; Step S20: Based on the illumination state vector of the connection part, an adaptive brightness correction mechanism is used to perform piecewise Gamma correction and local contrast enhancement tasks, and the illumination-corrected image is output. ; Step S30: Image correction based on illumination A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. ; Step S40: Preprocess the image based on structure preservation A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. ; Step S50: Based on the effective wire harness connection area Perform anomaly detection and output the results of harness connection anomaly detection.

2. The vision-based method for detecting abnormalities in motor wiring harness connections as described in claim 1, characterized in that, In step S10, an image of the motor wiring harness connection area is acquired, and an illumination state vector of the connection area is constructed based on the image of the motor wiring harness connection area using an illumination state modeling mechanism based on brightness statistical constraints. The steps specifically include: Step S101: Acquire an image of the motor wiring harness connection area, including the motor metal housing and the wiring harness connection area, using an industrial camera installed at the inspection station of the motor assembly line. ; Step S102: Use the brightness separation color space transformation method to transform the image of the motor wiring harness connection area. Convert to a luminance-separated color space to obtain the luminance component image. ; Step S103: Based on the brightness component image Calculate the overall average brightness of the image Luminance variance and luminance component kurtosis And based on the overall average brightness of the image Luminance variance and luminance component kurtosis The illumination state vector of the connection part is constructed using a vector construction method based on the normalized mapping of luminance statistics. .

3. The vision-based method for detecting abnormalities in motor wiring harness connections as described in claim 2, characterized in that, In step S20, based on the illumination state vector of the connection part, an adaptive brightness correction mechanism is used to perform piecewise Gamma correction and local contrast enhancement tasks, and an illumination-corrected image is output. The steps specifically include: Step S201: Based on the overall average brightness of the image and brightness variance Set the first brightness segment threshold Second brightness segment threshold ; and based on the kurtosis of the luminance component Set a set of piecewise Gamma correction coefficients ;in, This refers to the brightness segmentation adjustment coefficient; The Gamma correction factor is less than 1; The Gamma correction factor is equal to 1; The Gamma correction factor is greater than 1; Step S202: Process the luminance component image For any pixel position (x, y) with x-coordinate and y-coordinate, perform piecewise Gamma processing and output the Gamma correction coefficient. Based on the Gamma correction coefficient Gamma mapping is performed on the pixel brightness at pixel position (x, y) to generate an enhanced brightness image; Step S203: In the brightness separation color space, combine the enhanced brightness image with the image of the motor wiring harness connection area. The image is then fused and reconstructed to obtain the illumination-corrected image. .

4. The vision-based method for detecting abnormalities in motor wiring harness connections as described in claim 3, characterized in that, In step S202, the Gamma correction coefficient The formula is expressed as: ;in, This represents the pixel brightness value at pixel position (x, y).

5. The vision-based method for detecting abnormalities in motor wiring harness connections as described in claim 1, characterized in that, In step S30, the illumination-corrected image is... A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. The steps specifically include: Step S301: Image correction based on illumination The specular candidate mask Msp is obtained by combining brightness saturation threshold and gradient abrupt change judgment method; Step S302: Image correction based on illumination A trained lightweight semantic segmentation network is used to identify low-saturation and low-texture regions to obtain oil stain candidate masks Mol; Step S303: Within the union region of the specular candidate mask Msp and the oil stain candidate mask Mol, perform smoothing suppression processing on the non-structural principal directions while keeping the gradient in the edge directions unchanged, and maintain the structure of the output image as shown in the preprocessed image. .

6. The vision-based method for detecting abnormalities in motor wiring harness connections as described in claim 1, characterized in that, In step S40, the preprocessed image is based on structure preservation. A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. The steps specifically include: Step S401: Preserve the structure from the preprocessed image The input is fed into a target detection network that incorporates channel attention and multi-scale feature fusion structures, and the output is a set of detection boxes. and the corresponding set of detection confidence scores ; Step S402: Obtain the set of standard inspection boxes from the preset production line standard assembly template. According to the standard testing area With the set of detection boxes The cross-union ratio (CUI) of the i-th detection box is calculated using a geometric consistency method based on region overlap. ; Step S403: When the i-th detection box satisfies and When determining that the pixel corresponding to the i-th detection box belongs to the valid wire harness connection region, the valid wire harness connection region is finally output. ;in, To detect the confidence threshold; The assembly geometry consistency threshold; Let be the detection confidence level corresponding to the i-th detection box.

7. The vision-based method for detecting abnormalities in motor wiring harness connections as described in claim 1, characterized in that, In step S50, based on the effective wire harness connection area... The steps for performing anomaly detection and outputting the results of harness connection anomaly detection include: Step S501: Targeting the effective wire harness connection area Perform pixel-level structural segmentation to obtain the mask of the connected structural region; Step S502: Accumulate and calculate the actual structural area based on the area calculation method of pixel accumulation according to the mask of the connected structure region. The actual structural area With the preset standard structural area A structural deviation index is constructed using a normalization method based on area ratio. ; Step S503: Obtain the average detection confidence level corresponding to the mask of the connected structure region. Based on the average detection confidence level and structural deviation index An anomaly scoring function is constructed using a weighted linear mapping method. The anomaly scoring function outputs anomaly scoring function value. When the anomaly scoring function value exceeds the preset anomaly scoring threshold, it is determined that there is an anomaly in the corresponding wire harness connection part, and the wire harness connection anomaly detection result is output.

8. A vision-based abnormality detection system for motor wiring harness connection parts, applied to the vision-based abnormality detection method for motor wiring harness connection parts according to any one of claims 1 to 7, characterized in that, The vision-based abnormality detection system for motor wiring harness connections includes: The illumination state modeling module is used to acquire images of the motor wiring harness connection points. Based on these images, an illumination state modeling mechanism based on luminance statistical constraints is employed to construct illumination state vectors for the connection points. ; The adaptive brightness correction module is used to perform piecewise Gamma correction and local contrast enhancement based on the illumination state vector of the connection point using an adaptive brightness correction mechanism, and outputs an illumination-corrected image. ; Structure-preserving preprocessing module for illumination-corrected images A structure preservation mechanism based on the joint constraints of specular highlights and oil contamination is used to perform the preprocessing task, and the output is a structure preservation preprocessed image. ; The effective region determination module is used for preprocessing images based on structure preservation. A joint mechanism based on attention-enhanced target detection and assembly geometric constraints is employed to perform the region validity determination task, outputting the valid wire harness connection regions. ; The anomaly detection module is used to determine the location of valid wire harness connections. Perform anomaly detection and output the results of harness connection anomaly detection.

9. A vision-based abnormality detection device for motor wiring harness connection parts, characterized in that, The vision-based motor wiring harness connection anomaly detection device includes: a memory, a processor, and a vision-based motor wiring harness connection anomaly detection program stored in the memory and executable on the processor. When the vision-based motor wiring harness connection anomaly detection program is executed by the processor, it implements a vision-based motor wiring harness connection anomaly detection method according to any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a vision-based motor wiring harness connection anomaly detection program, which, when executed by a processor, implements a vision-based motor wiring harness connection anomaly detection method according to any one of claims 1 to 7.