A method and system for detecting surface defects of an electric cylinder piston rod

Through the adaptive histogram equalization method, the initial grayscale entropy of the image block is calculated and the optimal grayscale entropy is corrected. The cropping threshold is calculated based on the total number of pixel points and the total number of grayscale levels of the image block, which solves the problems of poor enhancement effect and low detection accuracy in surface defect detection of electric cylinder piston rods, and achieves more efficient defect detection.

CN120235796BActive Publication Date: 2025-07-29XIAN HUA OU PRECISION MACHINERY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510706390.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-07-29
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

In the prior art, when detecting surface defects of electric cylinder piston rods, the fixed threshold cannot adapt to the grayscale distribution in different regions, resulting in poor enhancement effect and low accuracy of defect detection.

Method used

Adaptive histogram equalization method is adopted to calculate the initial grayscale entropy of the image block and correct it to obtain the optimal grayscale entropy. The cropping threshold is calculated based on the total number of pixel points and the total number of grayscale levels of the image block, and the enhancement intensity of each image block is dynamically adjusted, and the vibration noise interference is eliminated, so as to improve detection accuracy.

Benefits of technology

The image enhancement effect is improved, and the enhanced image is more in line with actual needs, improving the accuracy of defect detection and the system's adaptability in dynamic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235796B_ABST
    Figure CN120235796B_ABST
Patent Text Reader

Abstract

This application relates to the field of image processing, and particularly to a method and system for detecting surface defects of an electric cylinder piston rod. The method includes preprocessing the obtained piston rod surface image to obtain a grayscale image; equally dividing the grayscale image into multiple image blocks, calculating the cropping threshold of the image blocks, performing adaptive histogram equalization according to the cropping threshold, and then merging all the image blocks to obtain an enhanced image; inputting the enhanced image into a preset defect detection model and outputting the defect detection result. This application can improve the image enhancement effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and particularly to a method and system for detecting surface defects of an electric cylinder piston rod. Background Art

[0002] As the core component of an electric cylinder, the piston rod of the electric cylinder is mainly responsible for transmitting the push and pull of linear motion. During the production process of the piston rod, due to problems such as uneven raw material composition and improper heat treatment process, it is easy to cause dimensional deviation or quality defects of the piston rod, resulting in problems such as waste of raw materials, fracture and deformation during operation. Therefore, surface defect detection is carried out on the piston rod during the production process.

[0003] The prior art can identify defects on the surface of the piston rod through image processing technology. For example, a Chinese patent with the patent authorization number CN115082486B discloses a method for detecting the surface quality of a hydraulic cylinder piston rod. By performing edge detection on the unfolded grayscale image of the piston rod to be detected, analyzing the length of the scratch area, the grayscale values of abnormal pixel points and their distribution characteristics, comprehensively evaluating the horizontal, vertical and scratch damage degrees of the piston rod, to judge the surface quality of the piston rod.

[0004] The surface of the metal piston rod is relatively smooth and has strong reflectivity, resulting in a large difference in the grayscale distribution of the piston rod image. The prior art can use an image enhancement algorithm to enhance the piston rod image and then perform defect recognition. The CLAHE (Contrast Limited Adaptive Histogram Equalization) algorithm is a commonly used image enhancement algorithm in the prior art. Usually, a fixed grayscale value clipping threshold is set. If the number of pixel points corresponding to a certain grayscale value exceeds the preset clipping threshold, the frequency of the excess part will be evenly distributed to other grayscale values, thereby achieving the enhancement of image contrast, as well as suppressing the problems of noise amplification and over-enhancement.

[0005] However, due to the too large difference in the grayscale distribution on the surface of the piston rod and the different grayscale value distributions in different regions, the fixed threshold cannot meet the grayscale distribution conditions in different regions, easily causing problems such as poor enhancement effect and low defect detection accuracy. Summary of the Invention

