Cable strand production monitoring method and system based on machine vision

Through machine vision technology, combined with brightness factors, grayscale distribution factors, K-means clustering algorithms, and edge segmentation analysis, the problem of low accuracy in gap area segmentation in stranded wire production is solved, and the accuracy of cable stranded wire production monitoring is improved.

CN118521578BActive Publication Date: 2024-09-20西部电缆陕西有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410976972.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-09-20
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

The gap area segmentation accuracy in existing stranded wire production is poor, resulting in low accuracy in cable stranded wire production monitoring. This is mainly due to the small grayscale difference between the texture area and the gap area, resulting in frequent misjudgments.

Method used

Using a method based on machine vision, the candidate gap area is extracted by acquiring the surface image of the cable strands, calculating the target brightness factor and grayscale distribution factor, combined with the K-means clustering algorithm to screen the target gap area, and determining it through edge segmentation and chain code analysis. The reasonableness of the gap is monitored.

Benefits of technology

It improves the accuracy of gap area segmentation and the accuracy of cable stranded production monitoring, ensuring the objectivity and accuracy of gap rationality detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521578B
    Figure CN118521578B
Patent Text Reader

Abstract

The present invention relates to the field of image data processing technology, and in particular to a cable strand production monitoring method and system based on machine vision, the method comprising: obtaining a target surface image corresponding to a cable strand to be detected, extracting a connected domain from a cable strand region in the target surface image; determining a target brightness factor corresponding to each candidate gap region; performing grayscale distribution analysis processing on each candidate gap region; screening out target gap regions; segmenting the edge of each target gap region, and determining the target gap rationality corresponding to each target gap region; and performing production monitoring on the cable strand to be detected according to the target gap rationality corresponding to each target gap region. The present invention realizes the segmentation of gap regions by performing image data processing on the target surface image, thereby realizing production detection of cable strands, and improving the accuracy of gap region segmentation and the accuracy of cable strand production monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to a cable strand production monitoring method and system based on machine vision. Background Art

[0002] The production process of cable strands includes multiple processes such as stranding, insulation, cabling, shielding, armoring and sheathing. The stranding process refers to twisting multiple stranded conductor units together to increase the flexibility and durability of the cable. Individual conductors may break easily during bending or use, while the twisted structure can evenly distribute stress and improve the durability and service life of the cable. The existing stranding method often uses a stranding machine to rotate and wrap multiple layers of stranded units around a central stranded unit. Since each stranded unit may have morphological differences, the gaps between the stranded units in the twisted cable strands may be uneven, which may lead to uneven stress distribution of the cable strands, thereby affecting the performance and service life of the cable strands. Therefore, it is of great significance to monitor the rationality of the gaps of the cable strands after the twisting process is completed. Therefore, it is often necessary to segment the gap area from the surface image of the cable strands to analyze the rationality of the gap. At present, when performing regional segmentation, the method usually used is to achieve regional segmentation according to different grayscale values.

[0003] However, when segmenting the gap area from the cable strand surface image based on the grayscale value, the following technical problems often occur:

[0004] Since the grayscale difference between the texture area and the gap area on the cable strands is often not large, if only the difference in grayscale values ​​is considered when segmenting the gap area from the surface image of the cable strands, it may often lead to misjudgment of the gap pixels, resulting in poor accuracy in gap area segmentation, and further poor accuracy in cable strand production monitoring. Summary of the invention

[0005] In order to solve the technical problem that the accuracy of cable strand production monitoring is poor due to the poor accuracy of gap area segmentation, the present invention proposes a cable strand production monitoring method and system based on machine vision.

[0006] In a first aspect, the present invention provides a cable strand production monitoring method based on machine vision, the method comprising:

[0007] Acquire a target surface image corresponding to the cable strands to be detected, and extract a connected domain from the cable strand region in the target surface image as a candidate gap region;

[0008] Determine the target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area;

[0009] Perform grayscale distribution analysis on each candidate gap area to obtain a grayscale distribution factor corresponding to each candidate gap area;

[0010] According to the target brightness factor and grayscale distribution factor corresponding to the candidate gap area, the target gap area is screened out from all the candidate gap areas;

[0011] The edge of each target gap region is segmented to obtain two sub-edges corresponding to each target gap region, and the rationality of the target gap corresponding to each target gap region is determined according to the area of ​​each target gap region and the difference in chain code values ​​between the two sub-edges corresponding to each target gap region;

[0012] According to the target gap rationality corresponding to each target gap area, production monitoring is performed on the cable strands to be detected.

[0013] In combination with the first aspect, in a possible implementation, determining the target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area includes:

[0014] The mean of the grayscale values ​​corresponding to all pixels in each candidate gap area is determined as the target brightness factor corresponding to each candidate gap area.

[0015] In combination with the first aspect above, in a possible implementation manner, performing grayscale distribution analysis processing on each candidate gap region to obtain a grayscale distribution factor corresponding to each candidate gap region includes:

[0016] Determine any candidate gap area as a marked area, and determine the difference between the grayscale value corresponding to each pixel in the marked area and the marked representative grayscale as the target grayscale difference corresponding to each pixel in the marked area, wherein the marked representative grayscale is the average of the grayscale values ​​corresponding to all pixels in the marked area;

[0017] The mean value of the target grayscale differences corresponding to all the pixels in the marked area is determined as the grayscale distribution factor corresponding to the marked area.

[0018] In combination with the first aspect, in a possible implementation manner, screening out a target gap region from all candidate gap regions according to a target brightness factor and a grayscale distribution factor corresponding to the candidate gap region includes:

[0019] Determine the possible gap index corresponding to each candidate gap region according to the target brightness factor and grayscale distribution factor corresponding to each candidate gap region, wherein both the target brightness factor and the grayscale distribution factor are negatively correlated with the possible gap index;

[0020] According to the gap possibility indicators corresponding to all candidate gap areas, all candidate gap areas are clustered into two clusters through the K-means clustering algorithm, and the mean of the gap possibility indicators corresponding to all candidate gap areas in each cluster is determined as the gap representative possibility factor corresponding to each cluster, and each candidate gap area in the cluster with the larger corresponding gap representative possibility factor in the two clusters is determined as the target gap area. In the process of clustering through the K-means clustering algorithm, the absolute value of the difference between the gap possibility indicator corresponding to the unclustered candidate gap area and the gap possibility indicator corresponding to the cluster center is used to characterize the distance between the unclustered candidate gap area and the cluster center.

[0021] In combination with the first aspect above, in a possible implementation manner, segmenting the edge of each target gap area to obtain two sub-edges corresponding to each target gap area includes:

[0022] The two pixels with the farthest distance are selected from the edge of each target gap region as segmentation points, and segmentation is performed using the two segmentation points on the edge of each target gap region to obtain two sub-edges corresponding to each target gap region.

[0023] In combination with the first aspect, in a possible implementation, determining the rationality of the target gap corresponding to each target gap area according to the area of ​​each target gap area and the difference in chain code values ​​between two sub-edges corresponding to each target gap area includes:

[0024] Taking any segmentation point on the edge of each target gap region as the starting point, obtain the edge chain codes corresponding to the two sub-edges corresponding to each target gap region;

[0025] The DTW value between the edge chain codes corresponding to the two sub-edges corresponding to each target gap region is determined as the target chain code difference corresponding to each target gap region, wherein the target chain code difference represents the difference in chain code values ​​between the two sub-edges;

[0026] According to the area corresponding to each target gap region and the target chain code difference, the target gap rationality corresponding to each target gap region is determined, wherein the area corresponding to the target gap region and the target chain code difference are negatively correlated with the target chain code difference.

[0027] In combination with the first aspect above, in a possible implementation, the production monitoring of the cable strands to be detected according to the target gap rationality corresponding to each target gap area includes:

[0028] Perform camera horizontal coordinate field of view distortion error analysis on each target gap area to obtain the lateral distortion error corresponding to each target gap area;

[0029] Perform camera longitudinal coordinate field of view distortion error analysis on each target gap area to obtain the longitudinal distortion error corresponding to each target gap area;

[0030] According to the lateral distortion error and the longitudinal distortion error corresponding to each target gap area, the target distortion error corresponding to each target gap area is determined, wherein the lateral distortion error and the longitudinal distortion error are both positively correlated with the target distortion error;

[0031] According to the target gap rationality and target distortion error corresponding to each target gap area, the target rationality index corresponding to each target gap area is determined, wherein the target gap rationality is positively correlated with the target rationality index, and the target distortion error is negatively correlated with the target rationality index;

[0032] If there is a target gap region where the corresponding target reasonable index is less than the preset reasonable threshold, it is determined that the gap of the cable strand to be tested is unqualified;

[0033] If there is no target gap region where the corresponding target reasonable index is less than the preset reasonable threshold, it is determined that the gap of the cable strands to be detected is qualified.

[0034] In combination with the first aspect above, in a possible implementation manner, a formula corresponding to the lateral distortion error corresponding to the target gap area is:

[0035] ;

[0036] ;

[0037] ;in, is the lateral distortion error corresponding to the target gap area; is the number of pixels in the target gap area; is the serial number of the pixel in the target gap area; is the first Sub-lateral error corresponding to pixels; It is the absolute value function; is the first The vertical coordinate of each pixel point in the target coordinate system; the target coordinate system takes the center point of the target surface image as the origin, the long side parallel to the cable strand area as the horizontal axis, and the straight line perpendicular to the horizontal axis as the vertical axis. It is the maximum value of the ordinate of all pixels in the cable strand area in the target surface image in the target coordinate system; is the first The candidate lateral error corresponding to the pixel points; is the radius of the minimum circumscribed circle corresponding to the cross section of the cable strand to be tested; is the tangent function; is the angle between the first straight line and the second straight line; the first straight line is the The first straight line is the line between the pixel point and its corresponding camera; the second straight line is the line between the center point of the target surface image and its corresponding camera.

[0038] In combination with the first aspect above, in a possible implementation manner, a formula corresponding to the longitudinal distortion error corresponding to the target gap area is:

