Image Processing-Based Method for Detecting the Coating Effect of Motor End Covers

CN120580223BActive Publication Date: 2026-09-01HUAXING TRANSMISSION TECH WUXI CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510951698.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2026-09-01
Estimated Expiration
2045-07-10

AI Technical Summary

Technical Problem

[0003]本发明提供一种基于图像处理的电机端盖喷涂效果检测方法,以解决现有技术中对电机端盖喷涂质量进行检测时,检测结果不准确的技术问题,所述方法包括以下步骤:

Benefits of technology

[0009] The image processing-based method for detecting the coating effect of motor end caps of this invention identifies and extracts images of high-probability sub-regions on the motor end cap that are prone to coating defects. This is then combined with temporal characteristics of the robotic arm's motion state for correlation analysis. This allows for precise focus on critical time periods where execution fluctuations occur during the coating process. By dynamically adjusting the weighting coefficients of the robotic arm's motion characteristic parameters within the corresponding time periods, the mapping relationship between defect features and abnormal robotic arm motion states is strengthened. This effectively improves the detection system's sensitivity to identifying localized minor coating defects, overcoming the shortcomings of traditional overall image processing methods in responding insufficiently to localized minor defects. This significantly improves the accuracy and reliability of coating quality detection, ensuring timely identification of potential defect areas caused by fluctuations in the robotic arm's execution precision, and avoiding the risk of insulation failure due to missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580223B_ABST
    Figure CN120580223B_ABST
Patent Text Reader

Abstract

This invention provides a method for detecting the coating effect of motor end caps based on image processing, belonging to the field of motor end cap coating effect detection technology. The method includes: acquiring the initial motion state feature vector group corresponding to the spraying robot arm during the coating process of the motor end cap to be detected; acquiring the target sub-image corresponding to each specified sub-region of the motor end cap to be detected, so as to obtain several target sub-images; obtaining several target coating time periods according to the temporal relationship of the nozzle motion trajectory points of the spraying robot arm; and according to A i The similarity between the center vector of each preset defect motion state feature vector group and the coating effect of the motor end cover to be inspected is used to determine whether the coating effect meets the preset conditions. This invention can overcome the shortcomings of traditional overall image processing methods in responding to local minor defects, and significantly improves the accuracy and reliability of coating quality inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of motor end cover coating effect detection technology, and in particular to a method for detecting motor end cover coating effect based on image processing. Background Technology

[0002] The motor end cover is an important component of the motor, used to protect its internal structure. Poor coating quality or defects such as bubbles, pinholes, uneven coating, and exposed substrate can lead to insulation failure, leakage, or short circuits, affecting the motor's safe operation and even causing accidents. To avoid these situations, it is usually necessary to inspect the coating quality of the motor end cover. One common method in the existing technology is image processing, which involves taking a picture of the entire coated motor end cover and then inputting the image into a preset model to obtain the coating quality. However, this method processes and inspects the entire image of the motor end cover. During the coating process, due to the limited precision of the robotic arm and the complexity of the motor end cover itself, several small areas prone to coating defects exist. The overall image processing method is not sensitive to these areas and cannot accurately detect them, leading to inaccurate inspection results. Summary of the Invention

[0003] This invention provides a method for detecting the coating effect of motor end caps based on image processing, to solve the technical problem of inaccurate detection results when detecting the coating quality of motor end caps in the prior art. The method includes the following steps:

