Gear defect identification method and system based on visual inspection
Through the combination of industrial cameras and light sources, combined with Gaussian filtering and histogram equalization technology, gear wear texture features are extracted and support vector machine models are built, which solves the problem of low gear wear recognition accuracy and achieves efficient and accurate wear detection and feedback control.
Patent Information
- Application Number
- CN202510427049.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing visual detection methods have low detection accuracy, high false alarm rate and difficulty in adapting to complex working conditions, unable to accurately determine the wear degree, and unable to meet the actual production needs.
An industrial camera is used to match an annular light source and a coaxial light source, combined with rotating workbench and Gaussian filtering and histogram equalization technology, extract gear wear texture feature parameters, and build a gear wear defect recognition model based on support vector machine to achieve accurate identification and feedback control of gear wear degree.
It improves the accuracy and efficiency of gear wear defect detection, reduces the false alarm rate, realizes rapid detection and adapts to different working conditions, and meets the needs of automated production.
Smart Images

Figure CN120355671A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and specifically relates to a method and system for gear defect recognition based on visual detection. Background Art
[0002] As a key transmission component of mechanical equipment, the performance of gears directly affects the operation stability and reliability of the equipment. During the production and use of gears, gear wear is one of the most common types of defects. Gear wear not only reduces the transmission efficiency of gears, causes vibration and noise, but also may lead to equipment failures and economic losses in severe cases.
[0003] Currently, the methods for detecting gear wear mainly include contact and non-contact methods. Contact detection methods, such as using tools like calipers and profilometers, although they can obtain high measurement accuracy, have low detection efficiency, are difficult to automate, and may cause damage to the gear surface. In non-contact detection, ultrasonic detection and magnetic particle detection mainly target internal defects and surface cracks, and have poor detection effects on gear wear. Moreover, the detection equipment is costly and has high technical requirements for operators. Visual detection technology has been widely used in the field of industrial detection due to its advantages such as non-contact, fast detection speed, and comprehensive information acquisition. However, existing visual detection methods have problems in gear wear recognition, such as low detection accuracy, high false alarm rate, and difficulty in adapting to complex working conditions. In addition, existing methods usually can only detect whether there are wear defects, it is very difficult to determine the specific wear degree of the gear, and cannot provide feedback to the production line according to the wear degree of the gear and adjust it in a timely manner, unable to meet the needs of actual production. Summary of the Invention
[0004] In view of the above technical deficiencies, the present invention provides a method and system for gear defect recognition based on visual detection to improve the detection accuracy and efficiency of gear wear defects.
[0005] The present invention is achieved through the following technical solutions:
[0006] There is provided a method for gear defect recognition based on visual detection, the method comprising the following steps:
[0007] Step S10: Fix the gear to be measured on a rotating workbench with an industrial camera equipped with a ring light source and a coaxial light source, with the gear axis perpendicular to the optical axis of the industrial camera. The rotating workbench drives the gear to rotate at a constant speed, and the industrial camera collects images of the gear to be measured at a set frequency.
[0008] Step S20: Convert the collected images of the gear to be measured into grayscale images of the gear to be measured, perform denoising processing using Gaussian filtering, and enhance the denoised grayscale images through histogram equalization.
[0009] Step S30: According to the gray-scale image of the gear to be measured after image enhancement, use the gray-level co-occurrence matrix to extract the wear texture feature parameters of the gear to be measured, including energy, entropy, and contrast;
[0010] Step S40: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to the above steps to establish a wear feature library, construct a gear wear defect recognition model based on a support vector machine, use the wear feature library to train the model, and after training is completed, input the feature parameters of the gear to be measured into the model for recognition, and output the recognition result and feedback.
[0011] Preferably, in step S10, an industrial camera is paired with an annular light source and a coaxial light source. The annular light source is arranged around the industrial camera lens to provide uniform basic illumination for the surface of the gear to be measured, eliminate shadows, and highlight the overall contour. The coaxial light source is installed on the optical axis of the industrial camera, and the illumination light is in the same direction as the line of sight of the industrial camera, which can effectively highlight the details such as the texture and scratches of the gear; the rotary table drives the gear to rotate at a constant speed. According to the size, rotation speed of the gear to be measured, and the frame rate of the industrial camera, set the rotation speed of the rotary table to ensure that during the rotation of the gear to be measured, the industrial camera has enough time to collect the complete surface information of the gear to be measured and avoid acquisition blind spots; the industrial camera collects images of the gear to be measured at a set frequency. According to the rotation speed of the gear to be measured and the resolution of the industrial camera, calculate and set the acquisition frequency of the industrial camera so that the camera can collect a series of continuous images at the set frequency during one rotation of the gear. These images can be stitched together to completely present the surface condition of the gear. Start the rotary table to make the gear rotate at a constant speed, and at the same time trigger the industrial camera to collect images at the set frequency. The collected images are transmitted to a computer or an image storage device in real time through a data cable for subsequent processing.
[0012] Preferably, the steps of converting the collected image of the gear to be measured into a gray-scale image of the gear to be measured, performing denoising processing using Gaussian filtering, and performing image enhancement on the denoised gray-scale image through histogram equalization in step S20 include:
[0013] Image grayscale conversion: Use the OpenCV library in the image processing software to read the collected image of the gear to be measured, load the image of the gear to be measured into the memory through a function to form a multi-dimensional array. According to the characteristics of the gear image, calculate the gray value according to the weights of the RGB three channels, as shown in Equation (1):
[0014] Gray = 0.299×R + 0.587×G + 0.114×B (1)
[0015] Among them, Gray is the calculated grayscale value, R is the red of each pixel in the gear image to be measured, G is the green of each pixel in the gear image to be measured, and B is the blue of each pixel in the gear image to be measured. By traversing each pixel in the image and calculating and replacing the original RGB values according to Equation (1), the grayscale image of the gear to be measured is obtained. The grayscale image obtained in this way can better retain the detailed information of the gear, such as the texture and edges of the gear, providing a good basis for subsequent defect recognition.
[0016] Image denoising: Gaussian filtering is used to denoise the grayscale image, and the size of the filter kernel and the value of the standard deviation are determined according to the noise distribution characteristics of the gear image to be measured.
[0017] Image enhancement: Histogram equalization is adopted. By adjusting the grayscale histogram of the denoised grayscale image of the gear to be measured for image enhancement, the grayscale distribution of the image is made more uniform, thereby improving the contrast of the image and highlighting the edge and detail features of the gear.
[0018] Preferably, the steps of extracting the gear wear texture features by using the gray-level co-occurrence matrix in step S30 include:
[0019] Parameter determination: According to the size of the gear wear marks in the historical gear wear data, the spatial interval between two pixels in the co-occurrence matrix is determined, the relative direction of the two pixels is determined, and calculations are taken in 4 directions of 0°, 45°, 90°, and 135° to obtain the texture information of the gear in different directions.
[0020] Calculating the gray-level co-occurrence matrix: Taking each pixel in the grayscale image of the gear to be measured as a reference point, and finding the corresponding pixels according to the set distance and angle. For each pair of co-occurring pixels, the number of occurrences of the gray-level value combination is counted. After traversing the entire image, the calculation of the gray-level co-occurrence matrix in one direction and distance is completed. For other set angles and distances, repeat the above process to obtain multiple gray-level co-occurrence matrices.
[0021] Extracting texture feature parameters: The extracted texture feature parameters include energy, entropy, and contrast. Energy reflects the uniformity of the texture of the grayscale image of the gear to be measured, entropy reflects the complexity of the texture, and contrast reflects the clarity and layering of the texture.
[0022] Texture feature fusion: The energy, entropy, and contrast feature parameters calculated at different distances and angles are fused to comprehensively reflect the gear texture characteristics. The weighted average method is adopted, with each distance and angle set as a group, obtaining four distance-angle pairs, and the weight of each distance-angle pair is 0.25, and the sum of the weights is 1.
[0023] Preferably, the steps of constructing a gear wear defect recognition model based on a support vector machine in step S40 include:
[0024] Establishing a wear feature library: Gear samples with different degrees of gear wear are collected, and image acquisition, image preprocessing and feature extraction are performed according to steps S10 to S30 to establish a wear feature library. The data in the wear feature library is divided into a training set and a test set according to an 8:2 ratio;
[0025] Gear wear defect recognition model construction and training: determine the kernel function type and penalty parameters of the support vector machine, and the kernel function parameters, and determine the optimal parameter combination through cross-validation and grid search method to improve the classification accuracy of the gear wear defect recognition model. After the parameters are confirmed, the divided training set is input into the gear wear defect recognition model for training, so that the model can accurately distinguish the sample data with different wear degrees in the training set. When the recognition accuracy is greater than or equal to 95%, the model training is completed;
[0026] Gear wear defect recognition model evaluation and optimization: Use the test set to evaluate the trained support vector machine model, calculate the accuracy, recall rate and F1 value of the model on the test set as the evaluation result, and optimize the model according to the calculated evaluation results. When the model evaluation results do not meet the expected requirements, re-select parameters, adjust the division ratio of the training set and the test set, or increase the number of samples, and train and evaluate again until the model performance meets the expected requirements;
[0027] Gear wear defect identification: The wear texture characteristic parameters of the gear to be tested obtained in step S30 are input into the optimized gear wear defect identification model. The model outputs whether the gear to be tested has wear defects and outputs the wear degree classification result of the gear with wear defects.
[0028] Preferably, outputting the recognition result and feeding back in step S40 includes:
[0029] Gear identification result output: The output results include whether the gear has wear defects and the degree of wear, the location of the wear area and quantitative evaluation data; the test results can be displayed on the display screen, and the results can also be saved to the database for subsequent query and analysis;
[0030] Feedback control: Based on the test results, the gear production process is feedback controlled. When wear defects are detected in the gear, an alarm signal is issued in time to notify the operator to handle it. At the same time, according to the degree and frequency of gear wear, the problems in the production process are analyzed and the production process is optimized to improve product quality.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also proposes a gear defect recognition system based on visual detection, and the gear defect recognition system based on visual detection includes:
[0032] Gear image acquisition platform construction and acquisition module for the gear under test: It is used to fix the gear under test on a rotating workbench with an industrial camera equipped with a ring light source and a coaxial light source. The axis of the gear is perpendicular to the optical axis of the industrial camera. The rotating workbench drives the gear to rotate at a constant speed, and the industrial camera collects images of the gear under test at a set frequency;
[0033] Preprocessing module for the gear image under test: It is used to convert the collected image of the gear under test into a grayscale image of the gear under test, perform denoising processing using Gaussian filtering, and enhance the denoised grayscale image through histogram equalization;
[0034] Texture feature extraction module for the gear image under test: It is used to extract wear texture feature parameters of the gear under test, including energy, entropy, and contrast, according to the enhanced grayscale image of the gear under test using a gray-level co-occurrence matrix;
[0035] Gear wear defect recognition model construction training and gear wear defect recognition module: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to the above steps to establish a wear feature library, construct a gear wear defect recognition model based on a support vector machine, train the model using the wear feature library, and after training, input the feature parameters of the gear under test into the model for recognition, output the recognition result and give feedback.
[0036] In addition, to achieve the above object, the present invention also proposes a gear defect recognition device based on visual detection. The device includes: a memory, a processor, and programs such as a gear defect recognition algorithm based on visual detection stored on the memory and executable on the processor. The programs such as the gear defect recognition algorithm based on visual detection are steps to implement a gear defect recognition method based on visual detection as described above.
[0037] In addition, to achieve the above object, the present invention also provides a computer program product. The computer program product includes programs such as a gear defect recognition algorithm based on visual detection. When the programs such as the gear defect recognition algorithm based on visual detection are executed by a processor, they implement a gear defect recognition method based on visual detection as described above.
[0038] The advantages and effects of the present invention are:
[0039] A gear defect recognition method and system based on visual detection proposed by the present invention, aiming at the gear wear defect among gear defects, extracts gear wear features and constructs texture feature parameters for fusion, enabling the model to better learn the mapping relationship between wear features and gear images, better learn the wear features of gears, improving the detection accuracy and efficiency of gear wear defects, and reducing the false alarm rate; at the same time, by using visual detection technology, rapid detection of the gear to be measured can be realized. Combining the cooperation of a rotary worktable and an industrial camera, complete surface information of the gear can be obtained in a short time, meeting the requirements of automated production; in addition, the method of the present invention is applicable to the wear detection of gear tooth surfaces of different types and sizes and can adapt to different working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0041] Figure 1 It is a flowchart of a gear defect recognition method based on visual detection according to the present invention.
[0042] Figure 2 It is a schematic structural diagram of a gear defect recognition system based on visual detection according to the present invention.
[0043] Figure 3 It is a schematic block diagram of the structure of an electronic device for gear defect recognition based on visual detection according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0045] As Figure 1 shown, in an embodiment of the present invention, a gear defect recognition method based on visual detection includes the following steps:
[0046] Step S10: Fix the gear to be measured on the rotary worktable with an industrial camera equipped with a ring light source and a coaxial light source. The axis of the gear is perpendicular to the optical axis of the industrial camera. The rotary worktable drives the gear to rotate at a constant speed, and the industrial camera collects images of the gear to be measured at a set frequency.
[0047] Specifically, in step S10, an industrial camera is paired with a ring light source and a coaxial light source. The ring light source is arranged around the industrial camera lens to provide uniform basic illumination for the surface of the gear to be measured, eliminate shadows, and highlight the overall contour. The coaxial light source is installed on the optical axis of the industrial camera, and the illumination light is in the same direction as the line of sight of the industrial camera, which can effectively highlight the detailed features such as the texture and scratches of the gear. The rotary table drives the gear to rotate at a constant speed. According to the size, rotation speed of the gear to be measured and the frame rate of the industrial camera, the rotation speed of the rotary table is set to ensure that during the rotation of the gear to be measured, the industrial camera has enough time to collect the complete surface information of the gear to be measured and avoid the occurrence of acquisition blind spots. The industrial camera collects images of the gear to be measured at a set frequency. According to the rotation speed of the gear to be measured and the resolution of the industrial camera, the acquisition frequency of the industrial camera is calculated and set so that the camera can collect a series of continuous images at the set frequency during one rotation of the gear. These images can completely present the surface condition of the gear after being stitched together. The rotary table is started to make the gear rotate at a constant speed, and at the same time, the industrial camera is triggered to collect images at the set frequency. The collected images are transmitted to a computer or an image storage device in real time through a data cable for subsequent processing.
[0048] Step S20: Convert the collected images of the gear to be measured into grayscale images of the gear to be measured, perform denoising processing using Gaussian filtering, and perform image enhancement on the denoised grayscale images through histogram equalization.
[0049] Specifically, the steps of converting the collected images of the gear to be measured into grayscale images of the gear to be measured, performing denoising processing using Gaussian filtering, and performing image enhancement on the denoised grayscale images through histogram equalization in step S20 include:
[0050] Image grayscale conversion: Use the OpenCV library in the image processing software to read the collected images of the gear to be measured, load the images of the gear to be measured into the memory through a function to form a multi-dimensional array. According to the characteristics of the gear images, calculate the grayscale value based on the weights of the RGB three channels, as shown in Equation (1):
[0051] Gray = 0.299×R + 0.587×G + 0.114×B (1)
[0052] where Gray is the calculated grayscale value, R is the red of each pixel point in the images of the gear to be measured, G is the green of each pixel point in the images of the gear to be measured, and B is the blue of each pixel point in the images of the gear to be measured. By traversing each pixel point in the image and calculating and replacing the original RGB values according to Equation (1), the grayscale images of the gear to be measured are obtained. The grayscale images obtained in this way can better retain the detailed information of the gear, such as the texture and edges of the gear, providing a good basis for subsequent defect identification.
[0053] Image denoising: Gaussian filtering is used to denoise the grayscale image, and the size of the filter kernel and the value of the standard deviation are determined according to the noise distribution characteristics of the gear image to be measured;
[0054] Image enhancement: Histogram equalization is adopted. By adjusting the grayscale histogram of the denoised gear grayscale image to be measured, image enhancement is performed to make the grayscale distribution of the image more uniform, thereby improving the contrast of the image and highlighting the edge and detail features of the gear.
[0055] Among them, in the image denoising step, after determining the size of the filter kernel and the value of the standard deviation according to the noise distribution characteristics of the gear image to be measured, according to the determined size of the filter kernel and the value of the standard deviation, the Gaussian distribution at each position (x, y) in the filter kernel is calculated using the Gaussian distribution function, where x and y represent the offset of the pixel position in the filter kernel relative to the central pixel. The calculated Gaussian distribution values are normalized so that the sum of all elements in the filter kernel is 1, which ensures that the overall brightness of the image does not change during the filtering process; after normalization, starting from the upper left corner of the gear grayscale image, each pixel point is traversed in turn. For each pixel point as the center, the Gaussian filter kernel is covered on the corresponding image neighborhood, each element in the filter kernel is multiplied by the corresponding image neighborhood pixel value, and then all the products are added together. The result obtained is used as the new value of the central pixel after Gaussian filtering. For the pixel points at the edge of the image, since their neighborhoods are incomplete, filling methods such as copying the edge pixels or mirror filling are usually adopted to ensure the normal progress of the convolution operation; all the pixel values after Gaussian filtering are recombined in the row and column order of the original image to generate the denoised gear grayscale image, effectively reducing the noise interference while retaining the details of the gear image to the greatest extent, providing a good data basis for subsequent feature extraction and defect recognition.
[0056] Step S30: According to the enhanced grayscale image of the gear to be measured, the gray level co-occurrence matrix is used to extract the wear texture feature parameters of the gear to be measured, including energy, entropy, and contrast.
[0057] Specifically, the steps of using the gray level co-occurrence matrix to extract the gear wear texture features in step S30 include:
[0058] Parameter determination: According to the size of the gear wear marks in the historical gear wear data, the spatial interval between two pixels in the co-occurrence matrix is determined. Usually, smaller integers such as 1, 2, and 3 are selected to capture the texture changes of the gear. The relative directions of the two pixels are determined, and 4 directions of 0°, 45°, 90°, and 135° are taken for calculation to obtain the texture information of the gear in different directions;
[0059] Calculating the gray-level co-occurrence matrix: Taking each pixel in the gray-scale image of the gear to be measured as a reference point, find the corresponding pixels at the set distance and angle. Taking the 0° direction as an example, count the pixels at the specified distance to the right of the reference point to form a pair of co-occurring pixels; for each pair of co-occurring pixels, count the number of times the gray-level value combination appears. For example, if the gray-level value of the reference point is 10 and the gray-level value of the corresponding pixel is 15, increment the count at the (10, 15) position in the gray-level co-occurrence matrix. After traversing the entire image, complete the calculation of the gray-level co-occurrence matrix in one direction and distance. For other set angles and distances, repeat the above process to obtain multiple gray-level co-occurrence matrices;
[0060] Extracting texture feature parameters: The extracted texture feature parameters include energy, entropy, and contrast. Energy reflects the uniformity of the texture in the gray-scale image of the gear to be measured, entropy reflects the complexity of the texture, and contrast reflects the clarity and sense of hierarchy of the texture;
[0061] Texture feature fusion: Fuse the energy, entropy, and contrast feature parameters calculated at different distances and angles to comprehensively reflect the gear texture characteristics. Using the weighted average method, each distance and angle is set as a group, obtaining four distance-angle pairs, and the weight of each distance-angle pair is 0.25, and the sum of the weights is 1.
[0062] Step S40: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to the above steps to establish a wear feature library, construct a gear wear defect recognition model based on a support vector machine, use the wear feature library to train the model, and after training is completed, input the feature parameters of the gear to be measured into the model for recognition, and output the recognition result and feedback.
[0063] Specifically, the steps of constructing a gear wear defect recognition model based on a support vector machine in step S40 include:
[0064] Establishing the wear feature library: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to steps S10 to S30 to establish a wear feature library, and divide the data in the wear feature library into a training set and a test set according to 8:2;
[0065] Constructing and training the gear wear defect recognition model: Determine the kernel function type, penalty parameter, and kernel function parameter of the support vector machine, and determine the optimal parameter combination through cross-validation and grid search method to improve the classification accuracy of the gear wear defect recognition model. After each parameter is confirmed, input the divided training set into the gear wear defect recognition model for training, so that the model can accurately distinguish the sample data with different wear degrees in the training set. When the recognition accuracy is greater than or equal to 95%, complete the model training;
[0066] Evaluation and Optimization of Gear Wear Defect Recognition Model: Use the test set to evaluate the trained support vector machine model, calculate the accuracy, recall rate, and F1 value of the model on the test set as the evaluation results, and optimize and adjust the model according to the calculated evaluation results. When the model evaluation results do not meet the expected requirements, reselect parameters, adjust the division ratio of the training set and the test set, or increase the number of samples, and then train and evaluate again until the model performance meets the expected requirements;
[0067] Gear Wear Defect Recognition: Input the wear texture feature parameters of the gear to be tested obtained in step S30 into the optimized gear wear defect recognition model. The model outputs whether there are wear defects in the gear to be tested and at the same time outputs the classification results of the wear degree of the gear with wear defects.
[0068] Specifically, the output of the recognition result and feedback in step S40 includes:
[0069] Gear Recognition Result Output: The output results include whether there are wear defects in the gear, the wear degree, the position of the wear area, and the quantitative evaluation data; the detection results can be displayed through a display screen or saved to a database for subsequent query and analysis;
[0070] Feedback Control: According to the detection results, perform feedback control on the gear production process. When it is detected that there are wear defects in the gear, an alarm signal is sent in time to notify the operator to handle it. At the same time, according to the wear degree and occurrence frequency of the gear, analyze the problems existing in the production process and optimize the production process to improve product quality.
[0071] In addition, as Figure 2 shown, in an embodiment of the present invention, a gear defect recognition system based on visual detection is proposed. The gear defect recognition system based on visual detection includes:
[0072] Construction and Acquisition Module of the Image Acquisition Platform for the Gear to be Tested: Used to fix the gear to be tested on a rotating workbench through an industrial camera with a ring light source and a coaxial light source. The axis of the gear is perpendicular to the optical axis of the industrial camera, and the rotating workbench drives the gear to rotate at a constant speed. The industrial camera collects images of the gear to be tested at a set frequency;
[0073] Preprocessing Module of the Image of the Gear to be Tested: Used to convert the collected image of the gear to be tested into a grayscale image of the gear to be tested, perform denoising processing using Gaussian filtering, and perform image enhancement on the denoised grayscale image through histogram equalization;
[0074] Texture Feature Extraction Module of the Image of the Gear to be Tested: Used to extract the wear texture feature parameters of the gear to be tested, including energy, entropy, and contrast, according to the grayscale image of the gear to be tested after image enhancement;
[0075] Gear wear defect identification model construction and training, and gear wear defect identification module: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to the above steps to establish a wear feature library, construct a gear wear defect identification model based on support vector machines, use the wear feature library to train the model, and after training is completed, input the characteristic parameters of the gear to be measured into the model for identification, output the identification result and give feedback.
[0076] A gear defect identification system based on visual inspection provided by this application adopts a gear defect identification method based on visual inspection in the above-mentioned embodiment, which can solve the technical problems of low efficiency and low accuracy of traditional gear defect identification methods. Compared with the prior art, the beneficial effects of a gear defect identification system based on visual inspection provided by this application are the same as those of a gear defect identification method based on visual inspection provided by the above-mentioned embodiment, and other technical features in the gear defect identification system based on visual inspection are the same as the features disclosed in the method of the above-mentioned embodiment, and will not be elaborated here.
[0077] This application provides a gear defect identification device based on visual inspection. The gear defect identification device based on visual inspection includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a gear defect identification method based on visual inspection in Embodiment 1 above.
[0078] As Figure 3 shown, in an embodiment of the present invention, a schematic structural diagram of a gear defect identification device based on visual inspection suitable for implementing the embodiment of this application is shown. A gear defect identification device based on visual inspection in the embodiment of this application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The shown gear defect identification device is only an example and should not impose any limitations on the functions and usage scope of the embodiments of this application.
[0079] Figure 3A gear defect recognition device based on visual detection as shown may include a processing system 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage system 1003 into a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of a gear defect recognition device based on visual detection are also stored. The processing system 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage system 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication system 1009. The communication system 1009 can allow a gear defect recognition device based on visual detection to communicate with other devices wirelessly or wiredly to exchange data. Although a gear defect recognition device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems can be implemented or had alternatively.
[0080] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication system, or installed from the storage system 1003, or installed from the ROM 1002. When the computer program is executed by the processing system 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.
[0081] A gear defect recognition device based on visual detection provided by the present application adopts a gear defect recognition method based on visual detection in the above-mentioned embodiment, which can solve the technical problems of low efficiency and low accuracy of traditional gear defect recognition methods. Compared with the prior art, the beneficial effects of the gear defect recognition device based on visual detection provided by the present application are the same as those of the gear defect recognition method based on visual detection provided by the above-mentioned embodiment, and other technical features in the gear defect recognition device based on visual detection are the same as those disclosed in the method of the previous embodiment, which will not be elaborated herein.
[0082] Each part disclosed in the present application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0083] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of a gear defect recognition method based on visual detection as described above are implemented.
[0084] The computer program product provided by the present application can solve the technical problems of low efficiency and low accuracy of traditional gear defect recognition methods. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the gear defect recognition method based on visual detection provided by the above-mentioned embodiment, which will not be elaborated herein.
[0085] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these changes and modifications.
Claims
1. A gear defect recognition method based on visual detection, characterized in that, The method includes the following steps: Step S10: Fix the gear to be measured on a rotating workbench with an industrial camera equipped with a ring light source and a coaxial light source. The axis of the gear is perpendicular to the optical axis of the industrial camera. The rotating workbench drives the gear to rotate at a constant speed, and the industrial camera collects images of the gear to be measured at a set frequency; Step S20: Convert the collected images of the gear to be measured into grayscale images of the gear to be measured, perform denoising processing using Gaussian filtering, and enhance the denoised grayscale images through histogram equalization; Step S30: According to the grayscale images of the gear to be measured after image enhancement, use the gray-level co-occurrence matrix to extract the wear texture feature parameters of the gear to be measured, including energy, entropy, and contrast; Step S40: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to the above steps to establish a wear feature library, construct a gear wear defect recognition model based on a support vector machine, train the model using the wear feature library, and after training is completed, input the feature parameters of the gear to be measured into the model for recognition, and output and feedback the recognition result.
2. The gear defect recognition method based on visual detection according to claim 1, wherein, In step S10, with an industrial camera equipped with a ring light source and a coaxial light source, the ring light source is arranged around the lens of the industrial camera to provide uniform illumination for the surface of the gear to be measured. The coaxial light source is installed on the optical axis of the industrial camera, and the illumination light is in the same direction as the line of sight of the industrial camera; the rotating workbench drives the gear to rotate at a constant speed. According to the size, rotation speed of the gear to be measured, and the frame rate of the industrial camera, set the rotation speed of the rotating workbench; the industrial camera collects images of the gear to be measured at a set frequency. According to the rotation speed of the gear to be measured and the resolution of the industrial camera, calculate and set the acquisition frequency of the industrial camera, start the rotating workbench to make the gear rotate at a constant speed, and at the same time trigger the industrial camera to collect images at the set frequency. The collected images are transmitted to a computer or an image storage device in real time through a data cable for subsequent processing.
3. The gear defect recognition method based on visual detection according to claim 1, characterized in that, The steps of converting the collected images of the gear to be measured into grayscale images of the gear to be measured, performing denoising processing using Gaussian filtering, and enhancing the denoised grayscale images through histogram equalization in step S20 include: Image grayscale conversion: Use the OpenCV library in the image processing software to read the collected images of the gear to be measured, load the images of the gear to be measured into the memory through a function to form an array. According to the characteristics of the gear images, calculate the grayscale value based on the weights of the three RGB channels, as shown in Equation (1): Gray = 0.299×R + 0.587×G + 0.114×B (1) where Gray is the calculated grayscale value, R is the red of each pixel point in the images of the gear to be measured, G is the green of each pixel point in the images of the gear to be measured, B is the blue of each pixel point in the images of the gear to be measured. By traversing each pixel point in the image and calculating and replacing the original RGB values according to Equation (1), the grayscale images of the gear to be measured are obtained; Image denoising: Perform denoising processing on the grayscale images using Gaussian filtering, and determine the values of the filter kernel size and standard deviation according to the noise distribution characteristics of the images of the gear to be measured; Image enhancement: Histogram equalization is adopted to perform image enhancement by adjusting the gray histogram of the gray-scale image of the gear to be measured after denoising.
4. A gear defect recognition method based on visual detection according to claim 1, characterized in that, The steps of extracting the gear wear texture features using the gray-level co-occurrence matrix in step S30 include: Parameter determination: Determine the spatial interval between two pixels in the co-occurrence matrix according to the size of the gear wear marks in the historical gear wear data, determine the relative direction of the two pixels, calculate in 4 directions of 0°, 45°, 90° and 135° to obtain the texture information of the gear in different directions; Calculate the gray-level co-occurrence matrix: Take each pixel in the gray-scale image of the gear to be measured as a reference point, find the corresponding pixels at the set distance and angle; for each pair of co-occurring pixels, count the number of occurrences of the gray-value combination. After traversing the entire image, complete the calculation of the gray-level co-occurrence matrix in one direction and distance. Repeat the above process for other set angles and distances to obtain the gray-level co-occurrence matrix; Extract texture feature parameters: The extracted texture feature parameters include energy, entropy and contrast. Energy reflects the uniformity of the texture of the gray-scale image of the gear to be measured, entropy reflects the complexity of the texture, and contrast reflects the clarity and sense of hierarchy of the texture; Texture feature fusion: Fusion of the energy, entropy and contrast feature parameters calculated at different distances and angles. The weighted average method is adopted. Each distance and angle is set as a group, and four distance-angle pairs are obtained. The weight of each distance-angle pair is 0.25, and the sum of the weights is 1.
5. A gear defect recognition method based on visual detection according to claim 1, characterized in that, The steps of constructing a gear wear defect recognition model based on a support vector machine in step S40 include: Establishment of a wear feature library: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing and feature extraction according to steps S10 to S30 to establish a wear feature library, and divide the data in the wear feature library into a training set and a test set according to 8:2; Construction and training of the gear wear defect recognition model: Determine the kernel function type, penalty parameter and kernel function parameter of the support vector machine, determine the optimal parameter combination through cross-validation and grid search method. After confirming each parameter, input the divided training set into the gear wear defect recognition model for training, so that the model can accurately distinguish the sample data with different wear degrees in the training set. When the recognition accuracy rate is greater than or equal to 95%, complete the model training; Evaluation and optimization of the gear wear defect recognition model: Use the test set to evaluate the trained support vector machine model, calculate the accuracy rate, recall rate and F1 value of the model on the test set as the evaluation results, and optimize and adjust the model according to the calculated evaluation results; Gear wear defect recognition: Input the gear wear texture feature parameters obtained in step S30 into the optimized gear wear defect recognition model. The model outputs whether there is a wear defect in the gear to be measured and at the same time outputs the classification result of the wear degree of the gear with a wear defect.
6. The gear defect recognition method based on visual detection according to claim 1, characterized in that, The output of the recognition result and feedback in step S40 includes: Output of gear recognition results: The output results include whether there is a wear defect in the gear, the wear degree, the position of the wear area and the quantitative evaluation data; Feedback control: Based on the detection results, perform feedback control on the gear production process. When gear wear defects are detected, send an alarm signal to notify the operator to handle it. At the same time, analyze the problems existing in the production process and optimize the production process according to the gear wear degree and occurrence frequency.
7. A gear defect recognition system based on visual detection, characterized in that, The described gear defect recognition system based on visual detection includes: Building and acquisition module for the image acquisition platform of the gear to be measured: Used to fix the gear to be measured on the rotating workbench through an industrial camera equipped with a ring light source and a coaxial light source. The axis of the gear is perpendicular to the optical axis of the industrial camera. The rotating workbench drives the gear to rotate at a constant speed, and the industrial camera acquires images of the gear to be measured at a set frequency. Preprocessing module for the image of the gear to be measured: Used to convert the acquired image of the gear to be measured into a grayscale image of the gear to be measured, perform denoising processing using Gaussian filtering, and enhance the denoised grayscale image through histogram equalization. Texture feature extraction module for the image of the gear to be measured: Used to extract the wear texture feature parameters of the gear to be measured, including energy, entropy, and contrast, according to the enhanced grayscale image of the gear to be measured using the gray-level co-occurrence matrix. Construction training of the gear wear defect recognition model and gear wear defect recognition module: Collect gear samples with different degrees of gear wear, perform image acquisition, image preprocessing, and feature extraction according to the above steps to establish a wear feature library, construct a gear wear defect recognition model based on support vector machines, use the wear feature library to train the model, and after training, input the feature parameters of the gear to be measured into the model for recognition, output the recognition result and give feedback.
8. A gear defect recognition device based on visual detection, characterized in that, The described gear defect recognition device based on visual detection includes: A memory, a processor, and a gear defect recognition program based on visual detection stored on the memory and executable on the processor. When the gear defect recognition program based on visual detection is executed by the processor, it implements the gear defect recognition method based on visual detection according to any one of claims 1 to 6.
9. A computer program product, characterized in that, The described computer program product includes a gear defect recognition program based on visual detection. When the gear defect recognition program based on visual detection is executed by the processor, it implements the gear defect recognition method based on visual detection according to any one of claims 1 to 6.