[0006] In order to solve the above technical problem of poor image enhancement effect, this application provides a method and system for detecting surface defects of an electric cylinder piston rod.

[0007] In a first aspect, this application provides a method for detecting surface defects of an electric cylinder piston rod, adopting the following technical solution:

[0008] A method for detecting surface defects of an electric cylinder piston rod includes the steps of: preprocessing the obtained surface image of the piston rod to obtain a grayscale image; equally dividing the grayscale image into multiple image blocks, calculating the cropping threshold of the image blocks, performing adaptive histogram equalization according to the cropping threshold, and then merging all the image blocks to obtain an enhanced image; inputting the enhanced image into a preset defect detection model to output a defect detection result; the calculation method of the cropping threshold is: calculating the initial grayscale entropy of any image block and correcting it to obtain the optimal grayscale entropy, and adding the normalized value of the optimal grayscale entropy to a preset initial cropping threshold as the cropping factor; calculating the product of the cropping factor of any image block and the total number of pixels of the image block, and taking the ratio of the product to the total number of gray levels of any image block as the cropping threshold.

[0009] The beneficial effects are as follows: Adaptive adjustment is performed according to the gray distribution characteristics of different regions. By calculating the initial grayscale entropy of the image block and correcting it to obtain the optimal grayscale entropy, the optimal grayscale entropy can reflect the information richness of the region (i.e., the gray change situation). Calculating the cropping threshold in combination with the total number of pixels and the total number of gray levels of the image block can ensure that the enhancement intensity of each image block matches its own gray distribution characteristics. For regions with relatively uniform gray distribution, the cropping threshold is low to prevent over-enhancement; while for regions with complex gray distribution, the cropping threshold is high to allow moderate enhancement to highlight details. Dynamically adjusting the cropping factor in combination with the preset initial cropping threshold, so as to adaptively set the cropping threshold according to the characteristics of each image block. This adaptive adjustment avoids the limitations brought by fixed thresholds, makes the enhanced image more in line with actual needs, and improves the effect of image enhancement.

[0010] Optionally, calculating the initial grayscale entropy of any image block and correcting it to obtain the optimal grayscale entropy includes: calculating the vibration intensity of the image, and taking the product of the negatively correlated normalization of the vibration intensity and the initial grayscale entropy as the optimal grayscale entropy.

[0011] The beneficial effects are as follows: Introducing the vibration intensity to correct the initial grayscale entropy can effectively eliminate the high-frequency noise interference caused by the vibration of the piston rod, ensure that the grayscale entropy can better reflect the true texture complexity, and improve the accuracy of defect detection.

[0012] Optionally, the calculation method of the vibration intensity of the image is: calculating the block vibration intensity of each image block, and taking the mean value of the block vibration intensity as the image vibration intensity of the current frame image.

[0013] The beneficial effects are as follows: By calculating the block vibration intensity of each image block and taking its mean value as the vibration intensity of the current frame image, it can comprehensively reflect the degree of image distortion caused by vibration during the rotation of the piston rod, providing a reliable basis for subsequent correction.

[0014] Optionally, the method for calculating the block vibration intensity is as follows: determine the candidate blocks corresponding to each image block; calculate the similarity between the image block and any candidate block, calculate the similarity mean value of the similarities between the image block and all candidate blocks, calculate the center point distance between the image block and any candidate block, and take the normalized value of the product of the ratio of the similarity to the similarity mean value and the center point distance as the block vibration intensity of the image block.

[0015] The beneficial effect is that by comprehensively considering the similarity and the center point distance between the image block and the candidate block, it can accurately quantify the spatial position offset and gray level change of the image block, and further improve the accuracy of vibration intensity calculation.

[0016] Optionally, the method for calculating the similarity is as follows: calculate the gray level difference of each pixel point between the image block and any candidate block, and take the difference between 1 and the normalized value of the gray level difference as the similarity.