[0004] S100, Obtain the initial motion state feature vector group A = (A1, A2, ..., A...) corresponding to the spraying robot arm during the spraying process of the motor end cap to be detected. i A n ), i = 1, 2, ..., n; A i Let A be the initial motion state feature vector of the i-th detection dimension corresponding to the painting robot arm, where n is the number of detection dimensions; i =(A i,1 A i,2 A i,j A i,m A i,j Let A be the j-th element in the initial motion state feature vector of the i-th detection dimension corresponding to the painting robot arm, where m is the number of elements in the initial motion state feature vector; i The elements in it have a temporal order.

[0005] S200, acquire the target sub-image corresponding to each specified sub-region of the motor end cover to be inspected, so as to obtain several target sub-images; the probability of a spraying defect occurring in the specified sub-region is greater than the preset probability.

[0006] S300: Based on the temporal relationship of the nozzle movement trajectory points of the spraying robot arm, determine the target spraying time period corresponding to each target sub-image to obtain several target spraying time periods.

[0007] S400, according to A i The similarity between the center vector of each preset defect motion state feature vector group and the coating effect of the motor end cover to be inspected is used to determine whether the coating effect meets the preset conditions; among them, in the case of A i When calculating the similarity with the center vector of each preset defect motion state feature vector group, the weight of the element corresponding to the target spraying time period is adjusted to the target weight; the target weight is greater than 1.

[0008] The present invention has at least the following beneficial effects:

[0009] The image processing-based method for detecting the coating effect of motor end caps of this invention identifies and extracts images of high-probability sub-regions on the motor end cap that are prone to coating defects. This is then combined with temporal characteristics of the robotic arm's motion state for correlation analysis. This allows for precise focus on critical time periods where execution fluctuations occur during the coating process. By dynamically adjusting the weighting coefficients of the robotic arm's motion characteristic parameters within the corresponding time periods, the mapping relationship between defect features and abnormal robotic arm motion states is strengthened. This effectively improves the detection system's sensitivity to identifying localized minor coating defects, overcoming the shortcomings of traditional overall image processing methods in responding insufficiently to localized minor defects. This significantly improves the accuracy and reliability of coating quality detection, ensuring timely identification of potential defect areas caused by fluctuations in the robotic arm's execution precision, and avoiding the risk of insulation failure due to missed detections. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0011] Figure 1 A flowchart of a motor end cap spraying effect detection method based on image processing provided in an embodiment of the present invention. Detailed Implementation

[0012] 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.

[0013] It should be noted that, based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Furthermore, this device and / or practice the method can be implemented using other structures and / or functionalities besides one or more of the aspects set forth herein.

[0014] The following will refer to Figure 1 The flowchart shown is a method for detecting the coating effect of motor end caps based on image processing, which introduces a method for detecting the coating effect of motor end caps based on image processing.

[0015] The image processing-based method for detecting the coating effect of motor end caps may include the following steps:

