A gear defect detection method and system based on artificial intelligence
By degrading, restoring, enhancing and brightness adjustment of gear images, extracting feature information, and inputting preset defect detection models for detection, the problem of low gear defect detection accuracy in the prior art is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202411942873.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In the prior art, gear defect detection methods have inaccurate defect recognition and low recognition accuracy due to problems such as noise, complex texture and dull image.
Using an artificial intelligence-based method, the target gear image is acquired for degradation and restoration processing, the gear three-dimensional point cloud data is obtained for image enhancement, image brightness adjustment is performed, and the image is extracted. Finally, the feature map is input to the preset defect detection model for defect detection.
Effectively eliminate noise in the image, enhance image characteristics, improve the accuracy of defect detection, and avoid the problems of low brightness and excessive local contrast.
Smart Images

Figure CN119359733B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of defect detection, and specifically relates to a gear defect detection method and system based on artificial intelligence. Background Art
[0002] Gears are very important parts for vehicles, especially in the differential of automobiles. Since gears have certain installation requirements and need to be inspected for defects before installation, the prior art generally uses machine vision inspection methods to detect gear defects. However, since gears are generally metal parts, under the influence of external environmental factors, it is easy to cause a series of problems in the captured gear images, such as large noise, complex texture, and dim images, which in turn leads to inaccurate gear defect identification and low identification accuracy during the gear defect identification process. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a gear defect detection method and system based on artificial intelligence, which are used to solve the technical problems in the prior art.
[0004] On the one hand, the present invention provides the following technical solution, a gear defect detection method based on artificial intelligence, comprising:
[0005] Acquire a target gear image, and perform degradation restoration processing on the target gear image to obtain a restored gear image;
[0006] Acquire gear three-dimensional point cloud data, and perform image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image;
[0007] Performing image brightness adjustment on the enhanced gear image to obtain an adjusted gear image;
[0008] Performing feature extraction on the adjustment gear image to obtain a gear feature map;
[0009] Gear training data is obtained, the gear training data is input into a preset defect detection model for training, the gear feature map is input into the trained preset defect detection model for defect detection, and a detection result is output.
[0010] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention first obtains a target gear image, performs degradation restoration processing on the target gear image to obtain a restored gear image; then obtains gear three-dimensional point cloud data, and performs image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image; then adjusts the image brightness of the enhanced gear image to obtain an adjusted gear image; then extracts features from the adjusted gear image to obtain a gear feature map; finally, obtains gear training data, inputs the gear training data into a preset defect detection model for training, and inputs the gear feature map into the trained preset defect detection model for defect detection to output a detection result. The present invention first performs degradation restoration processing on the image, which can effectively remove noise in the image and eliminate blur artifacts in the image, and then enhances and adjusts the brightness of the image, thereby enhancing the features of the image and retaining the detailed features of the image, while also avoiding low brightness, excessive local contrast, and unclear images. Then, feature extraction is performed on the image to extract all feature information containing defects in the image as much as possible, thereby improving the accuracy of subsequent model detection.
[0011] Preferably, the step of performing degradation restoration processing on the target gear image to obtain a restored gear image comprises:
[0012] Defining the degradation model , based on the degradation model The target gear image Perform degradation processing to obtain a degraded gear image ;
[0013] ;
[0014] In the formula, is the functional representation of the degradation model, is additive noise, represents spatial convolution;
[0015] Perform initial restoration on the degraded gear image to obtain an initial restored image :
[0016] ;
[0017] In the formula, is the matrix representation of the degradation model, represents the conjugate matrix, , They represent inverse Fourier transform and Fourier transform respectively. represents the Laplace operator, Represents the filter coefficient;
[0018] The initial restored image Perform image grayscale enhancement to obtain the restored gear image :
[0019] ;
[0020] In the formula, represents the grayscale of the initial restored image, Restored gear image Grayscale, represents the probability density of the grayscale of the initial restored image, Represents the differential operation.
[0021] Preferably, the step of performing image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image comprises:
[0022] Determine the projection mapping equation of the restored gear image:
[0023] ;
[0024] In the formula, represents the radius of the target gear standard part, Indicates the pixel accuracy in the y direction, Represents the length of the image after projection mapping in the x direction, represents the gear radius in the restored gear image, Indicates the pixel width of the restored gear image, , Respectively Projection distance in the x direction, projection length difference, , They represent the arc length corresponding to the blind spot angle and the arc length corresponding to the field of view angle in the restored gear image respectively;
[0025] Based on the projection mapping equation, the restored gear image super-target area is subjected to column pixel mapping to obtain an initial gear mapping image;
[0026] Acquire an anchor point of the initial gear mapping image, determine a reference line in the x direction with the anchor point, and project the vertices on both sides of the gear in the initial gear mapping image onto the reference line to obtain a gear mapping image;
[0027] Determine a gear point cloud image based on the gear three-dimensional point cloud data;
[0028] The gear mapping images at different angles and the gear point cloud images at different angles are stitched together to obtain a first stitched image and a second stitched image;
[0029] An enhanced gear image is determined based on the first stitched image and the second stitched image.
[0030] Preferably, the step of determining the gear point cloud image based on the gear three-dimensional point cloud data comprises:
[0031] Determine the outer minimum bounding box of the gear three-dimensional point cloud data and determine the center coordinates and three-dimensional size of the outer minimum bounding box;
[0032] A point cloud is randomly selected within the external minimum bounding box as a reference point cloud, and a standard circular cross section is determined by using the reference point cloud;
[0033] Determine the center position of the standard circular cross section based on the center coordinates and the three-dimensional size of the external minimum bounding box, and determine the intersection of the center position, the line connecting the reference point cloud and the standard circular cross section to obtain the point cloud to be projected;
[0034] Based on the projection mapping equation, the point cloud to be projected is projected onto the tangent plane of the standard circle to obtain a projected point cloud, the Euclidean distance between the reference point cloud and the point cloud to be projected is calculated, and the z-axis coordinate value of the projected point cloud is adjusted based on the Euclidean distance to obtain a final projection point;
[0035] The final projection points corresponding to all point clouds within the external minimum bounding box are determined to obtain a gear point cloud image.
[0036] Preferably, the step of determining an enhanced gear image based on the first stitched image and the second stitched image comprises:
[0037] Registering the first stitched image and the second stitched image respectively to obtain a first registered image and a second registered image;
[0038] Perform point cloud dimensionality reduction on the second registered image to obtain a reduced dimensionality image :
[0039] ;
[0040] In the formula, represents the z-axis coordinate of each point cloud in the second registered image, , Respectively represent the maximum and minimum z-axis coordinates of each point cloud in the second registered image;
[0041] Based on the reduced dimension image With the first registered image Determine the enhanced gear image :
[0042] ;
[0043] In the formula, represents the enhanced weight, represents median filtering, Indicates the filter kernel size.
[0044] Preferably, the step of adjusting the image brightness of the enhanced gear image to obtain the adjusted gear image comprises:
[0045] Calculate adjustment factors based on the enhanced gear image :
[0046] ;
[0047] In the formula, represents the mean brightness of the enhanced gear image, Indicates enhancing the brightness of the gear image;
[0048] Based on the adjustment factor The enhanced gear image is brightness adjusted to obtain a brightness component :
[0049] ;
[0050] Determine a guide image, determine a plurality of filter windows based on pixel points in the guide image, and determine a first filter coefficient based on the plurality of filter windows With the second filter coefficient :
[0051] ;
[0052] ;
[0053] In the formula, Indicated in pixels The filter window centered at Indicated in pixels The guidance image corresponding to the filter window centered at Represents pixel The gray value of , Indicated in pixels The guidance image corresponding to the filter window centered at The standard deviation and mean of the grayscale values in Represents pixel exist The average grayscale value within express The number of pixels in
[0054] Based on the first filter coefficient With the second filter coefficient Determine the adjustment amount :
[0055] ;
[0056] In the formula, represents an enhanced gear image;
[0057] Based on the adjustment component With the brightness component OK Adjust the gear image :
[0058] .
[0059] Preferably, the step of extracting features from the adjusted gear image to obtain a gear feature map comprises:
[0060] Calculate the encoding value of the adjustment gear image :
[0061] ;
[0062] ;
[0063] In the formula, Indicates adjusting the center pixel in the gear image. express No. Neighborhood pixels, represents the first step function, Indicates the number of code jumps, , represent the first threshold and the second threshold respectively;
[0064] Calculate the global gradient of the adjusted gear image With the gradient direction :
[0065] ;
[0066] ;
[0067] In the formula, , , , Respectively indicate the adjustment of the gear image in , , , The gray value at ;
[0068] Based on the coded value , the global gradient With the gradient direction Calculate the first feature map With the second feature map :
[0069] ;
[0070] ;
[0071] ;
[0072] In the formula, , Respectively represent adjusting the length and width of the gear image. represents the second step function, Indicates that the pixel center is The corresponding encoding value is Indicates the preset horizontal axis size in the feature map;
[0073] The first characteristic diagram and the second characteristic diagram are connected in series to obtain a gear characteristic diagram.
[0074] In a second aspect, the present invention provides the following technical solution: a gear defect detection system based on artificial intelligence, the system comprising:
[0075] A restoration module, used for acquiring a target gear image, and performing a degradation restoration process on the target gear image to obtain a restored gear image;
[0076] An enhancement module, used for acquiring gear three-dimensional point cloud data, and performing image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image;
[0077] An adjustment module, used for adjusting the image brightness of the enhanced gear image to obtain an adjusted gear image;
[0078] An extraction module, used for performing feature extraction on the adjustment gear image to obtain a gear feature map;
[0079] The detection module is used to obtain gear training data, input the gear training data into a preset defect detection model for training, input the gear feature map into the trained preset defect detection model for defect detection, and output a detection result.
[0080] In a third aspect, the present invention provides the following technical solution: a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned artificial intelligence-based gear defect detection method when executing the computer program.
[0081] In a fourth aspect, the present invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-mentioned artificial intelligence-based gear defect detection method. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0083] Figure 1 A flowchart of a gear defect detection method based on artificial intelligence provided in Embodiment 1 of the present invention;
[0084] Figure 2 A structural block diagram of a gear defect detection system based on artificial intelligence provided in Embodiment 2 of the present invention;
[0085] Figure 3 A schematic diagram of the hardware structure of a computer provided in another embodiment of the present invention.
[0086] The embodiments of the present invention will be further described below with reference to the accompanying drawings. DETAILED DESCRIPTION
[0087] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0088] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0089] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0090] In the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0091] Embodiment 1
[0092] In the first embodiment of the present invention, Figure 1 As shown, a gear defect detection method based on artificial intelligence includes:
[0093] S1, acquiring a target gear image, and performing degradation restoration processing on the target gear image to obtain a restored gear image;
[0094] Specifically, several cameras arranged around the target gear can be used to capture images of the target gear at multiple angles, and the back of the target gear also needs to be captured to obtain an image of the target gear. The target gear image is then subjected to degradation restoration processing to remove noise in the image and also eliminate blur artifacts in the image.
[0095] Wherein, the step S1 comprises:
[0096] S11. Define the degradation model , based on the degradation model The target gear image Perform degradation processing to obtain a degraded gear image ;
[0097] ;
[0098] In the formula, is the functional representation of the degradation model, is additive noise, represents spatial convolution;
[0099] The above degradation model is a commonly used degradation model in the prior art, and thus will not be described in detail here.
[0100] S12, performing initial restoration on the degraded gear image to obtain an initial restored image :
[0101] ;
[0102] In the formula, is the matrix representation of the degradation model, represents the conjugate matrix, , They represent inverse Fourier transform and Fourier transform respectively. represents the Laplace operator, Represents the filter coefficient;
[0103] Specifically, Specifically The above process can be briefly described as using least squares filtering and Laplace transform to restore the image, so as to remove the noise in the image.
[0104] S13, the initial restored image Perform image grayscale enhancement to obtain the restored gear image :
[0105] ;
[0106] In the formula, represents the grayscale of the initial restored image, Restored gear image Grayscale, represents the probability density of the grayscale of the initial restored image, represents differential operation;
[0107] Specifically, by performing grayscale enhancement on the image, the blurred image can be restored, that is, the blur artifacts existing in the image can be removed.
[0108] S2, acquiring gear three-dimensional point cloud data, and performing image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image;
[0109] Wherein, the step S2 comprises:
[0110] S21, determining the projection mapping equation of the restored gear image:
[0111] ;
[0112] In the formula, represents the radius of the target gear standard part, Indicates the pixel accuracy in the y direction, Represents the length of the image after projection mapping in the x direction, represents the gear radius in the restored gear image, Indicates the pixel width of the restored gear image, , Respectively Projection distance in the x direction, projection length difference, , They represent the arc length corresponding to the blind spot angle and the arc length corresponding to the field of view angle in the restored gear image respectively;
[0113] Specifically, in the captured image, since the gear has a certain curved surface, the captured image has a certain blind spot, and the purpose of this step is to map the image in the blind spot to the cutting plane, wherein the gear radius in the restored gear image represents the radius of the target gear standard part after the image is captured, and the blind spot of the field of view is specifically a range area, and the boundary of the range area intersects with the side arc length of the target gear in the image, and the angle between the line between the intersection and the origin and the X-axis is the blind spot angle.
[0114] S22, performing column pixel mapping on the super-target area of the restored gear image based on the projection mapping equation to obtain an initial gear mapping image;
[0115] Specifically, the side surface of the captured target gear image can be mapped onto a cutting plane for expansion through a projection mapping equation, so as to retain the original shape of the side surface of the target gear to the greatest extent.
[0116] S23, obtaining an anchor point of the initial gear mapping image, and determining a reference line in the x direction with the anchor point, and projecting the vertices on both sides of the gear in the initial gear mapping image onto the reference line to obtain a gear mapping image;
[0117] Specifically, after unfolding, the initial gear mapping image will have a certain distortion, that is, the target gear in the image does not cover the entire image area, but the upper area of the target gear is bent downward, and the lower area is bent upward. Therefore, by determining the baseline, which includes the upper baseline and the lower baseline, and projecting the upper vertices onto the upper baseline and the lower vertices onto the lower baseline, a gear mapping image that meets the size of the target area can be obtained. At the same time, in the actual mapping process, the upper surface and the lower surface of the gear can also be flipped and unfolded accordingly, so that the entire shape of the target gear is in the gear mapping image.
[0118] S24, determining a gear point cloud image based on the gear three-dimensional point cloud data;
[0119] Wherein, the step S24 comprises:
[0120] S241, determining the outer minimum bounding box of the gear three-dimensional point cloud data and determining the center coordinates and three-dimensional size of the outer minimum bounding box;
[0121] The three-dimensional gear here includes the length, width and height of the minimum bounding box.
[0122] S242, randomly selecting a point cloud in the external minimum bounding box as a reference point cloud, and determining a standard circular cross section using the reference point cloud.
[0123] S243, determining the center position of the standard circular cross section based on the center coordinates and three-dimensional dimensions of the external minimum bounding box, and determining the intersection of the center position, the line connecting the reference point cloud and the standard circular cross section to obtain the point cloud to be projected.
[0124] S244, projecting the point cloud to be projected onto the tangent plane of the standard circle based on the projection mapping equation to obtain a projected point cloud, calculating the Euclidean distance between the reference point cloud and the point cloud to be projected, and adjusting the z-axis coordinate value of the projected point cloud based on the Euclidean distance to obtain a final projection point;
[0125] Specifically, the final projection point can be obtained by adding the Euclidean distance to the z-axis coordinate value of the projection point cloud.
[0126] S244, determining the final projection points corresponding to all point clouds within the external minimum bounding box to obtain a gear point cloud image.
[0127] S25, respectively stitching the gear mapping images at different angles and the gear point cloud images at different angles to obtain a first stitched image and a second stitched image;
[0128] Specifically, the images are spliced to ensure that the full picture of the target gear can be reflected in the image.
[0129] S26, determining an enhanced gear image based on the first stitched image and the second stitched image;
[0130] Wherein, the step S26 comprises:
[0131] S261, registering the first stitched image and the second stitched image respectively to obtain a first registered image and a second registered image;
[0132] Specifically, by calculating the attitude angle of the camera, calculating the field of view angle offset value according to the attitude angle, and cropping and splicing the image according to the field of view angle offset value, the first registered image and the second registered image can be obtained.
[0133] S262: Perform point cloud dimensionality reduction on the second registered image to obtain a dimensionality-reduced image. :
[0134] ;
[0135] In the formula, represents the z-axis coordinate of each point cloud in the second registered image, , Respectively represent the maximum and minimum z-axis coordinates of each point cloud in the second registered image;
[0136] Specifically, the dimensionality reduction image here Specifically, a depth map can represent the depth information of the defect.
[0137] S263, based on the dimension reduction image With the first registered image Determine the enhanced gear image :
[0138] ;
[0139] In the formula, represents the enhanced weight, represents median filtering, Indicates the filter kernel size;
[0140] Among them, the enhancement weight is 0.4.
[0141] S3, adjusting the image brightness of the enhanced gear image to obtain an adjusted gear image;
[0142] Wherein, the step S3 comprises:
[0143] S31, calculating an adjustment factor based on the enhanced gear image :
[0144] ;
[0145] In the formula, represents the mean brightness of the enhanced gear image, Indicates enhancing the brightness of the gear image.
[0146] S32, based on the adjustment factor The enhanced gear image is brightness adjusted to obtain a brightness component :
[0147] .
[0148] S33, determining a guide image, determining a plurality of filter windows based on pixel points in the guide image, and determining a first filter coefficient based on the plurality of filter windows With the second filter coefficient :
[0149] ;
[0150] ;
[0151] In the formula, Indicated in pixels The filter window centered at Indicated in pixels The guidance image corresponding to the filter window centered at Represents pixel The gray value of , Indicated in pixels The guidance image corresponding to the filter window centered at The standard deviation and mean of the grayscale values in Represents pixel exist The average grayscale value within express The number of pixels within.
[0152] S34, based on the first filter coefficient With the second filter coefficient Determine the adjustment amount :
[0153] ;
[0154] In the formula, Represents an enhanced gear image.
[0155] S35, based on the adjustment component With the brightness component OK Adjust the gear image :
[0156] .
[0157] S4, extracting features from the adjustment gear image to obtain a gear feature map;
[0158] Wherein, the step S4 comprises:
[0159] S41, calculating the coding value of the adjustment gear image :
[0160] ;
[0161] ;
[0162] In the formula, Indicates adjusting the center pixel in the gear image. express No. Neighborhood pixels, represents the first step function, Indicates the number of code jumps, , represent the first threshold and the second threshold respectively;
[0163] in, Specifically represents the number of jumps between 0 and 1 in the encoding. The above encoding process can be, within a preset range, each neighborhood pixel is compared with the central pixel within the neighborhood range. If the central pixel is larger, it is 0, if the neighborhood pixel is larger, it is 1, and in this embodiment is 2, is 0.
[0164] S42, calculating the global gradient of the adjusted gear image With the gradient direction :
[0165] ;
[0166] ;
[0167] In the formula, , , , Respectively indicate the adjustment of the gear image in , , , The gray value at .
[0168] S43, based on the coding value , the global gradient With the gradient direction Calculate the first feature map With the second feature map :
[0169] ;
[0170] ;
[0171] ;
[0172] In the formula, , Respectively represent adjusting the length and width of the gear image. represents the second step function, Indicates that the pixel center is The corresponding encoding value is Indicates the preset horizontal axis size in the feature map.
[0173] S44, connecting the first characteristic diagram and the second characteristic diagram in series to obtain a gear characteristic diagram;
[0174] Specifically, the first characteristic diagram and the second characteristic diagram are specifically histograms, and then the two are connected in series to obtain the gear characteristic diagram.
[0175] S5, obtaining gear training data, inputting the gear training data into a preset defect detection model for training, inputting the gear feature map into the trained preset defect detection model for defect detection, and outputting a detection result;
[0176] Among them, the preset defect detection model is specifically an SVM model. By inputting the manually labeled gear training data with different defect types into the preset defect detection model for training, and then inputting the gear feature map into the preset defect detection model for defect detection, the corresponding detection results can be output.
[0177] The artificial intelligence-based gear defect detection method provided in the first embodiment of the present invention first obtains a target gear image, performs degradation restoration processing on the target gear image to obtain a restored gear image; then obtains gear three-dimensional point cloud data, and performs image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image; then adjusts the image brightness of the enhanced gear image to obtain an adjusted gear image; then extracts features from the adjusted gear image to obtain a gear feature map; finally obtains gear training data, inputs the gear training data into a preset defect detection model for training, and inputs the gear feature map into the trained preset defect detection model for defect detection to output a detection result. The present invention first performs degradation restoration processing on the image, which can effectively remove noise in the image and eliminate blur artifacts in the image, and then enhances and adjusts the brightness of the image, thereby enhancing the features of the image and retaining the detailed features of the image, while also avoiding the situation where the brightness is not high, the local contrast is too large, and the image is not clear. Then, feature extraction is performed on the image to extract all feature information containing defects in the image as much as possible, thereby improving the accuracy of subsequent model detection.
[0178] Embodiment 2
[0179] like Figure 2 As shown, in the second embodiment of the present invention, a gear defect detection system based on artificial intelligence is provided, and the system comprises:
[0180] Restoration module 1, used for acquiring a target gear image, and performing degradation restoration processing on the target gear image to obtain a restored gear image;
[0181] Enhancement module 2, used for acquiring gear three-dimensional point cloud data, and performing image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image;
[0182] An adjustment module 3 is used to adjust the image brightness of the enhanced gear image to obtain an adjusted gear image;
[0183] An extraction module 4 is used to extract features from the adjustment gear image to obtain a gear feature map;
[0184] Detection module 5, used for acquiring gear training data, inputting the gear training data into a preset defect detection model for training, inputting the gear feature map into the trained preset defect detection model for defect detection, and outputting a detection result;
[0185] The recovery module 1 comprises:
[0186] Degradation submodule, used to define the degradation model , based on the degradation model The target gear image Perform degradation processing to obtain a degraded gear image ;
[0187] ;
[0188] In the formula, is the functional representation of the degradation model, is additive noise, represents spatial convolution;
[0189] A restoration atom module is used to perform initial restoration on the degraded gear image to obtain an initial restoration image :
[0190] ;
[0191] In the formula, is the matrix representation of the degradation model, represents the conjugate matrix, , They represent inverse Fourier transform and Fourier transform respectively. represents the Laplace operator, Represents the filter coefficient;
[0192] A grayscale enhancement submodule is used to enhance the initial restored image Perform image grayscale enhancement to obtain the restored gear image :
[0193] ;
[0194] In the formula, represents the grayscale of the initial restored image, Restored gear image Grayscale, represents the probability density of the grayscale of the initial restored image, Represents the differential operation.
[0195] The enhancement module 2 comprises:
[0196] The equation submodule is used to determine the projection mapping equation of the restored gear image:
[0197] ;
[0198] In the formula, represents the radius of the target gear standard part, Indicates the pixel accuracy in the y direction, Represents the length of the image after projection mapping in the x direction, represents the gear radius in the restored gear image, Indicates the pixel width of the restored gear image, , Respectively Projection distance in the x direction, projection length difference, , They represent the arc length corresponding to the blind spot angle and the arc length corresponding to the field of view angle in the restored gear image respectively;
[0199] A mapping submodule, for performing column pixel mapping on the super-target area of the restored gear image based on the projection mapping equation to obtain an initial gear mapping image;
[0200] A reference submodule, used to obtain an anchor point of the initial gear mapping image, and determine a reference line in the x direction with the anchor point, and project the vertices on both sides of the gear in the initial gear mapping image onto the reference line to obtain a gear mapping image;
[0201] A point cloud submodule, used for determining a gear point cloud image based on the gear three-dimensional point cloud data;
[0202] A stitching submodule, used to stitch the gear mapping images at different angles and the gear point cloud images at different angles respectively to obtain a first stitching image and a second stitching image;
[0203] The enhancement submodule is used to determine an enhanced gear image based on the first stitched image and the second stitched image.
[0204] The point cloud submodule includes:
[0205] A bounding box unit, used to determine an outer minimum bounding box of the gear three-dimensional point cloud data and determine the center coordinates and three-dimensional size of the outer minimum bounding box;
[0206] A reference unit is used to select a point cloud in the external minimum bounding box as a reference point cloud, and determine a standard circular cross section with the reference point cloud;
[0207] A unit to be projected, used to determine the center position of the standard circular cross section based on the center coordinates and three-dimensional dimensions of the external minimum bounding box, and determine the intersection of the line connecting the center position and the reference point cloud with the standard circular cross section to obtain a point cloud to be projected;
[0208] A projection unit, configured to project the point cloud to be projected onto a tangent plane of the standard circle based on the projection mapping equation to obtain a projection point cloud, calculate a Euclidean distance between the reference point cloud and the point cloud to be projected, and adjust a z-axis coordinate value of the projection point cloud based on the Euclidean distance to obtain a final projection point;
[0209] The output unit is used to determine the final projection points corresponding to all point clouds within the external minimum bounding box to obtain a gear point cloud image.
[0210] The enhancer module comprises:
[0211] A registration unit, configured to register the first stitched image and the second stitched image respectively to obtain a first registered image and a second registered image;
[0212] A dimensionality reduction unit, used to perform point cloud dimensionality reduction on the second registered image to obtain a dimensionality reduction image :
[0213] ;
[0214] In the formula, represents the z-axis coordinate of each point cloud in the second registered image, , Respectively represent the maximum and minimum z-axis coordinates of each point cloud in the second registered image;
[0215] An enhancement unit is used for With the first registered image Determine the enhanced gear image :
[0216] ;
[0217] In the formula, represents the enhanced weight, represents median filtering, Indicates the filter kernel size.
[0218] The adjustment module 3 comprises:
[0219] A first adjustment submodule is used to calculate an adjustment factor based on the enhanced gear image. :
[0220] ;
[0221] In the formula, represents the mean brightness of the enhanced gear image, Indicates enhancing the brightness of the gear image;
[0222] The second adjustment submodule is used to adjust the The enhanced gear image is brightness adjusted to obtain a brightness component :
[0223] ;
[0224] A coefficient submodule is used to determine a guide image, determine a plurality of filter windows based on the pixel points in the guide image, and determine a first filter coefficient based on the plurality of filter windows. With the second filter coefficient :
[0225] ;
[0226] ;
[0227] In the formula, Indicated in pixels The filter window centered at Indicated in pixels The guidance image corresponding to the filter window centered at Represents pixel The gray value of , Indicated in pixels The guidance image corresponding to the filter window centered at The standard deviation and mean of the grayscale values in Represents pixel exist The average grayscale value within express The number of pixels in
[0228] The third adjustment submodule is used to adjust the filter coefficient based on the first filter coefficient. With the second filter coefficient Determine the adjustment amount :
[0229] ;
[0230] In the formula, represents an enhanced gear image;
[0231] A fourth adjustment submodule is configured to adjust the With the brightness component OK Adjust the gear image :
[0232] .
[0233] The extraction module 4 comprises:
[0234] The encoding submodule is used to calculate the encoding value of the adjustment gear image. :
[0235] ;
[0236] ;
[0237] In the formula, Indicates adjusting the center pixel in the gear image. express No. Neighborhood pixels, represents the first step function, Indicates the number of code jumps, , represent the first threshold and the second threshold respectively;
[0238] Gradient submodule, used to calculate the global gradient of the adjusted gear image With the gradient direction :
[0239] ;
[0240] ;
[0241] In the formula, , , , Respectively indicate the adjustment of the gear image in , , , The gray value at ;
[0242] Feature submodule for encoding values based on the , the global gradient With the gradient direction Calculate the first feature map With the second feature map :
[0243] ;
[0244] ;
[0245] ;
[0246] In the formula, , Respectively represent adjusting the length and width of the gear image. represents the second step function, Indicates that the pixel center is The corresponding encoding value is Indicates the preset horizontal axis size in the feature map;
[0247] The series connection submodule is used to connect the first characteristic diagram and the second characteristic diagram in series to obtain a gear characteristic diagram.
[0248] In some other embodiments of the present invention, the embodiments of the present invention provide the following technical solutions: a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 implements the above-mentioned artificial intelligence-based gear defect detection method when executing the computer program.
[0249] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0250] Among them, the memory 102 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 102 may be inside or outside the data processing device. In a specific embodiment, the memory 102 is a non-volatile memory. In a specific embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0251] The memory 102 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101 .
[0252] The processor 101 implements the above-mentioned gear defect detection method based on artificial intelligence by reading and executing computer program instructions stored in the memory 102.
[0253] In some embodiments, the computer may further include a communication interface 103 and a bus 100. Figure 3 As shown, the processor 101, the memory 102, and the communication interface 103 are connected via a bus 100 and communicate with each other.
[0254] The communication interface 103 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present invention. The communication interface 103 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0255] The bus 100 includes hardware, software or both, and couples the components of the computer device to each other. The bus 100 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate a particular bus, the present invention contemplates any suitable bus or interconnect.
[0256] The computer can execute the artificial intelligence-based gear defect detection method of the present invention based on the acquisition of the artificial intelligence-based gear defect detection system, thereby realizing artificial intelligence-based gear defect detection.
[0257] In some further embodiments of the present invention, in combination with the above-mentioned artificial intelligence-based gear defect detection method, the embodiments of the present invention provide the following technical solutions: a storage medium having a computer program stored thereon, and the computer program implements the above-mentioned artificial intelligence-based gear defect detection method when executed by a processor.
[0258] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0259] More specific examples of readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0260] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0261] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0262] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A gear defect detection method based on artificial intelligence, characterized in that: include: Acquire a target gear image, and perform degradation restoration processing on the target gear image to obtain a restored gear image; Acquire gear three-dimensional point cloud data, and perform image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image; Performing image brightness adjustment on the enhanced gear image to obtain an adjusted gear image; Performing feature extraction on the adjustment gear image to obtain a gear feature map; Acquire gear training data, input the gear training data into a preset defect detection model for training, input the gear feature map into the trained preset defect detection model for defect detection, and output a detection result; The step of performing image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image comprises: Determine the projection mapping equation of the restored gear image: ; In the formula, represents the radius of the target gear standard part, Indicates the pixel accuracy in the y direction, Represents the length of the image after projection mapping in the x direction, represents the gear radius in the restored gear image, Indicates the pixel width of the restored gear image, , Respectively Projection distance in the x direction, projection length difference, , They represent the arc length corresponding to the blind spot angle and the arc length corresponding to the field of view angle in the restored gear image respectively; Based on the projection mapping equation, the restored gear image super-target area is subjected to column pixel mapping to obtain an initial gear mapping image; Acquire an anchor point of the initial gear mapping image, determine a reference line in the x direction with the anchor point, and project two side vertices of the gear in the initial gear mapping image onto the reference line to obtain a gear mapping image; Determine a gear point cloud image based on the gear three-dimensional point cloud data; The gear mapping images at different angles and the gear point cloud images at different angles are stitched together to obtain a first stitched image and a second stitched image; An enhanced gear image is determined based on the first stitched image and the second stitched image.
2. The gear defect detection method based on artificial intelligence according to claim 1 is characterized in that: The step of performing degradation restoration processing on the target gear image to obtain a restored gear image comprises: Defining the degradation model , based on the degradation model The target gear image Perform degradation processing to obtain a degraded gear image ; ; In the formula, is the functional representation of the degradation model, is additive noise, represents spatial convolution; Perform initial restoration on the degraded gear image to obtain an initial restored image : ; In the formula, is the matrix representation of the degradation model, represents the conjugate matrix, , They represent inverse Fourier transform and Fourier transform respectively. represents the Laplace operator, Represents the filter coefficient; The initial restored image Perform image grayscale enhancement to obtain the restored gear image : ; In the formula, represents the grayscale of the initial restored image, Restored gear image Grayscale, represents the probability density of the grayscale of the initial restored image, Represents the differential operation.
3. The gear defect detection method based on artificial intelligence according to claim 1 is characterized in that: The step of determining the gear point cloud image based on the gear three-dimensional point cloud data comprises: Determine the outer minimum bounding box of the gear three-dimensional point cloud data and determine the center coordinates and three-dimensional size of the outer minimum bounding box; A point cloud is randomly selected within the external minimum bounding box as a reference point cloud, and a standard circular cross section is determined by using the reference point cloud; Determine the center position of the standard circular cross section based on the center coordinates and the three-dimensional size of the external minimum bounding box, and determine the intersection of the center position, the line connecting the reference point cloud and the standard circular cross section to obtain the point cloud to be projected; Based on the projection mapping equation, the point cloud to be projected is projected onto the tangent plane of the standard circle to obtain a projected point cloud, the Euclidean distance between the reference point cloud and the point cloud to be projected is calculated, and the z-axis coordinate value of the projected point cloud is adjusted based on the Euclidean distance to obtain a final projection point; The final projection points corresponding to all point clouds within the external minimum bounding box are determined to obtain a gear point cloud image.
4. The gear defect detection method based on artificial intelligence according to claim 1 is characterized in that: The step of determining an enhanced gear image based on the first stitched image and the second stitched image comprises: Registering the first stitched image and the second stitched image respectively to obtain a first registered image and a second registered image; Perform point cloud dimensionality reduction on the second registered image to obtain a reduced dimensionality image : ; In the formula, represents the z-axis coordinate of each point cloud in the second registered image, , Respectively represent the maximum and minimum z-axis coordinates of each point cloud in the second registered image; Based on the reduced dimension image With the first registered image Determine the enhanced gear image : ; In the formula, represents the enhanced weight, represents median filtering, Indicates the filter kernel size.
5. The gear defect detection method based on artificial intelligence according to claim 1 is characterized in that: The step of adjusting the image brightness of the enhanced gear image to obtain an adjusted gear image comprises: Calculate adjustment factors based on the enhanced gear image : ; In the formula, represents the mean brightness of the enhanced gear image, Indicates enhancing the brightness of the gear image; Based on the adjustment factor The enhanced gear image is brightness adjusted to obtain a brightness component : ; Determine a guide image, determine a plurality of filter windows based on pixel points in the guide image, and determine a first filter coefficient based on the plurality of filter windows With the second filter coefficient : ; ; In the formula, Indicated in pixels The filter window centered at Indicated in pixels The guidance image corresponding to the filter window centered at Represents pixel The gray value of , Indicated in pixels The guidance image corresponding to the filter window centered at The standard deviation and mean of the grayscale values in Represents pixel exist The average grayscale value within express The number of pixels in Based on the first filter coefficient With the second filter coefficient Determine the adjustment amount : ; In the formula, represents an enhanced gear image; Based on the adjustment component With the brightness component OK Adjust the gear image : 。 6. The gear defect detection method based on artificial intelligence according to claim 1 is characterized in that: The step of extracting features from the adjusted gear image to obtain a gear feature map comprises: Calculate the encoding value of the adjustment gear image : ; ; In the formula, Indicates adjusting the center pixel in the gear image. express No. Neighborhood pixels, represents the first step function, Indicates the number of code jumps, , represent the first threshold and the second threshold respectively; Calculate the global gradient of the adjusted gear image With the gradient direction : ; ; In the formula, , , , Respectively represent the adjustment of the gear image in , , , The gray value at ; Based on the coded value , the global gradient With the gradient direction Calculate the first feature map With the second feature map : ; ; ; In the formula, , Respectively represent adjusting the length and width of the gear image. represents the second step function, Indicates that the pixel center is The corresponding encoding value is Indicates the preset horizontal axis size in the feature map; The first characteristic diagram and the second characteristic diagram are connected in series to obtain a gear characteristic diagram.
7. A gear defect detection system based on artificial intelligence, the system adopts the gear defect detection method based on artificial intelligence as claimed in claim 1, characterized in that: The system comprises: A restoration module, used for acquiring a target gear image, and performing a degradation restoration process on the target gear image to obtain a restored gear image; An enhancement module, used for acquiring gear three-dimensional point cloud data, and performing image enhancement processing on the restored gear image based on the gear three-dimensional point cloud data to obtain an enhanced gear image; An adjustment module, used for adjusting the image brightness of the enhanced gear image to obtain an adjusted gear image; An extraction module, used for performing feature extraction on the adjustment gear image to obtain a gear feature map; The detection module is used to obtain gear training data, input the gear training data into a preset defect detection model for training, input the gear feature map into the trained preset defect detection model for defect detection, and output a detection result.
8. A computer 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 artificial intelligence-based gear defect detection method as described in any one of claims 1 to 6 is implemented.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the gear defect detection method based on artificial intelligence as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Metallic workpiece surface defect recognition method and device based on machine vision
CN110308151A
Image processing method and device and electronic equipment
CN114119826A