A method for segmenting wire rope images
Through C++ language programming combined with Gabor filtering and morphological processing, the signal stability and segmentation accuracy problems of wire rope detection in the prior art are solved, and efficient and accurate wire rope status evaluation is achieved to ensure the safe operation of the equipment.
Patent Information
- Application Number
- CN202410119484.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-01-29
AI Technical Summary
The prior art has low signal-to-noise ratio, low spatial resolution, low sampling sensitivity in wire rope detection, and poor repeatability and stability of electromagnetic detection, resulting in unsatisfactory detection and high risks and operational risks. Traditional image processing methods have limited ability to handle complex texture features and background noise, making it difficult to achieve efficient and accurate wire rope status evaluation.
The ontology segmentation of the wire rope image was performed using C++ language programming, combined with Gabor filtering and morphological processing methods, and the watershed segmentation was performed using the watershed function, and then the rope-strand segmentation was performed. The deflection angle was corrected and the average diameter was calculated through PCA analysis, and finally the morphological transformation was used to obtain the segmentation results of the area between the wire rope-strands.
It realizes efficient automated processing of wire rope images, improves segmentation accuracy, ensures safe operation of equipment, and can accurately evaluate the wire rope status, reducing errors and inconsistencies.
Smart Images

Figure CN117934521B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for segmenting wire rope images, specifically a method for segmenting wire rope images when regularly inspecting and evaluating wire ropes based on image processing detection technology, belonging to the technical field of wire rope detection. Background Art
[0002] With the development of modern industrial technology, wire ropes play a crucial role in multiple industries, such as cranes, elevators, mining, and construction. When the equipment is working, the wire ropes are easily damaged due to the influence of the use environment. In particular, the broken wires in the wire ropes have a great impact on their performance and reliability. The quality and condition of the wire ropes are directly related to the safe operation of the equipment. Therefore, it is particularly important to regularly inspect and evaluate the wire ropes.
[0003] Currently, the detection of wire ropes usually adopts the electromagnetic detection method, that is, an external magnetic field is applied to the wire ropes, and the change in the magnetic permeability of the wire ropes is used to detect the defects of the wire ropes. However, due to reasons such as electromagnetic interference, humidity, and temperature fluctuations, not only does the electromagnetic probe of the wire rope have problems such as low signal-to-noise ratio, low spatial resolution, and low sampling sensitivity, but also due to the uncertainty of the direction of the magnetic induction lines and the change in distance during the detection process, the repeatability and stability of the signals are relatively low, and there are great obstacles in quantitatively detecting the damaged signals and quantitatively detecting the wire rope defects. At the same time, the electromagnetic detection method will bring high risks of interference and operation risks. Therefore, the effect of detecting wire ropes by the electromagnetic method is not ideal.
[0004] In order to more efficiently, quickly, and accurately inspect wire ropes, in recent years, many detection technologies based on image processing have been proposed. These technologies usually involve converting the real physical characteristics of wire ropes into digital images and processing these images to obtain key information about wire ropes. However, due to the complex structure and numerous textures of wire ropes, coupled with possible environmental factor interferences (such as dust, grease, uneven illumination, etc.), image processing becomes challenging. Traditional wire rope image processing methods mainly rely on manual or semi-automatic methods, which may lead to inconsistent or inaccurate analysis results to a certain extent. In addition, many methods have limited capabilities in processing complex texture features and background noise. Especially when performing fine strand analysis, conventional image processing methods may not be able to obtain satisfactory results. Summary of the Invention
[0005] Aiming at the problems existing in the above-mentioned prior art, the present invention provides a method for segmenting wire rope images, which can perform efficient and automated processing on wire rope images and has high precision, thereby achieving accurate evaluation of the state of wire ropes and ensuring the safe operation of equipment.
[0006] To achieve the above object, the method for segmenting the steel wire rope image includes segmenting the steel wire rope body and segmenting the strands of the steel wire rope based on the segmentation result of the steel wire rope body, specifically including the following steps:
[0007] Step1, program in C++ language to segment the steel wire rope image, and obtain the accurate direction and the left and right contour point coordinates of the steel wire rope in the picture. Specifically:
[0008] Step1-1, filter the steel wire rope image in 8 different directions through Gabor filtering to extract the texture features of the steel wire rope image;
[0009] Step1-2, after performing binarization processing and morphological operations on the filtered image, find the largest contour of the image, perform morphological operations again to obtain the foreground and background images, combine them to obtain a marker image, and use the watershed function to input the original steel wire rope image and the marker image to obtain the segmentation result of the steel wire rope body;
[0010] Step1-3, traverse the segmented image, find the points with sudden changes in gray value in the image to obtain the left and right contour point coordinates of the steel wire rope, obtain the deflection angle of the steel wire rope in the image through PCA analysis, and finally obtain the average diameter of the corrected steel wire rope through the left and right contour point coordinates and the deflection angle;
[0011] Step2, program in C++ language, erase the redundant background area of the image according to the result of the body segmentation, and use the watershed segmentation algorithm to segment the strands of the steel wire rope image, and finally obtain the segmentation result of the area between the strands of the steel wire rope. Specifically:
[0012] Step2-1, traverse the image according to the left and right contour point coordinate results of the steel wire rope obtained from the steel wire rope body segmentation. When the point coordinates are outside the steel wire rope area, set the gray value at that point position to 255 to erase the redundant background area of the image;
[0013] Step2-2, determine the diameter multiplication coefficient required for the current picture according to the average diameter of the steel wire rope in the picture obtained from the steel wire rope body segmentation;
[0014] Step2-3, according to the obtained diameter multiplication coefficient, obtain the foreground picture and background picture of the steel wire rope image through morphological transformation of the image, and combine the foreground and background pictures to obtain a marker image;
[0015] Step2-4, use the watershed function, input the original steel wire rope picture and the obtained marker image, perform watershed segmentation, and obtain the segmentation result of the area between the strands of the steel wire rope.
[0016] Furthermore, in Step1-1, the specific method for extracting the texture features of the steel wire rope image is as follows:
[0017] Step1-1-1. First, determine the parameters required for the Gabor filter. Construct a Gabor filter kernel with a size of 3*3, define the standard deviation of the Gabor filter as 3.0, define the wavelength of the Gabor filter as CV_PI / 8, define the spatial aspect ratio of the Gabor filter as 0.5, define the phase offset of the Gabor filter as CV_PI*0.5, and define the data type of the Gabor filter as 64-bit floating point number;
[0018] Step1-1-2. Use the getGaborKernel function to obtain 8 Gabor filters in different directions, and use the filter2D function to perform Gabor filtering on the image;
[0019] Step1-1-3. Traverse the obtained 8 filtered result images in different directions, and take the maximum value in all the filtered images and combine them to obtain the final filtered result.
[0020] Furthermore, in Step1-2, use the watershed function to input the original wire rope image and the marked image to obtain the segmentation result of the wire rope body, as follows:
[0021] Step1-2-1. First, use the threshold function, set the parameter as THRESH_OTSU, and perform binarization processing on the filtered result obtained in Step1-1-3;
[0022] Step1-2-2. Use the getStructuringElement function, set the parameter as MORPH_ELLIPSE, construct a morphological kernel with a size of 9*9, and use the dilate and erode functions to perform morphological operations of "4 times dilation - 8 times erosion - 4 times re-dilation" on the binarized image;
[0023] Step1-2-3. Use the findContours function to find the largest contour in the image after the morphological operation, and use the drawContours function to draw the largest contour on a blank black image with the same size as the original image;
[0024] Step1-2-4. First, use the dilate function on the drawn image, set the default parameters to perform a single dilation on the image, use the threshold function, set the maximum gray value as 128 and the minimum gray value as 1, perform binarization processing on the dilated image to obtain the background image, and combine the drawn image and the background image using the overloaded operator "+" of the Mat parameter type to obtain the marked image;
[0025] Step1-2-5: Use the watershed function. Input the original image and the marker image obtained in Step1-2-4, perform watershed segmentation, convert the segmented marker image to the CV_8U type, and obtain the final segmentation result.
[0026] Furthermore, the specific steps of Step1-3 are as follows:
[0027] Step1-3-1: First, traverse the segmented image row by row from left to right to detect the sudden change points of gray values to obtain the left contour coordinates of the steel wire rope. Then, traverse the segmented image row by row from right to left to detect the sudden change points of gray values to obtain the right contour coordinates of the steel wire rope.
[0028] Step1-3-2: Press the obtained left and right contour point coordinates into a two-column Mat-type parameter in sequence. Use the pca_analysis function, set the parameter to PCA::DATA_AS_ROW, and perform PCA analysis to obtain the deflection angle of the steel wire rope in the image.
[0029] Step1-3-3: According to the obtained deflection angle, reverse-rotate the left and right contour point coordinates by the same angle to correct them to the vertical position, and obtain the average diameter of the steel wire rope by calculating the column coordinate difference of the corrected left and right contour point coordinates.
[0030] Furthermore, the specific steps of Step2-2 are as follows:
[0031] Step2-2-1: First, perform strand segmentation on the steel wire rope image with a certain determined diameter D0 to obtain a set of segmentation parameters for the steel wire rope of this diameter. The segmentation parameters include the structuring element sizes M0 and M1 and the number of operations X0 and X1 in each morphological operation, and record this set of parameters.
[0032] Step2-2-2: According to the average diameter D of the current steel wire rope image obtained after each body segmentation, obtain the diameter multiplication coefficient n = D / D0 for the current steel wire rope.
[0033] Furthermore, the specific steps of Step2-3 are as follows:
[0034] Step2-3-1: Use the threshold function to select the THRESH_OTSU parameter to obtain the global threshold T of the image. Then, use the threshold function again, set the threshold to T, the maximum gray value to 255, and select the THRESH_BINARY parameter to perform threshold processing on the steel wire rope image.
[0035] Step2-3-2: Use the morphologyEx function with the parameter MORPH_CLOSE. Use the structuring element size M0 determined in Step2-2-1 for the closing operation, and multiply the number of closing operation times X0 determined in Step2-2-1 by the diameter multiplication factor n determined in Step2-2-2 to obtain the current required number of morphological operations X = n * X0. Perform a morphological closing operation on the thresholded image to obtain the foreground image;
[0036] Step2-3-3: Use the dilate function. Use the structuring element size M1 determined in Step2-2-1 for the erosion operation, and multiply the number of erosion operation times X1 determined in Step2-2-1 by the diameter multiplication factor n determined in Step2-2-2 to obtain the current required number of morphological operations X = n * X1. Perform an erosion operation on the thresholded image, and then use the threshold function on the eroded image with the threshold set to 1, the maximum gray value set to 128, and the parameter THRESH_BINARY_INV selected to obtain the background image;
[0037] Step2-3-4: Use the overloaded operator '+' of the Mat parameter type to add the foreground image and the background image to obtain the marker image.
[0038] Further, in Step2-4, after performing the watershed segmentation, convert the marker image after the segmentation to the CV_8U type to obtain the segmentation result of the area between the wire strands of the steel wire rope.
[0039] Compared with the prior art, the segmentation method of the steel wire rope image includes two parts: body segmentation and strand segmentation. First, use the c++ programming language to extract the image texture features through Gabor filtering, combine with the morphological processing method to obtain the marker image, then apply the watershed function for watershed segmentation to obtain the body segmentation result, and then continue with the strand segmentation based on the obtained body segmentation result to finally obtain the segmentation result of the area between the wire strands of the steel wire rope, which can perform efficient and automated processing on the steel wire rope image and has high accuracy, thereby achieving accurate assessment of the state of the steel wire rope and ensuring the safe operation of the equipment. Description of the Drawings
[0040] Figure 1 is the original image of the steel wire rope;
[0041] Figure 2 is the Gabor filtering result image of the present invention;
[0042] Figure 3 is the body segmentation marker image of the present invention;
[0043] Figure 4 is the body segmentation result image of the present invention;
[0044] Figure 5 It is a diagram showing the position of the segmentation contour of the present invention in the original image;
[0045] Figure 6 It is a diagram showing the result of strand segmentation of the present invention;
[0046] Figure 7 It is a diagram showing the actual position of the result of strand segmentation of the present invention;
[0047] Figure 8 It is a diagram showing the result of strand segmentation obtained by using the Segment Anything deep learning segmentation method;
[0048] Figure 9 It is a diagram showing the segmentation contour obtained by using the Segment Anything deep learning segmentation method;
[0049] Figure 10 It is a diagram showing the position of the segmentation contour obtained by using the Segment Anything deep learning segmentation method in the original image;
[0050] Figure 11 It is a diagram showing the result of strand segmentation obtained by using the YOLOV8_SEG deep learning segmentation method;
[0051] Figure 12 It is a diagram showing the segmentation contour obtained by using the YOLOV8_SEG deep learning segmentation method;
[0052] Figure 13 It is a diagram showing the position of the segmentation contour obtained by using the YOLOV8_SEG deep learning segmentation method in the original image. Detailed implementation mode
[0053] The segmentation method of this steel wire rope image includes two parts: body segmentation and strand segmentation. First, the texture features of the image are extracted by Gabor filtering using the c++ programming language, and a marker map is obtained by combining morphological processing methods. Then, the watershed function is applied for watershed segmentation to obtain the body segmentation result. Subsequently, based on the obtained body segmentation result, strand segmentation is continued, and finally, the segmentation result of the area between the strands of the steel wire rope is obtained. The present invention will be further described below with reference to the accompanying drawings.
[0054] The segmentation method of this steel wire rope image includes the segmentation of the steel wire rope body and the segmentation of the steel wire rope strands based on the result of the steel wire rope body segmentation, and specifically includes the following steps:
[0055] Step1, program in c++ language to perform body segmentation on the steel wire rope image (as Figure 1 shown) to obtain the accurate direction and the coordinates of the left and right contour points of the steel wire rope in the picture. Specifically:
[0056] Step1-1. Filter the wire rope image in 8 different directions through Gabor filtering to extract the texture features of the wire rope image.
[0057] The specific steps for extracting the texture features of the wire rope image are as follows:
[0058] Step1-1-1. First, determine the parameters required for the Gabor filter. Construct a Gabor filter kernel size of 3*3, define the standard deviation of the Gabor filter as 3.0, define the wavelength of the Gabor filter as CV_PI / 8, define the spatial aspect ratio of the Gabor filter as 0.5, define the phase offset of the Gabor filter as CV_PI*0.5, and define the data type of the Gabor filter as 64-bit floating point number.
[0059] Step1-1-2. Use the getGaborKernel function to obtain Gabor filters in 8 different directions, and use the filter2D function to perform Gabor filtering on the image.
[0060] Step1-1-3. Traverse the obtained filtered result images in 8 different directions, and take the maximum value in all filtered images to combine and obtain the final filtered result as Figure 2 shown.
[0061] Step1-2. After performing binarization processing and morphological operations on the filtered image, find the largest contour of the image, perform morphological operations again to obtain the foreground and background images, and combine them to obtain the labeled image as Figure 3 shown. Use the watershed function to input the original wire rope image and the labeled image to obtain the segmentation result of the wire rope body as Figure 4 shown.
[0062] The specific steps for using the watershed function to input the original wire rope image and the labeled image to obtain the segmentation result of the wire rope body are as follows:
[0063] Step1-2-1. First, use the threshold function, set the parameter as THRESH_OTSU, and perform binarization processing on the filtered result obtained in Step1-1-3.
[0064] Step1-2-2. Use the getStructuringElement function, set the parameter as MORPH_ELLIPSE, construct a morphological kernel with a size of 9*9, and use the dilate and erode functions to perform morphological operations of "4 times dilation - 8 times erosion - 4 times re-dilation" on the binarized image.
[0065] Step1-2-3. Use the findContours function to find the largest contour in the image after morphological operations, and use the drawContours function to draw the largest contour on a blank black image of the same size as the original image.
[0066] Step1-2-4. For the drawn image, first use the dilate function to perform a single dilation on the image with default parameters, and use the threshold function to set the maximum gray value to 128 and the minimum gray value to 1 to perform binary processing on the dilated image to obtain the background image. Combine the drawn image and the background image using the overloaded operator '+' of the Mat parameter type to obtain the marker image.
[0067] Step1-2-5. Use the watershed function, input the original image and the marker image obtained in Step1-2-4, perform watershed segmentation, convert the marker image after segmentation to the CV_8U type to obtain the final segmentation result. The position of the segmentation contour in the original image is as Figure 5 shown.
[0068] Step1-3. Traverse the segmented image, find the points with sudden changes in gray value in the image, obtain the coordinate points of the left and right contours of the steel wire rope, obtain the deflection angle of the steel wire rope in the image through PCA analysis, and finally obtain the average diameter of the corrected steel wire rope through the coordinate points of the left and right contours and the deflection angle. Specifically:
[0069] Step1-3-1. First, traverse the segmented image row by row from left to right to detect the sudden change points of gray value to obtain the left contour coordinates of the steel wire rope, and then traverse the segmented image row by row from right to left to detect the sudden change points of gray value to obtain the right contour coordinates of the steel wire rope.
[0070] Step1-3-2. Press the obtained left and right contour point coordinates into a Mat-type parameter with two columns in sequence, use the pca_analysis function, set the parameter to PCA::DATA_AS_ROW, perform PCA analysis, and obtain the deflection angle of the steel wire rope in the image.
[0071] Step1-3-3. According to the obtained deflection angle, rotate the left and right contour point coordinates in the opposite direction by the same angle to correct them to the vertical position, and obtain the average diameter of the steel wire rope by calculating the difference in column coordinates of the corrected left and right contour point coordinates.
[0072] Step2. Program in C++ language. After erasing the redundant background area of the image according to the result of the ontology segmentation, use the watershed segmentation algorithm to perform strand segmentation on the steel wire rope image as Figure 6 shown, and finally obtain the segmentation result of the area between the strands of the steel wire rope as Figure 7 shown. Specifically:
[0073] Step2-1. Traverse the image according to the coordinate results of the left and right contour points of the steel wire rope obtained by dividing the steel wire rope body. When the point coordinates are outside the steel wire rope area, set the gray value at that point position to 255, erase the redundant background area of the image, reduce unnecessary subsequent calculations, and improve the running speed of the algorithm.
[0074] Step2-2. Determine the diameter multiplication factor required for the current image according to the average diameter of the steel wire rope in the picture obtained by dividing the steel wire rope body. Specifically:
[0075] Step2-2-1. First, perform strand segmentation on the steel wire rope image with a certain determined diameter D0. After several attempts and adjustments, obtain a set of appropriate segmentation parameters for the steel wire rope of this diameter, mainly referring to the structuring element sizes M0 and M1 and the number of operations X0 and X1 in each morphological operation, and record this set of parameters.
[0076] Step2-2-2. Divide the average diameter D of the current steel wire rope image obtained after each body segmentation by D0 to obtain the diameter multiplication factor n = D / D0 for the current steel wire rope.
[0077] Step2-3. According to the obtained diameter multiplication factor, through morphological transformation of the image, obtain the foreground image and background image of the steel wire rope image, and combine the foreground and background images to obtain a marker image. Specifically:
[0078] Step2-3-1. Use the threshold function to select the THRESH_OTSU parameter to obtain the global threshold T of the image. Then use the threshold function again, set the threshold to T, the maximum gray value to 255, and the parameter to THRESH_BINARY to perform threshold processing on the steel wire rope image.
[0079] Step2-3-2. Use the morphologyEx function, select the MORPH_CLOSE parameter, use the structuring element size M0 determined in Step2-2-1 for the closing operation, and use the number of closing operation times X0 determined in Step2-2-1 multiplied by the diameter multiplication factor n determined in Step2-2-2 to obtain the required number of morphological operations X = n*X0 for the current situation. Perform morphological closing operation on the threshold-processed image to obtain the foreground image.
[0080] Step2-3-3: Use the dilate function. Use the size M1 of the structuring element determined in Step2-2-1 for erosion, and multiply the number of erosion operations X1 determined in Step2-2-1 by the diameter multiplication factor n determined in Step2-2-2 to obtain the current required number of morphological operations X = n * X1. Perform an erosion operation on the thresholded image. Then, use the threshold function on the eroded image, set the threshold to 1, the maximum gray value to 128, and select the parameter THRESH_BINARY_INV to obtain the background image.
[0081] Step2-3-4: Use the overloaded operator "+" of the Mat parameter type to add the foreground image and the background image to obtain the marker image.
[0082] Step2-4: Use the watershed function, input the original wire rope image and the obtained marker image, perform watershed segmentation, and convert the segmented marker image to the CV_8U type to obtain the segmentation result of the area between the wire rope strands.
[0083] To verify the effectiveness of the segmentation method for this wire rope image, the Segement Anything deep learning segmentation method and the YOLOV8_SEG deep learning segmentation method are specifically used for comparison with the segmentation method of this wire rope image. As Figures 8 to 10 shown, for the segmentation result, contour map, and the position of the segmentation contour in the original image of the same picture obtained by using the Segement Anything deep learning segmentation method, there are several interference regions in the obtained segmentation result map compared with the segmentation result map obtained by the segmentation method of this wire rope image, and the segmentation contour does not fit well with the left and right edges of the wire rope, resulting in poor accuracy. As Figures 11 to 13 shown, for the segmentation result, contour map, and the position of the segmentation contour in the original image of the same picture obtained by using the YOLOV8_SEG deep learning segmentation method, the obtained segmentation result map is too rough compared with the segmentation result map obtained by the segmentation method of this wire rope image, does not fit well with the left and right edges of the wire rope, and has poor accuracy. The actual diameter, error, and single-time consumption of the final wire rope obtained by the segmentation method of this wire rope image, the Segement Anything deep learning segmentation method, and the YOLOV8_SEG deep learning segmentation method are shown in Table 1 below.
[0084] Table 1 Data comparison table of the method of the present invention, the Segement Anything method, and the YOLOV8_SEG method
[0085]
[0086] As can be seen from Table 1 above, compared with the deep learning segmentation methods of Segment Anything and YOLOV8_SEG, the method of the present invention can obtain relatively accurate detection results in a shorter time.
Claims
1. A method for segmenting wire rope images, including the segmentation of the wire rope body and the segmentation of wire rope strands based on the segmentation result of the wire rope body, characterized in that, Specifically, it includes the following steps: Step1, program in C++ language to perform ontology segmentation on the wire rope image, and obtain the accurate direction and left and right contour point coordinates of the wire rope in the picture. Specifically: Step1-1, filter the wire rope image in 8 different directions through Gabor filtering to extract the texture features of the wire rope image; Step1-2, after performing binarization processing and morphological operations on the filtered image, find the largest contour of the image, perform morphological operations again to obtain the foreground and background images, combine them to obtain the marker image, and use the watershed function to input the original wire rope image and the marker image to obtain the wire rope ontology segmentation result; Step1-3, traverse the segmented image, find the points with sudden changes in gray value in the image, obtain the left and right contour point coordinates of the wire rope, obtain the deflection angle of the wire rope in the image through PCA analysis, and finally obtain the average diameter of the corrected wire rope through the left and right contour point coordinates and the deflection angle; Step2, program in C++ language, according to the result of ontology segmentation, erase the redundant background area of the image, and use the watershed segmentation algorithm to perform strand segmentation on the wire rope image, and finally obtain the segmentation result of the area between the wire rope strands. Specifically: Step2-1, traverse the image according to the left and right contour point coordinate results of the wire rope obtained from the wire rope ontology segmentation. When the point coordinates are outside the wire rope area, set the gray value at that point position to 255 to erase the redundant background area of the image; Step2-2, determine the diameter multiplication factor required for the current picture according to the average diameter of the wire rope in the picture obtained from the wire rope ontology segmentation; Step2-3, according to the obtained diameter multiplication factor, through the morphological transformation of the image, obtain the foreground image and background image of the wire rope image, and combine the foreground and background images to obtain the marker image; Step2-4, use the watershed function, input the original wire rope image and the obtained marker image, perform watershed segmentation, and obtain the segmentation result of the area between the wire rope strands.
2. The segmentation method of the steel wire rope image according to claim 1, wherein In Step1-1, the specific method for extracting the texture features of the wire rope image is as follows: Step1-1-1, first determine the parameters required for the Gabor filter, construct the Gabor filter kernel size as 3*3, define the standard deviation of the Gabor filter as 3.0, define the wavelength of the Gabor filter as CV_PI / 8, define the spatial aspect ratio of the Gabor filter as 0.5, define the phase offset of the Gabor filter as CV_PI*0.5, and define the data type of the Gabor filter as 64-bit floating point number; Step1-1-2, use the getGaborKernel function to obtain Gabor filters in 8 different directions, and use the filter2D function to perform Gabor filtering on the image; Step1-1-3, traverse the obtained filtered result images in 8 different directions, and take the maximum value in all filtered images and combine them to obtain the final filtered result.
3. The method for segmenting a wire rope image according to claim 2, wherein In Step1-2, the watershed function is used to input the original wire rope image and the marked image to obtain the segmentation result of the wire rope body, which is as follows: Step1-2-1: First, use the threshold function with the parameter set to THRESH_OTSU to perform binarization on the filtering result obtained in Step1-1-3; Step1-2-2: Use the getStructuringElement function with the parameter set to MORPH_ELLIPSE to construct a morphological kernel of size 9*9. Then use the dilate and erode functions to perform a morphological operation of "4 times dilation - 8 times erosion - 4 times re-dilation" on the binarized image; Step1-2-3: Use the findContours function to find the largest contour in the image after the morphological operation, and use the drawContours function to draw the largest contour on a blank black image of the same size as the original image; Step1-2-4: For the drawn image, first use the dilate function with default parameters to perform a single dilation on the image. Then use the threshold function with the maximum gray value set to 128 and the minimum gray value set to 1 to perform binarization on the dilated image to obtain the background image. Combine the drawn image and the background image using the overloaded operator "+" of the Mat parameter type to obtain the marked image; Step1-2-5: Use the watershed function to input the original image and the marked image obtained in Step1-2-4, perform watershed segmentation, and convert the marked image after segmentation to the CV_8U type to obtain the final segmentation result.
4. The segmentation method of the steel wire rope image according to claim 3, wherein, The specific steps of Step1-3 are as follows: Step1-3-1: First, traverse the segmented image row by row from left to right to detect the mutation points of the gray value to obtain the left contour coordinates of the wire rope. Then traverse the segmented image row by row from right to left to detect the mutation points of the gray value to obtain the right contour coordinates of the wire rope; Step1-3-2: Press the obtained left and right contour point coordinates into a Mat-type parameter with two columns in sequence, and use the pca_analysis function with the parameter set to PCA::DATA_AS_ROW to perform PCA analysis to obtain the deflection angle of the wire rope in the image; Step1-3-3: According to the obtained deflection angle, rotate the left and right contour point coordinates in the reverse direction by the same angle to correct them to the vertical position, and obtain the average diameter of the wire rope by calculating the difference in the column coordinates of the corrected left and right contour point coordinates.
5. The segmentation method of the wire rope image according to claim 4, characterized in that, The specific steps of Step2-2 are as follows: Step2-2-1: First, perform strand segmentation on the wire rope image with a certain determined diameter D0 to obtain a set of segmentation parameters for the wire rope of this diameter. The segmentation parameters include the structuring element sizes M0 and M1 and the operation times X0 and X1 in each morphological operation, and record this set of parameters; Step2-2-2: Based on the average diameter D of the current wire rope image obtained after each segmentation of the main body, obtain the diameter multiplication factor n for the current wire rope, where n = D / D0.
6. The method for segmenting a wire rope image according to claim 5, characterized in that, The specific steps of Step2-3 are as follows: Step2-3-1: Use the threshold function to obtain the global threshold T of the image by selecting the THRESH_OTSU parameter. Then, use the threshold function again, set the threshold to T, set the maximum gray value to 255, and select the THRESH_BINARY parameter to perform threshold processing on the wire rope image. Step2-3-2: Use the morphologyEx function, select the MORPH_CLOSE parameter, use the structural element size M0 determined in Step2-2-1 for the closing operation, and use the number of closing operation times X0 determined in Step2-2-1 multiplied by the diameter multiplication factor n determined in Step2-2-2 to obtain the current required number of morphological operations X = n*X0. Perform morphological closing operation on the threshold-processed image to obtain the foreground image. Step2-3-3: Use the dilate function, use the structural element size M1 determined in Step2-2-1 for the erosion operation, and use the number of erosion operation times X1 determined in Step2-2-1 multiplied by the diameter multiplication factor n determined in Step2-2-2 to obtain the current required number of morphological operations X = n*X1. Perform erosion operation on the threshold-processed image, and then use the threshold function on the eroded image, set the threshold to 1, set the maximum gray value to 128, and select the THRESH_BINARY_INV parameter to obtain the background image. Step2-3-4: Use the overloaded operator "+" of the Mat parameter type to add the foreground image and the background image to obtain the marker image.
7. The method for segmenting a wire rope image according to claim 6, wherein In Step2-4, after performing watershed segmentation, convert the marker image after segmentation to the CV_8U type to obtain the segmentation result of the area between the wire rope strands.
Citation Information
Patent Citations
Real-time dynamic detection and evaluation method of steel wire rope lay length
CN110017777A
In-service steel wire rope surface defect detection method and system based on deep learning
CN110930357A