[0016] S100, Obtain the initial motion state feature vector group A = (A1, A2, ..., A...) corresponding to the spraying robot arm during the spraying process of the motor end cap to be detected. i A n ), i = 1, 2, ..., n; A i Let A be the initial motion state feature vector of the i-th detection dimension corresponding to the painting robot arm, where n is the number of detection dimensions; i =(A i,1 A i,2 A i,j A i,m A i,j Let A be the j-th element in the initial motion state feature vector of the i-th detection dimension corresponding to the painting robot arm, where m is the number of elements in the initial motion state feature vector; i The elements in it have a temporal order.

[0017] Furthermore, the detection dimensions include: acceleration detection dimension, acceleration direction detection dimension, angle detection dimension, and speed detection dimension for different components of the spraying robot arm.

[0018] Furthermore, A i It is obtained by encoding the original detection data of the i-th detection dimension and extracting temporal features.

[0019] In this embodiment, multi-axis inertial sensors (such as accelerometers and gyroscopes) and encoders installed at the joints of the spraying robotic arm are used to collect real-time data on the spatial acceleration, angle, angular velocity, motion angle, and instantaneous velocity of a component of the robotic arm along the X / Y / Z axes, with a sampling frequency of no less than 100Hz. After wavelet denoising processing of the raw data, the data is divided into time windows (e.g., every 0.1 seconds) to extract the temporal feature vector group A for each detection dimension (acceleration, angle, etc.); A i It consists of m time-series data points, representing the dynamic motion state of the robotic arm component in the i-th detection dimension.

[0020] Through the above steps, a high-precision robotic arm motion state database is established to capture instantaneous fluctuations, such as sudden acceleration changes and angle drifts. Multi-dimensional data fusion avoids the limitations of single-parameter detection and provides data support for defect tracing.

[0021] S200, acquire the target sub-image corresponding to each specified sub-region of the motor end cover to be inspected, so as to obtain several target sub-images; the probability of a spraying defect occurring in the specified sub-region is greater than the preset probability.

[0022] In this embodiment, it is understood that during the motor end cover painting process, there are some high-risk areas on the motor end cover that are prone to painting defects, namely designated sub-regions; for example: the edge groove of the end cover, the area around the bolt holes, the gap of the heat dissipation fins, and the coverage area corresponding to sharp turns and acceleration change points in the painting path; the designated sub-regions can be obtained by the following method: for the same model of motor end cover, collect corresponding historical production defect cases (such as image data and process logs), construct a defect location database, analyze the spatial distribution pattern of defects through clustering algorithms (such as DBSCAN), and mark high-frequency defect areas.

[0023] S300: Based on the temporal relationship of the nozzle movement trajectory points of the spraying robot arm, determine the target spraying time period corresponding to each target sub-image to obtain several target spraying time periods.

[0024] In this embodiment, when the spraying robot arm sprays the same model of motor end cap, the spraying trajectory is usually preset. The spraying trajectory includes several spraying trajectory points, and each spraying trajectory point corresponds to a position coordinate and a time point. For example, the spraying process of a motor end cap lasts for 60 seconds, and the spraying trajectory points and position coordinates are distributed within the 60-second time period. The spraying position coordinates and time points can be mapped onto the motor end cap image.

[0025] It can parse the motion trajectory log file of the robotic arm control system and extract the spraying timestamp (accurate to milliseconds) of the nozzle in the corresponding area of ​​each target sub-image. Through the position coordinate-time mapping algorithm, the spraying operation time period corresponding to each target sub-image is marked as the target spraying time period.

[0026] Through the above steps, a precise correlation between "spatial defect area - robotic arm movement time" is established, and the abnormal operation period that caused the defect is located; at the same time, it supports reverse tracing of the causal relationship between abnormal robotic arm movement and spraying defects.

[0027] S400, based on the similarity between A and the center vector group of each preset defect motion state feature vector group, determine whether the coating effect of the motor end cover to be tested meets the preset conditions; wherein, when calculating the similarity between A and the center vector group of each preset defect motion state feature vector group, the weight of the element corresponding to the target coating time period is adjusted to the target weight; the target weight is greater than 1.

[0028] In this embodiment, the area sprayed within the target time period is an area prone to defects or flaws. Therefore, when calculating similarity, the weight of the elements corresponding to the time points within the target spraying time period is increased to enhance the significance of abnormal motion features within the key time period and improve the model's sensitivity to latent defects. The dynamic weight mechanism avoids overfitting or underfitting problems caused by fixed thresholds, thereby improving the accuracy of vector comparison.

[0029] Furthermore, the target weights are obtained through the following steps:

[0030] S401, obtain the number of pixels NUM1 corresponding to all target sub-images and the total number of pixels NUM corresponding to the motor end cover image.

[0031] S402, based on NUM1 and NUM, determine the target weight λ=1+α×(NUM-NUM1) / NUM; α is a preset adjustment coefficient, which is related to the model of the motor end cover to be tested.

[0032] In this embodiment, α is a preset model-related adjustment coefficient, typically ranging from 0.5 to 2.0. For example, for complex models, such as end caps with multiple heat dissipation fins, α = 1.8 to improve the detection sensitivity of high-risk areas; for simple models, such as flat end caps, α = 0.6 to avoid oversensitivity. NUM-NUM1 represents the number of pixels in non-high-risk areas, designed to adjust the weight by the proportion of non-defective areas. The weight λ is positively correlated with the proportion of non-high-risk areas; when the high-risk area is small, i.e., NUM1 is small, the value of λ is large.

[0033] When the proportion of high-risk areas is low, i.e., NUM1 is small, it indicates that the defects may be concentrated in a few key locations, and higher weights are needed to amplify the corresponding abnormal robot arm movements; when the proportion of high-risk areas is high, i.e., NUM1 is large, the defects are widely distributed, and the weights should be appropriately reduced to avoid overfitting.

[0034] A pre-established mapping relationship of α values ​​for different end cap models is implemented. For example, end cap model Type-A has high structural complexity (multiple grooves), so α = 1.8; end cap model Type-B has low structural complexity (flat surface), so α = 1.8. Dynamic loading: The corresponding α value is automatically called according to the end cap model being inspected, enabling customization of the inspection strategy.

[0035] For example: when NUM1 = 200000 and NUM = 4000000: λ = 1 + α × 0.95; if α = 1.5, then λ = 1 + 1.425 = 2.425, that is, the feature weight is increased to 2.425 times the original value within the target time period.

[0036] The methods described above have at least the following beneficial effects:

[0037] 1. Dynamic balance between defect detection sensitivity and regional risk

[0038] When the high-risk area is small (e.g., only 5%), λ increases significantly (e.g., 2.425 times), forcing the model to focus on abnormal robotic arm movements in a few critical periods; when the high-risk area is large (e.g., 30%), the increase in λ is moderate (e.g., λ = 1.7 when α = 1.0), avoiding excessive amplification of normal motion fluctuations.

[0039] 2. Model Differentiation Adaptation

[0040] Complex end caps (high α value) improve the ability to detect minute defects and solve the problem that their structure can easily lead to uneven local spraying; simple end caps (low α value) reduce the false alarm rate and are suitable for their high process stability.

[0041] 3. Optimization of computational efficiency

[0042] By quantizing and adjusting weights using pixel ratio (NUM-NUM1 / NUM), high-precision calculations are avoided throughout the day, reducing computational resource consumption by more than 40%; formulaic adjustments replace manual parameter tuning, improving system deployment efficiency.

[0043] Furthermore, step S400 may include the following steps:

[0044] S410, cluster each preset defect motion state feature vector group to obtain a cluster list C = (C1, C2, ..., C... p C q ), p = 1, 2, ..., q; C pLet q be the p-th cluster obtained by clustering, and q be the number of clusters obtained by clustering.

[0045] In this embodiment, when spraying historical motor end covers of the same model as the motor end cover to be tested within a historical time period, several historical motor end covers with defects will be generated. The motion state feature vector of the robotic arm during the spraying process of the historical motor end covers with defects is the defect motion state feature vector. It can be understood that the types of defects are limited, and the defect motion state feature vectors of the robotic arms corresponding to the same type of defects are also similar. Therefore, each preset defect motion state feature vector group is clustered, and the defect motion state feature vectors corresponding to similar defects are divided into the same group, thus obtaining C. By clustering, discrete defect cases are summarized into typical patterns, and a mapping relationship of "robotic arm motion anomaly - coating defect type" is established. New detection data only needs to be compared with a limited cluster center, reducing computational complexity.

[0046] S420, obtain the similarity between the center vector groups of each defect motion state feature vector group in A and C, to obtain the similarity list η = (η1, η2, ..., η3). p , ..., η q ); where η p For A and C p Similarity between A and C; Euclidean distance is used to compare the similarity between A and C. p The similarity between them is calculated, and the weight of the element corresponding to the target spraying time period is adjusted to λ.

