Flat wire motor missing insertion detection method and system based on machine vision
By optimizing the camera, environment and light source parameters in the machine vision detection system, the problem of image quality degradation in the leakage detection of flat wire motors is solved, and the detection accuracy is improved.
Patent Information
- Application Number
- CN202510616666.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-12
AI Technical Summary
The existing machine vision detection system cannot effectively optimize camera parameters, environmental parameters and light source parameters in flat line motor leakage detection, resulting in a decrease in image quality, low detection accuracy, and high leakage detection rate and error judgment rate.
By obtaining the target image and its influencing factor data captured by the machine vision camera, performing linear regression fitting, and constructing an optimized model to adjust the camera, environment and light source parameters to the optimal value, improving image quality and detecting.
It effectively solves the problem of image quality degradation under the combined action of multiple factors and improves the accuracy of detection.
Smart Images

Figure CN120472232A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of flat wire motor missing insertion detection, and in particular to a flat wire motor missing insertion detection method and system based on machine vision. Background Art
[0002] Flat-wire motor misalignment occurs when the winding wires fail to properly fit into the stator slots during the manufacturing process. This problem can severely impact motor performance, potentially leading to reduced efficiency, insufficient power, and even failures such as short circuits and overheating. Therefore, appropriate detection methods are essential to promptly detect misalignment and ensure motor quality and performance.
[0003] Machine vision inspection requires high-quality images as a foundation, but in practical applications, factors such as unstable lighting conditions, fluctuating ambient temperatures, and machine vision camera parameters can affect the quality of acquired images, resulting in suboptimal image quality. Currently, existing machine vision inspection systems address this issue by utilizing image processing algorithms to improve image quality. While this improves image quality to a certain extent, it fails to optimize factors influencing the inspection process (such as camera parameters, environmental parameters, and light source parameters). This approach does not fundamentally address the image quality degradation caused by the combined effects of multiple factors, directly leading to low inspection accuracy and high rates of missed detection and false positives. To address this issue, we propose a machine vision-based method and system for detecting missed insertions in flat-wire motors. Summary of the Invention
[0004] The main purpose of the present invention is to provide a method and system for detecting missing insertion of a flat wire motor based on machine vision, which can effectively solve the problems in the background technology by optimizing the influencing factors (such as camera parameters, environmental parameters and light source parameters) during the detection process.
[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A method for detecting missing insertion of a flat wire motor based on machine vision, comprising:
[0007] Obtain the target image captured by the machine vision camera, and the influencing factor data that affects the image quality evaluation index of the target image when the target image is captured, and number the target image in the order of acquisition. , represents the i-th target image obtained, and defines the influencing factor data as , represents the jth influencing factor when acquiring the i-th target image;
[0008] Extract the kth image quality evaluation index data of the i-th target image , according to indicator data The correlation between image quality and image quality evaluation indicators is classified into positive indicators and negative indicators;
[0009] By performing linear regression fitting on the obtained indicator data and influencing factor data, the functional relationship between the u-th positive indicator and the influencing factor is obtained. , the functional relationship between the vth reverse indicator and the influencing factors is ;
[0010] The optimization objective function is to maximize the weighted value of the positive index and minimize the negative index. The influencing factors are used as optimization parameters. The adjustable range of the influencing factor data is extracted as the constraint condition. The optimization model is constructed and the optimal value of each influencing parameter in the optimization model is solved based on the acquired data. ;
[0011] Adjust the value of the jth influencing factor to the optimal value , using machine vision cameras to obtain the optimal value A target image of the flat wire motor to be inspected is obtained, and machine vision inspection is performed on the obtained target image to obtain a missing insertion detection result of the flat wire motor to be inspected.
[0012] A flat wire motor missing insertion detection system based on machine vision, comprising:
[0013] A target image acquisition module is used to acquire a target image captured by a machine vision camera;
[0014] The influencing factor data acquisition module is used to acquire data of various influencing factors that affect the image quality evaluation index of the target image when shooting the target image; including:
[0015] A camera parameter acquisition submodule is used to acquire the setting parameters of the machine vision camera when shooting the target image, including the camera resolution setting value, aperture size, exposure time and gain;
[0016] An environmental parameter acquisition submodule is used to acquire environmental parameters when capturing the target image, including light intensity, ambient temperature, and ambient humidity;
[0017] A light source parameter acquisition submodule is used to acquire light source parameters when capturing the target image, including light source type, light source intensity, and light source angle;
[0018] Image quality evaluation module, used to extract the kth image quality evaluation index data of the i-th target image , according to indicator data Correlation between the image quality and the image quality, classifying the image quality evaluation index into positive index and negative index, wherein the image quality evaluation index includes at least one of contrast, resolution, clarity, noise level and uniformity of the target image;
[0019] The data fitting module is used to perform linear regression fitting on the obtained indicator data and influencing factor data to obtain the functional relationship between the u-th positive indicator and the influencing factor , the functional relationship between the vth reverse indicator and the influencing factors ;
[0020] Constraint condition acquisition module, used to extract the adjustable range of each influencing factor data;
[0021] The optimization model construction module is used to use the weighted values of various image quality evaluation indicators as optimization targets, various influencing factors as optimization parameters, extract the adjustable range of the influencing factor data as constraints, build an optimization model, and solve the optimal values of various influencing parameters in the optimization model based on the acquired data. ;
[0022] Influencing factor adjustment module, used to adjust the value of the jth influencing factor to the optimal value ;
[0023] Visual inspection module, used to obtain the optimal value of the machine vision camera Perform machine vision inspection on the target image of the flat wire motor to be inspected, and obtain the missing insertion detection result of the flat wire motor to be inspected;
[0024] The system further includes a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0025] Furthermore, the influencing factors include machine vision camera parameters, environmental parameters and light source parameters.
[0026] Furthermore, the machine vision camera parameters include camera resolution setting value, aperture size, exposure time and gain;
[0027] Furthermore, the environmental parameters include light intensity, ambient temperature and ambient humidity;
[0028] Furthermore, the light source parameters include light source type, light source intensity and light source angle.
[0029] Furthermore, the classification principles of image quality evaluation indicators are as follows:
[0030] If the image quality evaluation index data The larger the value of , the better the image quality, and this type of image quality evaluation index is a positive indicator;
[0031] If the image quality evaluation index data The smaller the value of , the better the image quality, and this type of image quality evaluation index is a reverse index.
[0032] Furthermore, the image quality evaluation index includes at least one of contrast, resolution, clarity, noise level and uniformity of the target image.
[0033] Furthermore, the expression of the optimization model is:
[0034]
[0035]
[0036] Where, Expressed as optimization objective function; is a constraint condition; Expressed as the weight of the u-th positive indicator; Expressed as the weight of the v-th reverse indicator; It is expressed as the lower limit of the adjustable range of the jth influencing factor; It is expressed as the upper limit of the adjustable range of the jth influencing factor.
[0037] The present invention has the following beneficial effects:
[0038] Compared with the existing technology, the kth image quality evaluation index data of the i-th target image is extracted by obtaining the target image taken by the machine vision camera and the data of various influencing factors that affect the image quality evaluation index of the target image when taking the target image. , according to indicator data The correlation between the image quality and the image quality is analyzed, and the image quality evaluation indicators are classified into positive indicators and negative indicators. By performing linear regression fitting on the obtained indicator data and influencing factor data, the functional relationship between the u-th positive indicator and the influencing factor is obtained, and the functional relationship between the v-th negative indicator and the influencing factor is obtained. The weighted value of maximizing the positive indicator and minimizing the negative indicator is used as the optimization objective function, and the influencing factor is used as the optimization parameter. The adjustable range of each influencing factor data is extracted as the constraint condition, and an optimization model is constructed. The optimal value of each influencing parameter in the optimization model is solved according to the obtained data, and the value of the j-th influencing factor is adjusted to the optimal value. The target image of the flat wire motor to be inspected under the optimal value is obtained by using a machine vision camera, and the obtained target image is subjected to machine vision inspection to obtain the missed insertion detection result of the flat wire motor to be inspected. The influencing factors in the detection process, such as camera parameters, environmental parameters and light source parameters, can be optimized, fundamentally solving the problem of image quality degradation caused by the combined effect of multiple influencing factors, improving the quality of the obtained visual inspection image, and thereby improving the accuracy of missed insertion detection of the flat wire motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flow chart of a method for detecting missing insertion of a flat wire motor based on machine vision according to the present invention;
[0040] Figure 2 The present invention is a structural schematic diagram of a flat wire motor missing insertion detection system based on machine vision. DETAILED DESCRIPTION
[0041] The present invention will be further described below in conjunction with specific embodiments. The accompanying drawings are for illustrative purposes only and represent only schematic diagrams rather than actual drawings. They should not be understood as limiting the present invention. In order to better illustrate the specific embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product.
[0042] The specific implementation process of the technical solution of the present invention includes the following steps:
[0043] Step 1: Obtain the target image captured by the machine vision camera, as well as the data of various factors that affect the image quality evaluation index of the target image when the target image is captured, and number the target images in the order of acquisition. , represents the i-th target image obtained, and defines the influencing factor data as , represents the value of the jth influencing factor when obtaining the i-th target image;
[0044] Among them, the influencing factors include machine vision camera parameters, environmental parameters and light source parameters;
[0045] Machine vision camera parameters include camera resolution settings, aperture size, exposure time, and gain;
[0046] Environmental parameters include light intensity, ambient temperature, and ambient humidity;
[0047] Light source parameters include light source type, light source intensity and light source angle.
[0048] Step 2: Extract the kth image quality evaluation index data of the i-th target image , according to indicator data Based on the correlation between image quality and image quality, image quality evaluation indicators are classified into positive indicators and negative indicators. The classification principles of image quality evaluation indicators are as follows:
[0049] If the image quality evaluation index data The larger the value of is, the better the image quality is. This type of image quality evaluation index is a positive index. If the image quality evaluation index data is The smaller the value of , the better the image quality, and this type of image quality evaluation index is a reverse index.
[0050] The image quality evaluation index includes at least one of contrast, resolution, clarity, noise level and uniformity of the target image.
[0051] It should be noted that according to the above classification principles, the image quality evaluation indicators involved can be classified as follows:
[0052] Contrast: The larger the contrast value, the clearer the distinction between the target and the background in the image, and the better the image quality;
[0053] Resolution: The larger the resolution value, the more details that can be distinguished in the image and the better the image quality;
[0054] Sharpness: The larger the sharpness value, the sharper the edges and details in the image, and the better the image quality;
[0055] Uniformity: A smaller uniformity value indicates a more uneven brightness distribution in the image and a worse image quality. A larger uniformity value indicates a more even brightness distribution in the image and a better image quality.
[0056] Noise level: The smaller the noise level value, the less interference there is in the image and the better the image quality; conversely, the larger the noise level value, the more interference there is in the image and the worse the image quality.
[0057] Therefore, for the evaluation index of image quality, the classification results are:
[0058] Positive indicators: contrast, resolution, clarity, uniformity;
[0059] Contrary indicator: Noise level.
[0060] In practical applications, it is usually hoped that the value of the positive indicator is as large as possible and the value of the negative indicator is as small as possible to ensure that the image quality is optimal. For the functional relationship between the positive indicator and the influencing factors and the functional relationship between the negative indicator and the influencing factors, a linear regression model can be established between the indicator data and the influencing factor data, and the obtained indicator data and influencing factor data can be obtained by performing linear regression fitting.
[0061] Step 3: Take the weighted value of maximizing the positive index and minimizing the negative index as the optimization objective function, the influencing factors as the optimization parameters, extract the adjustable range of the influencing factor data as the constraint conditions, and build the optimization model. The expression of the optimization model is:
[0062]
[0063]
[0064] Where, Expressed as optimization objective function; is a constraint condition; Expressed as the weight of the u-th positive indicator; Expressed as the weight of the v-th reverse indicator; It is expressed as the lower limit of the adjustable range of the jth influencing factor; It is expressed as the upper limit of the adjustable range of the jth influencing factor.
[0065] In this embodiment, when the image quality evaluation index includes contrast, resolution, clarity, uniformity and noise level, the objective function The specific expression can be written as: ;
[0066] For the constraints, the lower limit and upper limit of the adjustable range of each influencing parameter need to be determined according to the actual situation. Specifically,
[0067] Obtain machine vision camera parameters, including the lower and upper limits of the adjustable range of the camera resolution setting value, the lower and upper limits of the adjustable range of the aperture size, the lower and upper limits of the adjustable range of the exposure time, and the lower and upper limits of the adjustable range of the gain;
[0068] Obtaining environmental parameters, including the lower and upper limits of the adjustable range of light intensity, the lower and upper limits of the adjustable range of ambient temperature, and the lower and upper limits of the adjustable range of ambient humidity;
[0069] Obtain light source parameters, including the lower and upper limits of the adjustable range of light source intensity and the lower and upper limits of the adjustable range of light source angle. For the light source type, the assignment method can be used to determine it. Different light source types are assigned different values. Obtain quantitative indicators of the light source type as the upper and lower limits of the adjustable range, such as wavelength range and output power. The wavelength range includes:
[0070] Wavelength tuning range: This is a key parameter of the light source’s tunability. Depending on the application requirements, the wavelength range can be very wide, such as from ultraviolet to infrared, or much narrower, such as covering only the visible light region.
[0071] The wavelength range of the gain medium;
[0072] Wavelength adjustment range of the frequency selector: If a temperature-controlled frequency selector is used, the wavelength adjustment range may be limited by temperature.
[0073] Output power includes output power range.
[0074] Through the above processing method, the lower limit and upper limit of the adjustable range of each influencing parameter can be determined, thereby determining the constraints of the optimization model to solve the optimal value of each influencing parameter. Provides a feasible range.
[0075] Step 4: Solve the optimal values of each influencing parameter in the optimization model based on the acquired data .
[0076] Specifically, a multi-objective optimization algorithm, such as a multi-objective genetic algorithm (MOGA) or a multi-objective particle swarm optimization (MOPSO), can be used to solve the problem based on the acquired historical data.
[0077] Step 5: Adjust the value of the jth influencing factor to the optimal value , using machine vision cameras to obtain the optimal value The target image of the flat wire motor to be inspected is obtained, and the obtained target image is inspected by machine vision to obtain the missing insertion detection result of the flat wire motor to be inspected. The specific process steps are as follows:
[0078] Step S51: Preparation
[0079] Equipment preparation: Prepare machine vision cameras, light sources, lenses and other equipment, and ensure they are working properly.
[0080] Parameter setting: Set the device parameters based on the optimized camera parameters (such as resolution, aperture size, exposure time, etc.), environmental parameters (such as light intensity, temperature, humidity, etc.), and light source parameters (such as light source type, light source intensity, light source angle, etc.).
[0081] Step S52: Image acquisition
[0082] Workpiece positioning: Use a workpiece positioning detector (such as a photoelectric sensor) to detect whether the flat wire motor to be inspected moves close to the center of the field of view of the machine vision camera system.
[0083] Triggering image acquisition: When the workpiece positioning detector detects that the flat wire motor to be inspected has reached the specified position, it sends a trigger pulse to the image acquisition unit. The image acquisition unit then sends a start pulse to the camera and lighting system according to the preset program and delay.
[0084] Camera Exposure and Shooting: After receiving a pulse, the camera stops the current scan and restarts a new frame, or waits until a pulse arrives, then starts a new frame scan. Before the camera begins scanning a new frame, the electronic shutter opens for exposure, and the exposure time can be set in advance. Simultaneously, another start pulse turns on the light, and the light's on time should match the camera's exposure time.
[0085] Image Reception and Storage: After the camera is exposed, the scanning and output of a new frame of image officially begins. The image acquisition unit receives and digitizes the analog video signal, or directly receives the digital video signal digitized by the camera, and stores the digital image in the processor or computer memory.
[0086] Step S53: Image processing
[0087] Preprocessing: Preprocess the collected images, such as filtering out noise, adjusting contrast and brightness, etc., to improve image quality.
[0088] Feature extraction: Use image processing algorithms (such as edge detection and contour extraction) to extract key features in the image, such as the position, shape, and size of the stator slots of the flat wire motor.
[0089] Defect detection: Based on the extracted features, machine vision detection algorithms (such as template matching, contour analysis, deep learning algorithms, etc.) are used to detect whether the flat wire motor has defects such as missing insertion.
[0090] Step S54: Output of detection results
[0091] Result determination: According to the preset judgment criteria, the detected features are analyzed to determine whether the flat wire motor to be inspected has defects such as missing insertion, and the inspection result (such as "qualified" or "unqualified") is output.
[0092] Data Recording and Feedback: Test results and related data are recorded in the database for subsequent quality analysis and traceability. For unqualified products, an alarm can be issued or they can be automatically isolated.
[0093] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for detecting missing insertion of a flat wire motor based on machine vision, characterized in that: include: Obtain the target image captured by the machine vision camera, and the influencing factor data that affects the image quality evaluation index of the target image when the target image is captured, and number the target image in the order of acquisition. , represents the i-th target image obtained, and defines the influencing factor data as , represents the jth influencing factor when acquiring the i-th target image; Extract the kth image quality evaluation index data of the i-th target image , according to indicator data The correlation between image quality and image quality evaluation indicators is classified into positive indicators and negative indicators; By performing linear regression fitting on the obtained indicator data and influencing factor data, the functional relationship between the u-th positive indicator and the influencing factor is obtained. , the functional relationship between the vth reverse indicator and the influencing factors ; The optimization objective function is to maximize the weighted value of the positive index and minimize the negative index. The influencing factors are used as optimization parameters. The adjustable range of the influencing factor data is extracted as the constraint condition. The optimization model is constructed and the optimal value of each influencing parameter in the optimization model is solved based on the acquired data. ; Adjust the value of the jth influencing factor to the optimal value , using machine vision cameras to obtain the optimal value A target image of the flat wire motor to be inspected is obtained, and machine vision inspection is performed on the obtained target image to obtain a missing insertion detection result of the flat wire motor to be inspected.
2. The method for detecting missing connection of a flat wire motor based on machine vision according to claim 1, characterized in that: The influencing factors include machine vision camera parameters, environmental parameters and light source parameters; wherein, The machine vision camera parameters include camera resolution setting value, aperture size, exposure time and gain; The environmental parameters include light intensity, ambient temperature and ambient humidity; The light source parameters include light source type, light source intensity and light source angle.
3. The method for detecting missing connection of a flat wire motor based on machine vision according to claim 1, characterized in that: The classification principles of image quality evaluation indicators are: If the image quality evaluation index data The larger the value of , the better the image quality, and this type of image quality evaluation index is a positive indicator; If the image quality evaluation index data The smaller the value of , the better the image quality, and this type of image quality evaluation index is a reverse index.
4. The method for detecting missing connection of a flat wire motor based on machine vision according to claim 3, characterized in that: The image quality evaluation index includes at least one of contrast, resolution, clarity, noise level and uniformity of the target image.
5. The method for detecting missing connection of a flat wire motor based on machine vision according to claim 1, characterized in that: The expression of the optimization model is: ; ; Where, Expressed as optimization objective function; is a constraint condition; Expressed as the weight of the u-th positive indicator; Expressed as the weight of the v-th reverse indicator; It is expressed as the lower limit of the adjustable range of the jth influencing factor; It is expressed as the upper limit of the adjustable range of the jth influencing factor.
6. A flat wire motor missing insertion detection system based on machine vision, characterized in that: The system is used to implement the steps of a flat wire motor missing insertion detection method based on machine vision according to any one of claims 1 to 5, including: A target image acquisition module is used to acquire a target image captured by a machine vision camera; The influencing factor data acquisition module is used to acquire data of various influencing factors that affect the image quality evaluation index of the target image when the target image is captured; including: A camera parameter acquisition submodule is used to acquire the setting parameters of the machine vision camera when shooting the target image, including the camera resolution setting value, aperture size, exposure time and gain; An environmental parameter acquisition submodule is used to acquire environmental parameters when capturing the target image, including light intensity, ambient temperature, and ambient humidity; A light source parameter acquisition submodule is used to acquire light source parameters when capturing the target image, including light source type, light source intensity, and light source angle; Image quality evaluation module, used to extract the kth image quality evaluation index data of the i-th target image , according to indicator data Correlation between the image quality and the image quality, classifying the image quality evaluation index into positive index and negative index, wherein the image quality evaluation index includes at least one of contrast, resolution, clarity, noise level and uniformity of the target image; The data fitting module is used to perform linear regression fitting on the obtained indicator data and influencing factor data to obtain the functional relationship between the u-th positive indicator and the influencing factor , the functional relationship between the vth reverse indicator and the influencing factors ; Constraint condition acquisition module, used to extract the adjustable range of each influencing factor data; The optimization model construction module is used to maximize the weighted value of the positive index and minimize the negative index as the optimization objective function, use the influencing factors as optimization parameters, extract the adjustable range of the influencing factor data as the constraint condition, build the optimization model, and solve the optimal value of each influencing parameter in the optimization model based on the acquired data. ; Influencing factor adjustment module, used to adjust the value of the jth influencing factor to the optimal value ; Visual inspection module, used to obtain the optimal value of the machine vision camera Perform machine vision inspection on the target image of the flat wire motor to be inspected, and obtain the missing insertion detection result of the flat wire motor to be inspected; The expression of the optimization model is: ; ; Where, Expressed as optimization objective function; is a constraint condition; Expressed as the weight of the u-th positive indicator; Expressed as the weight of the v-th reverse indicator; It is expressed as the lower limit of the adjustable range of the jth influencing factor; It is expressed as the upper limit of the adjustable range of the jth influencing factor.
7. The flat wire motor missing insertion detection system based on machine vision according to claim 6, characterized in that: The system also includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement the steps of a flat wire motor missing insertion detection method based on machine vision as described in any one of claims 1 to 5 when executing the program.
Citation Information
Patent Citations
Terminal board wiring visual detection method and device
CN113792711A
Camera exposure optimization and image quality evaluation method in structured light measurement
CN117575981A
Imaging parameter optimization method for mobile vision system
CN118887172A
High-quality ultrasonic image acquisition method based on artificial intelligence
CN119379605A
Semiconductor wafer defect detection light source configuration method, device and equipment
CN119445046A