Visual inspection method, device and equipment applied to automobile and storage medium
Through visual detection methods and deep learning models, automated defect detection of automotive motor parts is realized, solving the problems of cumbersome and inefficient detection processes in the existing technology, and improving detection efficiency and reliability.
Patent Information
- Application Number
- CN202411860679.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-05-16
AI Technical Summary
The current process of obtaining defect detection results of stator and rotor of automotive motors is cumbersome, inefficient, and easy to have human errors, affecting detection efficiency and reliability.
The visual detection method is used to obtain images of automotive motor components through the camera, and the deep learning model and programmable logic controller are used to realize automated angle correction and feature extraction to generate defect detection results.
It improves the efficiency of obtaining defect detection results, reduces detection time, avoids artificial errors, and enhances the reliability of detection results.
Smart Images

Figure CN120014527A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile technology, and in particular to a visual inspection method, device, equipment and storage medium applied to automobiles. Background Art
[0002] With the rapid development of the automobile manufacturing industry and technological progress, the quality requirements for automobile motors are increasing. As the core components of automobile motors, the quality of stators and rotors directly affects the performance, efficiency and service life of automobile motors.
[0003] However, the current process of obtaining defect detection results of the stator and rotor of the automobile motor is cumbersome, which is not conducive to improving the efficiency of obtaining defect detection results. The reason is that the existing technology mainly uses manual detection to detect the stator and rotor of the current automobile motor. The manual detection method is inefficient, increases the time for obtaining the defect detection results of the stator and rotor of the current automobile motor, and is prone to human errors. Therefore, it is not conducive to improving the efficiency of obtaining defect detection results. Summary of the invention
[0004] The present invention provides a visual inspection method, device, computer equipment and storage medium applied to automobiles, so as to solve the technical problem that the process of obtaining defect inspection results of the stator and rotor of the current automobile motor is cumbersome, which is not conducive to improving the efficiency of obtaining defect inspection results.
[0005] In a first aspect, a visual inspection method for an automobile is provided, comprising:
[0006] Acquire a first image of the stator and rotor of the current automobile motor captured by a camera;
[0007] When the correction angle of the first image is greater than a preset angle, a rotation instruction of the correction angle is sent to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and the rotor of the current automobile motor to rotate according to the rotation instruction;
[0008] Acquire a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera;
[0009] When the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image;
[0010] Based on a preset extraction method, feature extraction is performed on the current component image to obtain a feature vector of the current component image;
[0011] Based on a preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor.
[0012] Furthermore, when the correction angle of the first image is greater than a preset angle, a rotation instruction of the correction angle is sent to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction, including:
[0013] When the correction angle of the first image is greater than a preset angle, obtaining a rotation instruction of the correction angle;
[0014] A preset programmable logic controller is connected, and a rotation instruction of the correction angle is sent to the programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction.
[0015] Furthermore, the step of obtaining a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera includes:
[0016] Obtaining a response message returned by the programmable logic controller after executing the rotation instruction;
[0017] When the response message is a success message, a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera is obtained.
[0018] Furthermore, when the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image includes:
[0019] When the correction angle of the second image is not greater than the preset angle, generating a selection instruction;
[0020] The second image is selected as the current component image through the selection instruction.
[0021] Furthermore, the feature extraction of the current component image based on a preset extraction method to obtain a feature vector of the current component image includes:
[0022] Obtain a read instruction, and read the image feature extraction network in a preset file through the read instruction;
[0023] The image feature extraction network is used to extract features from the current component image to obtain a feature vector of the current component image.
[0024] Furthermore, the obtaining, based on a preset obtaining method, a recognition result generated by the trained deep learning model based on the feature vector, and selecting the recognition result as a defect detection result of the stator and rotor of the current automobile motor includes:
[0025] Inputting the feature vector into the trained generator of the deep learning model;
[0026] Obtain the recognition result generated by the generator of the trained deep learning model based on the feature vector, and select the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
[0027] Furthermore, before the first image is obtained by taking the stator and rotor of the current automobile motor by the camera, the visual inspection method includes:
[0028] Acquire a preset normal image and a defective image, wherein the normal image is an image obtained by taking a camera of a stator and a rotor without defects in a preset automobile motor, and the defective image is an image obtained by taking a camera of a stator and a rotor with defects in a preset automobile motor; the normal image and a normal label are combined into a normal sample, and the defective image and a defective label are combined into a defective sample; a plurality of different normal samples and a plurality of different defective samples are combined into a training set, a preset deep learning model is trained based on the training set, and the trained deep learning model is saved.
[0029] In a second aspect, a visual inspection device for an automobile is provided, comprising:
[0030] A first acquisition module, used for acquiring a first image obtained by photographing the stator and rotor of the current automobile motor by a camera;
[0031] a sending module, configured to send a rotation instruction of the correction angle to a preset programmable logic controller when the correction angle of the first image is greater than a preset angle, so that the programmable logic controller controls the platform carrying the stator and the rotor of the current automobile motor to rotate according to the rotation instruction;
[0032] A second acquisition module is used to acquire a second image obtained by the camera shooting the stator and rotor of the current automobile motor after rotation;
[0033] A selection module, configured to select the second image as the current component image when the correction angle of the second image is not greater than the preset angle;
[0034] An extraction module, used for performing feature extraction on the current component image based on a preset extraction method to obtain a feature vector of the current component image;
[0035] The detection module is used to obtain the recognition result generated by the trained deep learning model based on the feature vector based on a preset acquisition method, and select the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
[0036] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned visual inspection method when executing the computer program.
[0037] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned visual inspection method are implemented. The present application provides a visual inspection method, apparatus, computer equipment and storage medium applied to automobiles, which obtains a first image of the stator and rotor of the current automobile motor taken by a camera; when the correction angle of the first image is greater than a preset angle, sends a rotation instruction of the correction angle to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction; obtains a second image of the stator and rotor of the current automobile motor taken by the camera after rotation; when the correction angle of the second image is not greater than the preset angle, selects the second image as the current component image; based on a preset extraction method, performs feature extraction on the current component image to obtain a feature vector of the current component image; based on a preset The acquisition method is to obtain the recognition result generated by the trained deep learning model based on the feature vector, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor. The beneficial effects are in two aspects. On the one hand, based on the preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor. Since there is no need to manually detect the stator and rotor of the current automobile motor, the acquisition time of the defect detection results of the stator and rotor of the current automobile motor is reduced, which is conducive to improving the efficiency of obtaining the defect detection results. On the other hand, since the trained deep learning model will not have the situation of human error, it is conducive to improving the reliability of the acquired defect detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0039] Figure 1 is a schematic diagram of an application environment of a visual inspection method according to an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of a flow chart of a visual inspection method provided by an embodiment of the present invention;
[0041] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S23;
[0042] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S25;
[0043] Figure 5 yes Figure 1 A schematic flow chart of a specific implementation of step S26;
[0044] Figure 6 is a structural schematic diagram of a visual inspection device in one embodiment of the present invention;
[0045] Figure 7 It is a structural diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an application environment of a visual inspection method according to an embodiment of the present invention. The visual inspection method provided by the embodiment of the present invention can be applied in the following embodiments: Figure 1 In an application environment, the visual inspection device communicates with a programmable logic controller through a network protocol. The full name of the programmable logic controller in English is: Programmable Logic Controller, and the abbreviation of programmable logic controller is: PLC. The visual inspection device obtains a first image of the stator and rotor of the current automobile motor taken by a camera; when the correction angle of the first image is greater than a preset angle, a rotation instruction of the correction angle is sent to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction;
[0048] Acquire a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera;
[0049] When the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image;
[0050] Based on a preset extraction method, feature extraction is performed on the current component image to obtain a feature vector of the current component image;
[0051] Based on a preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor.
[0052] Among them, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor. Since there is no need to manually inspect the stator and rotor of the current automobile motor, the inspection time of the stator and rotor of the current automobile motor is reduced, which is beneficial to improving the inspection efficiency of the stator and rotor of the current automobile motor.
[0053] Among them, this application uses a deep learning model, combined with a high-resolution camera and multi-spectral imaging technology, to perform a full-scale scan of the stator and rotor surfaces of current automotive motors. This application can accurately identify defects including but not limited to the following:
[0054] Scratches: Linear damage that occurs on the surface;
[0055] Warping: Warping or deformation occurs;
[0056] Scratches: Irregular damage on the surface;
[0057] Pit: A local depression in the surface;
[0058] Foreign matter: impurities or foreign matter attached to the surface.
[0059] This application continuously optimizes the deep learning model through a large number of sample training, and improves the accuracy of identifying various defects. At the same time, this application can also classify defects according to their severity, providing data support for subsequent quality control and production optimization.
[0060] In the scheme implemented by the above-mentioned visual inspection method, device, equipment and medium, the beneficial effects are in two aspects. On the one hand, based on the preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor. Since there is no need to manually inspect the stator and rotor of the current automobile motor, the acquisition time of the defect detection results of the stator and rotor of the current automobile motor is reduced, which is beneficial to improve the efficiency of obtaining the defect detection results; on the other hand, since the trained deep learning model will not have the situation of human errors, it is beneficial to improve the reliability of the acquired defect detection results.
[0061] The present invention is described in detail below through specific embodiments.
[0062] See also Figure 2 , Figure 2 A flow chart of a visual inspection method provided by an embodiment of the present invention is applied to a visual inspection device. The visual inspection method comprises the following steps:
[0063] S21, obtaining a first image of the stator and rotor of the current automobile motor captured by a camera;
[0064] Among them, the current automobile motor is an unidentified automobile motor.
[0065] Among them, the automotive motor is a device that converts and transmits electrical energy, and is mainly used as a power source for electric vehicles. The automotive motor converts the electrical energy stored in the battery into mechanical energy, drives the wheels to rotate through the transmission system, and thus makes the car move.
[0066] Exemplarily, after S21 and before S22, the visual inspection method includes:
[0067] Acquire characteristic points, a center of a circle, and a vertical line in the first image, and determine a correction angle of the first image according to the characteristic points, the center of a circle, and the vertical line in the first image.
[0068] Acquire feature points, a center of a circle, and a perpendicular line in the first image, connect the feature points in the first image with the center of a circle in the first image to obtain a first straight line, and select an angle between the first straight line and the perpendicular line in the first image as a correction angle of the first image.
[0069] Among them, determining the correction angle of the first image is conducive to improving the processing efficiency of the first image. This is because when the first image is tilted or irregularly rotated, the position and direction of the features of the first image will be offset, which not only increases the difficulty of analyzing the first image, but also causes deviations in the analysis results. By determining the correction angle of the first image, the feature points, center of the circle and vertical line of the first image can be returned to their proper positions and directions, thereby simplifying the processing flow of the first image and helping to improve the processing speed of the first image.
[0070] S22, when the correction angle of the first image is greater than a preset angle, sending a rotation instruction of the correction angle to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction;
[0071] Wherein, when the correction angle of the first image is greater than a preset angle, a rotation instruction of the correction angle is sent to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction, including:
[0072] When the correction angle of the first image is greater than a preset angle, obtaining a rotation instruction of the correction angle;
[0073] A preset programmable logic controller is connected, and a rotation instruction of the correction angle is sent to the programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction.
[0074] Among them, controlling the rotation of the platform that carries the stator and rotor of the current automobile motor not only improves the accuracy of angle correction, but also can adapt to stators and rotors of different models and sizes, significantly improving the versatility and reliability of the present application.
[0075] S23, obtaining a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera;
[0076] Exemplarily, after S23 and before S24, the visual inspection method includes:
[0077] Acquire characteristic points, a center of a circle, and a vertical line in the second image, and determine a correction angle of the second image according to the characteristic points, the center of a circle, and the vertical line in the second image.
[0078] Acquiring feature points, a center of a circle, and a vertical line in the second image, and determining a correction angle of the second image according to the feature points, the center of a circle, and the vertical line in the second image, including:
[0079] Acquire feature points, a center of a circle, and a perpendicular line in the second image, connect the feature points in the second image with the center of a circle in the second image to obtain a second straight line, and select an angle between the second straight line and the perpendicular line in the second image as a correction angle of the second image.
[0080] Among them, determining the correction angle of the second image is conducive to improving the processing efficiency of the second image. This is because when the second image is tilted or irregularly rotated, the position and direction of the features of the second image will be offset, which not only increases the difficulty of analyzing the second image, but also causes deviations in the analysis results. By determining the correction angle of the second image, the feature points, center of the circle and vertical line of the second image can be returned to their proper positions and directions, thereby simplifying the processing flow of the second image and helping to improve the processing speed of the second image.
[0081] S24, when the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image;
[0082] Wherein, when the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image includes:
[0083] When the correction angle of the second image is not greater than the preset angle, generating a selection instruction;
[0084] The second image is selected as the current component image through the selection instruction.
[0085] S25, performing feature extraction on the current component image based on a preset extraction method to obtain a feature vector of the current component image;
[0086] S26, based on a preset acquisition method, obtain the recognition result generated by the trained deep learning model based on the feature vector, and select the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
[0087] Among them, defect detection results are an important basis for measuring whether the stators and rotors of current automotive motors meet the standards. Through comprehensive and detailed detection of the stators and rotors of current automotive motors, potential quality problems of the stators and rotors of current automotive motors can be discovered and eliminated in a timely manner, thereby improving the overall reliability and market competitiveness of the stators and rotors of current automotive motors.
[0088] Wherein, before acquiring the first image obtained by taking the stator and rotor of the current automobile motor by the camera, the visual inspection method includes:
[0089] Acquire a preset normal image and a defect image, wherein the normal image is an image obtained by taking a camera of a stator and a rotor without defects in a preset automobile motor, and the defect image is an image obtained by taking a camera of a stator and a rotor with defects in a preset automobile motor;
[0090] The normal image and the normal label form a normal sample, and the defect image and the defect label form a defect sample;
[0091] A plurality of different normal samples and a plurality of different defective samples are combined into a training set, a preset deep learning model is trained based on the training set, and the trained deep learning model is saved.
[0092] Among them, the preset automobile motor is the identified automobile motor.
[0093] There are many types of defects. For ease of explanation, the following are some examples:
[0094] Scratches: Linear damage that occurs on the surface;
[0095] Warping: The sheet is warped or deformed;
[0096] Scratches: Irregular damage on the surface;
[0097] Pit: A local depression in the surface;
[0098] Foreign matter: impurities or foreign matter attached to the surface.
[0099] The method comprises forming a training set with a plurality of different normal samples and a plurality of different defective samples, training the deep learning model based on the training set, and saving the trained deep learning model, including:
[0100] Combining a plurality of different normal samples and a plurality of different defective samples into a training set;
[0101] Training the deep learning model based on the training set, and obtaining a loss value of the deep learning model in the training set through a cross entropy loss function;
[0102] When the loss value is less than a preset value, stop training the deep learning model and save the trained deep learning model.
[0103] In an embodiment of the present invention, the beneficial effects lie in two aspects. On the one hand, based on a preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor. Since there is no need to manually detect the stator and rotor of the current automobile motor, the acquisition time of the defect detection results of the stator and rotor of the current automobile motor is reduced, which is beneficial to improving the efficiency of obtaining the defect detection results. On the other hand, since the trained deep learning model will not have human errors, it is beneficial to improve the reliability of the acquired defect detection results.
[0104] See also Figure 3 , Figure 3 yes Figure 1 A specific implementation flow diagram of step S23 is described in detail as follows:
[0105] S31, obtaining a response message returned by the programmable logic controller after executing the rotation instruction;
[0106] S32, when the response message is a success message, obtaining a second image obtained by the camera shooting the stator and rotor of the current automobile motor after rotation.
[0107] In the embodiment of the present invention, when the response message is a success message, the second image obtained by capturing the stator and rotor of the current automobile motor after rotation by the camera is obtained, and the second image can be obtained in time.
[0108] See also Figure 4 , Figure 4 yes Figure 1 A specific implementation flow diagram of step S25 is described in detail as follows:
[0109] S41, obtaining a read instruction, and reading an image feature extraction network in a preset file through the read instruction;
[0110] S42, performing feature extraction on the current component image through the image feature extraction network to obtain a feature vector of the current component image.
[0111] In the embodiment of the present invention, the image feature extraction network is used to extract features of the current component image to obtain a feature vector of the current component image. Through the feature vector, important information of the current component image can be obtained.
[0112] See also Figure 5 , Figure 5 yes Figure 1 A specific implementation flow diagram of step S26 is described in detail as follows:
[0113] S51, inputting the feature vector into the trained generator of the deep learning model;
[0114] S52, obtaining the recognition result generated by the generator of the trained deep learning model based on the feature vector, and selecting the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
[0115] In the embodiment of the present invention, since there is no need to manually inspect the stator and rotor of the current automobile motor, the time for obtaining defect detection results of the stator and rotor of the current automobile motor is reduced, which is conducive to improving the efficiency of obtaining defect detection results.
[0116] See also Figure 6 , Figure 6 Schematic diagram of a structure of a visual inspection device in one embodiment of the present invention, which is applied to visual inspection equipment, such as Figure 6 As shown, the visual inspection device includes a first acquisition module 101, a sending module 102, a second acquisition module 103, a selection module 104, an extraction module 105, and a detection module 106. The functional modules are described in detail as follows:
[0117] A first acquisition module 101 is used to acquire a first image obtained by photographing the stator and rotor of the current automobile motor by a camera;
[0118] The sending module 102 is used to send a rotation instruction of the correction angle to a preset programmable logic controller when the correction angle of the first image is greater than a preset angle, so that the programmable logic controller controls the platform carrying the stator and the rotor of the current automobile motor to rotate according to the rotation instruction;
[0119] A second acquisition module 103 is used to acquire a second image obtained by the camera shooting the stator and rotor of the current automobile motor after rotation;
[0120] A selection module 104, configured to select the second image as a current component image when the correction angle of the second image is not greater than the preset angle;
[0121] An extraction module 105 is used to extract features of the current component image based on a preset extraction method to obtain a feature vector of the current component image;
[0122] The detection module 106 is used to obtain the recognition result generated by the trained deep learning model based on the feature vector based on a preset acquisition method, and select the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
[0123] In an embodiment of the present invention, the beneficial effects lie in two aspects. On the one hand, based on a preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor. Since there is no need to manually detect the stator and rotor of the current automobile motor, the acquisition time of the defect detection results of the stator and rotor of the current automobile motor is reduced, which is beneficial to improving the efficiency of obtaining the defect detection results. On the other hand, since the trained deep learning model will not have human errors, it is beneficial to improve the reliability of the acquired defect detection results.
[0124] For the specific limitations on the visual inspection device, please refer to the limitations on the visual inspection method above, which will not be repeated here.
[0125] Each module in the above-mentioned visual inspection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0126] See also Figure 7 , Figure 7 is another structural diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided, the computer device is a visual detection device, and its internal structure diagram can be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external database. When the computer program is executed by the processor, a function or step of a visual inspection method applied to an automobile can be implemented.
[0127] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0128] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant description of the aforementioned method embodiment. In order to avoid repetition, they will not be described one by one here.
[0129] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0130] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0132] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0133] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A visual inspection method for automobiles, characterized in that: include: Acquire a first image of the stator and rotor of the current automobile motor captured by a camera; When the correction angle of the first image is greater than a preset angle, a rotation instruction of the correction angle is sent to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and the rotor of the current automobile motor to rotate according to the rotation instruction; Acquire a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera; When the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image; Based on a preset extraction method, feature extraction is performed on the current component image to obtain a feature vector of the current component image; Based on a preset acquisition method, the recognition result generated by the trained deep learning model based on the feature vector is obtained, and the recognition result is selected as the defect detection result of the stator and rotor of the current automobile motor.
2. The visual inspection method according to claim 1, characterized in that: When the correction angle of the first image is greater than a preset angle, a rotation instruction of the correction angle is sent to a preset programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and the rotor of the current automobile motor to rotate according to the rotation instruction, including: When the correction angle of the first image is greater than a preset angle, obtaining a rotation instruction of the correction angle; A preset programmable logic controller is connected, and a rotation instruction of the correction angle is sent to the programmable logic controller, so that the programmable logic controller controls the platform carrying the stator and rotor of the current automobile motor to rotate according to the rotation instruction.
3. The visual inspection method according to claim 1, characterized in that: The step of obtaining a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera includes: Obtaining a response message returned by the programmable logic controller after executing the rotation instruction; When the response message is a success message, a second image obtained by photographing the stator and rotor of the current automobile motor after rotation by the camera is obtained.
4. The visual inspection method according to claim 1, characterized in that: When the correction angle of the second image is not greater than the preset angle, selecting the second image as the current component image includes: When the correction angle of the second image is not greater than the preset angle, generating a selection instruction; The second image is selected as the current component image through the selection instruction.
5. The visual inspection method according to claim 1, characterized in that: The step of extracting features of the current component image based on a preset extraction method to obtain a feature vector of the current component image includes: Obtain a read instruction, and read the image feature extraction network in a preset file through the read instruction; The image feature extraction network is used to extract features from the current component image to obtain a feature vector of the current component image.
6. The visual inspection method according to claim 1, characterized in that: The method of obtaining the recognition result generated by the trained deep learning model based on the feature vector based on the preset acquisition method, and selecting the recognition result as the defect detection result of the stator and rotor of the current automobile motor, includes: Inputting the feature vector into the trained generator of the deep learning model; Obtain the recognition result generated by the generator of the trained deep learning model based on the feature vector, and select the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
7. The visual inspection method according to any one of claims 1 to 6, characterized in that: Before acquiring the first image obtained by taking the stator and rotor of the current automobile motor by the camera, the visual inspection method includes: Acquire a preset normal image and a defect image, wherein the normal image is an image obtained by taking a camera of a stator and a rotor without defects in a preset automobile motor, and the defect image is an image obtained by taking a camera of a stator and a rotor with defects in a preset automobile motor; The normal image and the normal label form a normal sample, and the defect image and the defect label form a defect sample; A plurality of different normal samples and a plurality of different defective samples are combined into a training set, a preset deep learning model is trained based on the training set, and the trained deep learning model is saved.
8. A visual inspection device for automobiles, characterized in that: include: A first acquisition module, used for acquiring a first image obtained by photographing the stator and rotor of the current automobile motor by a camera; a sending module, configured to send a rotation instruction of the correction angle to a preset programmable logic controller when the correction angle of the first image is greater than a preset angle, so that the programmable logic controller controls the platform carrying the stator and the rotor of the current automobile motor to rotate according to the rotation instruction; A second acquisition module is used to acquire a second image obtained by the camera shooting the stator and rotor of the current automobile motor after rotation; A selection module, configured to select the second image as the current component image when the correction angle of the second image is not greater than the preset angle; An extraction module, used for performing feature extraction on the current component image based on a preset extraction method to obtain a feature vector of the current component image; The detection module is used to obtain the recognition result generated by the trained deep learning model based on the feature vector based on a preset acquisition method, and select the recognition result as the defect detection result of the stator and rotor of the current automobile motor.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the visual inspection method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the visual inspection method according to any one of claims 1 to 7 are implemented.