[0047] In this embodiment, the Euclidean distance between vectors can be used to obtain the similarity between the central vector groups of each defect motion state feature vector group in A and C. It should be noted that when calculating the similarity, the weight of the element corresponding to the target spraying time period is adjusted to λ; for example: A i,j If the time point corresponding to the element with the difference is within the target spraying time period, then the weight of the two is adjusted to λ, that is, the weight is increased; the significance of abnormal movement characteristics within the key time period is strengthened, the sensitivity of the model to hidden defects is improved, and thus the accuracy of defect judgment is improved.

[0048] In this embodiment, η p The following method can be used to obtain: Get A from A i With C p The similarity between the central vector groups can be used to obtain n similarity scores. Then, the average of the n similarity scores is calculated to obtain η. p .

[0049] S430, if the maximum similarity η in η is maxIf η' < η', then the coating effect of the motor end cover to be tested is determined to meet the preset conditions; otherwise, the coating effect of the motor end cover to be tested is determined to be an undetermined effect; η' is the preset similarity threshold.

[0050] In this embodiment, η' is dynamically calibrated based on the distribution of historical qualified data to adapt to the process differences of different production lines and coatings; it avoids misjudgments caused by fixed thresholds, such as instantaneous fluctuations caused by environmental noise.

[0051] Through the above steps, a full-process inspection of "defect patterning - intelligent matching - hierarchical judgment" is realized, which significantly improves the inspection accuracy and efficiency, while providing data support for process optimization and forming a closed loop of quality control.

[0052] Furthermore, after step S430, the method may further include the following steps:

