A method for detecting surface defects of electric cylinder piston rod

By calculating the standard deviation of the local grayscale maximum point and the boundary curve of the non-reflective pixel point of the grayscale image of the electric cylinder piston rod, combined with the image blocking processing, the surface defects of the piston rod are accurately detected, and the problems of motor cylinder motion accuracy and stability are solved.

CN120182246BActive Publication Date: 2025-08-29XIAN HUIYUAN INSTR & VALVE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect surface defects of electric cylinder piston rods, affecting its motion accuracy and stability.

Method used

By obtaining the grayscale image of the electric cylinder piston rod, the standard deviation between the local grayscale maximum points is calculated as the characteristic value, the target pixel row is selected, and the defective pixel points are determined using the boundary curve of the non-reflective pixel points, and combined with the image blocking process, the defect area is accurately positioned.

Benefits of technology

High accuracy detection of surface defects of the electric cylinder piston rod is achieved, avoiding the error of comparing a single gray value, and ensuring the movement stability and accuracy of the electric cylinder.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182246B_ABST
    Figure CN120182246B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and in particular to a method for detecting surface defects of an electric cylinder piston rod. The method comprises: obtaining a grayscale image of the threaded portion of the piston rod of the electric cylinder, obtaining a target pixel row in the grayscale image based on the standard deviation of the distances between adjacent local grayscale maximum points in the same pixel row in the grayscale image; determining non-reflective pixels from the target pixel row based on 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 the non-reflective pixels to obtain multiple connected domains, and determining the boundary curve of the connected domain to determine a target curve in the grayscale image passing through the target pixel point; determining the defective pixel points located on the target curve to determine the surface defect detection result of the threaded portion of the electric cylinder piston rod. Through the above technical solution, the surface defect quality detection of the piston rod used for the electric cylinder can be better achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method for detecting surface defects of an electric cylinder piston rod. Background Art

[0002] The piston rod in the 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 cooperates with the nut in the electric cylinder through the threaded portion, which can convert the rotational motion of the lead screw in the electric cylinder into linear motion, thereby realizing push and pull operations on the load.

[0003] In assembly lines, piston rods can be used to control the movement of robotic arms; in machine tools or medical equipment, piston rods can be used to adjust the position of tool heads or control the movement of medical devices; in vehicles such as cars and airplanes, piston rods can be used to adjust seat positions and control door switches, ensuring ease and comfort of operation.

[0004] Long-term use of the piston rod may cause surface wear of the threaded part of the piston rod, or when the piston rod is working in a humid environment for a long time, it may cause corrosion of the threaded part of the piston rod; or, the threaded part of the completed piston rod to be assembled may have defects such as breakage, affecting the structural strength of the piston rod, thereby affecting the movement accuracy and stability of the electric cylinder.

[0005] For example, a piston rod with defects in the threaded part may affect the fit between the piston rod and the nut in the electric cylinder, and even accelerate the wear of the thread, further reducing the movement accuracy and stability of the electric cylinder. Therefore, it is necessary to inspect the surface defect quality of the piston rod used in the electric cylinder. Summary of the Invention

[0006] In order to realize the detection of surface defect quality of the piston rod of the electric cylinder, the present application provides a surface defect detection method of the piston rod of the electric cylinder, including: obtaining a grayscale image of the threaded part of the piston rod of the electric cylinder, and taking the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row in the grayscale image as the characteristic value of the pixel row; comparing the characteristic values ​​of different pixel rows in the grayscale image to obtain a 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 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, the non-reflective pixel point is determined from the target pixel row; a connected domain analysis is performed on the non-reflective pixel point to obtain multiple connected domains, and the boundary curve of the connected domain is 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; determining the defective pixel point located on the target curve to determine the surface defect detection result of the threaded part of the piston rod of the electric cylinder based on all the defective pixel points in the grayscale image.

[0007] In this way, the thread characteristics of the threaded part of the piston rod can be combined to realize the detection of the surface defect quality of the piston rod, avoiding the singleness of comparison with the grayscale value of the entire image. Therefore, the surface defect quality detection of the piston rod used for the electric cylinder can be realized more accurately.