[0017] The beneficial effect is that it provides a method for quantifying the similarity. The smaller the gray level difference, the closer the pixel gray level values of the two image blocks at the corresponding positions, and the higher the similarity; conversely, the larger the gray level difference, the lower the similarity.

[0018] Optionally, the method for normalizing the gray level difference is to calculate the ratio of the gray level difference to 255.

[0019] The beneficial effect is that it provides a normalization method. Taking the ratio of the gray level difference to the maximum gray level value (255) as the normalized value is simple, intuitive and easy to implement, ensuring the comparability of gray level differences between different image blocks.

[0020] Optionally, the method for calculating the initial gray level entropy of the image block is as follows: divide the gray level range of the image into a preset number of gray levels, group every preset number of consecutive gray levels into one level, select a direction and a step size, traverse the image block, count the number of occurrences of gray level pairs that meet the direction and distance conditions, construct a gray level co-occurrence matrix, and the element value in the gray level co-occurrence matrix represents the co-occurrence times of the corresponding gray level pair; perform normalization processing on the gray level co-occurrence matrix, divide each element value by the sum of all elements in the matrix to obtain a probability matrix; calculate the gray level entropy of each image block according to the probability matrix and normalize it to obtain the initial gray level entropy.

[0021] The beneficial effect is that by constructing a probability matrix based on the gray level co-occurrence matrix and calculating the gray level entropy, it can comprehensively reflect the gray level distribution characteristics and texture complexity within the image block, providing a reliable quantitative index for the subsequent calculation of the cropping threshold.

[0022] Optionally, the method for determining the candidate blocks corresponding to each image block is as follows: take the position of the image block in the second frame of the adjacent frame image as the search starting point, and search in the adjacent area along the preset direction respectively until reaching the preset maximum number of search blocks to stop the search, and obtain all candidate blocks corresponding to the image block, where the search starting point is also used as a candidate block.

[0023] The beneficial effects are as follows: By searching for adjacent regions in adjacent frame images along a preset direction, candidate blocks related to the current image block can be quickly located, improving the efficiency and accuracy of block vibration intensity calculation.

[0024] Optionally, dividing the grayscale image into multiple image blocks includes the steps of: using grid lines to divide the grayscale image into pixel blocks with pixels, and mirror-filling the missing image blocks at the edges to make all image blocks have the same size.

[0025] In a second aspect, the present application provides a surface defect detection system for an electric cylinder piston rod, adopting the following technical solution:

[0026] A surface defect detection system for an electric cylinder piston rod includes: a processor and a memory, and the memory stores computer program instructions, which when executed by the processor implement the surface defect detection method for the electric cylinder piston rod according to the above.

[0027] The beneficial effects are as follows: Generating a computer program for the above surface defect detection method for the electric cylinder piston rod and storing it in the memory to be loaded and executed by the processor. Thus, making a system according to the memory and the processor is convenient to use.

[0028] The present application has the following technical effects:

[0029] 1. By calculating the initial gray entropy of the image block and correcting it to obtain the optimal gray entropy, and combining the total number of pixels and the total number of gray levels of the image block to calculate the cropping threshold. It ensures that the enhancement intensity of each image block matches its own gray distribution characteristics. For regions with relatively uniform gray distribution, the cropping threshold is low to prevent over-enhancement; while for regions with complex gray distribution, the cropping threshold is high to allow moderate enhancement to highlight details. By dynamically adjusting the cropping factor, the limitations brought by the fixed threshold can be overcome, thereby improving the image enhancement effect and making the enhanced image more in line with actual requirements.

[0030] 2. During the process of rotating the piston rod of the electric cylinder to collect surface images, high-frequency noise may appear in the images due to vibration, affecting the accuracy of defect detection. By taking the product of the negatively correlated normalization of the vibration intensity and the initial gray entropy as the optimal gray entropy. This correction method can effectively eliminate the interference of high-frequency noise caused by the vibration of the piston rod, ensuring that the gray entropy can better reflect the true texture complexity. It improves the accuracy of defect detection and also enhances the adaptability of the system in a dynamic environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flowchart of a method for detecting surface defects of an electric cylinder piston rod according to an embodiment of the present application.