[0053] S440, if the coating effect of the motor end cover to be tested is undetermined, then obtain the standard motion state feature vector corresponding to each detection dimension to obtain the standard motion state feature vector group B = (B1, B2, ..., B...). i B n ); B i B is the standard motion state feature vector corresponding to the i-th detection dimension; i = (B i,1 B i,2 B i,j B i,m ); B i,j It is the j-th standard element in the standard motion state feature vector corresponding to the i-th detection dimension.

[0054] In this embodiment, under the preset ideal conditions, during the process of spraying the motor end cap, each detection dimension of the spraying robot arm corresponds to standard time-series data, which can be obtained. Then, time-series feature extraction is performed to obtain B. This step uses the same encoding and time-series extraction method as the above embodiment to obtain data, so that the two different vectors contain the same number of elements.

[0055] S450, according to A i and B i A was obtained i With B i List of deviation values ​​ΔE i =(ΔE) i,1 ΔE i,2 , …, ΔE i,j , …, ΔE i,m );ΔE i,j For A i,j With B i,j The deviation between; ΔE i,j=|A i,j -B i,j |;This leads to the n-row, m-column deviation matrix H=(ΔE1, ΔE2, …, ΔE i , …, ΔE n ).

[0056] S460, traverse H, if ΔE i,1 >γ i Then ΔE i,1 γ was identified as an anomalous element. i The preset threshold value for the deviation value corresponding to the i-th detection dimension.

[0057] In this embodiment, the deviation threshold value corresponding to each detection dimension can be obtained according to process requirements or statistical analysis of historical data.

[0058] S470, if the number of abnormal elements in the j-th column of H is greater than the preset number, then the time point corresponding to the j-th column is determined as the abnormal time point.

[0059] In this embodiment, the preset number can be set according to the number of detection dimensions. For example, the preset number is n / 2 rounded down. The number of abnormal elements in each column is counted. If it exceeds the preset number, it is marked as an abnormal time point. For example, if time point 5 is abnormal in the three dimensions of acceleration, angle and velocity, n=4 and the preset number is 2, then time point 5 is marked as an abnormal time point.

[0060] S480 determines whether the spraying effect of the motor end cap to be tested meets the preset conditions based on the temporal relationship between each abnormal time point and the nozzle movement trajectory point of the spraying robot arm.

[0061] Furthermore, step S480 may include the following steps:

[0062] S481, based on the temporal relationship between each abnormal time point and the nozzle movement trajectory point of the spraying robot arm, determine the spraying position coordinates corresponding to each abnormal time point.

[0063] In this embodiment, the nozzle motion trajectory log can be extracted from the spraying robotic arm control system. The log includes a timestamp sequence and corresponding three-dimensional coordinates and attitude angles; for the j-th abnormal time point t j Search the trajectory log for conditions |t j -t_log|≤Δt is the nearest neighbor coordinate, where t_log is the timestamp in the log and Δt is the allowed time error (usually Δt≤1ms); the validity of the coordinates is verified by the inverse kinematics model to exclude illegal coordinates (such as those outside the workspace boundary) that are outside the kinematic constraints of the robotic arm.

[0064] Example: Abnormal time point t j=15.236s, matching the coordinates (x=120.5mm, y=75.3mm, z=50.1mm) in the trajectory log at t_log=15.235s.

[0065] S482, a circular spraying area is determined with the spraying position coordinates as the center and the spraying radius of the nozzle as the radius.

[0066] In this embodiment, the spray radius of the nozzle can be obtained by means of a sample.

[0067] S483, the circular sprayed area corresponding to each abnormal time point in the image of the motor end cover to be tested is determined as the designated sub-region.

[0068] In this embodiment, the generated circular region is superimposed on the global image of the motor end cover, and the pixel set within each circular region is extracted as a designated sub-region. A unique ID is assigned to each designated sub-region, and the corresponding spatiotemporal attributes, such as position and radius, are recorded.

[0069] S484, combined with a self-attention mechanism, obtains the image features corresponding to the end cover image of the motor to be detected; wherein, the weight of the feature element corresponding to each specified sub-region in the image features is greater than the weight of the feature element corresponding to the non-specified sub-region.

