Magnetic pulse crimping parts classification and identification method, device and electronic equipment
Through structured light acquisition and image processing technology, combined with the ResNet network, the problem of low detection accuracy of magnetic pulse crimping parts is solved and high-accuracy classification and recognition effects are achieved.
Patent Information
- Application Number
- CN202111552057.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-17
AI Technical Summary
Existing magnetic pulse crimping parts detection methods cannot effectively distinguish subtle differences in workpieces, resulting in low quality inspection accuracy. In particular, traditional X-ray detection, infrared temperature measurement and ultrasonic detection methods are not suitable for magnetic pulse crimping parts. .
Structured light is used to collect the appearance characteristic image of the magnetic pulse crimping parts. The center point position of the bright band and the horizontal line of the outer contour are obtained through image processing. The vertical distance is calculated to form a depth map, and the trained ResNet network is used for classification and recognition.
It achieves high-accuracy classification and identification of magnetic pulse crimping parts, can effectively distinguish three-dimensional appearance features, and solves the problem of low detection accuracy in the existing technology.
Smart Images

Figure CN114187287B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of quality detection, and specifically relates to a method, a device and an electronic device for classifying and identifying magnetic pulse crimped parts. Background Art
[0002] At present, the industry lacks effective non-destructive testing methods for magnetic pulse crimping parts. The production line still uses primitive manual observation methods to determine whether the workpiece is qualified. The existing other types of non-magnetic pulse crimping parts testing methods are mainly divided into X-ray detection, infrared temperature measurement and ultrasonic detection. The X-ray detection method distinguishes the presence of defects by distinguishing the degree of penetration of X-rays into different parts, and its rays have lower penetration ability into defects. The infrared temperature measurement method determines whether there is a defect by comparing the difference in the diffusion coefficient of heat flow in different parts. The heat flow diffusion ability at the defect will be different from that at the non-defective part. The ultrasonic detection method compares the ultrasonic penetration waveform and reflection waveform at the defect and the non-defective part to determine the location of the defect. These methods often cannot distinguish subtle differences in the workpiece and are not suitable for magnetic pulse crimping parts.
[0003] Magnetic pulse press-fit parts are not suitable for traditional press-fit parts inspection methods such as X-ray inspection, infrared temperature measurement and ultrasonic inspection, because in most cases, magnetic pulse press-fit parts do not have obvious defects that can be detected by the above methods. The existing traditional idea of using image classification neural networks to directly learn machine vision image data sets for classification also has poor effects on this type of parts. Summary of the invention
[0004] The invention provides a method, a device and an electronic device for classifying and identifying magnetic pulse crimped parts, so as to solve the problem that the quality detection accuracy of existing magnetic pulse crimped parts is low.
[0005] Based on the above purpose, an embodiment of the present invention provides a method for classifying and identifying magnetic pulse crimped parts, comprising: using structured light to collect the appearance feature image of the magnetic pulse crimped parts; performing image processing on the appearance feature image to obtain the center point position of the bright band in each column of the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimped part parallel to the axis; obtaining the vertical distance from each center point in the bright band to the horizontal line, and obtaining a depth map of the appearance features of the magnetic pulse crimped parts based on the vertical distance; applying a trained ResNet network to perform classification based on the depth map, and outputting the classification result.
[0006] Optionally, the image processing is performed on the shape feature image to obtain the center point position of the bright band in each column of the shape feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis, including: preprocessing the shape feature image to obtain a target image; obtaining the center point position of the bright band in each column of the target image; and performing straight-line fitting on the center points along the axial direction of the magnetic pulse crimping part to obtain the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis.
[0007] Optionally, the preprocessing of the shape feature image includes: applying a median filter to filter out noise signals in the shape feature image; applying an OSTU method to calculate the grayscale domain value with the largest difference between a target pixel point set and a background pixel point set in the image, and segmenting the shape features of the magnetic pulse crimping part from the shape feature image according to the grayscale domain value to obtain the target image; applying an opening operation to filter out scattered points, and filling in missing pixels in the target image.
[0008] Optionally, obtaining the center point position of the bright band in each column of the target image includes: traversing the target image, searching for the center point position of the bright band in each column of the target image; and filling the missing positions in the bright band with the average value of the nearest non-missing center point positions adjacent to the left and right.
[0009] Optionally, obtaining the vertical distance from each center point in the bright band to the horizontal line, and obtaining the depth map of the appearance characteristics of the magnetic pulse crimping part based on the vertical distance includes: calculating the vertical distance from each center point in the bright band to the horizontal line; converting the value range of the vertical distance to a grayscale value range of 0-255, and converting the vertical distance from each center point in the bright band to the horizontal line to a pixel point in the grayscale value range, thereby forming a depth map of the appearance characteristics of the magnetic pulse crimping part.
[0010] Optionally, applying a trained ResNet network to perform classification according to the depth map and outputting the classification result includes: converting the depth map into a grayscale image with a shape of (224, 1, 1); inputting the grayscale image into the trained ResNet network to perform a one-dimensional search, and outputting the classification result.
[0011] Optionally, the grayscale image is input into the trained ResNet network for one-dimensional search and outputting a classification result, including: inputting the grayscale image into the trained ResNet network; after being processed by the convolution part of the ResNet network, the grayscale image is converted into a tensor with a shape of (7, 1, 512), and then processed through an average pooling and flattening layer, and classified through a fully connected layer, and outputting a classification result.
[0012] Optionally, the applying a trained ResNet network to perform classification according to the depth map and before outputting the classification result includes: obtaining historical appearance feature images of magnetic pulse crimping parts, processing them to obtain historical depth maps, and obtaining manual classification results to construct a training data set; dividing the training data set into a training set, a validation set, and a test set; training the ResNet network according to the training set, fine-tuning the ResNet network on the validation set, modifying some hyperparameters, testing the ResNet network on the test set, and obtaining the trained ResNet network.
[0013] Based on the same inventive concept, an embodiment of the present invention also proposes a magnetic pulse crimping parts classification and identification device, including: an image acquisition unit, used to use structured light to acquire the appearance feature image of the magnetic pulse crimping parts; an image processing unit, used to perform image processing on the appearance feature image, obtain the center point position of the bright band in each column of the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping parts parallel to the axis; a depth map acquisition unit, used to obtain the vertical distance from each center point in the bright band to the horizontal line, and obtain a depth map of the appearance feature of the magnetic pulse crimping parts based on the vertical distance; a classification and identification unit, used to apply a trained ResNet network to perform classification according to the depth map, and output the classification result.
[0014] Based on the same inventive concept, an embodiment of the present invention further proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the program.
[0015] The technical effect of the present invention is that, as can be seen from the above description, a magnetic pulse crimping parts classification and identification method, device and electronic device provided by the embodiments of the present invention collect the appearance feature image of the magnetic pulse crimping parts by using structured light; perform image processing on the appearance feature image to obtain the center point position of the bright band in each column of the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping parts parallel to the axis; obtain the vertical distance from each center point in the bright band to the horizontal line, and obtain a depth map of the appearance feature of the magnetic pulse crimping parts based on the vertical distance; classify using a trained ResNet network based on the depth map, and output the classification result, so as to classify and identify the three-dimensional appearance features with high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 Schematic diagram of the process of the magnetic pulse crimping parts classification and identification method in the embodiment of the present invention;
[0018] Figure 2 is a schematic diagram of a depth map of the appearance features of a magnetic pulse crimping component in an embodiment of the present invention;
[0019] Figure 3 Schematic diagram of the structure of the ResNet network in an embodiment of the present invention;
[0020] Figure 4 Schematic diagram of the structure of the first ResNet network unit in the ResNet network in an embodiment of the present invention;
[0021] Figure 5 Schematic diagram of the structure of a second ResNet network unit in a ResNet network in an embodiment of the present invention;
[0022] Figure 6 It is a structural schematic diagram of a magnetic pulse crimped parts classification and identification device in an embodiment of the present invention;
[0023] Figure 7 Schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0025] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present invention do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0026] The embodiment of the present invention also provides a method for classifying and identifying magnetic pulse crimped parts. Figure 1 As shown, the classification and identification method of magnetic pulse crimping parts includes:
[0027] Step S11: using structured light to collect the appearance feature image of the magnetic pulse crimped component.
[0028] In an embodiment of the present invention, structured light vision is used to collect the appearance feature image of the magnetic pulse crimping part, wherein the line structured light surface passes through the axis of the magnetic pulse crimping part, and the collected appearance feature image will reflect the appearance contour characteristics of the crimping part.
[0029] Step S12: performing image processing on the appearance feature image to obtain the center point position of each column of the bright band in the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis.
[0030] In step S12, optionally, the shape feature image is preprocessed to obtain a target image; the center point position of each column of the bright band in the target image is obtained; a straight line fitting is performed on the center point along the axial direction of the magnetic pulse crimping part to obtain the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis.
[0031] The noise points in the appearance feature image mainly come from the electromagnetic noise generated by the magnetic pulse device. When preprocessing the appearance feature image, the median filter is first applied to filter out the noise signal in the appearance feature image to facilitate the next step of image processing. Then the OSTU method is used to calculate the grayscale domain value with the largest difference between the target pixel set and the background pixel set in the image, and the appearance features of the magnetic pulse crimping part are segmented from the appearance feature image according to the grayscale domain value to obtain the target image. Specifically, the pixel value of each pixel in the appearance feature image can be compared with the grayscale domain value. If the pixel value of any pixel is greater than or equal to the grayscale domain value, the pixel value of the pixel remains unchanged; if the pixel value of any pixel is less than the grayscale domain value, the pixel value of the pixel is changed to 0. In this way, the appearance features of the magnetic pulse crimping part to be processed can be segmented from the appearance feature image to obtain the target image. Finally, the open operation is applied to filter out scattered points and fill in the missing pixels in the target image. After image segmentation, there may be discontinuities in the appearance features of the magnetic pulse crimping part in the target image, and the missing pixels need to be filled. The embodiment of the present invention uses an opening operation to pre-repair some missing pixels in the target image.
[0032] After obtaining the repaired target image, it is necessary to obtain the center point position of the bright band in each column of the target image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis. Optionally, first traverse the target image and search for the center point position of the bright band in each column of the target image. Specifically, the target image can be searched in the column direction first, and then the target image can be searched in the row direction to obtain the center point position of the bright band in each column of the target image. Then, the average value of the nearest non-missing center point positions adjacent to the left and right is applied to fill the missing position in the bright band. That is, the missing pixel points in the bright band are interpolated as the average value of the nearest non-missing center point positions adjacent to the left and right. Finally, a straight line fitting is performed on the center point of the bright band along the axis direction of the magnetic pulse crimping part to obtain the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis.
[0033] Step S13: obtaining the vertical distance from each center point in the bright band to the horizontal line, and obtaining a depth map of the appearance characteristics of the magnetic pulse crimping component according to the vertical distance.
[0034] In the embodiment of the present invention, the vertical distance from each center point in the bright band to the horizontal line is calculated; the value range of the vertical distance is converted into a grayscale value range of 0-255, and the vertical distance from each center point in the bright band to the horizontal line is converted into a pixel point in the grayscale value range to form a depth map of the appearance characteristics of the magnetic pulse crimping part. In this way, a depth map of the appearance characteristics of the magnetic pulse crimping part is obtained, such as Figure 2 As shown, the larger the gray value, that is, the brighter the area, the deeper the inward depression of the shape.
[0035] The depth map obtained by processing the shape feature image in the embodiment of the present invention can effectively obtain information containing the shape features and eliminate the interference of redundant image information. The depth map intuitively represents the distribution of the shape features. It is not only suitable for magnetic pulse crimping parts, but also can be used for most rotating workpieces related to three-dimensional shape features.
[0036] Step S14: applying the trained ResNet network to perform classification according to the depth map, and outputting the classification result.
[0037] In an embodiment of the present invention, before step S14, the ResNet network needs to be trained based on historical data. Optionally, the historical appearance feature image of the magnetic pulse crimping part is obtained, and a historical depth map is obtained after processing, and the manual classification result is obtained to construct a training data set; the training data set is divided into a training set, a validation set and a test set; the ResNet network is trained according to the training set, the ResNet network is fine-tuned on the validation set, some hyperparameters are modified, and the ResNet network is tested on the test set to obtain the trained ResNet network. The method of processing the historical appearance feature image to obtain the processed historical depth map is the same as the processing method in steps S11-S13, and will not be repeated here. The ResNet network is improved from the ResNet18 network, and the main structure remains unchanged, but its filter kernel only searches in one-dimensional direction. Specifically, Figure 3-5 As shown in the figure, the depth map is first processed by a 7x1 convolution layer with 64 convolution kernels, a stride of 2, and a padding of 3; then it is processed by a normalization layer and an activation layer in sequence, with the activation function set to "Relu"; after being processed by a 3x1 maximum pooling layer, it is processed by two first ResNet network units with 64 convolution kernels, a second ResNet network unit with 128 convolution kernels, a first ResNet network unit with 128 convolution kernels, a second ResNet network unit with 256 convolution kernels, a first ResNet network unit with 256 convolution kernels, a second ResNet network unit with 512 convolution kernels, and a first ResNet network unit with 512 convolution kernels to obtain a tensor of shape (7, 1, 512); finally, it is processed by an average pooling layer, a flattening layer, and a fully connected layer in sequence to output the classification result. The first ResNet network unit is shown in Figure 4As shown in the figure, the input is processed by a 3x1 convolution layer, a normalization layer, an activation layer, a 3x1 convolution layer, a normalization layer, and then superimposed with the original input, and then processed by the activation layer for output; the activation functions of the two activation layers are set to "Relu". In the first 3x1 convolution layer, the stride is 1 and the padding is 1; in the second 3x1 convolution layer, the stride is 2 and the padding is 1. The second ResNet network unit is as follows Figure 5 As shown in the figure, the input is processed by a 3x1 convolution layer, a normalization layer, an activation layer, a 3x1 convolution layer, and a normalization layer, and the other is processed by a 1x1 convolution layer. The two are superimposed and then processed by the activation layer for output. In the first 3x1 convolution layer, the stride is 1 and the padding is 1; in the second 3x1 convolution layer, the stride is 2 and the padding is 1; in the 1x1 convolution layer, the stride is 2 and the padding is 0.
[0038] When training the ResNet network, the embodiment of the present invention first trains the ResNet network according to the training set, then fine-tunes the ResNet network according to the validation set, modifies some hyperparameters, adds some layers, and finally tests the ResNet network according to the test set, thereby obtaining a trained ResNet network to achieve a high-accuracy classification task. The training results of the ResNet network of the embodiment of the present invention achieved an accuracy of 92% and 85% on the validation set and the test set, respectively.
[0039] In an embodiment of the present invention, in step S14, the depth map is converted into a grayscale image with a shape of (224, 1, 1); the grayscale image is input into the trained ResNet network for one-dimensional search, and a classification result is output. Optionally, the grayscale image is input into the trained ResNet network; after being processed by the convolution part of the ResNet network, the grayscale image becomes a tensor with a shape of (7, 1, 512), and then processed by average pooling and flattening layers, and classified by a fully connected layer, and the classification result is output. In the embodiment of the present invention, there are 10 classifications according to the causes of the deformation area of the magnetic pulse crimping part, and the output classification result is one of the 10 classifications.
[0040] The embodiment of the present invention uses a variant one-dimensional convolution kernel ResNet network to learn a depth map. The network structure for processing one-dimensional images is simpler and does not need to process complex two-dimensional image information. The training speed is faster and the accuracy is higher. This solves the problem of the current lack of quality inspection methods for magnetic pulse crimping parts and can be used to identify similar features that are difficult to distinguish.
[0041] The embodiment of the present invention uses structured light to collect the appearance feature image of the magnetic pulse crimping part; performs image processing on the appearance feature image to obtain the center point position of the bright band in each column of the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis; obtains the vertical distance from each center point in the bright band to the horizontal line, and obtains the depth map of the appearance feature of the magnetic pulse crimping part based on the vertical distance; applies the trained ResNet network to perform classification based on the depth map, and outputs the classification result, so as to classify and identify the three-dimensional appearance features with high accuracy.
[0042] The above describes specific embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0043] Based on the same inventive concept, the embodiment of the present invention provides a magnetic pulse crimping parts classification and identification device. Figure 6 As shown, the magnetic pulse crimping parts classification and identification device includes: an image acquisition unit, an image processing unit, a depth map acquisition unit and a classification and identification unit.
[0044] An image acquisition unit, used for acquiring an image of the appearance characteristics of the magnetic pulse crimped parts by using structured light;
[0045] An image processing unit, used for performing image processing on the appearance feature image, obtaining the center point position of each bright band in the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis;
[0046] A depth map acquisition unit, used to acquire the vertical distance from each center point in the bright band to the horizontal line, and acquire the depth map of the appearance characteristics of the magnetic pulse crimping part according to the vertical distance;
[0047] The classification and recognition unit is used to perform classification according to the depth map using the trained ResNet network and output the classification result.
[0048] For the convenience of description, the above device is described as various modules according to their functions. Of course, when implementing the embodiment of the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0049] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0050] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the above embodiments is implemented.
[0051] Figure 7 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 701, a memory 702, an input / output interface 703, a communication interface 704, and a bus 705. The processor 701, the memory 702, the input / output interface 703, and the communication interface 704 are connected to each other in communication within the device through the bus 705.
[0052] The processor 701 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.
[0053] The memory 702 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 702 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present invention is implemented by software or firmware, the relevant program code is stored in the memory 702 and is called and executed by the processor 701.
[0054] The input / output interface 703 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0055] The communication interface 704 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0056] The bus 705 includes a path for transmitting information between various components of the device (eg, the processor 701 , the memory 702 , the input / output interface 703 , and the communication interface 704 ).
[0057] It should be noted that, although the above device only shows the processor 701, the memory 702, the input / output interface 703, the communication interface 704 and the bus 705, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiment of the present invention, and does not necessarily include all the components shown in the figure.
[0058] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.
[0059] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of this disclosure.
Claims
1. A method for classifying and identifying magnetic pulse crimped parts, characterized in that: The method comprises: Structured light is used to collect the appearance feature images of magnetic pulse press-fit parts; Performing image processing on the appearance feature image to obtain the center point position of each bright band in the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis; Obtaining the vertical distance from each center point in the bright band to the horizontal line, and obtaining a depth map of the appearance characteristics of the magnetic pulse crimping part according to the vertical distance, wherein the vertical distance from each center point in the bright band to the horizontal line is calculated; the value range of the vertical distance is converted into a grayscale value range of 0-255, and the vertical distance from each center point in the bright band to the horizontal line is converted into a pixel point in the grayscale value range, so as to form a depth map of the appearance characteristics of the magnetic pulse crimping part; According to the depth map, a trained ResNet network is applied to perform classification, and a classification result is output; the depth map is converted into a grayscale image with a shape of (224, 1, 1); the grayscale image is input into the trained ResNet network for one-dimensional search, and a classification result is output, wherein the grayscale image is input into the trained ResNet network; after being processed by the convolution part of the ResNet network, the grayscale image becomes a tensor with a shape of (7, 1, 512), and then processed by an average pooling and flattening layer, and classified by a fully connected layer, and a classification result is output.
2. The method according to claim 1, characterized in that: The image processing of the shape feature image to obtain the center point position of each bright band in the shape feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis includes: Preprocessing the appearance feature image to obtain a target image; Obtaining the center point position of each bright band in the target image; A straight line fitting is performed on the center point along the axis direction of the magnetic pulse crimping component to obtain the horizontal line of the outer contour of the magnetic pulse crimping component parallel to the axis.
3. The method according to claim 2, characterized in that: The preprocessing of the appearance feature image comprises: Applying a median filter to filter out noise signals in the shape feature image; The OSTU method is used to calculate the grayscale domain value of the maximum difference between the target pixel point set and the background pixel point set in the image, and the shape features of the magnetic pulse crimping part are segmented from the shape feature image according to the grayscale domain value to obtain the target image; An opening operation is applied to filter out scattered points and fill in the missing pixels in the target image.
4. The method according to claim 2, characterized in that: The step of obtaining the center point position of each bright band in the target image comprises: Traversing the target image, searching for the center point position of each bright band in the target image; The missing positions in the bright band are filled with the average of the nearest non-missing center point positions on the left and right.
5. The method according to claim 1, characterized in that: Before applying the trained ResNet network to classify the depth map and outputting the classification result, the method includes: Obtain historical appearance feature images of magnetic pulse crimped parts, obtain historical depth maps after processing, obtain manual classification results, and construct a training data set; Dividing the training data set into a training set, a validation set, and a test set; The ResNet network is trained according to the training set, the ResNet network is fine-tuned on the validation set, some hyperparameters are modified, and the ResNet network is tested on the test set to obtain the trained ResNet network.
6. A magnetic pulse crimping parts classification and identification device, characterized in that: The device comprises: An image acquisition unit, used for acquiring an image of the appearance characteristics of the magnetic pulse crimped parts by using structured light; An image processing unit, used for performing image processing on the appearance feature image, obtaining the center point position of each bright band in the appearance feature image and the horizontal line of the outer contour of the magnetic pulse crimping part parallel to the axis; A depth map acquisition unit is used to acquire the vertical distance from each center point in the bright band to the horizontal line, and acquire the depth map of the appearance characteristics of the magnetic pulse crimping part according to the vertical distance, wherein the vertical distance from each center point in the bright band to the horizontal line is calculated; the value range of the vertical distance is converted into a gray value range of 0-255, and the vertical distance from each center point in the bright band to the horizontal line is converted into a pixel point in the gray value range to form a depth map of the appearance characteristics of the magnetic pulse crimping part; The classification recognition unit is used to apply the trained ResNet network to classify according to the depth map and output the classification result; convert the depth map into a grayscale image with a shape of (224, 1, 1); input the grayscale image into the trained ResNet network for one-dimensional search, and output the classification result, wherein the grayscale image is input into the trained ResNet network; after being processed by the convolution part of the ResNet network, the grayscale image becomes a tensor with a shape of (7, 1, 512), and then processed by average pooling and flattening layers, and classified by a fully connected layer, and the classification result is output.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