[0039] ;

[0040] ;in, is the longitudinal distortion error corresponding to the target gap area; is the number of pixels in the target gap area; is the serial number of the pixel in the target gap area; is the first Candidate longitudinal errors corresponding to pixels; It is the absolute value function; is the first The target coordinate system is the coordinate system with the center point of the target surface image as the origin, the long side parallel to the cable strand area as the horizontal axis, and the straight line perpendicular to the horizontal axis as the vertical axis. It is the maximum value of the horizontal coordinates of all pixels in the cable strand area in the target surface image in the target coordinate system; is the radius of the minimum circumscribed circle corresponding to the cross section of the cable strand to be tested; It is half the width of the minimum bounding rectangle of the cable strand area in the target surface image.

[0041] In a second aspect, the present invention provides a cable strand production monitoring system based on machine vision, the system comprising:

[0042] An acquisition and extraction module is used to acquire a target surface image corresponding to the cable strands to be detected, and extract a connected domain from the cable strand region in the target surface image as a candidate gap region;

[0043] A brightness factor determination module, used to determine a target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area;

[0044] A distribution factor determination module is used to perform grayscale distribution analysis on each candidate gap area to obtain a grayscale distribution factor corresponding to each candidate gap area;

[0045] A region screening module, used for screening out a target gap region from all candidate gap regions according to a target brightness factor and a grayscale distribution factor corresponding to the candidate gap region;

[0046] A rationality determination module is used to segment the edge of each target gap area to obtain two sub-edges corresponding to each target gap area, and determine the target gap rationality corresponding to each target gap area according to the area of ​​each target gap area and the difference in chain code values ​​between the two sub-edges corresponding to each target gap area;

[0047] The production monitoring module is used to perform production monitoring on the cable strands to be detected according to the target gap rationality corresponding to each target gap area.

[0048] In a third aspect, a server is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes the method in the first aspect or any possible implementation of the first aspect.

[0049] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.

[0050] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0051] The present invention has the following beneficial effects:

[0052] The cable strand production monitoring method based on machine vision of the present invention realizes the segmentation of the gap area and the gap rationality detection of the cable strand by processing the image data of the target surface image, solves the technical problem of poor accuracy of cable strand production monitoring due to poor accuracy of gap area segmentation, improves the accuracy of gap area segmentation, thereby improving the accuracy of gap rationality detection of cable strands, and further improves the accuracy of cable strand production monitoring. In actual situations, the grayscale distribution on the texture area of ​​the cable strand is often different from the grayscale distribution on the gap area. For example, the grayscale distribution on the texture area of ​​the cable strand is often relatively chaotic, while the grayscale distribution on the gap area is often relatively uniform. Therefore, compared with the gap area segmentation that only considers the difference in grayscale, the present invention comprehensively considers the target brightness factor that characterizes the overall grayscale of the candidate gap area and the grayscale distribution factor that characterizes the grayscale distribution, thereby improving the accuracy of gap area segmentation. Therefore, the target gap area can better characterize the real gap area. Secondly, the present invention quantifies the target gap rationality corresponding to the target gap area, so as to facilitate the subsequent relatively objective analysis of the gap rationality of the cable strands to be detected, thereby improving the accuracy of production monitoring of the cable strands to be detected. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 It is a flow chart of the cable strand production monitoring method based on machine vision of the present invention;

[0055] Figure 2 It is a schematic diagram of the process of determining the lateral distortion error of the present invention;

[0056] Figure 3 It is a schematic diagram of the structure of the cable strand production monitoring system based on machine vision of the present invention;

[0057] Figure 4 The figure is a schematic diagram of the structure of a computer device of the present invention. DETAILED DESCRIPTION

[0058] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0059] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0060] refer to Figure 1 , shows the process of some embodiments of the cable strand production monitoring method based on machine vision of the present invention. The cable strand production monitoring method based on machine vision includes the following steps:

[0061] Step S1, obtaining a target surface image corresponding to the cable strands to be detected, and extracting a connected domain from the cable strand region in the target surface image as a candidate gap region.

[0062] The cable strands to be tested may be cable strands to be tested for reasonable clearance. The cable strands are often twisted by rotating the stranded wires around the strand axis at equal angular velocities and moving the strands forward at a uniform speed. The target surface image may be an image representing the surface of the cable strands to be tested. The cable strand area in the target surface image may represent the cable strands to be tested.

[0063] As an example, an industrial camera can be used to capture the surface image of the cable strands to be inspected as the target surface image. Through semantic segmentation, the background is removed and the area representing the cable strands to be inspected is segmented as the cable strand area. Through a connected domain extraction algorithm, a connected domain is extracted from the cable strand area as a candidate gap area.

[0064] Step S2, determining a target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area.

[0065] As an example, the average of the grayscale values ​​corresponding to all the pixels in each candidate gap area may be determined as the target brightness factor corresponding to each candidate gap area.

[0066] As another example, the maximum value among the grayscale values ​​corresponding to all the pixels in each candidate gap region may be determined as the target brightness factor corresponding to each candidate gap region.