[0070] In this embodiment, a pre-trained ResNet-50backbone can be used to extract the global feature map F of the endcap image; for each specified sub-region, a binary mask is generated, and the importance score of each sub-region is calculated through a learnable attention weight generator (fully connected layer) to synthesize a spatial attention map A; the attention map A is multiplied with the original feature map F channel by channel to obtain a weighted feature map F'.

[0071] The self-attention mechanism dynamically calculates the feature weights of each designated sub-region (i.e., the circular sprayed area corresponding to the robotic arm malfunction), allowing the model to focus on high-risk areas. This significantly improves the detection rate of small defects such as pinholes and bubbles; the feature weights of non-designated sub-regions are reduced, greatly minimizing the impact of background interference (such as scratches and reflections) on the detection results.

[0072] S485, input the image features corresponding to the image of the motor end cover to be tested into the preset detection model to determine whether the coating effect of the motor end cover to be tested meets the preset conditions.

[0073] In this embodiment, the preset detection model can be a binary classification model, which outputs a qualified or unqualified result; or it can be a regression model, which outputs a defect probability and determines whether the motor end cover to be tested meets the preset conditions based on the defect probability.

[0074] Furthermore, it can output a visual heat map, highlighting the defective area and its associated abnormal robot arm motion parameters, providing data support for subsequent defect analysis and parameter adjustment and correction of the painting robot arm.

[0075] In this embodiment, an explicit correlation between abnormal robotic arm motion and coating defects is established through a closed-loop link of abnormal time point → spatial coordinates → image sub-region → feature enhancement. This solves the problem of "isolated analysis of motion data and image defects" in traditional methods. It achieves accurate mapping of the entire link of "robotic arm motion - coating defects - image features". Combined with the self-attention mechanism to enhance the expression of defect features, it significantly improves detection accuracy and process diagnosis capabilities, providing reliable technical support for real-time quality control in intelligent manufacturing.

[0076] By identifying and extracting high-probability sub-region images of the motor end cap that are prone to spraying defects, and combining them with the temporal characteristics of the spraying robot's motion state for correlation analysis, the system can accurately focus on key time periods with execution fluctuations during the spraying process. By dynamically adjusting the weight coefficients of the robot's motion characteristic parameters within the corresponding time period, the mapping relationship between defect features and abnormal robot motion states is strengthened, effectively improving the detection system's sensitivity to identifying local minor spraying defects. This overcomes the shortcomings of traditional overall image processing methods in responding insufficiently to local minor defects, significantly improving the accuracy and reliability of spraying quality detection. This ensures that potential defect areas caused by fluctuations in the robot's execution precision can be identified in a timely manner, avoiding the risk of insulation failure due to missed detection.

[0077] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0078] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.

[0079] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0080] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0081] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0082] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0083] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0084] The electronic device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments in this application.

[0085] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and a bus connecting different system components (including memory and processor).

[0086] The memory stores program code that can be executed by the processor, causing the processor to perform the steps in the various embodiments described in this specification.

[0087] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).

[0088] The memory may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0089] A bus can represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus structures.

[0090] The electronic device can also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0091] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0092] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.

[0093] While specific embodiments of the invention have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention.

Claims

