Steel wire rope defect positioning detection method and device, electronic equipment and storage medium
By determining the optimal rotation angle and transformation matrix in wire rope inspection, the problem of accurately locating defects in individual wire strands in existing technologies has been solved, achieving efficient strand-level defect detection in wire ropes.
Patent Information
- Application Number
- CN202610922038.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2046-06-25
AI Technical Summary
Existing wire rope inspection technologies are insufficient to accurately locate defects in individual wire strands, resulting in inadequate defect detection capabilities.
By determining the optimal rotation angle, a coordinate system most conducive to strand separation is established. The wire rope image is transformed using the target rotation angle and transformation matrix to separate the individual wires and perform defect detection.
It significantly improves the defect detection capability of wire ropes, and achieves precise defect location and detection at the strand level.
Smart Images

Figure CN122473159B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer data processing technology, and in particular to a method, apparatus, electronic device and storage medium for locating and detecting defects in wire ropes. Background Technology
[0002] Wire rope is a key load-bearing component of lifting and transportation equipment, and it is generally made of multiple strands of steel wire twisted according to certain rules.
[0003] Early detection and accurate diagnosis of defects in wire ropes are crucial for equipment safety. Existing wire rope inspection technologies generally treat the wire rope as a whole object for inspection, and their defect detection capabilities need to be improved. Summary of the Invention
[0004] This application provides a method, device, electronic device, storage medium, and program product for locating and detecting defects in wire ropes. By determining the optimal rotation angle and establishing a coordinate system most conducive to strand separation, the individual strands of the wire rope are located, thereby achieving strand-level defect detection and significantly improving the defect detection capability of wire ropes.
[0005] This application provides a method for locating and detecting defects in steel wire ropes, the method comprising: Determine the target rotation angle for transforming the first wire rope image, so that the orientation of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; Based on the target transformation matrix constructed based on the target rotation angle, the first wire rope image is transformed to obtain the transformed second wire rope image; Determine the first region corresponding to each strand of steel wire in the second steel wire rope image; Based on the first region corresponding to each strand of steel wire and the target transformation matrix, locate the second region corresponding to each strand of steel wire in the first steel wire rope image; Based on the second region, defect detection is performed on the steel wire to obtain the defect detection result of the steel wire.
[0006] This application provides a wire rope defect location and detection device, the device comprising: An angle determination module is used to determine the target rotation angle for transforming the first wire rope image, so that the direction of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction. The transformation module is used to transform the first wire rope image according to the target transformation matrix constructed based on the target rotation angle to obtain the transformed second wire rope image. The region first determination module is used to determine the first region corresponding to each strand of steel wire in the second steel wire rope image; The second region determination module is used to locate the second region corresponding to each strand of steel wire in the first steel wire rope image based on the first region corresponding to each strand of steel wire and the target transformation matrix; The detection module is used to perform defect detection on the steel wire based on the second region and obtain the defect detection result of the steel wire.
[0007] Furthermore, this application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the wire rope defect location and detection method provided in this application.
[0008] Furthermore, this application embodiment also provides a storage medium storing a computer program. When the computer program is run on an electronic device, the computer program is used to cause the electronic device to execute any of the wire rope defect location and detection methods provided in this application embodiment.
[0009] Furthermore, this application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement any of the wire rope defect location and detection methods provided in this application.
[0010] In this embodiment, a target rotation angle is determined for transforming a first wire rope image, ensuring that the orientation of each strand of wire in the transformed image matches a first direction. The first wire rope image is then transformed using a target transformation matrix constructed based on the target rotation angle to obtain a transformed second wire rope image. A first region corresponding to each strand of wire in the second wire rope image is determined. Based on the first region and the target transformation matrix, a second region corresponding to each strand of wire is located in the first wire rope image. Defect detection is then performed on the wire based on the second region to obtain the defect detection result. Thus, by determining the optimal rotation angle and establishing a coordinate system most conducive to strand separation, the individual strands of the wire rope can be located, thereby achieving strand-level defect detection and significantly improving the defect detection capability of the wire rope. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] To gain a more complete understanding of this application and its beneficial effects, the following description will be provided in conjunction with the accompanying drawings, wherein the same reference numerals in the following description denote the same parts.
[0013] Figure 1 This is a flowchart illustrating the wire rope defect location and detection method provided in the embodiments of this application; Figure 2 This is a schematic image of the first wire rope provided in the embodiments of this application; Figure 3 This is a schematic diagram of the binarized image of the first wire rope provided in the embodiments of this application; Figure 4 This is a schematic projection of the second wire rope image provided in the embodiments of this application; Figure 5 This is a schematic diagram of strand positioning based on a first wire rope image provided in an embodiment of this application; Figure 6 This is a schematic diagram of the steel wire rope defect location and detection device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0015] Furthermore, in the embodiments of this application, "multiple" refers to two or more. The terms "first" and "second," etc., in the embodiments of this application are used for distinguishing descriptions and should not be construed as implying relative importance.
[0016] Wire ropes are critical load-bearing components in lifting and transportation equipment. Early detection and accurate diagnosis of defects are essential for equipment safety. Existing wire rope inspection technologies mainly include: The first method is manual visual inspection. This involves inspectors visually examining the surface of the wire rope to determine defects. However, this method suffers from high subjectivity, low accuracy, and a tendency to miss defects.
[0017] The second method is electromagnetic induction. This method uses electromagnetic fields to detect metal defects, but it has limited ability to detect internal defects and cannot distinguish the structure of the strand.
[0018] The third method is a traditional image processing approach based on edge detection algorithms such as Canny or Sobel. This involves acquiring a single frame of image and performing edge detection. However, these methods struggle to accurately locate the boundaries of each strand and cannot effectively count defects within a single strand.
[0019] The fourth type is semantic segmentation based on deep learning. For example, U-Net can be used for pixel-level segmentation, but the segmented results still require further connected component analysis and post-processing to identify individual segments, lacking a clear segment-level structural localization mechanism.
[0020] This shows that existing methods lack specific processing for the strand structure of wire ropes. Even with deep learning segmentation, it is difficult to automatically and reliably interpret the segmentation results into specific strand regions.
[0021] To address at least some of the aforementioned problems, embodiments of this application provide a method, apparatus, electronic device, storage medium, and computer program product for locating and detecting defects in wire ropes.
[0022] Specifically, this embodiment will be described from the perspective of a wire rope defect location and detection device, which can be integrated into an electronic device. That is, the wire rope defect location and detection method of this application embodiment can be executed by an electronic device. The electronic device can be a server or a terminal device.
[0023] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0024] The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be connected directly or indirectly through wired or wireless communication, which is not limited herein.
[0025] Taking the integration of a wire rope defect location and detection device into an electronic device as an example, this electronic device can be a terminal device. The terminal device determines the target rotation angle for transforming a first wire rope image, ensuring that the orientation of each strand of wire in the transformed image matches a first direction. Based on the target transformation matrix constructed using the target rotation angle, the first wire rope image is transformed to obtain a transformed second wire rope image. A first region corresponding to each strand of wire in the second wire rope image is determined. Based on the first region and the target transformation matrix, a second region corresponding to each strand of wire is located in the first wire rope image. Defect detection is performed on the wire based on the second region, yielding the defect detection result. Thus, by determining the optimal rotation angle and establishing a coordinate system most conducive to strand separation, the individual strands of the wire rope can be located, thereby achieving strand-level defect detection and significantly improving the defect detection capability of the wire rope.
[0026] It should be noted that, with the evolution of technology and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems. The solutions provided in the embodiments of this application are specifically illustrated through the following examples. It should be noted that the order of description of the following examples is not intended to limit the preferred order of the embodiments.
[0027] This embodiment will be described from the perspective of a wire rope defect location and detection device. Specifically, the wire rope defect location and detection device can be integrated into an electronic device, which can be a terminal device and / or a server. This application does not impose any limitations on this.
[0028] Please see Figure 1 , Figure 1 This is a flowchart illustrating the wire rope defect location and detection method provided in this application embodiment. The specific process can be summarized in the following steps S101 to S105: Step S101: Determine the target rotation angle for transforming the first wire rope image, so that the direction of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction.
[0029] The first wire rope image refers to the image captured by an image acquisition device (such as a camera) of the wire rope.
[0030] It should be noted that the first wire rope image can be the original image of the wire rope captured by photography, or it can be an image of the wire rope obtained after certain processing (such as grayscale processing, enhancement processing). There is no limitation here. For example, the first wire rope image can be as follows: Figure 2 The image shown is the original wire rope image after grayscale processing. For example, the first wire rope image could also be as follows: Figure 3The binarized image shown is illustrated. The process of obtaining this binarized image can be as follows: The steel wire rope is photographed using an image acquisition device to obtain an original image containing background and noise information. The original steel wire rope image is then subjected to binary masking to separate the foreground target from the background region. Subsequently, a contour extraction operation is performed based on the processed binary mask image to obtain contour data characterizing the morphological features of the steel wire rope. The extracted contour data is then subjected to white-hat processing to eliminate uneven lighting and local background interference, thereby obtaining a processed binary image with enhanced contrast. This processed binary image is then used as the final first steel wire rope image.
[0031] The target rotation angle refers to the optimal rotation angle for establishing a coordinate system that best facilitates string separation. The first direction can refer to the horizontal or vertical direction of the image. This application preferably uses the horizontal direction.
[0032] In some embodiments, the step of "determining the target rotation angle for transforming the first wire rope image" can be as follows: for each rotation angle within a preset rotation angle range, transform the wire rope in the first wire rope image according to the transformation matrix determined based on the rotation angle to obtain a transformed wire rope image; perform projection processing on the transformed wire rope image to obtain a projection vector; determine the total number of projection points and the first number of projection points whose projection value is a first projection value according to the projection vector; determine the sparsity corresponding to the rotation angle according to the total number and the first number; and determine the target rotation angle for transforming the first wire rope image according to the sparsity corresponding to each rotation angle.
[0033] The transformation matrix can be a rotation matrix determined by the rotation angle, or a translation matrix determined by the translation amount.
[0034] The aforementioned projection vector refers to the vector formed by projecting the transformed wire rope image along the direction of the first coordinate axis to obtain the projection point on the second coordinate axis, and the projection value of the projection point.
[0035] It should be noted that the first and second coordinate axes are the two coordinate axes of the coordinate system in which the image is located. When the first coordinate axis is the X-axis, the second coordinate axis is the Y-axis. The direction of the first coordinate axis can be understood as the direction corresponding to the row of the image, i.e., the horizontal direction. When the first coordinate axis is the Y-axis, the second coordinate axis is the X-axis. The direction of the first coordinate axis can be understood as the direction corresponding to the column of the image, i.e., the vertical direction.
[0036] Preferably, in this application, when the first coordinate axis is the X-axis, the second coordinate axis is the Y-axis, and the direction of the first coordinate axis can be understood as the direction corresponding to the row of the image.
[0037] The total number of projection points is determined based on the coordinates of the starting projection point and the ending projection point on the second coordinate axis. For example, if the starting projection point has coordinates of 4 and the ending projection point has coordinates of 100, then the total number of projection points is (100-4+1)=97. The first projection value indicates 0. The first quantity indicates the number of projection points with a projection value of 0 within a projection interval, which is determined based on the coordinates of the starting and ending projection points on the second coordinate axis. For example, if the starting projection point has coordinates of 4 and the ending projection point has coordinates of 100, then the projection interval is [4,100].
[0038] The step "determine the target rotation angle for transforming the first wire rope image based on the sparsity corresponding to each rotation angle" may include: determining the maximum sparsity among the sparsities corresponding to each rotation angle; and taking the rotation angle corresponding to the maximum sparsity as the target rotation angle for transforming the first wire rope image.
[0039] It should be noted that high sparsity indicates clear separation between strands, forming distinct dividing bands. Thus, by identifying the rotation angle with the highest sparsity, the rotation angle most conducive to strand separation can be obtained.
[0040] In scenarios where high precision is not required, the target rotation angle can also be a rotation angle with a sparsity greater than the preset sparsity to speed up processing. The preset sparsity can be set according to the actual situation and is not limited here.
[0041] For example, assume the direction of the first coordinate axis is horizontal. Traverse within a set rotation angle range (e.g., -50° to -10°), performing the following operations for each rotation angle: Calculate the rotation matrix corresponding to the rotation angle, and perform an affine transformation on the first wire rope image based on this rotation matrix. Project the rotated image along the horizontal direction (also known as row projection) to obtain a one-dimensional projection vector. This projection vector includes multiple projection points on the second coordinate axis and the projection value of each projection point. The projection value of this projection point is obtained by summing or counting pixels along the row direction in the rotated image. That is, count the number of non-zero pixels in the row of the rotated image to obtain a one-dimensional row projection vector P[y]. Determine the binary projection B[y] of the rotated image on the Y-axis (i.e., the second coordinate axis) according to the formula (P[y]>0?1:0). Calculate the sparsity of the image at this rotation angle according to (number of zero-value rows) / (number of effective rows). Wherein, the number of zero-value rows is equal to the number of projection points whose projection value is the first projection value. The number of effective rows is equal to the total number of projection points. Select the angle with the largest sparsity as the optimal rotation angle (i.e., the target rotation angle).
[0042] Thus, row projection and sparsity analysis based on pixel count can effectively determine the optimal rotation angle that is most conducive to strand separation.
[0043] In other embodiments, the process of "determining the target rotation angle for transforming the first wire rope image" may also be as follows: inputting the first wire rope image into a pre-trained wire rope recognition model to output the pixel set corresponding to the two outer wires of the wire rope; fitting the axis of the wire rope based on the pixel set corresponding to the two outer wires; and determining the target rotation angle for transforming the first wire rope image according to the angle between the axis and the first direction.
[0044] It should be noted that there are multiple ways to determine the target rotation angle, not limited to the options mentioned above. The specific method can be adjusted according to the actual situation, and no restrictions are imposed here.
[0045] Step S102: Based on the target transformation matrix constructed based on the target rotation angle, transform the first wire rope image to obtain the transformed second wire rope image.
[0046] The target transformation matrix can be a rotation matrix determined based on the target rotation angle, or a translation matrix constructed based on the rotation matrix determined by the target rotation angle and the translation amount.
[0047] The second wire rope image is the transformed wire rope image.
[0048] For example, for such Figure 3 The first wire rope image shown is transformed to obtain the following result: Figure 4 The image shown is of the second steel wire rope.
[0049] It should be noted that the image coordinate system in which the second wire rope image is located is the coordinate system most conducive to strand separation, constructed based on the optimal rotation angle.
[0050] Step S103: Determine the first region corresponding to each strand of wire in the second wire rope image.
[0051] In this context, each first region corresponds to a single steel wire. The first region is the image area of the steel wire in the second steel wire rope image.
[0052] In some embodiments, the step of "determining the first region corresponding to each strand of wire in the second wire rope image" may include: projecting each pixel of the second wire rope image along the direction of the first coordinate axis to obtain projection points on the second coordinate axis and a target projection vector composed of the projection values of the projection points, wherein the projection values of the projection points are determined based on the number of pixels projected to the same position, at least some of the projection points have projection values of the first projection value, and the direction of the first coordinate axis matches the first direction; dividing the target projection vector based on the first projection value to obtain several vector intervals; determining the coordinate range of each strand of wire on the second coordinate axis according to the coordinate positions of the endpoints of each vector interval on the second coordinate axis; and extracting the image regions of the second wire rope image located in each coordinate range as the first region where each strand of wire is located.
[0053] One vector interval is used to indicate a continuous non-zero interval. One vector interval corresponds to one strand of steel wire.
[0054] The step "determine the coordinate range of each wire on the second coordinate axis based on the coordinate positions of the endpoints of each vector interval on the second coordinate axis" is as follows: The coordinates of the starting endpoint and the ending endpoint on the second coordinate axis of the vector interval are used to determine the coordinate range. For example, if the starting endpoint has a coordinate of 4 and the ending endpoint has a coordinate of 20, then the coordinate range of the corresponding wire on the second coordinate axis is [4, 20].
[0055] In some embodiments, to adapt to changes in different working conditions, projection values higher than a threshold can be filtered to eliminate noise. Therefore, before the step "dividing the target projection vector based on the first projection value to obtain several vector intervals," the above-mentioned wire rope defect location and detection method further includes: determining a first projection point in the target projection vector whose projection value is lower than the projection filter value, wherein the projection filter value includes a value determined based on at least one statistical distribution feature of the target projection vector; and updating the projection value of the first projection point to the first projection value.
[0056] The first projection point is used to indicate the projection point whose projection value is lower than the projection filter value.
[0057] The projection filter value can be a preset filter value or a filter value determined based on at least one statistical distribution feature of the target projection vector (such as mean, variance, standard deviation, etc.).
[0058] In some embodiments, since the first and last wires in the wire rope image are usually incomplete, there may be projection points with projection values lower than the projection filter value. If the filtering process is continued, it is easy to miss the first and last wires.
[0059] Therefore, the above-mentioned wire rope defect location detection method further includes: based on the first projection value, the target projection vector is initially divided to obtain a specified vector interval, wherein the specified vector interval includes the first vector interval and the last vector interval; if the first projection point belongs to the specified vector interval, the step of updating the projection value of the first projection point to the first projection value is not performed.
[0060] The first vector interval is used to indicate the vector interval corresponding to the first wire, and the last vector interval is used to indicate the vector interval corresponding to the last wire.
[0061] In some embodiments, not all vector intervals are valid intervals.
[0062] Therefore, the above-mentioned wire rope defect location detection method also includes: determining the second projection point with the largest projection value in each vector interval.
[0063] Based on this, the above step of "determining the coordinate range of each wire on the second coordinate axis according to the coordinate position of the endpoint of each vector interval on the second coordinate axis" may include: when the difference between the projection value of the second projection point and the projection value of the endpoint is greater than a preset difference, determining the coordinate range of the wire corresponding to the vector interval on the second coordinate axis according to the coordinate position of the endpoint of the vector interval on the second coordinate axis.
[0064] If the difference between the projection value of the second projection point and the projection value of the endpoint is less than or equal to a preset difference, the step of determining the coordinate range based on the vector interval will not be executed.
[0065] Step S104: Based on the first region corresponding to each strand of steel wire and the target transformation matrix, locate the second region corresponding to each strand of steel wire in the first steel wire rope image.
[0066] The first region is used to indicate the image area of the steel wire on the second steel wire rope image. The second region is used to indicate the image area of the steel wire on the first steel wire rope image.
[0067] Specifically, based on the target transformation matrix, an inverse affine transformation is performed on the first region corresponding to each strand of steel wire to obtain the second region corresponding to each strand of steel wire. For example, based on the target transformation matrix... Figure 4 By performing an inverse affine transformation on the first region corresponding to each of the steel wires shown, we can obtain the following: Figure 5 The second region corresponding to each strand of steel wire shown.
[0068] For example, based on the target transformation matrix constructed based on the target rotation angle, for such Figure 3 The first wire rope image shown is transformed to obtain the following result: Figure 4the illustrated second steel wire rope image. Projection processing is performed on each pixel of the second steel wire rope image along the horizontal direction of the image to obtain projection points on the Y-axis and a target projection vector composed of the projection values of the projection points, that is, the second steel wire rope image is projected row by row to obtain a row projection vector P[y]. Statistics are calculated for non-zero projection values within an effective projection interval (i.e., an interval determined by the coordinate of the first projection point on the Y-axis and the coordinate of the last projection point on the Y-axis). For example, the mean μ of the target projection vector is calculated according to the formula μ = (∑P[y]) / (number of non-zero rows). The standard deviation σ of the target projection vector is calculated according to the formula σ = sqrt(∑(P[y] - μ)² / N), where N is the number of intervals. According to the mean and standard deviation of the target projection vector, a projection filtering value T of the target projection vector is determined according to the formula T = μ - k·σ, where k is an adaptive coefficient. Threshold filtering is performed on the projection points based on the projection filtering value T, that is, if P[y] ≥ T, the projection value of the projection point is retained; if P[y] < T and y is outside the first and last effective strand regions, the projection value of the projection point is set to zero, so as to obtain Figure 4 the filtered projection curve shown on the left. Gaussian smoothing is performed on the filtered projection curve (the kernel size and σ can be adapted according to the steel wire rope specification), and then local maximum detection is performed. Specifically, connectivity analysis is performed on the binary projection B[y] to find all continuous non-zero intervals (i.e., vector intervals), the position corresponding to the projection maximum value (i.e., the second projection point) in each interval is found as the peak position y_peak[i] of the strand, and it is checked whether the height of the peak relative to the valley values on both sides is greater than a preset height. If yes, it is determined that the interval corresponds to one steel wire strand; otherwise, the interval is not processed. The Y-axis range [y_start[i], y_end[i]] of each strand in the rotating coordinate system is determined through the valley positions (i.e., endpoints) of the interval. For the Y-axis range of each strand, an image region corresponding to the strand is extracted in the rotating coordinate system (i.e., the coordinate system where the second steel wire rope image is located), and then mapped back to the original image coordinate system (i.e., the coordinate system where the first steel wire rope image is located) through inverse affine transformation. The transformed region is intersected with the original steel wire rope mask to obtain an accurate pixel set of the strand. Contour detection is performed on the set to extract a polygonal contour, so as to obtain the accurate boundary of the strand.
[0069] Step S105: Defect detection is performed on the steel wire based on the second region to obtain a defect detection result of the steel wire.
[0070] Specifically, for each positioned strand region, detailed defective monofilament identification can be performed, for example, a pre-trained defect detection model is used to detect defects of the steel wire and / or count the number, position, and severity of defective monofilaments.
[0071] For each strand of steel wire, generate corresponding defect detection results, such as strand ID, total number of defective filaments in the strand, detailed information of the defective filaments (index, type, location, severity), and statistical indicators such as the defect rate of the strand. The above data is output in a standardized format for use by the subsequent defect inference engine.
[0072] The wire rope defect location and detection method of this application can be implemented by determining a target rotation angle for transforming a first wire rope image, so that the orientation of each strand of wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches a first direction; transforming the first wire rope image according to the target transformation matrix constructed based on the target rotation angle, obtaining a transformed second wire rope image; determining a first region corresponding to each strand of wire in the second wire rope image; locating a second region corresponding to each strand of wire in the first wire rope image based on the first region corresponding to each strand of wire and the target transformation matrix; and performing defect detection on the wire based on the second region to obtain the defect detection result of the wire. Thus, by determining the optimal rotation angle and establishing a coordinate system most conducive to strand separation, the individual strands of the wire rope can be located, thereby achieving strand-level defect detection and significantly improving the defect detection capability of the wire rope.
[0073] To facilitate better implementation of the wire rope defect location and detection method provided in this application, this application also provides an apparatus based on the above-described wire rope defect location and detection method. The meanings of the terms used are the same as in the above-described wire rope defect location and detection method, and specific implementation details can be found in the descriptions in the method embodiments.
[0074] For example, such as Figure 6 As shown, this application provides an apparatus based on the above-described wire rope defect location and detection method. This wire rope defect location and detection apparatus may include: Angle determination module 201 is used to determine the target rotation angle for transforming the first wire rope image, so that the direction of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction. The transformation module 202 is used to transform the first wire rope image according to the target transformation matrix constructed based on the target rotation angle to obtain the transformed second wire rope image. The region first determination module 203 is used to determine the first region corresponding to each strand of steel wire in the second steel wire rope image; The second region determination module 204 is used to locate the second region corresponding to each strand of steel wire in the first steel wire rope image based on the first region corresponding to each strand of steel wire and the target transformation matrix. The detection module 205 is used to perform defect detection on the steel wire based on the second region and obtain the defect detection results of the steel wire.
[0075] In some embodiments, the angle determining module 201 includes: The first transformation unit is used to transform the wire rope in the first wire rope image according to the transformation matrix determined based on the rotation angle for each rotation angle within the preset rotation angle range, so as to obtain the transformed wire rope image. The first projection unit is used to project the transformed wire rope image to obtain a projection vector. The quantity determination unit is used to determine the total number of projection points and the first number of projection points whose projection value is a first projection value, based on the projection vector. The sparsity determination unit is used to determine the sparsity corresponding to the rotation angle based on the total quantity and the first quantity; An angle determination unit is used to determine the target rotation angle for transforming the first wire rope image based on the sparsity corresponding to each rotation angle.
[0076] In some embodiments, the angle determining unit further includes: The maximum sparsity determination sub-unit is used to determine the maximum sparsity among the sparsity corresponding to each rotation angle; Angle determination subunit is used to take the rotation angle corresponding to the maximum sparsity as the target rotation angle for transforming the first wire rope image.
[0077] In some embodiments, the aforementioned region first determining module 203 includes: The second projection unit is used to project each pixel of the second wire rope image along the direction of the first coordinate axis to obtain the projection points on the second coordinate axis and the target projection vector composed of the projection values of the projection points. The projection values of the projection points are determined based on the number of pixels projected to the same position. At least some of the projection points have projection values of the first projection value. The direction of the first coordinate axis matches the first direction. The first partitioning unit is used to partition the target projection vector based on the first projection value to obtain several vector intervals; The range determination unit is used to determine the coordinate range of each steel wire on the second coordinate axis based on the coordinate positions of the endpoints of each vector interval on the second coordinate axis. The region determination unit is used to extract the image regions of the second wire rope image located in each coordinate range, as the first region where each wire is located.
[0078] In some embodiments, prior to the first dividing unit, the wire rope defect location and detection device further includes: The first projection point determining unit is used to determine the first projection point in the target projection vector whose projection value is lower than the projection filter value, wherein the projection filter value includes a value determined based on at least one statistical distribution feature of the target projection vector; The update unit is used to update the projection value of the first projection point to the first projection value.
[0079] In some embodiments, the above-mentioned wire rope defect location and detection device further includes: The second partitioning unit is used to perform preliminary partitioning of the target projection vector based on the first projection value to obtain a specified vector interval, wherein the specified vector interval includes the first vector interval and the last vector interval; The judgment unit is used to determine whether to update the projection value of the first projection point to the first projection value if the first projection point belongs to the specified vector interval.
[0080] In some embodiments, the above-mentioned wire rope defect location and detection device further includes: The second projection point determination unit is used to determine the second projection point with the largest projection value in each vector interval.
[0081] Based on this, the aforementioned scope-determining unit includes: The range determination sub-unit is used to determine the coordinate range of the steel wire corresponding to the vector interval on the second coordinate axis based on the coordinate position of the endpoint of the vector interval when the difference between the projection value of the second projection point and the projection value of the endpoint is greater than a preset difference.
[0082] The wire rope defect location and detection device according to the embodiments of this application can determine the target rotation angle for transforming the first wire rope image through the angle determination module 201, so that the direction of each strand of wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; the transformation module 202 transforms the first wire rope image according to the target transformation matrix constructed based on the target rotation angle to obtain the transformed second wire rope image; the region first determination module 203 determines the first region corresponding to each strand of wire in the second wire rope image; the region second determination module 204 locates the second region corresponding to each strand of wire in the first wire rope image according to the first region corresponding to each strand of wire and the target transformation matrix; the detection module 205 performs defect detection on the wire based on the second region to obtain the defect detection result of the wire. In this way, by determining the optimal rotation angle to establish a coordinate system most conducive to strand separation, the individual strands of the wire rope are located, thereby realizing strand-level defect detection and significantly improving the defect detection capability of the wire rope.
[0083] In practice, each of the above modules can be implemented as an independent entity or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation methods and corresponding beneficial effects of each of the above modules, please refer to the previous method embodiments, which will not be repeated here.
[0084] This application also provides an electronic device, such as... Figure 7 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically: The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more storage media, a power supply 303, and an input unit 304. Those skilled in the art will understand that... Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 301 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes computer programs and / or modules stored in the memory 302, and calls data stored in the memory 302 to perform various functions and process data. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 301.
[0085] The memory 302 can be used to store computer programs and modules. The processor 301 executes various functional applications and diagnostic schemes by running the computer programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as voice prompt function, text input function, voice input function, display mode selection function, etc.), etc.; the data storage area may store data created according to the use of the electronic device. In addition, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include memory electronics to provide the processor 301 with access to the memory 302.
[0086] The electronic device also includes a power supply 303 that supplies power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 303 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0087] The electronic device may also include an input unit 304, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0088] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 302 according to the following instructions, and the processor 301 runs the computer programs stored in the memory 302 to realize various functions. For example: Determine the target rotation angle for transforming the first wire rope image, so that the orientation of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; Based on the target transformation matrix constructed based on the target rotation angle, the first wire rope image is transformed to obtain the transformed second wire rope image. Determine the first region corresponding to each strand of steel wire in the second steel wire rope image; Based on the first region corresponding to each strand of steel wire and the target transformation matrix, locate the second region corresponding to each strand of steel wire in the first steel wire rope image; Defect detection of the steel wire is performed based on the second region to obtain the defect detection results of the steel wire.
[0089] Therefore, the electronic device provided in this application embodiment can determine the target rotation angle for transforming a first wire rope image, so that the orientation of each strand of wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; transform the first wire rope image according to the target transformation matrix constructed based on the target rotation angle to obtain a transformed second wire rope image; determine the first region corresponding to each strand of wire in the second wire rope image; locate the second region corresponding to each strand of wire in the first wire rope image according to the first region corresponding to each strand of wire and the target transformation matrix; and perform defect detection on the wire based on the second region to obtain the defect detection result of the wire. Thus, by determining the optimal rotation angle and establishing a coordinate system most conducive to strand separation, the individual strands of the wire rope can be located, thereby achieving strand-level defect detection and significantly improving the defect detection capability of the wire rope.
[0090] For details on the specific implementation methods and corresponding beneficial effects of each of the above operations, please refer to the detailed description of the wire rope defect location and detection method above, which will not be repeated here.
[0091] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a storage medium and loaded and executed by a processor.
[0092] Therefore, embodiments of this application provide a storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the wire rope defect location and detection methods provided in this application. For example, the computer program can execute the following steps: Determine the target rotation angle for transforming the first wire rope image, so that the orientation of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; Based on the target transformation matrix constructed based on the target rotation angle, the first wire rope image is transformed to obtain the transformed second wire rope image. Determine the first region corresponding to each strand of wire in the second wire rope image; Based on the first region corresponding to each strand of steel wire and the target transformation matrix, locate the second region corresponding to each strand of steel wire in the first steel wire rope image; Defect detection of the steel wire is performed based on the second region to obtain the defect detection results of the steel wire.
[0093] Therefore, the storage medium provided in this application embodiment can determine the target rotation angle for transforming the first wire rope image, so that the orientation of each strand of wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; transform the first wire rope image according to the target transformation matrix constructed based on the target rotation angle to obtain the transformed second wire rope image; determine the first region corresponding to each strand of wire in the second wire rope image; locate the second region corresponding to each strand of wire in the first wire rope image according to the first region corresponding to each strand of wire and the target transformation matrix; perform defect detection on the wire based on the second region to obtain the defect detection result of the wire. In this way, by determining the optimal rotation angle to establish a coordinate system most conducive to strand separation, the strands of wire rope can be located, thereby realizing strand-level defect detection and significantly improving the defect detection capability of wire rope.
[0094] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the previous embodiments, which will not be repeated here.
[0095] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0096] Since the computer program stored in the storage medium can execute the steps in any of the wire rope defect location and detection methods provided in the embodiments of this application, the beneficial effects that any of the wire rope defect location and detection methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0097] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer device to perform the aforementioned wire rope defect location and detection method.
[0098] The foregoing has provided a detailed description of a method, apparatus, electronic device, storage medium, and computer program product for locating and detecting defects in wire ropes, as provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for locating and detecting defects in steel wire ropes, characterized in that, The method includes: Determine the target rotation angle for transforming the first wire rope image, so that the orientation of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction; Based on the target transformation matrix constructed based on the target rotation angle, the first wire rope image is transformed to obtain the transformed second wire rope image; Determine the first region corresponding to each strand of steel wire in the second steel wire rope image; Based on the first region corresponding to each strand of steel wire and the target transformation matrix, locate the second region corresponding to each strand of steel wire in the first steel wire rope image; Defect detection is performed on the steel wire based on the second region to obtain the defect detection result of the steel wire; The step of determining the first region corresponding to each strand of wire in the second wire rope image includes: Each pixel of the second wire rope image is projected along the direction of the first coordinate axis to obtain the projection point on the second coordinate axis and the target projection vector composed of the projection value of the projection point. The projection value of the projection point is determined based on the number of pixels projected to the same position. At least some of the projection points have a first projection value. The direction of the first coordinate axis matches the first direction. Determine a first projection point in the target projection vector whose projection value is lower than the projection filter value, wherein the projection filter value includes a value determined based on at least one statistical distribution feature of the target projection vector; Based on the first projection value, the target projection vector is initially divided to obtain a specified vector interval, wherein the specified vector interval includes a first vector interval and a last vector interval; If the first projection point does not belong to the specified vector interval, the projection value of the first projection point is updated to the first projection value; If the first projection point belongs to the specified vector interval, the step of updating the projection value of the first projection point to the first projection value is not performed; Based on the first projection value and the target projection vector, the first region corresponding to each strand of steel wire in the second steel wire rope image is determined; The step of locating the second region corresponding to each strand of steel wire in the first steel wire rope image based on the first region corresponding to each strand of steel wire and the target transformation matrix includes: For each of the steel wires, an inverse affine transformation is performed on the first region corresponding to the steel wire based on the target transformation matrix to obtain the transformed region corresponding to the steel wire; The intersection of the transformed region corresponding to the steel wire and the mask of the first steel wire rope image is obtained to obtain the pixel set corresponding to the steel wire; Contour detection is performed on the pixel set corresponding to the steel wire to extract the polygonal contour, and the area enclosed by the polygonal contour in the first steel wire rope image is taken as the second region corresponding to the steel wire.
2. The method for locating and detecting defects in wire ropes according to claim 1, characterized in that, Determining the target rotation angle for transforming the first wire rope image includes: For each rotation angle within the preset rotation angle range, the wire rope in the first wire rope image is transformed according to the transformation matrix determined based on the rotation angle to obtain the transformed wire rope image. The transformed wire rope image is projected to obtain a projection vector; Based on the projection vector, determine the total number of projection points and the first number of projection points whose projection value is the first projection value; Based on the total quantity and the first quantity, determine the sparsity corresponding to the rotation angle; The target rotation angle for transforming the first wire rope image is determined based on the sparsity corresponding to each rotation angle.
3. The method for locating and detecting defects in steel wire ropes according to claim 2, characterized in that, Determining the target rotation angle for transforming the first wire rope image based on the sparsity corresponding to each rotation angle includes: Determine the maximum sparsity among the sparsities corresponding to each rotation angle; The rotation angle corresponding to the maximum sparsity is used as the target rotation angle for transforming the first wire rope image.
4. The method for locating and detecting defects in wire ropes according to claim 1, characterized in that, The step of determining the first region corresponding to each strand of steel wire in the second steel wire rope image based on the first projection value and the target projection vector includes: Based on the first projection value, the target projection vector is divided to obtain several vector intervals; Based on the coordinate positions of the endpoints of each vector interval on the second coordinate axis, determine the coordinate range of each steel wire on the second coordinate axis; Extract the image regions of the second wire rope image located within each of the coordinate ranges, and use them as the first regions where each wire is located.
5. The method for locating and detecting defects in wire ropes according to claim 4, characterized in that, The method further includes: Determine the second projection point with the largest projection value in each of the vector intervals; Determining the coordinate range of each steel wire on the second coordinate axis based on the coordinate positions of the endpoints of each vector interval on the second coordinate axis includes: If the difference between the projection value of the second projection point and the projection value of the endpoint is greater than a preset difference, the coordinate range of the wire corresponding to the vector interval on the second coordinate axis is determined according to the coordinate position of the endpoint of the vector interval on the second coordinate axis.
6. A wire rope defect location and detection device, characterized in that, The device includes: An angle determination module is used to determine the target rotation angle for transforming the first wire rope image, so that the direction of each wire in the image obtained after transforming the first wire rope image based on the target rotation angle matches the first direction. The transformation module is used to transform the first wire rope image according to the target transformation matrix constructed based on the target rotation angle to obtain the transformed second wire rope image. The region first determination module is used to determine the first region corresponding to each strand of steel wire in the second steel wire rope image; The second region determination module is used to locate the second region corresponding to each strand of steel wire in the first steel wire rope image based on the first region corresponding to each strand of steel wire and the target transformation matrix; The detection module is used to perform defect detection on the steel wire based on the second region, and obtain the defect detection result of the steel wire; The first region determination module is further configured to: project each pixel of the second wire rope image along the direction of the first coordinate axis to obtain projection points on the second coordinate axis and a target projection vector composed of the projection values of the projection points, wherein the projection values of the projection points are determined based on the number of pixels projected to the same position, at least some projection points have projection values of the first projection value, and the direction of the first coordinate axis matches the first direction; determine a first projection point in the target projection vector whose projection value is lower than the projection filter value, wherein the projection filter value includes a value determined based on at least one statistical distribution feature of the target projection vector; preliminarily divide the target projection vector based on the first projection value to obtain a specified vector interval, wherein the specified vector interval includes a first vector interval and a last vector interval; update the projection value of the first projection point to the first projection value when the first projection point does not belong to the specified vector interval; not perform the step of updating the projection value of the first projection point to the first projection value when the first projection point belongs to the specified vector interval; and determine the first region corresponding to each strand of wire in the second wire rope image based on the first projection value and the target projection vector. The second region determination module is further configured to: perform an inverse affine transformation on the first region corresponding to each strand of steel wire based on the target transformation matrix to obtain the transformed region corresponding to the steel wire; intersect the transformed region corresponding to the steel wire with the mask of the first steel wire rope image to obtain the pixel set corresponding to the steel wire; perform contour detection on the pixel set corresponding to the steel wire, extract polygon contours, and take the region enclosed by the polygon contours in the first steel wire rope image as the second region corresponding to the steel wire.
7. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the wire rope defect location and detection method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It includes a computer program that, when run on an electronic device, causes the electronic device to perform the steps of the wire rope defect location and detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Segmentation algorithm of steel wire rope image
CN117934521A
Steel wire rope surface defect detection method and system based on machine vision
CN120070433A