[0008] Optionally, the non-reflective pixel points are determined by: determining the probability value of the pixel points in the target pixel row belonging to the non-reflective pixel points, and taking the pixel points with a probability value greater than a preset probability threshold as the non-reflective pixel points; the probability value , norm is the normalization function, exp is the exponential function with the natural constant as the base, is the average grayscale value of the local grayscale 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.

[0009] Optionally, 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 based on the reference curve of the target pixel point, a reference curve passing through the target pixel point is determined; the target curve coincides with the reference curve after horizontal movement.

[0010] In this way, the target curve where the target pixel point is located can be used to better determine whether the target pixel point has a defect.

[0011] Optionally, 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 subjected to image blocking processing to obtain multiple image blocks, and the parts of the translated curve 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.

[0012] In this way, by performing image block processing on the grayscale image to obtain multiple image blocks, matching target curves can be determined for target pixel points located in different image blocks, thereby better realizing the quality detection of the threaded portion of the piston rod.

[0013] Optionally, performing image block processing on the grayscale image to obtain a plurality of image blocks includes: performing image block processing on the grayscale image to obtain a plurality of image blocks using a non-equidistant partitioning method.

[0014] In this way, a more flexible division of the grayscale image can be achieved, so as to better detect surface defects of the threaded portion of the piston rod.

[0015] Optionally, the local grayscale maximum point in the pixel row is determined in the following manner: when the grayscale value of the pixel point is greater than or equal to multiple other adjacent pixel points on one side of the same pixel row, the pixel point is taken as a candidate maximum point; when the grayscale value of the candidate maximum point is greater than or equal to multiple other adjacent pixel points on the other side of the same pixel row, the candidate maximum point is taken as the local grayscale maximum point.

[0016] Optionally, the eigenvalues ​​of different pixel rows in the grayscale image are compared to obtain the target pixel row in the grayscale image, including: 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 the target threshold value based on the first coefficient and the second coefficient, so as to take the pixel row in the grayscale image whose eigenvalue is less than or equal to the target threshold value as the target pixel row.

[0017] Optionally, determining the target threshold based on 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.

[0018] Optionally, the surface defect detection result includes at least one of the following: the number of defective pixels in the grayscale image, the area of ​​the defective region formed by the defective pixels, and the labeling result of the defective part in the grayscale image.

[0019] In this way, the defective piston rod can be easily processed according to the obtained surface defect detection results.

[0020] Optionally, the method further includes: when the surface defect detection result indicates that the defect area of ​​the threaded part is greater than a preset area threshold, outputting a prompt message; the prompt message is used to indicate that there is a defect in the threaded part of the electric cylinder piston rod.