1. A method for detecting the coating effect of motor end caps based on image processing, characterized in that, The method includes the following steps: S100, Obtain the initial motion state feature vector group A = (A1, A2, ..., A...) corresponding to the spraying robot arm during the spraying process of the motor end cap to be detected. i A n ), i=1,2,…,n; A i Let A be the initial motion state feature vector of the i-th detection dimension corresponding to the painting robot arm, where n is the number of detection dimensions; i = (A i,1 A i,2 A i,j A i,m A i,j Let A be the j-th element in the initial motion state feature vector of the i-th detection dimension corresponding to the painting robot arm, where m is the number of elements in the initial motion state feature vector; i The elements in it have a temporal sequence; S200, acquire the target sub-image corresponding to each specified sub-region of the motor end cover to be inspected, so as to obtain a number of target sub-images; the probability of a spraying defect occurring in the specified sub-region is greater than the preset probability; S300, based on the temporal relationship of the nozzle movement trajectory points of the spraying robot arm, determine the target spraying time period corresponding to each target sub-image to obtain several target spraying time periods; S400, based on the similarity between A and the center vector group of each preset defect motion state feature vector group, determine whether the coating effect of the motor end cover to be tested meets the preset conditions; wherein, when calculating the similarity between A and the center vector group of each preset defect motion state feature vector group, the weight of the element corresponding to the target coating time period is adjusted to the target weight; the target weight is greater than 1. The target weights are obtained through the following steps: S401, obtain the number of pixels NUM1 corresponding to all target sub-images and the total number of pixels NUM corresponding to the motor end cover image; S402, based on NUM1 and NUM, determine the target weight λ = 1 + α × (NUM - NUM1) / NUM; α is a preset adjustment coefficient, which is related to the model of the motor end cover to be tested; Step S400 includes the following steps: S410, cluster each preset defect motion state feature vector group to obtain a cluster list C = (C1, C2, ..., C... p C q ), p=1,2,…,q; C p Let be the p-th cluster obtained by clustering, and q be the number of clusters obtained by clustering; S420, obtain the similarity between the center vector groups of each defect motion state feature vector group in A and C, to obtain the similarity list η = (η1, η2, ..., η3). p , ..., η q ); where η p For A and C p Similarity between A and C; Euclidean distance is used to compare the similarity between A and C. p The similarity between them is calculated, and the weight of the element corresponding to the target spraying time period is adjusted to λ; S430, if the maximum similarity η in η is max If η' < η', then the coating effect of the motor end cover to be tested is determined to meet the preset conditions; otherwise, the coating effect of the motor end cover to be tested is determined to be an undetermined effect; η' is the preset similarity threshold. S440, if the coating effect of the motor end cover to be tested is undetermined, then obtain the standard motion state feature vector corresponding to each detection dimension to obtain the standard motion state feature vector group B = (B1, B2, ..., B...). i B n ); B i B is the standard motion state feature vector corresponding to the i-th detection dimension; i = (B i,1 B i,2 B i,j B i,m ); B i,j It is the j-th standard element in the standard motion state feature vector corresponding to the i-th detection dimension; S450, according to A i and B i A was obtained i With B i List of deviation values ​​ΔE i =(ΔE i,1 ΔE i,2 , …, ΔE i,j , …, ΔE i,m ); ΔE i,j For A i,j With B i,j The deviation between; ΔE i,j =|A i,j -B i,j |;This leads to the n-row, m-column deviation matrix H = (ΔE1, ΔE2, ..., ΔE...). i , …, ΔE n ); S460, traverse H, if ΔE i,1 >γ i Then ΔE i,1 γ was identified as an anomalous element. i The preset threshold value for the deviation value corresponding to the i-th detection dimension; S470, If the number of abnormal elements in the j-th column of H is greater than the preset number, then the time point corresponding to the j-th column is determined as the abnormal time point; S480, based on the temporal relationship between each abnormal time point and the nozzle movement trajectory point of the spraying robot arm, determines whether the spraying effect of the motor end cover to be tested meets the preset conditions; Step S480 includes the following steps: S481, Based on the temporal relationship between each abnormal time point and the nozzle movement trajectory point of the spraying robot arm, determine the spraying position coordinates corresponding to each abnormal time point; S482, a circular spraying area is determined with the spraying position coordinates as the center and the spraying radius of the nozzle as the radius; S483, the circular sprayed area corresponding to each abnormal time point in the image of the motor end cover to be tested is determined as the designated sub-region; S484, combined with a self-attention mechanism, obtains the image features corresponding to the image of the motor end cover to be detected; wherein, the weight of the feature element corresponding to each specified sub-region in the image features is greater than the weight of the feature element corresponding to the non-specified sub-region. S485, input the image features corresponding to the image of the motor end cover to be tested into the preset detection model to determine whether the coating effect of the motor end cover to be tested meets the preset conditions.

2. The method for detecting the coating effect of motor end caps based on image processing according to claim 1, characterized in that, The detection dimensions include: acceleration detection dimension, acceleration direction detection dimension, angle detection dimension, and speed detection dimension of different components of the spraying robot arm.

3. The method for detecting the coating effect of motor end caps based on image processing according to claim 1, characterized in that, A i It is obtained by encoding the original detection data of the i-th detection dimension and extracting temporal features.

Citation Information

Patent Citations

  • Blow molding bag production defect detection method

    CN115082419A

  • Target tracking method and apparatus, computer device, and storage medium

    WO2019237516A1