[0067] It should be noted that the inside of the gap often appears relatively dark. Therefore, when the target brightness factor corresponding to the candidate gap area is smaller, it often means that the grayscale in the candidate gap area is relatively darker, which often means that the candidate gap area is more likely to be a real gap area.

[0068] Step S3, performing grayscale distribution analysis on each candidate gap region to obtain a grayscale distribution factor corresponding to each candidate gap region.

[0069] As an example, this step may include the following steps:

[0070] In the first step, any candidate gap area is determined as a marked area, and the difference between the grayscale value corresponding to each pixel in the marked area and the grayscale representative of the mark is determined as the target grayscale difference corresponding to each pixel in the marked area.

[0071] The grayscale represented by the mark may be the average of the grayscale values ​​corresponding to all pixels in the marked area.

[0072] In the second step, the mean value of the target grayscale differences corresponding to all the pixels in the marked area is determined as the grayscale distribution factor corresponding to the marked area.

[0073] For example, the formula for determining the grayscale distribution factor corresponding to the candidate gap area may be:

[0074] ;in, It is The grayscale distribution factor corresponding to the candidate gap area. is the sequence number of the candidate gap region. It is The number of pixels in the candidate gap area. It is The sequence number of the pixel points in the candidate gap area. It is the absolute value function. It is The first The gray value corresponding to each pixel. It is The mean of the gray values ​​corresponding to all pixels in the candidate gap area. Characterizes the target grayscale difference.

[0075] It should be noted that, in actual situations, the grayscale distribution on the cable strand texture area is often different from the grayscale distribution on the gap area. For example, the grayscale distribution on the cable strand texture area is often relatively chaotic, while the grayscale distribution on the gap area is often relatively uniform. The smaller the time, the more likely it is that The more uniform the grayscale distribution on the candidate gap area is, the better the The more likely a candidate gap region is to be a real gap region.

[0076] Step S4, screening out a target gap region from all candidate gap regions according to the target brightness factor and grayscale distribution factor corresponding to the candidate gap regions.

[0077] As an example, this step may include the following steps:

[0078] In the first step, the possible gap index corresponding to each candidate gap area is determined according to the target brightness factor and grayscale distribution factor corresponding to each candidate gap area.

[0079] Among them, the target brightness factor and the grayscale distribution factor can both be negatively correlated with the gap possible index.

[0080] For example, the formula for determining the gap possible index corresponding to the candidate gap area may be:

[0081] ;in, It is The gap possible indicators corresponding to the candidate gap areas. is the sequence number of the candidate gap region. is a natural exponential function. It is The target brightness factor corresponding to the candidate gap area. It is The grayscale distribution factor corresponding to the candidate gap area.

[0082] It should be noted that when The smaller the time, the more likely it is that The darker the grayscale in the candidate gap area, the The more likely the candidate gap region is to be the real gap region. The smaller the time, the more likely it is that The more uniform the grayscale distribution on the candidate gap area is, the better the The more likely the candidate gap regions are to be real gap regions. The larger the The more likely a candidate gap region is to be a real gap region.

[0083] In the second step, according to the gap possibility indicators corresponding to all candidate gap areas, all candidate gap areas are clustered into two clusters through the K-means clustering algorithm, that is, candidate gap areas with similar gap possibility indicators are clustered into the same cluster, and the mean of the gap possibility indicators corresponding to all candidate gap areas in each cluster is determined as the gap representative possibility factor corresponding to each cluster, and each candidate gap area in the cluster with the larger gap representative possibility factor in the two clusters is determined as the target gap area.

[0084] In the process of clustering by the K-means clustering algorithm, the absolute value of the difference between the gap possibility index corresponding to the unclustered candidate gap area and the gap possibility index corresponding to the cluster center can be used to represent the distance between the unclustered candidate gap area and the cluster center.

[0085] Specifically, according to the gap possibility indicators corresponding to all candidate gap areas, through the K-means clustering algorithm, clustering all candidate gap areas into two cluster clusters may include: setting the number of clusters to 2, taking the candidate gap area with the smallest gap possibility indicator and the candidate gap area with the largest gap possibility indicator as two initial cluster centers respectively, calculating the absolute value of the difference between the gap possibility indicator corresponding to the unclustered candidate gap area and the gap possibility indicator corresponding to each cluster center as the distance between the unclustered candidate gap area and each cluster center, dividing the unclustered candidate gap area into the category to which the cluster center with the smallest distance belongs, and finally completing clustering to obtain two cluster clusters.

[0086] Step S5, segmenting the edge of each target gap area to obtain two sub-edges corresponding to each target gap area, and determining the target gap rationality corresponding to each target gap area according to the area of ​​each target gap area and the difference in chain code values ​​between the two sub-edges corresponding to each target gap area.

[0087] As an example, this step may include the following steps:

[0088] In the first step, two pixels with the farthest distance are selected from the edge of each target gap area as segmentation points, and segmentation is performed using the two segmentation points on the edge of each target gap area to obtain two sub-edges corresponding to each target gap area.