[0032] Figure 2 It is the flowchart of step S2 in a method for detecting surface defects of an electric cylinder piston rod according to an embodiment of the present application. Specific embodiments

[0033] An embodiment of the present application discloses a method for detecting surface defects of an electric cylinder piston rod. Referring to Figure 1 , it includes steps S1 - S3:

[0034] S1: Preprocess the obtained surface image of the piston rod to obtain a grayscale image.

[0035] Vertically fix the piston rod on a preset rotating platform, fixedly install a camera on one side of the rotating platform. The rotating platform rotates to make the piston rod rotate, and the camera captures an image of the outer surface of the piston rod. The piston rod can be fixed with a fixture in the prior art, multiple frames of images are collected, and the frame images are converted into grayscale images. Exemplarily, the frame extraction frequency can be extracted at 60 frames per second. The shooting angle is the side view angle of the piston rod, and the outer contour of the piston rod presents a rectangular or nearly rectangular shape in the frame image.

[0036] S2: Divide the grayscale image into multiple image blocks equally, calculate the cropping threshold of the image blocks, perform adaptive histogram equalization according to the cropping threshold, and then merge all the image blocks to obtain an enhanced image.

[0037] The cropping threshold is used to limit the adjustment range of the pixel distribution during the histogram equalization process. If the cropping threshold is too large, too much noise may be retained, affecting the image quality. If the threshold is too small, the gray level distribution may be over - cropped, losing important details.

[0038] Use grid lines to divide the grayscale image into pixel blocks, and mirror - fill the missing image blocks at the edges to make all the image blocks have the same size.

[0039] Referring to Figure 2 , the calculation method of the cropping threshold includes steps S20 - S21, specifically as follows:

[0040] S20: Calculate the initial gray entropy of any image block and correct it to obtain the optimal gray entropy, and accumulate the normalized value of the optimal gray entropy with a preset initial cropping threshold as the cropping factor.

[0041] Specifically, the gray entropy can reflect the randomness of the gray level distribution and the texture complexity within the image block. The larger the gray entropy, the more disordered the gray distribution and the higher the texture complexity. Therefore, the cropping threshold of the adaptive histogram equalization can be adjusted according to the gray entropy.

[0042] Calculate the gray entropy for each image block. Specifically, the gray value range of the image It is divided into 16 gray levels, and every 16 consecutive gray values are grouped into one level. Based on the quantized gray levels, a gray-level co-occurrence matrix (GLCM) is constructed. Select the direction (θ) and the step size (d). Exemplarily, the directions are 0°, 45°, 90°, 135°, and the step size d is 1. Traverse the image blocks, and count the number of occurrences of gray-level pairs that meet the direction and distance conditions. A 16×16 matrix is formed, and the element values in the matrix represent the co-occurrence times of the corresponding gray-level pairs. Then, the gray-level co-occurrence matrix is normalized by dividing each element value by the sum of all elements in the matrix to obtain a probability matrix. Finally, the gray entropy of each image block is calculated according to the probability matrix and normalized to obtain the initial gray entropy.

[0043] In defect detection, the initial gray entropy can reflect whether there is an abnormal gray distribution within the image block (for example, the defect area usually has a higher texture complexity). If the initial gray entropy of a certain image block is significantly higher than that of other regions, it may indicate that there is a defect in that region. However, during the rotation of the piston rod, the image may be affected by high-frequency noise (such as blurring, jitter, etc.) due to vibration. These noises will change the gray distribution of the image block, and the high-frequency noise will increase the initial gray entropy, masking the true texture complexity information, thus affecting the accuracy of defect detection.

[0044] This application calculates the vibration intensity of the image and modifies the initial gray entropy through the vibration intensity to obtain the optimal gray entropy.