[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, the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row in the grayscale image is used as the characteristic value of the pixel row, which can 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 by the non-reflective pixel points, a target curve that is more reference-oriented for the target pixel points can be located from the grayscale image, thereby using the target curve to determine whether the target pixel points have defects. Therefore, the present application can combine the characteristics of the threaded portion of the piston rod itself to more accurately realize the quality detection of surface defects of the piston rod used for the electric cylinder.

[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0024] Figure 1 This is a flow chart showing a method for detecting surface defects of an electric cylinder piston rod according to an exemplary embodiment;

[0025] Figure 2 is a schematic diagram of a grayscale image of the threaded portion of the piston rod of the electric cylinder. DETAILED DESCRIPTION

[0026] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this application.

[0027] First, a brief introduction to the application scenario of the embodiment 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 reciprocating motion through the cooperation of the threaded part and 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 for the electric cylinder to avoid defective piston rods from being installed in the electric cylinder.

[0028] In order to solve the above technical problems, the present invention provides a method for detecting surface defects of an electric cylinder piston rod. Figure 1 FIG. 1 is a flow chart showing a method for detecting surface defects of an electric cylinder piston rod according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps.

[0029] In step S101, a grayscale image of the threaded portion of the piston rod of the electric cylinder is obtained, and the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row in the grayscale image is used as the feature value of the pixel row.

[0030] An image acquisition device can be used to obtain a grayscale image of the threaded portion of the piston rod of the electric cylinder; the piston rod of the electric cylinder can be a piston rod that has been completed and is to be assembled to the electric cylinder; 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.

[0031] The longitudinal direction of the piston rod of the electric cylinder can be located in the horizontal direction of the grayscale image; the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row can reflect the degree of unevenness of the distance between the local grayscale maximum points in the same pixel row, and since the top or bottom of the threaded part is usually more likely to appear as a local grayscale maximum point in the grayscale image, under normal circumstances, the distance between adjacent tops or bottoms of the threaded part has a high consistency. Therefore, the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row can reflect the inconsistency of the distance between adjacent tops or bottoms of the threaded part.

[0032] The pixel value of a local grayscale maximum point in a grayscale image is at least greater than or equal to the grayscale values ​​of the pixel points on both sides of the pixel row where the local grayscale maximum point is located.

[0033] Since the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row can reflect the inconsistency of the distance between adjacent tops or bottoms of the threaded part, the standard deviation of the distance between adjacent local grayscale maximum points in the same pixel row in the grayscale image is used as the eigenvalue of the pixel row. The eigenvalue can be used to screen out pixel rows in the grayscale image that correspond to more uniform tops or bottoms of the threaded part.

[0034] When there are no defective pixels in the pixel row of the grayscale image of the threaded portion of the threaded rod, the local grayscale maximum points in the grayscale image correspond to the protrusions or depressions of the threads of the threaded portion, and the spacing between the local grayscale maximum points has a high consistency.

[0035] When there are no defective pixels in the pixel row of the grayscale image of the threaded part of the threaded rod, the local grayscale maximum points in the grayscale image may correspond to the protrusions or depressions of the threads of the threaded part, and other local grayscale maximum points other than the protrusions or depressions of the threads are generated under the influence of the edges of the defective noise, which reduces the consistency of the spacing between the local grayscale maximum points. Therefore, the characteristic value of the pixel row can more accurately determine the pixel row in the grayscale image that is not affected by the defect.

[0036] In one embodiment, the local grayscale maximum point in a pixel row is determined in the following manner: when the grayscale value of the pixel point is greater than or equal to multiple other adjacent pixel points on one side of the same pixel row, the pixel point is used as a candidate maximum point; when the grayscale value of the candidate maximum point is greater than or equal to multiple other adjacent pixel points on the other side of the same pixel row, the candidate maximum point is used as a local grayscale maximum point.

[0037] For example, for pixel point A0 located in a certain pixel row, it can be determined whether the grayscale values ​​of multiple pixel points located in the left neighborhood of pixel point A0 are all less than or equal to the grayscale value of pixel point A0; if there is at least one grayscale value greater than the grayscale value of pixel point A0 among the multiple pixel points in the left neighborhood of pixel point A0, then pixel point A0 can be determined as a non-maximum point.

[0038] If the grayscale values ​​of multiple pixels in the left neighborhood of pixel point A0 are all less than or equal to the grayscale value of pixel point A0, pixel point A0 can be determined as a candidate maximum point to continue comparing the grayscale values ​​of pixels in the right neighborhood of the pixel point.

[0039] The left neighborhood or right neighborhood used to compare the grayscale values ​​of the pixel points can be determined based on the pitch of the threaded portion in the piston rod; the larger the pitch of the threaded portion in the piston rod, the larger the left neighborhood or right neighborhood can be used to compare the grayscale values ​​of the pixel points.

[0040] On the contrary, the smaller the pitch of the threaded portion in the piston rod, the smaller the left neighborhood or right neighborhood can be used to compare the grayscale values ​​of the pixel points; the pitch information of the threaded portion in the piston rod can be determined in advance by obtaining the model information of the electric pump.

[0041] In this way, the grayscale values ​​of the pixel point can be compared with those of other pixel points in the same row within the neighborhood range of the grayscale image to determine whether the pixel point is a local grayscale maximum point. Since the operation of determining whether all pixel points are local grayscale maximum points is the same, the determination of local grayscale maximum points can be automatically performed through electronic equipment.

[0042] In step S102 , the characteristic values ​​of different pixel rows in the grayscale image are compared to obtain the target pixel row in the grayscale image.

[0043] The eigenvalue of the target pixel row is less than or equal to the target threshold; the target threshold may be determined based on an average value of the eigenvalues ​​of different pixel rows in the grayscale image and a standard deviation of the eigenvalues ​​of different pixel rows in the grayscale image.

[0044] Since the characteristic value 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 no defective pixels are located. Based on the obtained target pixel row, the defective pixels that may exist in the threaded portion of the piston rod can be determined more accurately.

[0045] In one embodiment, the eigenvalues ​​of different pixel rows in a grayscale image are compared to obtain a target pixel row in the grayscale image, including: taking the average value of the eigenvalues ​​of different pixel rows in the grayscale image as a first coefficient, and taking the standard deviation of the eigenvalues ​​of different pixel rows in the grayscale image as a second coefficient; determining a target threshold value based on the first coefficient and the second coefficient, so as to take the pixel row in the grayscale image whose eigenvalue is less than or equal to the target threshold value as the target pixel row.

[0046] The dimension of the average of the eigenvalues ​​of the pixel rows in the grayscale image is the same as the dimension of the standard deviation of the pixel rows in the grayscale image. The target threshold is determined based on the first coefficient and the second coefficient. The matching target threshold can be adaptively determined based on the actual situation of the eigenvalues ​​of the pixel rows in the grayscale image.

[0047] In the surface grayscale image of the threaded portion of the piston rod, there are usually one or more rows of pixels that appear to be arranged normally. By comparing the characteristic values ​​of the pixel rows in the grayscale image to determine the target threshold, the target pixel rows in the grayscale image that meet the characteristics of the pixel rows without defects can be screened out.

[0048] In this way, the target threshold is determined according to the first coefficient and the second coefficient, so that the pixel row in the grayscale image whose eigenvalue is less than or equal to the target threshold is used as the target pixel row, so that the target threshold is determined according to the actual situation of the pixel row in the grayscale image, so that a relatively accurate target pixel row can be obtained in a variety of scenarios.

[0049] 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 using the sum of the third coefficient and the first coefficient as the target threshold.

[0050] 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, for example, a positive integer such as 1, 2, and 3; 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 target threshold obtained, and a more stringent screening can be performed on the characteristic values ​​of the pixel rows in the grayscale image to obtain a target pixel row that is more consistent with the characteristics of a normal pixel row.

[0051] 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, according to the first coefficient and the second coefficient, both the average level of the eigenvalues ​​of different pixel rows and the degree of difference in the eigenvalues ​​of different pixel rows can be considered, which can help to more accurately determine the defective pixels that may exist in the threaded part of the piston rod.

[0052] In step S103, for the pixel points in the target pixel row, the non-reflective pixel points are determined 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.

[0053] The top of the threaded portion of the piston rod may refer to a raised thread line of the thread of the threaded portion of the piston rod; and the bottom of the threaded portion of the piston rod may refer to a recessed thread line of the thread of the threaded portion of the piston rod.

[0054] Since the top or bottom of the threaded part of the piston rod is more likely to be a local grayscale maximum point in the grayscale image, the edge line where the local grayscale maximum point closest to the pixel point is located can provide a reference for whether the pixel point is a reflective pixel point.

[0055] The edge line where the local grayscale maximum point is located can be obtained by performing edge detection on the image; edge detection of the image can be achieved by edge detection operators such as the Sobel operator, Prewitt operator, Canny operator and Laplacian operator. The embodiment of the present application does not limit the operators used for edge detection.

[0056] The average grayscale change rate of the edge line where the local grayscale maximum point is located can refer to the average value of the change rate of the grayscale values ​​of the pixels in the edge line where the local grayscale maximum point is located from top to bottom; when there are reflective pixels in the edge line, the proportion of reflective pixels in the entire edge line is usually smaller (for example, less than 10%), so that when determining the average grayscale change rate of the edge line, the grayscale values ​​of the pixels from top to bottom in a part of the edge line do not change significantly, while the grayscale values ​​of the pixels from top to bottom in another part of the edge line may show a trend of decreasing grayscale values. Therefore, when there are reflective pixels in the edge line, the average grayscale change rate of the edge line is usually less than 0.

[0057] When there are no reflective pixels on the edge line, the grayscale values ​​of the pixels from top to bottom of the edge line may increase or decrease, but there will not be a significant decrease in the grayscale value. Therefore, when there are no reflective pixels on the edge line, the average grayscale change rate of the edge line is usually greater than or equal to 0.

[0058] In one embodiment, the non-reflective pixel points are determined by: determining the probability value of the pixel points in the target pixel row belonging to the non-reflective pixel points, and taking the pixel points with a probability value greater than a preset probability threshold as the non-reflective pixel points; the probability value , norm is the normalization function, exp is the exponential function with the natural constant as the base, is the average grayscale value of the local grayscale 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.

[0059] 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 minimum-maximum standardization, logarithmic transformation, inverse tangent function, and sigmoid function.

[0060] When the pixel point in the target pixel row is a non-reflective pixel point, the average grayscale change rate of the edge line where the local grayscale maximum point closest to the pixel point is located is usually greater than or equal to 0, so a higher probability value can be determined.

[0061] Since local grayscale maximum points are more likely to be reflective pixels in a grayscale image, the greater the difference between the average grayscale value of the local grayscale maximum points in the target pixel row where the pixel point is located and the average grayscale value of the local grayscale maximum points in all target pixel rows, the greater the difference in reflective ability between the target pixel row and the evenly arranged pixel rows that may contain reflective pixels, the more likely the target pixel row is to be a non-reflective pixel point, and the more likely the pixel point located in the target pixel row is to be a non-reflective pixel point.

[0062] 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.

[0063] In this way, since the target pixel row belongs to the pixel row with more consistent pitch in the grayscale image of the threaded part, after comparing the local grayscale maximum points in the target pixel row with the local grayscale maximum points in other pixel rows, the probability value obtained can better characterize the probability that the pixel point belongs to a non-reflective pixel point.

[0064] In step S104, a connected domain analysis is performed on the non-reflective pixel points to obtain multiple connected domains, and boundary curves of the connected domains are determined to determine a target curve passing through the target pixel point in the grayscale image.

[0065] 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.

[0066] For example, the target curve may include pixel points A1, A2, A3 and A4 from top to bottom, and the boundary curve closest to the target pixel point may 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.

[0067] The curvature of the target curve at pixel point A1 may 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 may 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 may 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 may be equal to the curvature of the boundary curve closest to the target pixel point at pixel point B4.

[0068] Since the curvature of the target curve at different positions is the same as the curvature of the corresponding position point in the boundary curve closest to the target pixel point, for the target pixel point located on the raised thread line in the threaded part of the piston rod, the grayscale value of the target pixel point can be compared with that of other pixel points on the raised thread line.

[0069] For the target pixel point located on the recessed thread line in the threaded portion of the piston rod, the grayscale value of the target pixel point can be compared with that of other pixel points on the recessed thread line; for the target pixel point located outside the thread line in the threaded portion of the piston rod, the grayscale value of the target pixel point can be compared with that of other pixel points on the target curve that is consistent with the shape characteristics of the thread line to determine whether the target pixel point is a defective pixel point in the threaded portion.

[0070] 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 based on the reference curve of the target pixel point, a reference curve passing through the target pixel point is determined; the target curve coincides with the reference curve after horizontal movement.

[0071] Since the spiral line of the threaded part of the piston rod is repeatable, and when there are no defective pixels on the spiral line, the grayscale values ​​of the pixels located on the same spiral line have high consistency, therefore, selecting the boundary curve closest to the target pixel point as a reference can ensure that the obtained target curve has a high reference value for determining whether the target pixel point is a defective pixel point.

[0072] 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 annular line actually corresponding to the target pixel point in the piston rod.

[0073] In this way, the target curve where the target pixel point is located can be determined more quickly, and it can also be ensured that the obtained target curve can be better used to determine whether the target pixel point has a defect.

[0074] 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 divided into blocks to obtain multiple image blocks, and the parts of the translated curve 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.

[0075] Performing image block processing on the 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, and matching target curves can be determined for the target pixel points located in different image blocks, so that the obtained target curve is more targeted relative to the target pixel point.

[0076] In this way, since matching target curves can be determined for target pixels located in different image blocks respectively, the obtained target curves are more targeted relative to the target pixels, thereby helping to more accurately determine defective pixels in the grayscale image of the threaded part.

[0077] In one embodiment, performing image block processing on the grayscale image to obtain a plurality of image blocks includes: performing image block processing on the grayscale image to obtain a plurality of image blocks using a non-equidistant partitioning method.

[0078] By performing non-equidistant division on grayscale images, a more flexible division of grayscale images can be achieved, and multiple image blocks of different sizes can be obtained; non-equidistant division of grayscale images can be achieved through algorithms such as region growing algorithm, watershed algorithm and superpixel algorithm.

[0079] In one embodiment, performing image block processing on the grayscale image to obtain a plurality of image blocks includes: performing image block processing on the grayscale image using an equidistant partitioning method to obtain a plurality of image blocks of the same size.

[0080] For example, a grayscale image may be divided into a plurality of image blocks of a preset size, and the plurality of image blocks obtained after the division together constitute a grayscale image, thereby achieving simple and effective division processing of the grayscale image.

[0081] In step S105 , defective pixel points located on the target curve are determined, so as to determine the surface defect detection result of the threaded portion of the electric cylinder piston rod based on all defective pixel points in the grayscale image.

[0082] The surface defect detection result may include at least one of the following: the number of defective pixels in the grayscale image, the area of ​​the defective region formed by the defective pixels, and the marking result of the defective part in the grayscale image.

[0083] By outputting the surface defect detection results of the threaded part of the electric cylinder piston rod, it is easy to process the piston rod with defects in the threaded part, and it is also easy to put the piston rod without defects in the threaded part into use, thereby ensuring the reliability of the operation of the electric cylinder piston rod.

[0084] When there are no defective pixels in the target curve, the grayscale values ​​of the pixels on the target curve have a high consistency; when there are defective pixels in the target curve, such as defects such as thread breakage in the threaded part of the piston rod, the consistency of the grayscale values ​​of the pixels on the target curve is reduced.

[0085] The grayscale values ​​of the pixels on the target curve can be compared. For example, for a pixel on the target curve, the difference between the grayscale value of the pixel and the average grayscale value of all pixels on the target curve can be determined to obtain a difference value sequence; the pixel with a grayscale value smaller than the lower quartile in the difference value sequence is regarded as a defective pixel in the target curve.

[0086] The lower quartile is the position at the 25% quantile in the data set, and 25% of the pixel points in the difference value sequence have grayscale values ​​less than or equal to the grayscale value corresponding to the lower quartile; in addition, those skilled in the art can also select the percentile for determining defective pixel points according to actual needs.

[0087] Figure 2 is a schematic diagram of a grayscale image of the threaded portion of the piston rod of the electric cylinder, such as Figure 2 As shown, since the surface of the piston rod of the electric cylinder has a certain reflective ability to light, there may be some reflective pixels in the grayscale image of the threaded portion of the piston rod.

[0088] There may be some defects on the surface of the threaded part of the piston rod, so that there may be some defective pixels in the grayscale image of the surface of the threaded part of the piston rod that are inconsistent with other pixels. Since there may be some reflective pixels in the grayscale image of the threaded part, the grayscale value of the reflective pixels in the grayscale image is greater than that of the non-reflective pixels in the grayscale image, and the grayscale value of the non-defective pixels in the grayscale image is greater than or equal to the defective pixels in the grayscale image, the reflective pixels in the grayscale image may interfere with the process of determining the defective pixels in the grayscale image.

[0089] For example, in the grayscale image of the surface of the threaded part of the piston rod, the pixels in the grayscale image can be divided into four categories of pixels: normal reflective pixels, defective reflective pixels, normal non-reflective pixels, and defective non-reflective pixels, according to whether the pixels are reflective pixels or defective pixels.

[0090] When directly using the grayscale threshold to treat pixels with lower grayscale values ​​in the grayscale image as defective pixels in the grayscale image of the threaded portion of the piston rod, reflective defective pixels in the grayscale image may be mistaken for reflective normal pixels.

[0091] In the technical solution provided in the embodiment of the present application, whether a pixel point in a grayscale image is a defective pixel point is obtained by comparing the pixel point with other pixel points in the target curve in which 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 as a reference for determining whether the pixel point is a defective pixel point. Therefore, the defective pixel point in the piston rod can be determined more accurately.

[0092] In one embodiment, 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 may be output; the prompt message is used to indicate that there is a defect in the threaded portion of the electric cylinder piston rod.

[0093] The preset area threshold may be determined based on the total area of ​​the threaded portion. For example, the preset area threshold may be equal to 10% to 15% of the total area of ​​the threaded portion of the piston rod.

[0094] When the defect area is larger than the preset area threshold, a prompt message is output, which can facilitate supervisors or other electronic equipment to deal with the abnormal piston rod in time and avoid the use of piston rods with defects in the threaded part.

[0095] It should be understood that the features of some embodiments of the various applications described herein may be combined with each other unless specifically stated otherwise.

[0096] 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. Rather, these terms are used only to distinguish one component, part, region, layer, or section from another component, part, region, layer, or section. Therefore, without departing from the teachings of the examples described herein, a first component, part, region, layer, or section mentioned in the examples may also be referred to as a second component, part, region, layer, or section.

[0097] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include at least one of such features. In this description, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0098] Furthermore, 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. Rather, the use of the word exemplary is intended to present concepts in a concrete manner. As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or."