[0089] In the second step, taking any segmentation point on the edge of each target gap region as the starting point, the edge chain codes corresponding to the two sub-edges corresponding to each target gap region are obtained.

[0090] Among them, Edge Chain Code is a method used to describe the contour or edge of a two-dimensional image. It serializes the pixels on the contour and represents the shape of the entire contour by encoding the connection relationship between adjacent pixels.

[0091] In the third step, the DTW value between the edge chain codes corresponding to the two sub-edges corresponding to each target gap region is determined as the target chain code difference corresponding to each target gap region.

[0092] The target chain code difference can represent the difference in chain code values ​​between two sub-edges. The DTW value, also known as the DTW (Dynamic Time Warping) distance, can be used to represent the difference between two edge chain codes.

[0093] The fourth step is to determine the target gap rationality corresponding to each target gap area according to the area corresponding to each target gap area and the target chain code difference.

[0094] Among them, the area corresponding to the target gap region and the target chain code difference can both be negatively correlated with the target chain code difference.

[0095] For example, the formula for determining the target gap rationality corresponding to the target gap area may be:

[0096] ;in, It is The target gap rationality corresponding to the target gap area. is the sequence number of the target gap area. is a natural exponential function. It is The area of ​​the target gap region can be expressed as The number of pixels in the target gap area is represented. is the minimum value among the areas of all target gap regions. is the maximum value among the areas of all target gap regions. It is The target chain code difference corresponding to the target gap area.

[0097] It should be noted that, in actual situations, when the gap is narrow and the edges on both sides of the gap are relatively parallel, it often indicates that the gap is relatively qualified. The smaller the time, the more likely it is that The smaller the target gap area is, the smaller the The target gap area is relatively narrower. The smaller the time, the more likely it is that The more similar the chain code values ​​between the edges of the target gap area are, the more likely it is that the The shapes of the edges on both sides of the target gap area are closer. The larger the The target gap area is relatively narrower, and the The closer the shapes of the two sides of the target gap area are, the closer the shapes of the two sides of the target gap area are; The larger the target gap area may be, the more reasonable it is.

[0098] Step S6, performing production monitoring on the cable strands to be tested according to the target gap rationality corresponding to each target gap area.

[0099] As an example, according to the target gap rationality corresponding to each target gap area, the production monitoring of the cable strands to be detected may include the following steps:

[0100] In the first step, the camera horizontal coordinate field of view distortion error analysis is performed on each target gap area to obtain the lateral distortion error corresponding to each target gap area.

[0101] For example, the formula for determining the lateral distortion error corresponding to the target gap area can be:

[0102] ;

[0103] ;

[0104] ;in, is the lateral distortion error corresponding to the target gap area. is the number of pixels in the target gap area. It is the serial number of the pixel in the target gap area. is the first The sub-lateral error corresponding to the pixel point. It is the absolute value function. is the first The vertical coordinate of each pixel in the target coordinate system. The target coordinate system is a coordinate system with the center point of the target surface image as the origin, the long side parallel to the cable strand area as the horizontal axis, and the straight line perpendicular to the horizontal axis as the vertical axis. In actual situations, the long side of the cable strand is often parallel to the long side of the captured cable strand surface image. Therefore, at this time, the target coordinate system can be a coordinate system with the center point of the target surface image as the origin, the horizontal direction of the target surface image as the horizontal axis, the horizontal right direction as the positive direction, the vertical direction of the target surface image as the vertical axis, and the vertical upward direction as the positive direction. It is the maximum value of the ordinate of all pixels in the cable strand area in the target surface image in the target coordinate system. is the first The candidate lateral error corresponding to the pixel point. It is the radius of the minimum circumscribed circle corresponding to the cross-section of the cable strands to be tested. is the tangent function. is the angle between the first straight line and the second straight line. The first straight line is the The first straight line is the line between a pixel and its corresponding camera. The camera corresponding to the pixel can be the camera that captured the pixel. The line between the pixel and the camera usually refers to the path of light from the object to the imaging plane (i.e., the sensor) during the imaging process. The second straight line is the line between the center point of the target surface image and its corresponding camera.

[0105] The lateral distortion error determination process can be as follows: Figure 2 Specifically, Figure 2 The three horizontal line segments in the image are recorded as the first line segment, the second line segment and the third line segment in ascending order. The first line segment can represent the side view of the captured target surface image, and the rectangle formed by the second line segment and the third line segment can represent the side view of the front half of the captured cable strand to be detected, that is, the width of the rectangle formed by the second line segment and the third line segment can represent the radius of the minimum circumscribed circle corresponding to the cross section of the cable strand to be detected. , point P can represent the center point of the target surface image, The point can represent the pixel points, point M is the foot of the perpendicular between line segment MP and the second line segment, line segment MP is the line segment connecting point M and point P, point Q can represent the camera, , is the length of the line segment connecting point Q and point M, The maximum value among all candidate lateral errors can be characterized.