[0045] Specifically, the calculation method of the vibration intensity of the image is as follows: calculate the block vibration intensity of each image block, and use the average value of the block vibration intensity as the image vibration intensity of the current frame image.

[0046] In one embodiment, the calculation method of the block vibration intensity is as follows:

[0047] Determine the candidate blocks corresponding to each image block. The method for determining the candidate blocks is as follows: take the position of the image block in the second frame image of the adjacent frame image as the search starting point, and search in the adjacent area along the preset direction until the preset maximum number of search blocks is reached and the search stops, to obtain all the candidate blocks corresponding to the image block, where the search starting point is also used as a candidate block. Exemplarily, the preset direction is the 8-neighborhood direction, that is, up, down, left, right, upper left, lower left, upper right, and lower right, and the range of the adjacent area can be the 24-neighborhood area, that is, the area of the image block, and the preset maximum number of search blocks can be 2.

[0048] After obtaining the candidate blocks corresponding to the image block, calculate the similarity between the image block and any candidate block, calculate the average value of the similarities between the image block and all candidate blocks, calculate the center point distance between the image block and any candidate block, and use the normalized value of the product of the ratio of the similarity to the average similarity and the center point distance as the block vibration intensity of the image block.

[0049] In one embodiment, the mathematical expression of the similarity can be:

[0050] ; where is the similarity between the th image block of the th frame image and its corresponding th candidate block, is the size of the image block partitioning, is the gray value corresponding to the th pixel point within the th image block of the th frame image, is the gray value corresponding to the

[0051] This formula quantifies the similarity between two image blocks by calculating the average gray difference of corresponding pixel points between any image block in the image at a certain moment and its candidate block, performing gray-level normalization processing, and then subtracting the normalized result from 1. The smaller the normalized result of the average gray difference between two image blocks, the smaller the difference in gray values of pixel points at each corresponding position of the two image blocks, that is, the more similar the two image blocks are and the higher the similarity. On the contrary, it indicates that the similarity between these two image blocks is lower.

[0052] According to a similar calculation, the block vibration intensity of each image block is calculated, and the mathematical expression of the block vibration intensity is: , is the block vibration intensity corresponding to the th image block of the standard normalization function, is the similarity between the th image block of the th frame image and its corresponding th candidate block, is the center point distance between the th image block of the

[0053] If two image blocks are very similar (small gray difference), then the similarity is close to 1; on the contrary, the similarity is close to 0. The center point distance reflects the spatial position difference between the current image block and the candidate block. If the spatial positions of two image blocks are quite different, it indicates that there may be relatively large vibration or offset. The purpose of Normalization is performed to make it comparable for all candidate blocks. Then multiply by the distance from the center point to amplify the influence of spatial position differences on the block vibration intensity. The final result is normalized to the range for subsequent processing and comparison.

[0054] The block vibration intensity comprehensively considers the gray-scale change and spatial position offset of the image block, and can effectively reflect the degree of image distortion caused by vibration during the dynamic rotation of the piston rod. The stronger the vibration of the piston rod, the higher the block vibration intensity; conversely, the lower the block vibration intensity.

[0055] After obtaining the block vibration intensity of each image block, the mean value of all image block vibration intensities is used as the image vibration intensity of the current frame image.

[0056] The product of the negatively correlated normalized image vibration intensity and the initial gray-scale entropy is used as the optimal gray-scale entropy. In one embodiment, the calculation formula of the optimal gray-scale entropy can be:

[0057] ; where is the corrected gray-scale entropy of the th image block of the frame image, is the initial gray-scale entropy of the th image block of the frame image, represents the exponential function with the natural constant as the base, is the vibration intensity of the

[0058] The higher the vibration intensity, the more significant the image is affected by noise interference, and the degree of chaos in the gray-scale distribution increases accordingly, resulting in an increase in the gray-scale entropy. At this time, it is necessary to reduce the gray-scale entropy to eliminate vibration noise and highlight the true structural features. When the vibration intensity is low, the image noise interference is small, and the gray-scale distribution approaches the ordered state of the true structure, and there is no need to overly adjust the gray-scale entropy.

