Electric cylinder piston rod surface defect detection method
By performing grayscale image processing on the threaded part of the electric cylinder piston rod, calculating feature values, and determining the target pixel row and curve, the problem of surface defect detection of piston rod is solved, and more accurate defect detection results are achieved.
Patent Information
- Application Number
- CN202510607866.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-13
AI Technical Summary
The threaded portion of the piston rod may have defects such as wear, corrosion or breaking during long-term use or in humid environments, which will affect the movement accuracy and stability of the electric cylinder, and it is difficult for the prior art to effectively detect these surface defects.
By obtaining the grayscale image of the threaded portion of the electric cylinder piston rod, the standard deviation of the distance between the local grayscale maximum points in the same pixel row is calculated as the characteristic value, the characteristic values of different pixel rows are compared, the target pixel row is determined, and the non-reflective pixel points are determined according to the average grayscale change rate of the edge line of the closest local grayscale maximum point is determined, and the connection domain analysis is performed to determine the defective pixel points on the target curve.
Accurate detection of surface defects of the piston rod thread part is achieved, avoiding the singularity of single gray value comparison, and improving the accuracy and reliability of detection.
Smart Images

Figure CN120182246A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and particularly to a method for detecting surface defects of an electric cylinder piston rod. Background Art
[0002] The piston rod in an electric cylinder can be used to drive devices such as robotic arms and conveyor belts. The piston rod can convert the rotational motion from the motor into linear motion. For example, the piston rod can cooperate with the nut inside the electric cylinder through a threaded part to convert the rotational motion of the lead screw in the electric cylinder into linear motion, thereby realizing the pushing and pulling operations on the load.
[0003] In the assembly line, the piston rod can be used to control the movement of the robotic arm; in machine tools or medical equipment, the piston rod can be used to adjust the position of the tool head or control the movement of medical devices; in vehicles such as cars and airplanes, the piston rod can be used to adjust the seat position and control the opening and closing of cabin doors, etc., to ensure operation convenience and comfort.
[0004] The long-term use of the piston rod may cause surface wear of the threaded part of the piston rod. Or, when the piston rod works in a humid environment for a long time, it may cause corrosion in the threaded part of the piston rod. Or, there may be defects such as fractures in the threaded part of the piston rod to be assembled after production, affecting the structural strength of the piston rod, and thus affecting the motion accuracy and stability of the electric cylinder.
[0005] For example, a piston rod with defects in the threaded part may affect the cooperation effect between the piston rod and the nut inside the electric cylinder, and even accelerate the wear of the thread, further reducing the motion accuracy and stability of the electric cylinder. Therefore, it is necessary to detect the surface defect quality of the piston rod used in the electric cylinder. Summary of the Invention
[0006] To achieve the detection of the surface defect quality of the piston rod for an electric cylinder, the present application provides a method for detecting surface defects of an electric cylinder piston rod, including: obtaining a grayscale image of the threaded part in the piston rod of the electric cylinder, and taking the standard deviation of the distances between adjacent local grayscale maximum points in the same pixel row in the grayscale image as the eigenvalue of the pixel row; comparing the eigenvalues of different pixel rows in the grayscale image to obtain the target pixel row in the grayscale image; the eigenvalue of the target pixel row is less than or equal to the target threshold; for the pixel points in the target pixel row, according to the average grayscale change rate of the edge line where the local grayscale maximum point closest to the pixel point is located, non-reflective pixel points are determined from the target pixel row; connected component analysis is performed on the non-reflective pixel points to obtain multiple connected components, and the boundary curves of the connected components are determined to determine the target curve passing through the target pixel point in the grayscale image; the curvature of the target curve at different position points is the same as the curvature of the corresponding position point in the boundary curve closest to the target pixel point; the defective pixel points located on the target curve are determined to determine the surface defect detection result of the threaded part of the electric cylinder piston rod according to all the defective pixel points in the grayscale image.
[0007] In this way, it is possible to combine the thread characteristics of the threaded part of the piston rod to achieve the detection of the surface defect quality of the piston rod, avoiding the singularity of comparing with the grayscale values of the entire image. Therefore, it is possible to more accurately achieve the quality detection of the surface defects of the piston rod for an electric cylinder.
[0008] Optionally, the non-reflective pixel points are determined by the following method: determining the probability value that the pixel points in the target pixel row belong to non-reflective pixel points, and taking the pixel points with a probability value greater than the preset probability threshold as non-reflective pixel points; the probability value , where norm is the normalization function and exp is the exponential function with the natural constant as the base. is the average grayscale value of the local grayscale maximum points in the target pixel row where the pixel point is located. is the average grayscale value of the local grayscale maximum points in all target pixel rows; when , ; when , ; k is the average grayscale change rate.
[0009] Optionally, the target curve passing through the target pixel point is determined by the following method: taking the boundary curve closest to the target pixel point in the grayscale image as the reference curve of the target pixel point, and determining the reference curve passing through the target pixel point according to the reference curve of the target pixel point; the target curve coincides with the reference curve after horizontal movement.
[0010] In this way, the target curve where the obtained target pixel point is located can be better used to determine whether there are defects in the target pixel point.
[0011] Optionally, the target curve passing through the target pixel is determined as follows: The boundary curve closest to the target pixel in the grayscale image is used as the reference curve of the target pixel, and the reference curve is translated so that the translated curve passes through the target pixel; the grayscale image is subjected to image block processing to obtain a plurality of image blocks, and the parts at both ends of the translated curve that intersect with the image block where the target pixel is located are used as the target curve of the target pixel.
[0012] In this way, the grayscale image is subjected to image block processing to obtain a plurality of image blocks, and target curves that match the target pixels located in different image blocks can be determined respectively. Therefore, the quality detection of the threaded part of the piston rod can be better realized.
[0013] Optionally, subjecting the grayscale image to image block processing to obtain a plurality of image blocks includes: using a non-uniform division method to subject the grayscale image to image block processing to obtain a plurality of image blocks.
[0014] In this way, a more flexible division of the grayscale image can be realized to better detect the surface defects of the threaded part of the piston rod.
[0015] Optionally, the local gray value maximum points in the pixel row are determined as follows: When the gray value of the pixel is greater than or equal to a plurality of other adjacent pixels on one side in the same pixel row, the pixel is used as a candidate maximum point; when the gray value of the candidate maximum point is greater than or equal to a plurality of other adjacent pixels on the other side in the same pixel row, the candidate maximum point is used as the local gray value maximum point.
[0016] Optionally, comparing the eigenvalue of different pixel rows in the grayscale image to obtain the target pixel row in the grayscale image includes: taking the average value of the eigenvalues of different pixel rows in the grayscale image as the first coefficient, and taking the standard deviation of the eigenvalues of different pixel rows in the grayscale image as the second coefficient; determining a target threshold according to the first coefficient and the second coefficient, and using the pixel row in the grayscale image with the eigenvalue less than or equal to the target threshold as the target pixel row.
[0017] Optionally, determining the target threshold according to the first coefficient and the second coefficient includes: multiplying the second coefficient by a preset positive number to obtain a third coefficient, and taking the sum value of the third coefficient and the first coefficient as the target threshold.
[0018] Optionally, the surface defect detection result includes at least one of the following: the number of defective pixel points in the grayscale image, the area of the defective area composed of the defective pixel points, and the annotation result of the defective part in the grayscale image.
[0019] In this way, based on the obtained surface defect detection results, it is convenient to process the defective piston rod.
[0020] Optionally, the method further includes: when the defect area of the threaded portion in the surface defect detection result is greater than a preset area threshold, outputting a prompt message; the prompt message is used to prompt that there is a defect in the threaded portion of the piston rod of the electric cylinder.
[0021] The technical solution provided by the embodiments of the present application may include the following beneficial effects: for the grayscale image of the threaded portion of the piston rod, taking the standard deviation of the distances between adjacent local grayscale maximum points in the same pixel row of the grayscale image as the eigenvalue of the pixel row, it is possible to determine the target pixel row with a more uniform distribution in the grayscale image, thereby determining the non-reflective pixel points in the grayscale image; using the boundary curve obtained from the non-reflective pixel points, it is possible to locate the target curve in the grayscale image that is more referenceable to the target pixel points, and thus use the target curve to determine whether there are defects in the target pixel points. Therefore, the present application can more accurately implement the quality detection of the surface defects of the piston rod for the electric cylinder in combination with the characteristics of the threaded portion of the piston rod itself.
[0022] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0024] Figure 1 is a flowchart of a method for detecting surface defects of a piston rod of an electric cylinder shown according to an exemplary embodiment; Figure 2 is a schematic diagram of a grayscale image of the threaded portion of the piston rod of the electric cylinder. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application.
[0026] First, a brief introduction to the application scenario of the embodiments of the present application is given. In the application scenario of the present application, the piston rod of the electric cylinder can convert the rotational motion of the motor into a reciprocating motion through the cooperation of the threaded part with the nut in the electric cylinder; when there are defects in the threaded part of the piston rod, it will affect the stability and accuracy of the reciprocating motion output by the electric cylinder. Therefore, it is necessary to perform quality inspection on the surface defects of the piston rod used in the electric cylinder to avoid installing defective piston rods into the electric cylinder.
[0027] In view of the above technical problems, the embodiments of the present application provide a method for detecting surface defects of an electric cylinder piston rod. Figure 1 It is a flowchart of a method for detecting surface defects of an electric cylinder piston rod shown according to an exemplary embodiment. As Figure 1 shown, the method includes the following steps.
[0028] In step S101, a grayscale image of the threaded part in the piston rod of the electric cylinder is obtained, and the standard deviation of the distances between adjacent local grayscale maximum points in the same pixel row in the grayscale image is used as the eigenvalue of the pixel row.
[0029] An image acquisition device can be used to obtain a grayscale image of the threaded part in the piston rod of the electric cylinder; the piston rod of the electric cylinder can be a piston rod to be assembled into the electric cylinder after production; or, the piston rod of the electric cylinder can be a piston rod to be tested that has been running for a certain period of time in the electric cylinder, so as to achieve periodic or non-periodic detection of the piston rod of the electric cylinder.
[0030] The longitudinal direction of the piston rod of the electric cylinder can be in the horizontal direction of the grayscale image; the standard deviation of the distances between adjacent local grayscale maximum points in the same pixel row can reflect the unevenness of the distances between local grayscale maximum points in the same pixel row, and since the top or bottom of the threaded part is usually more likely to be shown as local grayscale maximum points in the grayscale image, and usually the distances between adjacent tops or bottoms of the threaded part have high consistency, therefore, the standard deviation of the distances between adjacent local grayscale maximum points in the same pixel row can reflect the non-uniformity of the distances between adjacent tops or bottoms of the threaded part.
[0031] The pixel value of the local grayscale maximum point in the grayscale image is at least greater than or equal to the grayscale values of the pixel points on both sides in the pixel row where the local grayscale maximum point is located.
[0032] Since the standard deviation of the distances between adjacent local gray-level maximum points in the same pixel row can reflect the inconsistency of the distances between adjacent tops or bottoms of the threaded part, the standard deviation of the distances between adjacent local gray-level maximum points in the same pixel row of the gray-scale image is used as the eigenvalue of the pixel row, and the eigenvalue can be used to screen out the pixel rows corresponding to the threaded part of the gray-scale image with more uniform tops or bottoms.
[0033] In the case where there are no defective pixel points in the pixel rows of the gray-scale image of the threaded part of the threaded rod, the local gray-level maximum points in the gray-scale image correspond to the protrusions or depressions of the threads of the threaded part, and the distances between the local gray-level maximum points have a high degree of consistency.
[0034] In the case where there are no defective pixel points in the pixel rows of the gray-scale image of the threaded part of the threaded rod, the local gray-level maximum points in the gray-scale image may correspond to the protrusions or depressions of the threads of the threaded part, and other local gray-level maximum points other than the protrusions or depressions of the threads are also generated under the influence of the edges of the defective noises, resulting in a decrease in the consistency of the distances between the local gray-level maximum points. Therefore, the eigenvalue of the pixel row can more accurately determine the pixel rows in the gray-scale image that are not affected by defects.
[0035] In one embodiment, the local gray-level maximum points in the pixel row are determined in the following manner: when the gray value of a pixel point is greater than or equal to the gray values of a plurality of other adjacent pixel points on one side of the same pixel row, the pixel point is used as a candidate maximum point; when the gray value of the candidate maximum point is greater than or equal to the gray values of a plurality of other adjacent pixel points on the other side of the same pixel row, the candidate maximum point is used as the local gray-level maximum point.
[0036] For example, for the pixel point A0 located in a certain pixel row, it can be determined whether the gray values of a plurality of pixel points in the left neighborhood of the pixel point A0 are all less than or equal to the gray value of the pixel point A0; if there is at least one gray value greater than the gray value of the pixel point A0 among the plurality of pixel points in the left neighborhood of the pixel point A0, the pixel point A0 can be determined as a non-maximum point.
[0037] If the gray values of the plurality of pixel points in the left neighborhood of the pixel point A0 are all less than or equal to the gray value of the pixel point A0, the pixel point A0 can be determined as a candidate maximum point to continue the comparison of the gray values of the pixel points in the right neighborhood of the pixel point.
[0038] The left neighborhood or the right neighborhood used for comparing the gray values of the pixel points can be determined according to the pitch of the threaded part in the piston rod; the larger the pitch of the threaded part in the piston rod, the larger the left neighborhood or the right neighborhood can be used to compare the gray values of the pixel points.
[0039] On the contrary, the smaller the pitch of the threaded part in the piston rod, the smaller the left or right neighborhood can be adopted to compare the gray values of pixel points; the pitch information of the threaded part in the piston rod can be determined in advance by obtaining the model information of the electric pump.
[0040] In this way, the gray value of a pixel point can be compared with the gray values of other pixel points in the same row within the neighborhood range in the gray image to determine whether the pixel point is a local gray maximum point. Since the operation of determining whether all pixel points are local gray maximum points is the same, the determination of local gray maximum points can be automatically performed by an electronic device.
[0041] In step S102, the eigenvalue of different pixel rows in the gray image is compared to obtain the target pixel row in the gray image.
[0042] The eigenvalue of the target pixel row is less than or equal to the target threshold; the target threshold can be determined according to the average value of the eigenvalues of different pixel rows in the gray image and the standard deviation of the eigenvalues of different pixel rows in the gray image.
[0043] Since the eigenvalue of the target pixel row is less than or equal to the target threshold, the target pixel row is more likely to be the pixel row where the pixel points without defects are located. Based on the obtained target pixel row, the defective pixel points that may exist in the threaded part of the piston rod can be determined more accurately.
[0044] In one embodiment, comparing the eigenvalues of different pixel rows in the gray image to obtain the target pixel row in the gray image includes: taking the average value of the eigenvalues of different pixel rows in the gray image as the first coefficient, and taking the standard deviation of the eigenvalues of different pixel rows in the gray image as the second coefficient; determining the target threshold according to the first coefficient and the second coefficient, and taking the pixel row in the gray image whose eigenvalue is less than or equal to the target threshold as the target pixel row.
[0045] The dimension of the average of the eigenvalues of the pixel rows in the gray image is the same as the dimension of the standard deviation of the pixel rows in the gray image. Determining the target threshold according to the first coefficient and the second coefficient can adaptively determine a matching target threshold according to the actual situation of the eigenvalues of the pixel rows in the gray image.
[0046] In the surface gray image of the threaded part of the piston rod, there is usually one or more rows of pixel rows arranged normally. Comparing the eigenvalues of the pixel rows in the gray image to determine the target threshold can screen out the target pixel rows that meet the characteristics of the pixel rows without defects in the gray image.
[0047] In this way, the target threshold is determined according to the first coefficient and the second coefficient, and the pixel rows in the grayscale image with eigenvalues less than or equal to the target threshold are used as the target pixel rows, so that the target threshold is determined according to the actual situation of the pixel rows in the grayscale image, enabling the relatively accurate target pixel rows to be obtained in various scenarios.
[0048] In one embodiment, determining the target threshold according to the first coefficient and the second coefficient includes: multiplying the second coefficient by a preset positive number to obtain a third coefficient, and taking the sum of the third coefficient and the first coefficient as the target threshold.
[0049] The preset positive number can be specified in advance or in real time according to the actual needs of the user. The preset positive number can be positive integers such as 1, 2, and 3, etc. Since the target threshold is equal to the sum of the third coefficient and the first coefficient, and the third coefficient is equal to the product of the second coefficient and the preset positive number, the smaller the value of the preset positive number, the smaller the obtained target threshold, and a more stringent screening can be performed on the eigenvalues of the pixel rows in the grayscale image to obtain target pixel rows that are more in line with the characteristics of normal pixel rows.
[0050] In this way, since the first coefficient is the average value of the eigenvalues of different pixel rows in the grayscale image, and the second coefficient is the standard deviation of the eigenvalues of different pixel rows in the grayscale image, based on the first coefficient and the second coefficient, both the average level of the eigenvalues of different pixel rows can be considered, and the degree of difference in the eigenvalues of different pixel rows can also be considered, which can help to more accurately determine the defective pixel points that may exist in the threaded part of the piston rod.
[0051] In step S103, for the pixel points in the target pixel row, non-reflective pixel points are determined from the target pixel row according to the average gray level change rate of the edge line where the local gray level maximum point closest to the pixel point is located.
[0052] The top of the threaded part of the piston rod can refer to the raised thread line of the thread in the threaded part of the piston rod; the bottom of the threaded part of the piston rod can refer to the sunken thread line of the thread in the threaded part of the piston rod.
[0053] Since the top or bottom of the threaded part of the piston rod is more likely to be a local gray level maximum point in the grayscale image, the edge line where the local gray level maximum point closest to the pixel point is located can provide a reference for whether the pixel point belongs to a reflective pixel point.
[0054] The edge line where the local gray level maximum point is located can be obtained by performing edge detection on the image; the edge detection of the image can be implemented by edge detection operators such as Sobel operator, Prewitt operator, Canny operator, and Laplacian operator. The embodiments of the present application do not limit the operators used for edge detection.
[0055] The average gray value change rate of the edge line where the local gray value maximum point is located can refer to the average value of the change rate of the gray values of the pixel points from top to bottom in the edge line where the local gray value maximum point is located; when there are reflective pixel points in the edge line, the proportion of the reflective pixel points in the entire edge line is usually less (for example, less than 10%), so that when determining the average gray value change rate of the edge line, the gray values of the pixel points from top to bottom in a part of the edge line do not change significantly, while the gray values of the pixel points from top to bottom in another part of the edge line may show a downward trend of gray values. Therefore, when there are reflective pixel points in the edge line, the average gray value change rate of the edge line is usually less than 0.
[0056] When there are no reflective pixel points in the edge line, the gray values of the pixel points from top to bottom in the edge line may increase or decrease, but there will be no significant decrease in gray values. Therefore, when there are no reflective pixel points in the edge line, the average gray value change rate of the edge line is usually greater than or equal to 0.
[0057] In one embodiment, the non-reflective pixel points are determined in the following manner: determining the probability value that the pixel points in the target pixel row belong to non-reflective pixel points, and taking the pixel points with probability values greater than the preset probability threshold as non-reflective pixel points; the probability value , norm is the normalization function, and exp is the exponential function with the natural constant as the base. is the average gray value of the local gray value maximum points in the target pixel row where the pixel point is located. is the average gray value of the local gray value maximum points in all target pixel rows; when When, When; When, ; k is the average gray value change rate.
[0058] The normalization function norm is used to normalize the variable to be normalized to the range of 0 to 1. For example, the normalization function can be min-max standardization, logarithmic transformation, arctangent function, and Sigmoid function, etc.
[0059] When the pixel points in the target pixel row belong to non-reflective pixel points, the average gray value change rate of the edge line where the local gray value maximum point closest to the pixel point is located is usually greater than or equal to 0. Therefore, a higher probability value can be determined.
[0060] Since local gray - level maximum points are more likely to be reflective pixel points in a gray - level image, the greater the difference between the average gray - level value of local gray - level maximum points in the target pixel row where the pixel point is located and the average gray - level value of local gray - level maximum points in all target pixel rows, the greater the difference in the reflective ability between the target pixel row and the pixel rows with uniform arrangement that may have reflective pixel rows. The more likely the target pixel row is a non - reflective pixel row, and the more likely the pixel points located in the target pixel row also belong to non - reflective pixel points.
[0061] The preset probability threshold can be set according to actual needs. For example, the value of the preset probability threshold can be between 0.6 and 0.8.
[0062] In this way, since the target pixel row belongs to the pixel rows with more consistent pitch in the gray - level image of the thread part, by comparing the local gray - level maximum points in the target pixel row with those in other pixel rows, the obtained probability value can better represent the probability that the pixel point belongs to a non - reflective pixel point.
[0063] In step S104, perform connected - component analysis on non - reflective pixel points to obtain multiple connected components, and determine the boundary curves of the connected components to determine the target curve passing through the target pixel point in the gray - level image.
[0064] The curvature of the target curve at different position points is the same as the curvature of the corresponding position points in the boundary curve closest to the target pixel point.
[0065] For example, the target curve can include pixel points A1, A2, A3, and A4 from top to bottom, and the boundary curve closest to the target pixel point can include at least pixel points B1, B2, B3, and B4 from top to bottom; the number of pixel points in the boundary curve closest to the target pixel point is greater than or equal to the number of pixel points in the boundary curve where the target pixel point is located.
[0066] The curvature of the target curve at pixel point A1 can be equal to the curvature of the boundary curve closest to the target pixel point at pixel point B1; the curvature of the target curve at pixel point A2 can be equal to the curvature of the boundary curve closest to the target pixel point at pixel point B2; the curvature of the target curve at pixel point A3 can be equal to the curvature of the boundary curve closest to the target pixel point at pixel point B3; the curvature of the target curve at pixel point A4 can be equal to the curvature of the boundary curve closest to the target pixel point at pixel point B4.
[0067] Since the curvature of the target curve at different position points is the same as the curvature of the corresponding position points in the boundary curve closest to the target pixel point, for the target pixel points located on the raised thread line in the thread part of the piston rod, the gray - level values of the target pixel points can be compared with those of other pixel points on the raised thread line.
[0068] For the target pixel points located on the concave thread lines in the threaded part of the piston rod, the gray values of the target pixel points can be compared with those of other pixel points on the concave thread lines; for the target pixel points located outside the thread lines in the threaded part of the piston rod, the gray values of the target pixel points can be compared with those of other pixel points on the target curve that has the same shape characteristics as the thread lines, so as to determine whether the target pixel points belong to the defective pixel points in the threaded part.
[0069] In one embodiment, the target curve passing through the target pixel point is determined in the following manner: The boundary curve closest to the target pixel point in the grayscale image is used as the reference curve of the target pixel point, and the reference curve passing through the target pixel point is determined according to the reference curve of the target pixel point; the target curve coincides with the reference curve after horizontal translation.
[0070] Since the spiral lines of the threaded part of the piston rod are repetitive, and when there are no defective pixel points on the spiral lines, the gray values of the pixel points on the same spiral line have high consistency. Therefore, selecting the boundary curve closest to the target pixel point as the reference can ensure that the obtained target curve has high reference value for determining whether the target pixel point belongs to the defective pixel points.
[0071] For example, the boundary curve closest to the target pixel point can be translated so that the translated boundary curve passes through the target pixel point. Since the translation operation does not change the shape of the curve itself, the obtained target curve is more likely to correspond to the actual annular line corresponding to the target pixel point in the piston rod.
[0072] In this way, not only can the target curve where the target pixel point is located be determined more quickly, but also it can be ensured that the obtained target curve can be better used to determine whether there are defects in the target pixel point.
[0073] In one embodiment, the target curve passing through the target pixel point is determined in the following manner: The boundary curve closest to the target pixel point in the grayscale image is used as the reference curve of the target pixel point, and the reference curve is translated so that the translated curve passes through the target pixel point; the grayscale image is processed by image block division to obtain multiple image blocks, and the part where the two ends of the translated curve intersecting with the image block where the target pixel point is located is used as the target curve of the target pixel point.
[0074] Performing image block processing on a grayscale image to obtain multiple image blocks can facilitate more refined processing of the grayscale image of the threaded part. In the translated curve, the parts at both ends that intersect with the image block where the target pixel point is located are used as the target curve of the target pixel point. This can respectively determine matching target curves for target pixel points located in different image blocks, making the obtained target curve more targeted with respect to the target pixel point.
[0075] In this way, since matching target curves can be respectively determined for target pixel points located in different image blocks, making the obtained target curve more targeted with respect to the target pixel point, it helps to more accurately determine the defective pixel points existing in the grayscale image of the threaded part.
[0076] In one embodiment, performing image block processing on a grayscale image to obtain multiple image blocks includes: using a non-uniform partitioning method to perform image block processing on the grayscale image to obtain multiple image blocks.
[0077] Through non-uniform partitioning of the grayscale image, more flexible partitioning of the grayscale image can be achieved, obtaining multiple image blocks with different sizes. Non-uniform partitioning of the grayscale image can be achieved through algorithms such as region growing algorithm, watershed algorithm, and superpixel algorithm.
[0078] In one embodiment, performing image block processing on a grayscale image to obtain multiple image blocks includes: using a uniform partitioning method to perform image block processing on the grayscale image to obtain multiple image blocks with the same size.
[0079] For example, the grayscale image can be divided into multiple image blocks of a preset size, and the multiple image blocks obtained after division together form the grayscale image, realizing simple and effective division processing of the grayscale image.
[0080] In step S105, determine the defective pixel points located on the target curve to determine the surface defect detection result of the threaded part of the electric cylinder piston rod based on all the defective pixel points in the grayscale image.
[0081] The surface defect detection result can include at least one of the following: the number of defective pixel points in the grayscale image, the area of the defective region composed of the defective pixel points, and the annotation result of the defective part in the grayscale image.
[0082] By outputting the surface defect detection result of the threaded part of the electric cylinder piston rod, it is convenient to process the piston rod with defects in the threaded part and also convenient to put the piston rod without defects in the threaded part into use, ensuring the reliability of the operation of the electric cylinder piston rod.
[0083] In the case where there are no defective pixel points in the target curve, the gray values of the pixel points on the target curve are highly consistent; while in the case where there are defective pixel points in the target curve, for example, there are defects such as thread breaks in the threaded part of the piston rod, the consistency of the gray values of the pixel points on the target curve decreases.
[0084] The gray values of the pixel points on the target curve can be compared. For example, for the pixel points located on the target curve, the difference between the gray value of the pixel point and the average gray value of all pixel points on the target curve can be determined to obtain a sequence of difference values; the pixel points in the sequence of difference values whose gray values are less than the gray value corresponding to the lower quartile are used as the defective pixel points in the target curve.
[0085] The lower quartile is the position of the 25th percentile in the dataset, and the gray values of 25% of the pixel points in the sequence of difference values are less than or equal to the gray value corresponding to the lower quartile; in addition, those skilled in the art can also select the percentile used to determine the defective pixel points according to actual needs.
[0086] Figure 2 It is a schematic diagram of the gray image of the threaded part of the piston rod of the electric cylinder, as Figure 2 shown. Since the surface of the piston rod of the electric cylinder has a certain light reflection ability, there may be some reflective pixel points in the gray image of the threaded part of the piston rod.
[0087] There may be some defects on the surface of the threaded part of the piston rod, so there may be some defective pixel points inconsistent with other pixel points in the gray image of the surface of the threaded part of the piston rod. And because there may be some reflective pixel points in the gray image of the threaded part, the gray values of the reflective pixel points in the gray image are greater than those of the non-reflective pixel points in the gray image, and the gray values of the non-defective pixel points in the gray image are greater than or equal to those of the defective pixel points in the gray image, which may cause the reflective pixel points in the gray image to interfere with the determination process of the defective pixel points in the gray image.
[0088] For example, in the gray image of the surface of the threaded part of the piston rod, according to whether the pixel points belong to reflective pixel points and whether they belong to defective pixel points, the pixel points in the gray image can be divided into four types: reflective normal pixel points, reflective defective pixel points, non-reflective normal pixel points, and non-reflective defective pixel points.
[0089] When directly using a gray threshold to take the pixel points with lower gray values in the gray image as the defective pixel points in the gray image of the threaded part of the piston rod, the reflective defective pixel points in the gray image may be misidentified as reflective normal pixel points.
[0090] In the technical solution provided by the embodiments of the present application, whether a pixel point in a grayscale image belongs to a defective pixel point is obtained by comparing the pixel point with other pixel points in the target curve where it is located. Therefore, the pixel point can be compared with other pixel points on the same thread line. Compared with the pixel points in the entire grayscale image, the other pixel points on the target curve are more valuable for determining whether the pixel point belongs to a defective pixel point. Therefore, the defective pixel points in the piston rod can be determined more accurately.
[0091] In one embodiment, a prompt message may also be output when the defective area characterized by the surface defect detection result in the threaded portion is greater than a preset area threshold; the prompt message is used to prompt that there is a defect in the threaded portion of the electric cylinder piston rod.
[0092] The preset area threshold can be determined according to the total area of the threaded portion. For example, the preset area threshold can be equal to 10% to 15% of the total area of the threaded portion of the piston rod.
[0093] Outputting a prompt message when the defective area is greater than the preset area threshold can facilitate supervisors or other electronic devices to process the abnormal piston rod in time and prevent the piston rod with defects in the threaded portion from being put into use.
[0094] It should be understood that unless otherwise specifically stated, the features of some embodiments of the present application described herein can be combined with each other.
[0095] Although terms such as "first", "second", and "third" may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. On the contrary, these terms are only used to distinguish one component, part, region, layer, or section from another. Therefore, without departing from the teachings of the examples, the first component, part, region, layer, or section mentioned in the examples described herein can also be referred to as the second component, part, region, layer, or section.
[0096] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description herein, "a plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0097] In addition, the word "exemplary" is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as "exemplary" is not necessarily to be construed as advantageous over other aspects or designs. Instead, the word exemplary is intended to present concepts in a concrete fashion. As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or".
[0098] Likewise, although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding this specification and the drawings. In particular with respect to the various functions performed by the components described above (e.g., elements, resources, etc.), unless otherwise indicated, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific function of the described component, even if not structurally equivalent to the disclosed structure.
[0099] In addition, although specific features of the present application may have been disclosed with respect to only one of several implementations, such features may, as may be desired and advantageous for any given or particular application, be combined with one or more other features of other implementations.
[0100] Other embodiments of the present application will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed herein. The specification and examples are to be considered exemplary only.
[0101] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes may be made without departing from its scope.
Claims
1. A method for detecting surface defects of an electric cylinder piston rod, characterized in that: include: Obtain a grayscale image of the threaded portion of the piston rod of the electric cylinder, and use the standard deviation of the distance between adjacent local grayscale maximum value points in the same pixel row in the grayscale image as the characteristic value of the pixel row; Compare the characteristic values of different pixel rows in the grayscale image to obtain the target pixel row in the grayscale image; the characteristic value of the target pixel row is less than or equal to the target threshold; For a pixel point in the target pixel row, determine a non-reflective pixel point from the target pixel row according to the average grayscale change rate of the edge line where the local grayscale maximum point closest to the pixel point is located; Performing a connected domain analysis on non-reflective pixel points to obtain multiple connected domains, and determining the boundary curves of the connected domains to determine a target curve passing through the target pixel point in the grayscale image; The curvature of the target curve at different positions is the same as the curvature of the corresponding position in the boundary curve closest to the target pixel; Defective pixel points located on the target curve are determined, so as to determine the surface defect detection result of the threaded part of the electric cylinder piston rod according to all defective pixel points in the grayscale image.
2. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: The non-reflective pixel point is determined in the following manner: Determine the probability value of the pixel points in the target pixel row being non-reflective pixel points, and take the pixel points whose probability values are greater than a preset probability threshold as non-reflective pixel points; Probability value , norm is the normalization function, exp is the exponential function with the natural constant as the base, is the average gray value of the local gray maximum point in the target pixel row where the pixel is located, is the average gray value of the local gray maximum points in all target pixel rows; when hour, ;when hour, ; k is the average grayscale change rate.
3. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: The target curve passing through the target pixel is determined in the following way: The boundary curve closest to the target pixel in the grayscale image is used as the reference curve of the target pixel, and a reference curve passing through the target pixel is determined based on the reference curve of the target pixel; the target curve coincides with the reference curve after horizontal movement.
4. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: The target curve passing through the target pixel is determined in the following way: The boundary curve closest to the target pixel in the grayscale image is used as a reference curve for the target pixel, and the reference curve is translated so that the translated curve passes through the target pixel; The grayscale image is divided into blocks to obtain a plurality of image blocks, and the parts of the translated curve at both ends intersecting with the image block where the target pixel point is located are used as the target curve of the target pixel point.
5. The electric cylinder piston rod surface defect detection method according to claim 4, characterized in that: The grayscale image is processed into blocks to obtain multiple image blocks, including: The grayscale image is divided into blocks using a non-equidistant partitioning method to obtain a plurality of image blocks.
6. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: The local grayscale maximum point in a pixel row is determined in the following way: When the grayscale value of a pixel is greater than or equal to a plurality of other adjacent pixels on one side of the same pixel row, the pixel is taken as a candidate maximum value point; When the grayscale value of the candidate maximum point is greater than or equal to a plurality of other adjacent pixel points on the other side of the same pixel row, the candidate maximum point is taken as a local grayscale maximum point.
7. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: Compare the characteristic values of different pixel rows in the grayscale image to obtain the target pixel row in the grayscale image, including: The average value of the characteristic values of different pixel rows in the grayscale image is used as the first coefficient, and the standard deviation of the characteristic values of different pixel rows in the grayscale image is used as the second coefficient; The target threshold is determined according to the first coefficient and the second coefficient, so that the pixel row in the grayscale image whose characteristic value is less than or equal to the target threshold is used as the target pixel row.
8. The electric cylinder piston rod surface defect detection method according to claim 7, characterized in that: Determining the target threshold according to the first coefficient and the second coefficient includes: The second coefficient is multiplied by a preset positive number to obtain a third coefficient, and the sum of the third coefficient and the first coefficient is used as the target threshold.
9. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: The surface defect detection results include at least one of the following: The number of defective pixels in the grayscale image, the area of the defective region composed of defective pixels, and the labeling results of the defective parts in the grayscale image.
10. The electric cylinder piston rod surface defect detection method according to claim 1, characterized in that: The method further comprises: When the surface defect detection result indicates that the defect area of the threaded portion is greater than a preset area threshold, a prompt message is output; the prompt message is used to prompt that there is a defect in the threaded portion of the electric cylinder piston rod.
Citation Information
Patent Citations
Intelligent defect detection method for aero-engine parts based on machine vision
CN117522870A
Defect detection method for high-strength stamping part
CN117830139A
Connector pin automatic detection method based on machine vision
CN118781115A
Cable defect detection method and system based on image processing
CN119295466A
Screen defect detection method and apparatus, and device and storage medium
WO2025045021A1