[0106] It should be noted that the length of the cable strands is much larger than the cross-sectional radius. It can represent the lateral shrinkage error of the target gap area. The larger its value is, the more likely the target gap area is to be shrunk left and right during the shooting process. That is to say, the gap represented by the target gap area is often smaller than its corresponding real gap, which often means that the target gap area is shrunk relatively more, and the larger the lateral shrinkage error of the target gap area is, the more likely the target gap area is to be closer to the left and right boundaries of the surface image.

[0107] In the second step, the camera longitudinal coordinate field of view distortion error analysis is performed on each target gap area, and the formula corresponding to the longitudinal distortion error of each target gap area can be obtained as follows:

[0108] ;

[0109] ;in, is the longitudinal distortion error corresponding to the target gap area. is the number of pixels in the target gap area. It is the serial number of the pixel in the target gap area. is the first The candidate longitudinal error corresponding to the pixel point. It is the absolute value function. is the first The target coordinate system is the horizontal coordinate of a pixel point in the target coordinate system. The target coordinate system takes the center point of the target surface image as the origin, the long side parallel to the cable strand area as the horizontal axis, and the straight line perpendicular to the horizontal axis as the vertical axis. It is the maximum value of the horizontal coordinates of all pixels in the cable strand area in the target surface image in the target coordinate system. It is the radius of the minimum circumscribed circle corresponding to the cross-section of the cable strands to be tested. It is half the width of the minimum circumscribed rectangle of the cable strand area in the target surface image, which can represent the length of the radius of the minimum circumscribed circle corresponding to the cross section of the cable strand to be detected mapped in the target surface image.

[0110] It should be noted that when When it is larger, it often indicates that the target gap area is more likely to be shrunk up and down during the shooting process, that is, the gap represented by the target gap area is often smaller than its corresponding real gap, which often indicates that the width of the target gap area is relatively more shrunk, which often indicates that the shrinkage error of the target gap area in the longitudinal direction is relatively larger, which often indicates that the target gap area is more likely to tend to the boundary of the surface image.

[0111] The third step is to determine the target distortion error corresponding to each target gap area according to the lateral distortion error and the longitudinal distortion error corresponding to each target gap area.

[0112] Among them, both the lateral distortion error and the longitudinal distortion error can be positively correlated with the target distortion error.

[0113] For example, the sum of the squares of the lateral distortion error and the longitudinal distortion error corresponding to each target gap region may be determined as the target distortion error corresponding to each target gap region.

[0114] The fourth step is to determine the target rationality index corresponding to each target gap area according to the target gap rationality and target distortion error corresponding to each target gap area.

[0115] Among them, the target gap rationality can be positively correlated with the target rational index, and the target distortion error can be negatively correlated with the target rational index.

[0116] For example, the formula for determining the target reasonable index corresponding to the target gap area can be:

[0117] ;in, It is The target reasonableness index corresponding to the target gap area. is the sequence number of the target gap area. It is The target gap rationality corresponding to the target gap area. is a natural exponential function. It is The lateral distortion error corresponding to the target gap area. It is The longitudinal distortion error corresponding to the target gap area. It is The target distortion error corresponding to the target gap area.

[0118] It should be noted that when The larger the The target gap area is relatively narrower, and the The shapes of the edges on both sides of the target gap area are closer. When is larger, it often indicates that the target gap area may be closer to the boundary of the surface image, and often indicates that the shrinkage error of the target gap area is relatively larger. The larger the The more reasonable the target gap area is, the more likely it is that the cable strands to be tested will meet the standards during the production process.

[0119] In the fifth step, if there is a target gap region where the corresponding target reasonable index is less than a preset reasonable threshold, it is determined that the gap of the cable strands to be tested is unqualified.

[0120] The preset reasonable threshold may be a preset threshold, for example, 0.88.

[0121] In the sixth step, if there is no target gap region where the corresponding target reasonable index is less than the preset reasonable threshold, it is determined that the gap of the cable strands to be tested is qualified.

[0122] Optionally, according to the target gap rationality corresponding to each target gap area, the production monitoring of the cable strands to be tested may further include the following steps:

[0123] In the first step, if there is a target gap area whose corresponding target gap rationality is less than a preset rational threshold, it is determined that the gap of the above-mentioned cable strands to be tested is unqualified.

[0124] In the second step, if there is no corresponding target gap region whose target gap rationality is less than a preset rational threshold, it is determined that the gap of the cable strands to be tested is qualified.

[0125] It should be noted that, for greater accuracy, the surface local images corresponding to multiple faces of the cable strand to be tested can be collected by an industrial camera, wherein the surface local image can be an image of a single face of the cable strand to be tested, and each collected surface local image is determined as a target surface image, and the target gap area can be screened out from all target surface images by the above-mentioned target gap area acquisition method, and the production monitoring of the cable strand to be tested is carried out according to the target gap rationality corresponding to all target gap areas. Secondly, during the shooting process, the cable strand to be tested can be placed horizontally and fixed on a rotating bracket in the experimental table, and the rotating bracket can be used to rotate the cable strand to be tested at a specific angular velocity, and then the surface image of the rotating cable strand to be tested is collected by the industrial camera, and at the same time, the industrial camera is moved at a certain speed along a direction parallel to the length of the cable strand, so as to collect all surface local images corresponding to the cable strand to be tested.