[0059] S21: Calculate the product of the cropping factor of any image block and the total number of pixels of the image block, and use the ratio of the product to the total number of gray levels of any image block as the cropping threshold.

[0060] According to the optimal gray-scale entropy, dynamically adjust the cropping threshold of each image block during the adaptive histogram equalization process. Specifically, add the normalized value of the optimal gray-scale entropy to the preset initial cropping threshold as the cropping factor; calculate the product of the cropping factor of any image block and the total number of pixels of the image block, and use the ratio of the product to the total number of gray levels of any image block as the cropping threshold.

[0061] In one embodiment, the mathematical expression of the clipping threshold may be: ; Frame image The cropping threshold of the image patch, Expresses the total number of pixels in the image block, Indicates The number of gray levels contained in an image block (obtained through statistics).

[0062] The formula can be: ;in, yes Frame image The limiting cropping factor of the image patch, is the initial value of the clipping threshold, which can be 2 for example. represent Frame image Grayscale entropy of the image block after vibration correction.

[0063] In one embodiment, can be replace, is the adjustment value, which can be 0.5 for example, In the range [0,1], adjust the value It can be mapped to , thus ensuring that the final value range of the standard hyperbolic tangent function is between and between.

[0064] When the grayscale entropy is larger, it indicates that the local complexity of the area is greater and the information contained is richer. The clipping threshold should be increased to retain more details. Conversely, a smaller grayscale entropy indicates that it is in a smooth area. The clipping value should be lowered to reduce the amount of data processing.

[0065] The final value of the cropping threshold for each image block also needs to meet an overall upper and lower threshold value to limit the valid range of the function output value and avoid the result losing practical meaning due to the value being too large or too small.

[0066] Based on the cropping thresholds for different image blocks, contrast-limited adaptive histogram equalization is performed. Specifically, for each edge-padded image block, a grayscale histogram is calculated, and the pixel distribution at each grayscale level is statistically analyzed. A cropping threshold is calculated according to the cropping threshold calculation formula. Histogram values exceeding the threshold are cropped, and the cropped histogram is equalized to generate a grayscale mapping function. This adjusts the pixel values within the block to enhance contrast. The processed image blocks are interpolated to smooth the boundaries between blocks and eliminate blocking artifacts. All processed image blocks are merged to obtain a globally enhanced image.

[0067] S3: Input the enhanced image into a preset defect detection model to output the defect detection result.

[0068] For the image processed by CLAHE, divide the picture into pixel blocks of n×n pixels, extract the energy, homogeneity, and contrast in the gray-level co-occurrence matrix texture features for each image block, and normalize the eigenvalues to obtain a normalized feature vector.

[0069] Label the normalized feature vector with defect type tags, input it into a pre-trained neural network model (such as a fully connected network), the output is the probability of each defect. Take the defect with a probability greater than a preset probability threshold (such as 0.8) as the defect detection result, map the classification result back to the original image, that is, according to the position and classification result of each pixel block, mark the existence and type of the defect at the corresponding position in the original image to generate a defect heat map.

[0070] The embodiment of the present application also discloses a surface defect detection system for an electric cylinder piston rod, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the surface defect detection method for the electric cylinder piston rod according to the present application is implemented.

[0071] The above system also includes other components well-known to those skilled in the art such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be elaborated here.

[0072] In the present application, the aforementioned memory can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, etc., or any other medium that can be used to store the required information and can be accessed by an application program, module, or both. Any such computer storage medium can be a part of the device or accessible or connectable to the device.

[0073] The above are all the preferred embodiments of the present application. The protection scope of the present application is not limited by this. Therefore, all equivalent changes made according to the structure, shape, and principle of the present application should be covered within the protection scope of the present application.

