A method for detecting surface defects of engine cylinder liner
By analyzing the grayscale image of the cylinder liner surface, image segmentation and skeleton extraction algorithms are used to calculate the significance coefficient and tilt consistency coefficient of the vibration texture. Combined with image enhancement and threshold segmentation, the problem of low detection accuracy of vibration defects on the cylinder liner surface is solved, and the detection effect is improved.
Patent Information
- Application Number
- CN202411230798.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-09-04
AI Technical Summary
Existing machine vision methods for detecting surface vibration defects in cylinder liners have low accuracy, which makes diesel engines prone to malfunctions during operation.
By acquiring grayscale images of the cylinder liner surface, image segmentation and skeleton extraction algorithms are used to analyze the grayscale change curves and centroid coordinates, calculate the significance coefficient and tilt consistency coefficient of the vibration texture, and combine image enhancement and threshold segmentation algorithms to accurately detect vibration defects on the cylinder liner surface.
This improves the accuracy of cylinder liner surface vibration defect detection, enhances the detection effect, and ensures the normal operation of diesel engines.
Smart Images

Figure CN118735924B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method for detecting surface defects of an engine cylinder liner. Background Art
[0002] With the advancement of science and technology and the development of the economy, people have higher and higher requirements for the quality of diesel engines and the accessories of diesel engines. Among them, the quality of cylinder liners, as important accessories in diesel engines, is closely related to the overall performance of diesel engines. During the processing and production of cylinder liners, due to the influence of many factors, chatter defects will occur on the surface of the cylinder liners, resulting in unqualified cylinder liners. If unqualified cylinder liners are used in diesel engines, it will cause the diesel engine to malfunction during operation. The chatter marks on the surface of the cylinder liner are usually periodic stripes on the horizontal surface of the product. They are relatively slight on the surface of the cylinder liner, and the lines are not clear and difficult to observe. The effect of detecting chatter defects through traditional machine vision is poor and the accuracy is low, which causes the engine to malfunction in subsequent work. Summary of the invention
[0003] In order to solve the above technical problems, the purpose of the present invention is to provide a method for detecting surface defects of engine cylinder liners, so as to solve the problem that the detection accuracy of existing machine vision detection of cylinder liner surface chatter defects is low. The technical solutions adopted are as follows:
[0004] Based on a method for detecting surface defects of an engine cylinder liner, the method comprises the following steps:
[0005] Acquire a grayscale image of the cylinder liner surface, and use an image segmentation algorithm to acquire a cylinder liner region on the grayscale image;
[0006] Acquire a pixel column in the cylinder liner area, acquire a grayscale value sequence of the pixel column based on the grayscale values of the pixel points in the pixel column, and acquire a grayscale change curve of the grayscale value sequence;
[0007] The two wide median line segments of the minimum circumscribed rectangle of the grayscale change curve are recorded as the first line segment, the area enclosed by the first line segment and the grayscale change curve is recorded as the closed area, and the area change vector is obtained according to the area of the closed area;
[0008] Draw a perpendicular line of the first line segment through the centroid coordinates of the closed areas in sequence, and set the intersection of the perpendicular line and the first line segment as the first intersection. When the ordinate of the centroid coordinate is greater than the ordinate of the first intersection, record the sequence number of the closed area in all closed areas as the first sequence number, and record the element at the first sequence number position as the number 1; when the ordinate of the centroid coordinate is less than the ordinate of the first intersection, record the element at the first sequence number position as the number -1; when the ordinate of the centroid coordinate is equal to the ordinate of the first intersection, record the element of the first sequence number as the number 0; obtain the elements of the first sequence number corresponding to the centroid coordinates of all closed areas, and obtain the difference sequence according to the elements of the first sequence number corresponding to the centroid coordinates; obtain the standard sequence, and obtain the vibration texture significance coefficient according to the average discrete degree of the elements in the area change vector and the similarity between the difference sequence and the standard sequence;
[0009] Obtain a significant pixel column of chatter texture features according to the value of the chatter texture significant coefficient, and obtain a significant region of chatter texture features according to whether the significant pixel columns of chatter texture features are adjacent and continuous;
[0010] Use image segmentation algorithm combined with skeleton extraction algorithm to obtain the skeleton of the significant area of vibration texture features;
[0011] Get the line segment inclination based on the position between the endpoints of the skeleton;
[0012] Based on the proportion of the line segment inclination of the skeleton in the average line segment inclination of its adjacent skeletons, the inclination consistency coefficient is obtained, and the vibration mark feature prominent area is obtained according to the inclination consistency coefficient. The vibration mark feature prominent area is enhanced using an image enhancement algorithm, and the threshold segmentation algorithm is used to obtain the defect area from the enhanced grayscale image.
[0013] Further, the grayscale image of the cylinder liner surface is obtained, and the cylinder liner area is obtained by using an image segmentation algorithm on the grayscale image, including the following specific methods:
[0014] A charge coupled device camera is used to obtain an RGB image of the cylinder liner surface, the RGB image is grayed to obtain a gray image of the cylinder liner surface, and an image segmentation algorithm is used to obtain a cylinder liner area from the gray image.
[0015] Further, the method of acquiring the pixel column in the cylinder liner area, acquiring the grayscale value sequence of the pixel column based on the grayscale value of the pixel point in the pixel column, and acquiring the grayscale change curve of the grayscale value sequence includes the following specific methods:
[0016] Dividing the pixels in the cylinder liner region into columns, and treating the pixels in each column as a pixel column;
[0017] Sort the grayscale values of all the pixels in the pixel column from top to bottom according to the positions of the pixels to obtain a grayscale value sequence;
[0018] Constructing a grayscale change curve with a grayscale value sequence, wherein the abscissa of the grayscale change curve is the sequence number of the element in the grayscale value sequence, and the ordinate is the grayscale value of the data point;
[0019] Furthermore, the specific method of obtaining the area change vector according to the area of the closed area is as follows:
[0020] Sort the areas of all closed regions from small to large according to the size of the horizontal coordinates in the centroid coordinates, and obtain the area change vector.
[0021] Further, the specific method of obtaining the difference sequence according to the element of the first sequence number corresponding to the centroid coordinates is as follows:
[0022] Arrange the elements of the first sequence number corresponding to the centroid coordinates in ascending order according to the horizontal coordinates of the centroid of the closed area to obtain a difference sequence.
[0023] Furthermore, the specific method for obtaining the significant coefficient of the chatter texture is:
[0024] Obtain the cosine similarity between the difference sequence and the standard sequence;
[0025] The variance of the elements in the area change vector is recorded as the first variance;
[0026] Recording the sum of the first variance and the first preset constant as a first sum value;
[0027] The product of the first sum and the cosine similarity is recorded as the chatter texture feature significance coefficient.
[0028] Further, the method of obtaining a significant pixel column of chattering texture features according to the value of the chattering texture significant coefficient, and obtaining a significant region of chattering texture features according to the adjacent and continuous significant pixel columns of chattering texture features, includes the following specific methods:
[0029] Obtaining a significant coefficient of a chattering texture of a pixel column, recording a difference between a first preset constant and a first preset threshold as a first difference, and recording a sum of the first preset constant and the first preset threshold as a second sum;
[0030] The interval with the second sum as the upper limit and the first difference as the lower limit is recorded as the first interval;
[0031] Record the pixel column in the first interval of the significant coefficient of the chattering texture as the significant pixel column of chattering texture feature;
[0032] The number of consecutive adjacent significant pixel columns of chatter texture features is recorded as the first column number;
[0033] The region consisting of chattering texture feature-significant pixel columns whose first column number is greater than a second preset threshold is recorded as a chattering texture feature-significant region.
[0034] Furthermore, the specific method of obtaining the skeleton of the region with significant vibration texture features includes:
[0035] An image segmentation algorithm is used to process the region with significant chatter texture features to obtain a suspected chatter region in the region with significant chatter texture features, and a skeleton extraction algorithm is used to obtain a skeleton of the suspected chatter region.
[0036] Further, the obtaining of the line segment inclination includes the following specific methods:
[0037] The line segment connecting the pixels at both ends of the skeleton is recorded as the first line segment;
[0038] The endpoint with the largest ordinate value on the first line segment is recorded as the first endpoint, and the endpoint with the smallest ordinate value is recorded as the second endpoint;
[0039] Draw a vertical ray through the first endpoint and a horizontal ray through the second endpoint, and record the intersection of the vertical ray and the horizontal ray as the second intersection point;
[0040] The line segment connecting the first endpoint and the second intersection point is recorded as the second line segment, and the line segment connecting the second endpoint and the second intersection point is recorded as the third line segment;
[0041] Recording the sum of the length of the third line segment and the first preset constant as a third sum;
[0042] The ratio of the length of the second line segment to the third sum is recorded as the line segment inclination of the first line segment.
[0043] Furthermore, the specific method for obtaining the tilt consistency coefficient is:
[0044] For each skeleton, the mean of the segment inclinations of the corresponding line segments of the previous adjacent skeleton and the next adjacent skeleton of the skeleton is calculated as the first mean, the ratio of the segment inclinations of the corresponding line segments of the skeleton to the first mean is calculated as the first ratio, and the sum of all the first ratios is taken as the inclination consistency coefficient.
[0045] The beneficial effects of the present invention are as follows: the present invention analyzes the chattering defects on the surface of the cylinder barrel. Chattering usually appears as horizontal periodic stripes in the image, and the grayscale value in the vertical direction shows periodic changes. Based on the above characteristics, the present invention constructs the chattering texture feature significance to obtain the area where the grayscale value change is close to the chattering texture change, and then analyzes the degree of conformity to the positional relationship between the chattering textures in the area, constructs the tilt consistency coefficient, and obtains the area where the chattering features are significant. Image enhancement is performed on the area with significant chattering features, so that the subsequent detection accuracy of chattering defects in the image is higher, which solves the problem of low detection accuracy of chattering defects on the surface of the cylinder sleeve and enhances the detection effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 A schematic flow chart of a method for detecting surface defects of an engine cylinder liner provided by an embodiment of the present invention;
[0048] Figure 2 It is the grayscale change curve;
[0049] Figure 3 A schematic diagram of the enclosed area. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] See also Figure 1 , which shows a flow chart of a method for detecting surface defects of an engine cylinder liner provided by an embodiment of the present invention, the method comprising the following steps:
[0052] Step S001, obtaining a grayscale image of the cylinder liner surface, and using a graph cut algorithm to obtain a cylinder liner region on the grayscale image.
[0053] In this embodiment, a charge coupled device camera is used to collect the surface image of the cylinder liner, and the surface image of the cylinder liner is an RGB image. In this embodiment, the cylinder liner of the original Changchai L32 Kaishan is tested. The cylinder liner has high requirements for dimensional accuracy, and the accuracy is accurate to 0.1 mm. In the process of image processing, the accuracy of the image must be guaranteed while reducing the interference of noise. In this embodiment, a bilateral filtering algorithm is used to denoise the surface image of the cylinder liner, while retaining the boundary information of the cylinder liner, removing the influence of noise. The implementer can also select other denoising methods for image preprocessing according to actual conditions.
[0054] In order to analyze the chatter mark feature information on the cylinder liner surface image, the cylinder liner surface image is processed using the Gamma correction grayscale method to obtain a grayscale image of the cylinder liner surface, which is recorded as image F. The implementation process of the bilateral filtering method and the Gamma correction grayscale method is prior art and is not within the scope of protection of the present invention, and will not be elaborated here.
[0055] The cylinder liner region in the image is extracted by using the GrabCut graph cutting algorithm, wherein the GrabCut graph cutting algorithm is a well-known technology and will not be described in detail.
[0056] At this point, the cylinder liner area in image F is obtained.
[0057] Step S002, obtaining a gray value sequence of the cylinder liner area, obtaining a gray value change curve of the gray value sequence, obtaining a closed area on the gray value change curve, obtaining a difference sequence according to the centroid coordinates of the closed area, and thereby obtaining a significant coefficient of chattering texture.
[0058] Specifically, since the vibration lines are horizontal periodic stripes, the grayscale value in the vertical direction shows periodic changes. The pixels in the cylinder liner area are divided into pixel columns. The number of pixel columns obtained is , set Pixel columns . For pixel columns Analyze the pixels on the The grayscale values of the pixels on the y are arranged in a grayscale value sequence from top to bottom according to the positions of the corresponding pixels. The gray value sequence on is , Pixel Column The number of pixels contained in Pixel Column Middle The gray value of the pixel, .
[0059] Since the turning vibration marks on the cylinder liner surface are usually evenly spaced and light and dark alternate, the grayscale values of the pixels in the pixel column show a certain fluctuation pattern. The elements in construct the grayscale change curve, and the horizontal axis of the grayscale change curve is the grayscale value sequence The vertical axis is the pixel column. If the gray value of the pixel in the pixel column meets the characteristics of the turning chatter defect, the gray value change curve constructed by the pixel points in the pixel column will show a curve with a changing rule.
[0060] Furthermore, if the pixel values in the pixel column satisfy the defect of turning chatter marks, the corresponding grayscale change curve presents a regular wave shape, such as Figure 2 Get the minimum circumscribed rectangle of the grayscale change curve, connect the midpoints of the two widths of the minimum circumscribed rectangle of the grayscale change curve, and set the connecting line of the two midpoints as the line segment , the line segment The closed area intersecting with the grayscale change curve is recorded as the first closed area. The area of the first closed region formed is recorded as , and similarly obtain ,in, Grayscale change curve and line segment The composition of The area of the first closed region, where .like Figure 3 shown.
[0061] Get area change vector , the area change vector is If the grayscale values of the pixels in the pixel column satisfy the variation of the turning chatter defect, the values of the elements in the corresponding area variation vector vary little.
[0062] Furthermore, the closed areas on the polyline are distributed on the line segments. The upper and lower sides of the first closed area, taking the first closed area as an example, the first closed area is numbered 1, and the centroid coordinates of the first closed area are , draw a line segment through the centroid of the closed area The perpendicular line of the line segment The coordinates of the intersection point on are , compare the centroid and the perpendicular line through the centroid on the line segment The vertical coordinate value of the intersection point on the line segment is calculated based on the centroid and the perpendicular line through the centroid. The difference between the vertical axis coordinates of the intersection points on the y-axis constructs a difference sequence to reflect the changes in the corresponding broken lines.
[0063] Get difference sequence , where the construction rule of the difference sequence is: when the vertical axis coordinate value of the centroid is equal to the line segment When the difference in the vertical coordinates of the intersection points on is greater than 0, the element corresponding to the sequence number of the first closed area corresponding to the centroid is recorded as ; When the vertical axis coordinate value of the center of mass is on the line segment When the difference in the vertical coordinates of the intersection points on is less than 0, the element corresponding to the sequence number of the first closed area corresponding to the centroid is recorded as a number ; When the vertical axis coordinate of the center of mass is on the line segment The difference in the vertical coordinates of the intersection points on the When , the element at the serial position of the first closed area corresponding to the centroid is recorded as a number .
[0064] If the change characteristics of the pixel column meet the characteristics of the vibration pattern in the image, then the grayscale change curve of the pixel column corresponds to the difference sequence of the digital and numbers Alternating sequence.
[0065] Specifically, the centroid coordinates of all the first closed areas are traversed, and the elements in the difference sequence are obtained according to the above difference sequence construction rules to obtain the difference sequence of the grayscale change curve. .
[0066] Setting Standard Sequence , calculate the cosine similarity between the difference sequence and the standard sequence, where the length of the standard sequence is consistent with the length of the corresponding interpolation sequence.
[0067] Furthermore, let the cosine similarity between the difference sequence and the standard sequence be If the elements in the difference sequence are alternating between the numbers 1 and -1, then the difference sequence and the standard sequence The cosine similarity value is 1 or -1. When the cosine similarity value is 1, the difference sequence is similar to the standard sequence. The alternation between the numbers 1 and -1 in the elements between them is consistent; when the value of the cosine similarity is -1, the difference sequence is consistent with the standard sequence The alternation between the numbers 1 and -1 in the elements between are completely opposite, and both cases conform to the changing rules of the turning vibration marks in image F.
[0068] Get the vibration texture saliency coefficient , the formula is: ;in, is the vibration texture significance coefficient, The difference sequence and standard sequence of the grayscale change curve corresponding to the pixel column The cosine similarity between ; is the area change vector The variance of all elements contained in .
[0069] It should be noted that cosine similarity It reflects the similarity of the texture change trend in the pixel column. If the texture change trend in the pixel column is closer to the texture change trend of the vibration pattern on the cylinder barrel, the cosine similarity The closer the value is to 1 or -1, the square of the cosine similarity The closer the value is to 1; if the texture of the area composed of the pixels in the pixel column meets the texture characteristics of the vibration pattern, the corresponding variance The closer the value is to 0.
[0070] Furthermore, we set the threshold , with a value of 0.5, and the vibration texture significant coefficient In the interval The pixel columns in are recorded as pixel columns with significant vibration texture features, and all pixel columns in image F are traversed to complete the marking of pixel columns with significant vibration texture features in image F.
[0071] Furthermore, according to the characteristics of the vibration pattern in the image, it usually does not appear in only a single pixel column. , with a value of 5, will be continuous The region consisting of adjacent rows of significant pixels of chattering texture features is regarded as the chattering texture feature significant region.
[0072] At this point, the significant region of the vibration texture feature is obtained.
[0073] Step S003, obtaining a vibration texture feature-significant region according to the vibration texture-significant coefficient, obtaining a suspected vibration region of the vibration texture feature-significant region, obtaining a skeleton of the suspected vibration region, obtaining a tilt consistency coefficient, and obtaining a vibration feature-significant region according to the tilt consistency coefficient.
[0074] Specifically, vibration marks usually appear as continuous thin lines parallel to each other in the image. The region growing algorithm is used to obtain the suspected vibration mark area in the region with significant vibration mark texture features. The rules of the region growing algorithm are as follows: 10 pixel points are randomly selected as starting points from the region with significant vibration mark texture features. The growth criterion is that the absolute value of the grayscale value difference between the next growing point and the current growing point is less than the threshold 3, and the suspected vibration mark area in the region with significant vibration mark texture features is obtained.
[0075] Furthermore, the K3M skeleton extraction algorithm is used to extract the skeleton of the suspected vibration mark area. From top to bottom, the first skeleton is selected, and the pixel points at both ends of the skeleton are connected. The line segment obtained after the connection is set as , and so on, traverse all skeletons, obtain the line segments connecting the pixels at both ends of all skeletons, and set the number of skeletons to .
[0076] Specifically, line segment For example, get the line segment The two endpoints of the vertical axis are marked as , the endpoint with the smaller vertical coordinate value is recorded as From the endpoint Start by drawing a vertical ray from the endpoint Start by drawing a horizontal ray and record the intersection of the two rays as , point and The length of the connected line segment is recorded as ,point and The length of the connected line segment is recorded as , let the slope of the line segment , the formula is: ; In the formula, is the slope of the line segment, For point and The length of the connected line segment, For point and The length of the connected line segment. The number 1 is the parameter adjustment factor to prevent the denominator from being zero and causing the line segment to have no inclination.
[0077] Specifically, the line segment inclination reflects the degree of inclination of the line segment. The greater the degree of inclination of the line segment, the greater the obtained line segment inclination.
[0078] Further, the line segment inclinations of all the skeleton corresponding line segments are obtained, and the first Line segments The slope of the line segment is recorded as ,in, , get the tilt change vector .
[0079] Obtaining the Tilt Consistency Coefficient , the formula is: ; In the formula, is the tilt consistency coefficient, For the The segment inclination of the line segment corresponding to the skeleton, For the The segment inclination of the line segment corresponding to the skeleton, For the The segment inclination of each skeleton corresponding to the segment.
[0080] It should be noted that the higher the parallelism between the skeletons in the region with significant vibration texture features, the closer the average inclination of the line segment connecting the two end points of the skeleton to the inclination of the line segment connecting the two ends of the adjacent skeletons is to 1, and the corresponding inclination consistency coefficient is closer to 1.
[0081] Furthermore, we set the threshold , with a value of 0.3, will tilt the consistency coefficient In the interval The region with significant chattering texture features within is marked as the region with significant chattering features.
[0082] At this point, the significant area of chatter mark features is obtained.
[0083] Step S004: Use an image enhancement algorithm to enhance the region with significant vibration mark features, use a threshold segmentation algorithm to obtain the defect region of the enhanced grayscale image, and complete the defect detection on the cylinder liner surface.
[0084] Specifically, histogram equalization is used to perform image enhancement on the region with significant chattering features, so that the contrast of the region with significant chattering features in the image F is higher, thereby improving the detection accuracy of chattering defects.
[0085] The maximum inter-class variance method is used to obtain the optimal segmentation threshold for the enhanced image F. The area composed of pixels with grayscale values greater than the optimal segmentation threshold is recorded as the foreground area, and the other areas are recorded as the background area. The inter-class variance between the foreground area and the background area is obtained.
[0086] Set threshold , the value is 49, if the between-class variance is greater than the threshold , then the foreground area is recorded as the chatter defect area; if the inter-class variance is less than or equal to the threshold , then there is no chatter defect area in image F.
[0087] At this point, the detection of chatter marks on the cylinder surface is completed.
[0088] It should be noted that the above-mentioned sequence of the embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. In some cases, the actions or steps recorded in the embodiments of the present invention can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0089] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting surface defects of an engine cylinder liner, characterized in that: The method comprises the following steps: Acquire a grayscale image of the surface of the cylinder liner, and use an image segmentation algorithm to acquire a cylinder liner region on the grayscale image; Acquire a pixel column in the cylinder liner area, acquire a grayscale value sequence of the pixel column based on the grayscale values of the pixel points in the pixel column, and acquire a grayscale change curve of the grayscale value sequence; The two wide median line segments of the minimum circumscribed rectangle of the grayscale change curve are recorded as the first line segment, the area enclosed by the first line segment and the grayscale change curve is recorded as the closed area, and the area change vector is obtained according to the area of the closed area; Draw a perpendicular line of the first line segment through the centroid coordinates of the closed areas in sequence, and set the intersection of the perpendicular line and the first line segment as the first intersection. When the ordinate of the centroid coordinate is greater than the ordinate of the first intersection, record the sequence number of the closed area in all closed areas as the first sequence number, and record the element at the first sequence number position as the number 1; when the ordinate of the centroid coordinate is less than the ordinate of the first intersection, record the element at the first sequence number position as the number -1; when the ordinate of the centroid coordinate is equal to the ordinate of the first intersection, record the element of the first sequence number as the number 0; obtain the elements of the first sequence number corresponding to the centroid coordinates of all closed areas, and obtain the difference sequence according to the elements of the first sequence number corresponding to the centroid coordinates; obtain the standard sequence, and obtain the vibration texture significance coefficient according to the average discrete degree of the elements in the area change vector and the similarity between the difference sequence and the standard sequence; Obtain a significant pixel column of chatter texture features according to the value of the chatter texture significant coefficient, and obtain a significant region of chatter texture features according to whether the significant pixel columns of chatter texture features are adjacent and continuous; Use image segmentation algorithm combined with skeleton extraction algorithm to obtain the skeleton of the significant area of vibration texture features; Get the line segment inclination based on the position between the endpoints of the skeleton; Based on the proportion of the line segment inclination of the skeleton in the average of the line segment inclinations of its adjacent skeletons, a tilt consistency coefficient is obtained, and a significant region of chattering features is obtained according to the tilt consistency coefficient, and the significant region of chattering features is enhanced using an image enhancement algorithm, and a threshold segmentation algorithm is used on the enhanced grayscale image to obtain a defect region; The specific method for obtaining the significant coefficient of the chatter texture is: Obtain the cosine similarity between the difference sequence and the standard sequence; The variance of the elements in the area change vector is recorded as the first variance; Recording the sum of the first variance and the first preset constant as a first sum value; The product of the first sum and the cosine similarity is recorded as a significant coefficient of the chatter texture feature; The method of obtaining a significant pixel column of chattering texture features according to the value of the chattering texture significant coefficient, and obtaining a significant region of chattering texture features according to the adjacent and continuous situation of the significant pixel columns of chattering texture features includes the following specific methods: Obtaining a significant coefficient of a chattering texture of a pixel column, recording a difference between a first preset constant and a first preset threshold as a first difference, and recording a sum of the first preset constant and the first preset threshold as a second sum; The interval with the second sum as the upper limit and the first difference as the lower limit is recorded as the first interval; Record the pixel column in the first interval of the significant coefficient of the chattering texture as the significant pixel column of chattering texture feature; The number of consecutive adjacent significant pixel columns of chatter texture features is recorded as the first column number; Recording a region composed of significant pixel columns of chattering texture features whose first column number is greater than a second preset threshold as a chattering texture feature significant region; The specific method for obtaining the tilt consistency coefficient is: For each skeleton, the mean of the segment inclinations of the corresponding line segments of the previous adjacent skeleton and the next adjacent skeleton of the skeleton is calculated as the first mean, the ratio of the segment inclinations of the corresponding line segments of the skeleton to the first mean is calculated as the first ratio, and the sum of all the first ratios is taken as the inclination consistency coefficient.
2. The method for detecting surface defects of an engine cylinder liner according to claim 1, characterized in that: The grayscale image of the cylinder liner surface is obtained, and the cylinder liner region is obtained by using an image segmentation algorithm on the grayscale image, including the following specific methods: A charge coupled device camera is used to obtain an RGB image of the cylinder liner surface, the RGB image is grayed to obtain a gray image of the cylinder liner surface, and an image segmentation algorithm is used to obtain a cylinder liner area from the gray image.
3. The method for detecting surface defects of an engine cylinder liner according to claim 1, characterized in that: The method of obtaining a pixel column in the cylinder liner region, obtaining a grayscale value sequence of the pixel column based on the grayscale value of the pixel point in the pixel column, and obtaining a grayscale change curve of the grayscale value sequence includes: Dividing the pixels in the cylinder liner region into columns, and treating the pixels in each column as a pixel column; Sort the grayscale values of all pixels included in the pixel column in order from top to bottom according to the positions of the pixels to obtain a grayscale value sequence; A grayscale change curve is constructed using a grayscale value sequence, wherein the abscissa of the grayscale change curve is the sequence number of the element in the grayscale value sequence, and the ordinate is the grayscale value of the data point.
4. The method for detecting surface defects of an engine cylinder liner according to claim 1, characterized in that: The specific method of obtaining the area change vector according to the area of the closed area includes: Sort the areas of all closed regions from small to large according to the size of the horizontal coordinates in the centroid coordinates, and obtain the area change vector.
5. The method for detecting surface defects of an engine cylinder liner according to claim 1, characterized in that: The specific method of obtaining the difference sequence according to the element of the first sequence number corresponding to the centroid coordinates is as follows: Arrange the elements of the first sequence number corresponding to the centroid coordinates in ascending order according to the horizontal coordinates of the centroid of the closed area to obtain a difference sequence.
6. The method for detecting surface defects of an engine cylinder liner according to claim 1, characterized in that: The specific method of obtaining the skeleton of the region with significant vibration texture features includes: An image segmentation algorithm is used to process the region with significant chatter texture features to obtain a suspected chatter region in the region with significant chatter texture features, and a skeleton extraction algorithm is used to obtain a skeleton of the suspected chatter region.
7. The method for detecting surface defects of an engine cylinder liner according to claim 1, characterized in that: The specific method of obtaining the slope of the line segment includes: The line segment connecting the pixels at both ends of the skeleton is recorded as the first line segment; The endpoint with the largest ordinate value on the first line segment is recorded as the first endpoint, and the endpoint with the smallest ordinate value is recorded as the second endpoint; Draw a vertical ray through the first endpoint and a horizontal ray through the second endpoint, and record the intersection of the vertical ray and the horizontal ray as the second intersection point; The line segment connecting the first endpoint and the second intersection point is recorded as the second line segment, and the line segment connecting the second endpoint and the second intersection point is recorded as the third line segment; Recording the sum of the length of the third line segment and the first preset constant as a third sum; The ratio of the length of the second line segment to the third sum is recorded as the line segment inclination of the first line segment.
Citation Information
Cited By
Air cylinder air hole defect detection system and method based on positioning and matching fusion
CN122415584A