[0126] refer to Figure 3 Based on the same inventive concept as the above method embodiment, the present invention provides a cable strand production monitoring system based on machine vision, the system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the above computer program is executed by the processor, the steps of implementing the cable strand production monitoring method based on machine vision may specifically include:

[0127] An acquisition and extraction module 301 is used to acquire a target surface image corresponding to the cable strands to be detected, and extract a connected domain from the cable strand region in the target surface image as a candidate gap region;

[0128] A brightness factor determination module 302 is used to determine a target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area;

[0129] A distribution factor determination module 303 is used to perform grayscale distribution analysis on each candidate gap region to obtain a grayscale distribution factor corresponding to each candidate gap region;

[0130] The region screening module 304 is used to screen out a target gap region from all candidate gap regions according to a target brightness factor and a grayscale distribution factor corresponding to the candidate gap region;

[0131] The rationality determination module 305 is used to segment the edge of each target gap area to obtain two sub-edges corresponding to each target gap area, and determine the target gap rationality corresponding to each target gap area according to the area of ​​each target gap area and the difference in chain code values ​​between the two sub-edges corresponding to each target gap area;

[0132] The production monitoring module 306 is used to perform production monitoring on the above-mentioned cable strands to be tested according to the target gap rationality corresponding to each target gap area.

[0133] Figure 4 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 4 As shown, the computer device 400 includes: a memory 401, a processor 402, and a computer program 403 stored in the memory 401 and running on the processor 402, wherein when the processor 402 executes the computer program 403, the computer device can execute any one of the cable strand production monitoring methods based on machine vision introduced above.

[0134] Based on the same inventive concept as the above method embodiment, the present invention provides a server, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes any of the above-mentioned cable strand production monitoring methods based on machine vision.

[0135] Based on the same inventive concept as the above-mentioned method embodiment, the present invention provides a computer program product, which includes: computer program code, when the computer program code runs on a computer, enables the computer to execute any one of the above-mentioned cable strand production monitoring methods based on machine vision.

[0136] Based on the same inventive concept as the above-mentioned method embodiment, the present invention provides a computer-readable storage medium, which stores a computer program code. When the computer program code runs on a computer, the computer executes any one of the above-mentioned cable strand production monitoring methods based on machine vision.

[0137] In summary, compared to the gap region segmentation that only considers the grayscale difference, the present invention comprehensively considers the target brightness factor that characterizes the overall grayscale of the candidate gap region and the grayscale distribution factor that characterizes the grayscale distribution, thereby improving the accuracy of gap region segmentation. Therefore, the target gap region can better characterize the real gap region. Secondly, the present invention quantifies the target gap rationality corresponding to the target gap region, so that it can facilitate the subsequent more objective analysis of the gap rationality of the cable strands to be tested, thereby improving the accuracy of production monitoring of the cable strands to be tested.

[0138] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A cable strand production monitoring method based on machine vision, characterized in that: The following steps are involved: Acquire a target surface image corresponding to the cable strands to be detected, and extract a connected domain from the cable strand region in the target surface image as a candidate gap region; Determine the target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area; Perform grayscale distribution analysis on each candidate gap area to obtain a grayscale distribution factor corresponding to each candidate gap area; According to the target brightness factor and grayscale distribution factor corresponding to the candidate gap area, the target gap area is screened out from all the candidate gap areas; The edge of each target gap region is segmented to obtain two sub-edges corresponding to each target gap region, and the rationality of the target gap corresponding to each target gap region is determined according to the area of ​​each target gap region and the difference in chain code values ​​between the two sub-edges corresponding to each target gap region; According to the target gap rationality corresponding to each target gap area, production monitoring is performed on the cable strands to be tested; The method of performing production monitoring on the cable strands to be detected according to the target gap rationality corresponding to each target gap area includes: Perform camera horizontal coordinate field of view distortion error analysis on each target gap area to obtain the lateral distortion error corresponding to each target gap area; Perform camera longitudinal coordinate field of view distortion error analysis on each target gap area to obtain the longitudinal distortion error corresponding to each target gap area; According to the lateral distortion error and the longitudinal distortion error corresponding to each target gap area, the target distortion error corresponding to each target gap area is determined, wherein the lateral distortion error and the longitudinal distortion error are both positively correlated with the target distortion error; According to the target gap rationality and target distortion error corresponding to each target gap area, the target rationality index corresponding to each target gap area is determined, wherein the target gap rationality is positively correlated with the target rationality index, and the target distortion error is negatively correlated with the target rationality index; If there is a target gap region where the corresponding target reasonable index is less than the preset reasonable threshold, it is determined that the gap of the cable strand to be tested is unqualified; If there is no target gap region where the corresponding target reasonable index is less than the preset reasonable threshold, then the gap of the cable strand to be tested is determined to be qualified; The formula for the lateral distortion error corresponding to the target gap area is: ; ; ;in, is the lateral distortion error corresponding to the target gap area; is the number of pixels in the target gap area; is the serial number of the pixel point in the target gap area; is the first Sub-lateral error corresponding to pixels; It is the absolute value function; is the first The vertical coordinate of each pixel in the target coordinate system; the target coordinate system takes the center point of the target surface image as the origin, the long side parallel to the cable strand area as the horizontal axis, and the straight line perpendicular to the horizontal axis as the vertical axis. It is the maximum value of the ordinate of all pixels in the cable strand area in the target surface image in the target coordinate system; is the first The candidate lateral error corresponding to the pixel points; is the radius of the minimum circumscribed circle corresponding to the cross section of the cable strand to be tested; is the tangent function; is the angle between the first straight line and the second straight line; the first straight line is the The second straight line is the line between the center point of the target surface image and its corresponding camera; The formula for the longitudinal distortion error corresponding to the target gap area is: ; ;in, is the longitudinal distortion error corresponding to the target gap area; is the number of pixels in the target gap area; is the serial number of the pixel point in the target gap area; is the first Candidate longitudinal errors corresponding to pixels; It is the absolute value function; is the first The target coordinate system is the coordinate system with the center point of the target surface image as the origin, the long side parallel to the cable strand area as the horizontal axis, and the straight line perpendicular to the horizontal axis as the vertical axis. It is the maximum value of the horizontal coordinates of all pixels in the cable strand area in the target surface image in the target coordinate system; is the radius of the minimum circumscribed circle corresponding to the cross section of the cable strand to be tested; It is half the width of the minimum bounding rectangle of the cable strand area in the target surface image.