Claims

1. A method for detecting surface defects of an electric cylinder piston rod, characterized in that, Including the steps: Preprocess the obtained picture of the piston rod surface to obtain a grayscale image; Divide the grayscale image equally into multiple image blocks, calculate the cropping threshold of the image blocks, perform adaptive histogram equalization according to the cropping threshold, and then merge all the image blocks to obtain an enhanced image; Input the enhanced image into a preset defect detection model and output the defect detection result; The calculation method of the cropping threshold is as follows: calculate the initial gray entropy of any image block and correct it to obtain the optimal gray entropy, and accumulate the normalized value of the optimal gray entropy and the preset initial cropping threshold as the cropping factor; Calculate the product of the cropping factor of any image block and the total number of pixels of the image block, and take the ratio of the product to the total number of gray levels of any image block as the cropping threshold; Calculating the initial gray entropy of any image block and correcting it to obtain the optimal gray entropy includes: calculating the vibration intensity of the image, and taking the product of the vibration intensity after negative correlation normalization and the initial gray entropy as the optimal gray entropy; The calculation method of the vibration intensity of the image is as follows: calculate the block vibration intensity of each image block, and take the average value of the block vibration intensity as the vibration intensity of the current frame image; The calculation method of the block vibration intensity is as follows: determine the candidate blocks corresponding to each image block; calculate the similarity between the image block and any candidate block, calculate the average value of the similarities between the image block and all candidate blocks, calculate the center point distance between the image block and any candidate block, and take the normalized value of the product of the ratio of the similarity to the average similarity value and the center point distance as the block vibration intensity of the image block.

2. The method for detecting surface defects of the electric cylinder piston rod according to claim 1, characterized in that The calculation method of the similarity is as follows: calculate the gray difference of each pixel point in the image block and any candidate block, and take the difference between 1 and the normalized value of the gray difference as the similarity.

3. The surface defect detection method for the piston rod of the electric cylinder according to claim 2, characterized in that, The normalization method of the gray difference is to calculate the ratio of the gray difference to 255.

4. The surface defect detection method of the electric cylinder piston rod according to claim 1, characterized in that, The calculation method of the initial gray entropy of the image block is as follows: divide the gray value range of the image into a preset number of gray levels, group every preset number of consecutive gray values into one level, select the direction and step size, traverse the image block, count the number of occurrences of the gray level pairs that meet the direction and distance conditions, construct a gray co-occurrence matrix, and the element value in the gray co-occurrence matrix represents the co-occurrence times of the corresponding gray level pairs; Perform normalization processing on the gray co-occurrence matrix, divide each element value by the sum of all elements in the matrix to obtain a probability matrix; Calculate the gray entropy of each image block according to the probability matrix and normalize it to obtain the initial gray entropy.

5. The surface defect detection method of the electric cylinder piston rod according to claim 1, characterized in that The method for determining the candidate blocks corresponding to each image block is as follows: take the position of the image block in the second frame image of the adjacent frame images as the search starting point, and search in the adjacent area along the preset direction respectively until reaching the preset maximum number of search blocks to stop the search, and obtain all the candidate blocks corresponding to the image block, where the search starting point is also used as a candidate block.

6. The surface defect detection method for the piston rod of the electric cylinder according to claim 5, wherein, Dividing a grayscale image equally into multiple image blocks includes the steps of: dividing the grayscale image into pixel blocks with pixels, and mirror-filling the missing image blocks at the edges to make all image blocks the same size.

7. An electric cylinder piston rod surface defect detection system, characterized in that, Including: A processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for detecting the surface defects of the electric cylinder piston rod according to any one of claims 1-6 is implemented.

Citation Information

Patent Citations

  • A method for inspecting the surface quality of a hydraulic cylinder piston rod

    CN115082486B

  • Forging defect detection method based on deep learning

    CN113393439A

  • Steel pipe defect intelligent detection method based on image enhancement

    CN117173180A