[0099] 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 accompanying drawings. With particular regard to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise indicated, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific functions of the described components, even if not structurally equivalent to the disclosed structures.

[0100] Additionally, while particular features of the present application may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations as may be desired and advantageous for any given or particular application.

[0101] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein, and the description and examples are to be considered merely as exemplary.

[0102] It will be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

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 distances between adjacent local grayscale maximum points in the same pixel row in the grayscale image as the characteristic value of the pixel row; Comparing 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 a target pixel row, a non-reflective pixel point is determined from the target pixel row based on the average grayscale change rate of the edge line where the local grayscale maximum point closest to the pixel point is located; the non-reflective pixel point is determined in the following manner: Determine the probability value of pixels in the target pixel row being non-reflective pixels, and define pixels with probability values ​​greater than a preset probability threshold as non-reflective pixels; Probability value , norm is the normalization function, exp is the exponential function with the natural constant as the base, is the average grayscale value of the local grayscale 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; Performing a connected domain analysis on the non-reflective pixels to obtain multiple connected domains, and determining the boundary curves of the connected domains to determine the target curve passing through the target pixel 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 portion of the electric cylinder piston rod based on 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 target curve passing through the target pixel is determined as follows: 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 a reference curve passing through the target pixel point is determined based on the reference curve of the target pixel point; the target curve coincides with the reference curve after horizontal movement.