2. A cable strand production monitoring method based on machine vision according to claim 1, characterized in that: Determining the target brightness factor corresponding to each candidate gap area according to the grayscale values ​​corresponding to all pixels in each candidate gap area includes: The mean of the grayscale values ​​corresponding to all pixels in each candidate gap area is determined as the target brightness factor corresponding to each candidate gap area.

3. The cable strand production monitoring method based on machine vision according to claim 1 is characterized in that: The grayscale distribution analysis process is performed on each candidate gap region to obtain a grayscale distribution factor corresponding to each candidate gap region, including: Determine any candidate gap area as a marked area, and determine the difference between the grayscale value corresponding to each pixel in the marked area and the marked representative grayscale as the target grayscale difference corresponding to each pixel in the marked area, wherein the marked representative grayscale is the average of the grayscale values ​​corresponding to all pixels in the marked area; The mean value of the target grayscale differences corresponding to all the pixels in the marked area is determined as the grayscale distribution factor corresponding to the marked area.

4. The cable strand production monitoring method based on machine vision according to claim 1 is characterized in that: The step of selecting a target gap region from all candidate gap regions according to a target brightness factor and a grayscale distribution factor corresponding to the candidate gap region comprises: Determine the possible gap index corresponding to each candidate gap region according to the target brightness factor and grayscale distribution factor corresponding to each candidate gap region, wherein both the target brightness factor and the grayscale distribution factor are negatively correlated with the possible gap index; According to the gap possibility indicators corresponding to all candidate gap areas, all candidate gap areas are clustered into two clusters through the K-means clustering algorithm, and the mean of the gap possibility indicators corresponding to all candidate gap areas in each cluster is determined as the gap representative possibility factor corresponding to each cluster, and each candidate gap area in the cluster with the larger corresponding gap representative possibility factor in the two clusters is determined as the target gap area. In the process of clustering through the K-means clustering algorithm, the absolute value of the difference between the gap possibility indicator corresponding to the unclustered candidate gap area and the gap possibility indicator corresponding to the cluster center is used to characterize the distance between the unclustered candidate gap area and the cluster center.

5. The cable strand production monitoring method based on machine vision according to claim 1, characterized in that: The step of segmenting the edge of each target gap region to obtain two sub-edges corresponding to each target gap region includes: The two pixels with the farthest distance are selected from the edge of each target gap region as segmentation points, and segmentation is performed using the two segmentation points on the edge of each target gap region to obtain two sub-edges corresponding to each target gap region.

6. The cable strand production monitoring method based on machine vision according to claim 5 is characterized in that: Determining the rationality of the target gap corresponding to each target gap region according to the area of ​​each target gap region and the difference in chain code values ​​between two sub-edges corresponding to each target gap region includes: Taking any segmentation point on the edge of each target gap region as the starting point, obtain the edge chain codes corresponding to the two sub-edges corresponding to each target gap region; The DTW value between the edge chain codes corresponding to the two sub-edges corresponding to each target gap region is determined as the target chain code difference corresponding to each target gap region, wherein the target chain code difference represents the difference in chain code values ​​between the two sub-edges; According to the area corresponding to each target gap region and the target chain code difference, the target gap rationality corresponding to each target gap region is determined, wherein the area corresponding to the target gap region and the target chain code difference are negatively correlated with the target chain code difference.

7. A cable strand production monitoring system based on machine vision, characterized in that: It comprises a processor and a memory, wherein the processor is used to process instructions stored in the memory to implement the cable strand production monitoring method based on machine vision as described in any one of claims 1-6.