3. The method for detecting surface defects of an electric cylinder piston rod according to claim 1, characterized in that: 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 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 multiple image blocks, and the parts of the translated curve that intersect the image block where the target pixel point is located are used as the target curve of the target pixel point.

4. The method for detecting surface defects of an electric cylinder piston rod according to claim 3, characterized in that: The grayscale image is divided into multiple image blocks to obtain multiple image blocks, including: The grayscale image is divided into blocks using a non-equidistant partitioning method to obtain multiple image blocks.

5. 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: If 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 regarded as a candidate maximum 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.

6. The method for detecting surface defects of an electric cylinder piston rod according to claim 1, characterized in that: Compare the eigenvalues ​​of different pixel rows in the grayscale image to obtain the target pixel row in the grayscale image, including: The average value of the eigenvalues ​​of different pixel rows in the grayscale image is used as the first coefficient, and the standard deviation of the eigenvalues ​​of different pixel rows in the grayscale image is used as the second coefficient; A target threshold is determined according to the first coefficient and the second coefficient, so that a 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.

7. The method for detecting surface defects of an electric cylinder piston rod according to claim 6, 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.

8. The method for detecting surface defects of an electric cylinder piston rod 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 part in the grayscale image.

9. The method for detecting surface defects of an electric cylinder piston rod according to claim 1, wherein: 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 indicate that there is a defect in the threaded portion of the electric cylinder piston rod.

Citation Information

Patent Citations

  • Connector pin automatic detection method based on machine vision

    CN118781115A

  • Cable defect detection method and system based on image processing

    CN119295466A