Non-contact mooring anchor chain inclination angle detection method and system
By employing a non-contact mooring chain tilt detection method, utilizing a binocular vision measurement system and an improved YOLOv7-w6 model, the problem of difficult sensor installation and maintenance and underwater environmental interference was solved, achieving high-precision and low-cost mooring chain tilt monitoring.
Patent Information
- Application Number
- CN202511624515.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-04-07
Smart Images

Figure CN121810757A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of inclination detection, in particular to a non-contact mooring chain inclination detection method and system. BACKGROUND
[0002] With the rapid development of offshore engineering technology, floating offshore platforms are increasingly widely used in oil and gas exploration and production. Offshore floating facilities mainly rely on single-point or multi-point mooring systems to position the floating facilities. The mooring system is usually composed of multiple mooring legs. However, floating offshore platforms are often threatened by extreme environments such as wind, waves, and currents or natural disasters during service, as well as adverse factors such as material aging and fatigue failure. These factors can cause the mooring system to fail and thus cause the platform to lose control or even overturn, seriously threatening the safety and stability of the platform. Mooring chain inclination monitoring can timely detect platform inclination abnormalities and provide data support for safe operation and risk protection of platform facilities. On the other hand, based on the monitoring data, the in-situ performance of the platform can be accurately evaluated to provide a scientific basis for optimizing the platform design scheme and improving the safety of the platform. Therefore, accurate inclination monitoring of the mooring chain is of great significance to ensure the safe operation of the floating platform and optimize the design. The mooring system of a floating facility is usually composed of a top chain, a mooring cable (polyester cable or steel cable), and a bottom chain. In order to facilitate the installation of a monitoring device, inclination monitoring is usually performed on the top chain near the floating facility. The most direct method for monitoring the inclination of the mooring cable of a floating facility is to use an inclination sensor. However, the installation of the inclination sensor on the mooring cable is difficult, and it is affected by waves, currents, and the movement of the mooring cable, which affects the monitoring accuracy of the inclination sensor and makes it prone to damage. Repairing the damaged sensor is difficult. In addition, conventional inclination sensors are usually cable-mounted, and the cable path from the inclination sensor to the floating facility is long. The cable moves dynamically with the floating body and the mooring cable and is prone to cross and interfere with the mooring cable. The cable is prone to damage, affecting the continuity and reliability of the monitoring system. Currently, there are inclination sensors that use underwater acoustic propagation, which do not require a cable connection. However, the sensor needs to be configured with a certain capacity of battery, and the overall weight is relatively large. When the battery is depleted, the monitoring device needs to be taken out from underwater as a whole to replace the battery or charge it, which has a high maintenance cost in the later period. Therefore, a non-contact mooring chain inclination detection method and system are provided. SUMMARY
[0003] The purpose of the present application is to provide a non-contact mooring chain inclination detection method and system to solve the problems of difficult sensor installation and maintenance, susceptibility to underwater environmental interference, cable damage, high maintenance cost in the later period, and poor monitoring continuity and reliability in the existing mooring chain inclination monitoring method as described in the background.
[0004] To achieve the above object, the present application aims to provide a contactless mooring chain inclination detection method, comprising: S1, collecting left and right view underwater images of the area where the anchor chain is located and pre-processing and stereo rectification of the underwater images; S2, using the improved YOLOv7-w6 model with ECBAM attention mechanism and BIFPN feature fusion structure to perform joint target detection and key point detection on the corrected underwater images, identify the anchor chain target area, and output the key pixel point coordinates at both ends of each anchor chain ring; S3, using the principle of triangulation to convert the key pixel point coordinates into three-dimensional space coordinates, and organizing the key pixel point sequence in each frame of underwater image according to the timestamp to form the data input for inclination calculation; S4, performing spatial geometric calculation on the three-dimensional space coordinates of adjacent two key pixel points to obtain the inclination values of each segment of the anchor chain relative to the horizontal plane.
[0005] As a further improvement of the technical solution, in S1, the pre-processing and stereo rectification of the underwater images include the following steps: S1.1, converting the underwater image to a grayscale image; S1.2, using a median filter algorithm to smooth the grayscale image; S1.3, performing adaptive histogram equalization processing on the grayscale image; S1.4, based on the camera intrinsic parameters and distortion coefficients, performing geometric distortion correction on the left and right view underwater images; S1.5, according to the extrinsic parameters of the binocular camera, establishing the epipolar geometric relationship of the left and right camera views, so that the projections of the same space point in the left and right view underwater images are located on the corresponding epipolar lines; S1.6, based on the epipolar geometric relationship, performing epipolar rectification on the left and right view underwater images, and re-projecting the scan lines of the left and right view underwater images to a unified row direction, so that the corresponding pixels are located on the same horizontal row; S1.7, based on the left and right view underwater images after epipolar alignment, using a semi-global block matching algorithm for stereo matching for three-dimensional coordinate reconstruction.
[0006] As a further improvement of the technical solution, in S1.7, based on the left and right images after epipolar alignment, the semi-global block matching algorithm is used for stereo matching, including the following steps: Setting the parameters of the semi-global block matching algorithm; Executing the semi-global block matching algorithm on the left and right view underwater images after epipolar alignment, calculating the disparity value of each pixel, and generating a preliminary disparity map; For the missing measurement points in the preliminary disparity map, two rectangular search areas are defined around the measurement points to collect the depth information of the neighboring pixels; The depth values of the participating pixels in the search area are extracted, and the maximum and minimum values of the depth values are calculated; The level value of each pixel in the search area is calculated; According to the screening condition, the pixels with values greater than the minimum value and less than or equal to the level value among the pixels participating in the search are retained; The depth values of the screened pixels are calculated according to the median to obtain the final depth value of the measurement point, and the final depth value is filled into the missing pixel position to obtain a complete depth map.
[0007] As a further improvement of the technical solution, in S2, the anchor chain target area is identified, and the coordinates of the key pixel points at both ends of each anchor chain ring are output, including the following steps: S2.1, input the left and right perspective underwater images after stereo rectification into the YOLOv7-POSE model; S2.2, use the ECBAM attention mechanism integrated backbone network to perform multi-scale feature extraction on the preprocessed image to obtain image feature maps at different scales; S2.3, introduce BIFPN structure on the extracted multi-scale image feature maps, establish a bidirectional feature transmission path between different scale feature layers, and enhance the detection ability of the anchor chain target through a weighted fusion mechanism; S2.4, set multi-scale anchor boxes on the fused image feature maps, respectively generate candidate bounding boxes and corresponding class confidence through the target detection branch, and predict the key point coordinates at both ends of each anchor chain ring through the key point detection branch; S2.5, use the Sigmoid activation function to output the confidence of the candidate bounding box, and perform non-maximum suppression algorithm on all candidate boxes; S2.6, according to the pre-set confidence threshold, the effective candidate bounding box, i.e. the anchor chain target box, is screened out from the detection results processed by the non-maximum suppression algorithm, and the bounding box of each anchor chain ring and the coordinates of the key pixel points at both ends are output.
[0008] As a further improvement of the technical solution, in S2.2, the ECBAM attention mechanism integrated backbone network is used to perform multi-scale feature extraction on the preprocessed image, involving the following specific steps: input the preprocessed underwater image into the backbone network, extract primary features of different receptive fields through multi-scale convolution modules, and integrate ECBAM attention mechanism to weight channels and spaces of each scale feature, so as to enhance the response of key channels and spatial regions, suppress underwater noise, and generate multi-scale feature maps with low-level texture information and high-level semantic information.
[0009] As a further improvement to this technical solution, in S2.3, a BIFPN structure is introduced to establish a bidirectional feature transfer path between feature layers of different scales, and the detection capability of anchor chain targets is enhanced through a weighted fusion mechanism. The specific steps involved are as follows: The BIFPN structure is introduced to align and fuse the texture information of low-level features with the semantic information of high-level features through bidirectional feature transfer from bottom to top and from top to bottom, and linear combination and iterative enhancement of features at each scale are performed through a learnable weighted mechanism to generate a multi-scale feature map with both high-resolution details and rich semantics.
[0010] As a further improvement to this technical solution, in step S3, the coordinates of key pixels are converted into three-dimensional spatial coordinates using the principle of triangulation, and the sequence of key pixels in each frame of underwater image is organized by timestamp, including the following steps: S3.1, Record the coordinates of the key pixels in the left and right view images obtained in step S2 as follows: and ; S3.2 Calculate the horizontal disparity of the keypoint pairs matched in step S1.7. And based on baseline length and focal length The depth of this key point is calculated using the principle of triangulation. ; S3.3, Based on depth value Combined with the focal length parameter in the camera intrinsic parameter matrix coordinates of the principal point Convert pixel coordinates to 3D coordinates in the camera coordinate system Simultaneously, the extrinsic parameter matrix is used to transform points in the camera coordinate system into three-dimensional coordinates in the world coordinate system. ; S3.4 Perform geometric consistency verification on the three-dimensional coordinates of the key points at both ends of the same anchor chain link, and calculate and compare the Euclidean distance between the two points with the standard geometric dimensions of the anchor chain link; S3.5. Add unified timestamp information to the underwater images from the left and right perspectives, and convert the three-dimensional coordinates... By binding with timestamps, a structured time-series dataset is formed.
[0011] As a further improvement to this technical solution, in step S4, spatial geometric calculations are performed on the three-dimensional spatial coordinates of two adjacent key pixels to obtain the inclination angle of each anchor chain segment relative to the horizontal plane, including the following steps: S4.1 Read the valid keypoint sequence of the current frame from the structured time-series dataset, and according to the order of the anchor chains in the image, perform keypoint analysis on adjacent pairs of points. Pairing is performed to form a set of anchor chain segments to be calculated. ; in, For anchor chain index; S4.2 For each pair of adjacent key points, calculate its spatial vector in the world coordinate system; S4.3, using spatial vectors Projection vector to the horizontal plane The included angle between them is taken as the inclination angle of that section of the anchor chain. ; S4.4. Screen for outliers and verify the validity of all calculated dip angle results; S4.5 To reduce single-point errors and local noise interference, the effective tilt angle set of the current frame is subjected to extreme value removal and averaging to generate an average tilt angle. ; S4.6, Based on average dip angle The final output tilt angle value is obtained by introducing a short-term trend constraint mechanism. .
[0012] As a further improvement to this technical solution, in step S4.6, based on the average tilt angle... The final output tilt angle value is obtained by introducing a short-term trend constraint mechanism. The specific steps involved are as follows: The average tilt angle calculated from consecutive sampled frames... The time sequence is formed by caching in chronological order, and the current frame is compared with the previous frame. A short-term sliding window is established between the frame average tilt angles; the mean of the historical average tilt angles is calculated within this window as the short-term trend tilt angle. According to the weighting coefficient Average tilt angle of the current frame with trend angle Weighted fusion is performed to obtain the final output tilt angle. ; in, Indicates time.
[0013] On the other hand, the present invention provides a contactless mooring anchor chain tilt angle detection system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the contactless mooring anchor chain tilt angle detection method described in any one of the above.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention relates to a non-contact mooring anchor chain tilt angle detection method and system. By constructing a binocular vision measurement system and combining image preprocessing techniques such as stereo correction, median filtering, CLAHE enhancement, and distortion correction, the quality of anchor chain images under underwater low-light, high-noise, and color-distortion conditions is significantly improved. Furthermore, an improved YOLOv7-POSE model integrating the ECBAM attention mechanism and BIFPN feature fusion structure is introduced, achieving high-precision joint detection of the anchor chain loop target and key points at both ends, enhancing the model's feature extraction capability and robustness in harsh underwater scenarios such as bubble occlusion and suspended object interference. Combining SGBM stereo matching and triangulation principles, two-dimensional pixel coordinates are accurately converted into three-dimensional spatial coordinates in the world coordinate system, providing a reliable data foundation for subsequent tilt angle calculations, thus achieving accurate perception of the spatial attitude of the mooring anchor chain without physical contact.
[0015] 2. This invention relates to a non-contact mooring chain tilt angle detection method and system. Based on three-dimensional coordinates, it calculates the local tilt angle of the mooring chain relative to the horizontal plane segment by segment using spatial vector geometry. A multi-level verification mechanism is designed (including key point distance consistency verification, segment length deviation screening, and rate of change anomaly judgment) to effectively eliminate false detections or abnormal data caused by noise. Furthermore, a dual optimization strategy of "extreme value removal averaging" and "short-term trend constraint" is proposed: the former eliminates the influence of extreme errors within a single frame, while the latter uses a sliding window to weightedly fuse the average tilt angle of the current frame and historical frames, suppressing instantaneous fluctuations and preserving the true motion trend. This mechanism significantly improves the smoothness and temporal continuity of the tilt angle output, making it suitable for long-term dynamic monitoring tasks and providing highly reliable data support for the safety assessment and intelligent early warning of mooring systems such as offshore platforms and floating structures. Attached Figure Description
[0016] Fig. 1 This is a flowchart illustrating the overall method of the present invention; Fig. 2 This is a schematic diagram of the mooring anchor chain tilt angle monitoring system in this embodiment; Fig. 3 This is a schematic diagram of the key points of the mooring anchor chain in this implementation. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1: Please refer to Figs. 1-3As shown, this embodiment provides a non-contact mooring anchor chain tilt angle detection method, including the following steps: S1. Acquire underwater images of the area where the anchor chain is located from the left and right perspectives, and perform preprocessing and stereo correction on the underwater images; In this embodiment, firstly according to Fig. 2 A binocular measurement system is set up, with left and right cameras used for image acquisition of mooring anchor chains, and a central supplementary light primarily for clearer and more identifiable nighttime images. The cameras should be securely mounted, and their accurate coordinates should be obtained. Image quality is affected by camera resolution; higher resolution produces clearer image details. The resolution is typically determined by considering the field of view and measurement accuracy. After determining the camera resolution, the lens focal length must also be considered. Generally, a longer focal length results in a longer working distance, while a shorter focal length results in a shorter working distance. Furthermore, the underwater environment tolerance of the camera and supplementary light should be considered when selecting them.
[0019] Before measuring the images, the measurement system needs to be calibrated. This invention selects the Zhang's calibration method, which is easy to implement and highly accurate, to calibrate the binocular camera. The cameras are arranged according to the actual installation spacing. Following the Zhang's calibration method, this invention uses the left and right cameras to take 80 standard calibration chessboard photos. The calibration parameters are calculated using the StereoCamera Calibrator function in Matlab. After calibration, a reprojection error map is used to analyze the error pixels of each chessboard grid and the average error pixels. If a large difference is found between the error pixels of a calibration board and the average error pixels, the image is deleted to improve the accuracy of the camera calibration. During the calibration stage, camera intrinsic parameters (focal length) are generated. , Principal point coordinates , ) and distortion coefficients (radial and tangential distortion); To train the target detection and keypoint detection algorithms on the anchor chain, keypoints need to be labeled on the anchor chain stereo keypoint dataset using LabelMe software. First, more than 1000 anchor chain images were collected, with the image size set to 640x640. Then, LabelMe software was used to label the anchor chain and the keypoints at both ends of the anchor chain. (See...) Fig. 3 After annotation is completed, you will obtain an "images" folder and an "annotations" folder.
[0020] YOLOv7 cannot directly use the VOC format annotation file obtained in the previous step. Therefore, a script needs to be written to convert the annotation results from VOC format to YOLO format. The meaning of each line in the YOLO format annotation file is [category, center x-coordinate to width ratio, center y-coordinate to height ratio, bounding box width to image width ratio, bounding box height to image height ratio].
[0021] Next, we will use the above data for training. First, we will allocate the labeled image files to the training, validation, and test sets in an 8:1:1 ratio, and write a configuration file to properly store the images and labeled files. After starting training, we will observe the training effect of each epoch, focusing on the mAP50 result. mAP50 represents the mean Average Precision (IoU=0.5), which is the average precision of all images for each class when the IoU is set to 0.5. Usually, if the collected data is good and the labeling is accurate, mAP will converge relatively quickly. Training can be stopped when mAP is basically stable at a high level (0.92 or above). If mAP fails to converge, we can try adjusting the learning rate and try again. Finally, we obtain a well-converged deep learning model for anchor chain object detection and keypoint detection.
[0022] The preprocessed anchor chain image test set is fed into the YOLOv7 learning model for anchor chain target detection and keypoint detection trained in the previous step to test performance. The corresponding anchor chain target detection boxes and keypoint information can be observed. If there are many false positives and false negatives, it is necessary to consider collecting more anchor chain images, improving the accuracy of the standard, and retraining until a better recognition effect is obtained. The underwater image preprocessing and stereo correction includes the following steps: S1.1 Convert underwater images to grayscale images. Due to the complex underwater lighting and obvious color attenuation, the original color images are first converted to grayscale images to reduce the impact of color distortion on texture recognition and feature extraction, and to unify the distribution of brightness information. S1.2 To address random noise caused by suspended particles, bubbles, and plankton in the underwater environment, a median filtering algorithm is used to smooth the grayscale image. This method selects a local neighborhood window centered on the pixel and takes the median of the neighborhood grayscale values as the new grayscale value of the center pixel, effectively eliminating impulse noise and maintaining clear image edges. Typically, underwater camera images suffer from overall color distortion due to the influence of seawater, yellow substances, plankton, and certain non-pigmented particles. Furthermore, external and internal interference is unavoidable during image formation, transmission, reception, and processing. This includes uneven sensitivity of sensitive elements during photoelectric conversion, quantization noise during digitization, transmission errors, and human factors, all of which degrade image quality. After comparing the effects of commonly used filtering methods, median filtering shows better denoising performance for anchor chain images. This invention employs median filtering to smooth anchor chain images. Median filtering replaces the local mean with the local median. In grayscale images, the median is used as the pixel... Within the central N×N masking window, first sort the grayscale values of these N×N pixels by size, then select the grayscale value that is in the middle position. ,make In this way, the median gray value of a pixel in a neighborhood of the processed point is used as the estimated value of that point. Since median filtering does not affect the step function and gradient function, and the impulse function tends to disappear when the width is less than half of the window, and the top of the trigonometric function is flattened, median filtering generally does not cause edge blurring, but rather reduces discrete impulse noise; S1.3 To solve the problems of uneven brightness and insufficient contrast in underwater images, adaptive histogram equalization (CLAHE) is applied to grayscale images. This method enhances local contrast through block equalization, suppresses overexposed or underexposed areas, and thus improves the clarity of anchor chain texture. S1.4 Camera intrinsic parameters (focal length) obtained during the system calibration phase , Principal point coordinates , The system uses distortion coefficients (radial and tangential distortion) to perform geometric distortion correction on underwater images from both left and right perspectives, eliminating geometric distortion caused by lens deformation. Specifically, it normalizes pixel coordinates to the camera coordinate system using an intrinsic parameter matrix and calculates the radial distance of each pixel. Then, based on the distortion model, the distorted pixel coordinates are reverse-mapped, and the corrected normalized coordinates are reprojected back to the pixel plane through the intrinsic parameter matrix to obtain distortion-free left and right view corrected images, thereby eliminating radial stretching and tangential offset distortion caused by the underwater imaging system, and providing a precise geometric basis for subsequent stereo matching and 3D reconstruction. S1.5, Based on the extrinsic parameters (rotation matrix) of the binocular camera With translation vector Establish the epipolar geometric relationship between the left and right camera views, so that the projections of the same spatial point in the two underwater images from the left and right perspectives lie on the corresponding epipolar lines, providing alignment constraints for the stereo matching algorithm. Specifically, firstly, determine the spatial rigid transformation relationship between the two camera coordinate systems through extrinsic parameters, that is, any point in the right camera coordinate system... Points in the left camera coordinate system pass This indicates that, by further utilizing the projection model of the two cameras, the constraint relationship satisfied between the coordinates of the left and right images can be obtained. ,in Based on the matrix, , These are the intrinsic parameter matrices for the left and right cameras, respectively. For the reason The constructed antisymmetric matrix; this constraint describes any point in the left image. Corresponding point in the right image It must be located on its corresponding epipolar line, realizing the epipolar geometric constraint between the two views, and providing a theoretical basis for subsequent stereo correction and disparity calculation; S1.6. Based on epipolar geometry, perform epipolar correction on the left and right view underwater images, reprojecting the scan lines of the two underwater images onto a unified row direction so that corresponding pixels are located on the same horizontal row. This step involves calculating the correction matrix. , With projection matrix , Remapping pixel coordinates achieves image alignment. S1.7 Based on the underwater images from the left and right perspectives after epipolar alignment, a semi-global block matching (SGBM) algorithm is used for stereo matching for 3D coordinate reconstruction. Furthermore, due to errors between different cameras and interference from other factors, the same point in three-dimensional space may appear to vary to different degrees from the perspectives of different cameras. Therefore, stereo matching is a crucial step in this process. The SGBM (Semi-Global Block Matching) algorithm is a semi-global matching method with the advantages of high matching quality and relatively low computational cost. This invention mainly uses the SGBM algorithm to complete image stereo matching.
[0023] However, during actual matching, due to the difference in image quality between the left and right cameras, there may be situations where the pixels of the left and right images cannot be matched, resulting in a lack of depth information. To solve this problem, this invention proposes an effective pixel search method. This method calculates the pixel depths around the measurement point and calculates the median of the filtered pixel depths, using the calculation result as the depth of the measurement point. Based on the epipolar aligned left and right images, stereo matching is performed using the semi-global block matching (SGBM) algorithm, including the following steps: Set the parameters for the semi-global block matching (SGBM) algorithm, including at least the block matching window size, disparity range, P1 / P2 smoothing term coefficients, minimum / maximum disparity, and pre-filtering parameters; The semi-global block matching (SGBM) algorithm is performed on the underwater images of the left and right views after epipolar alignment to calculate the disparity value of each pixel and generate a preliminary disparity map. The preliminary disparity map serves as the basic depth information. However, in actual matching, due to differences in imaging quality between the left and right images or occlusion, some pixels may fail to match or have noise points. For missing or abnormal measurement points in the preliminary disparity map, two rectangular search regions are defined around each measurement point (centered on the pixel, with two rectangular search regions defined in the left and right neighborhoods respectively, for example, with a size of...). The area of the local search range can be adaptively adjusted according to the image resolution and noise characteristics. By setting this local search range, pixels with similar parallax features or continuous depth distribution around the measurement point can be captured spatially, providing a data basis for subsequent depth information compensation. This area is used to collect depth information of neighboring pixels, providing a reference for subsequent missing value completion. Extract the depth values of the participating pixels within the search area, and calculate the maximum and minimum depth values. These two boundary values can reflect the upper and lower limits of the local depth distribution, providing a quantitative benchmark for subsequent pixel screening and anomaly removal. For each pixel within the search area, a rank value is calculated. (For each pixel within the search area, a rank value is calculated based on its depth value and statistical characteristics within the area (such as mean, variance, gradient information, etc.). This value is used to measure the degree of deviation between the pixel depth and the local depth distribution. The rank value is calculated through linear normalization or based on a robust distance metric (such as Z-score or median absolute deviation MAD), thereby reflecting the reasonableness and credibility of the pixel depth and providing a reliable criterion for the screening stage.) Based on the filtering criteria, pixels with values greater than the minimum value and less than the grade value are retained among the pixels participating in the search. This is used to remove outliers and isolated points, ensuring that the pixel depth used for calculation is more reliable. The median of the filtered pixel depth values is used to calculate the final depth value of the measurement point, which is then used to fill in the missing pixel positions to obtain a complete and accurate depth map.
[0024] S2. Using the improved YOLOv7-w6 model that incorporates the ECBAM attention mechanism and the BIFPN feature fusion structure, joint target detection and key point detection are performed on the corrected underwater image to identify the anchor chain target area and output the coordinates of key pixels at both ends of each anchor chain ring. In this embodiment, the target detection is based on the YOLOv7-w6 network structure, responsible for anchor chain loop target detection and determining the target for key point detection. This network is an edge GPU-oriented structure with a small network structure, low deployment requirements, and high flexibility. In this embodiment, the detection node is deployed on a remote server, but it can also be deployed on the host computer on the sensor side. To address the issue of low accuracy in anchor chain loop detection caused by the YOLOv7 network's difficulty in extracting anchor chain features in underwater environments due to blurring and bubble occlusion, an ECBAM attention mechanism is added to the target monitoring module algorithm to improve the algorithm's ability to extract anchor chain features. To address the increased computational cost after introducing the ECBAM attention mechanism, a more efficient BIFPN feature fusion network is used to reduce the loss of anchor chain feature information, enhance multi-scale feature fusion capabilities, and improve detection performance. The YOLOPOSE model combines the YOLO model with a keypoint detection model. It not only retains the high detection speed and accuracy of the YOLO series models, but also, compared to mainstream bottom-up keypoint detection methods, uses a top-down approach to cluster keypoints using object detection algorithms. This reduces the impact of background noise on keypoint detection while maintaining detection speed. Compared to mainstream bottom-up methods, YOLOPOSE performs better on multi-object keypoint detection tasks and is suitable for real underwater environments. YOLOv7POSE is based on YOLOv7-w6. YOLOv7POSE adds a keypoint detection module after the YOLOv7-w6 feature fusion network, so that the model's extracted features can be applied to both object detection and keypoint detection tasks, thus improving model efficiency. This invention uses YOLOv7POSE key point detection technology to detect two key points at both ends of each anchor chain link used for anchor chain inclination angle measurement; Identify the target area of the anchor chain and output the coordinates of the key pixels at both ends of each anchor chain loop, including the following steps: S2.1 Input the stereo-corrected underwater images from the left and right perspectives into the YOLOv7-POSE model respectively. Perform size scaling and pixel normalization on the input images to meet the input requirements of the YOLOv7-POSE model. Here, preprocessing is performed separately for each image (left and right perspectives). S2.2. The backbone network with integrated ECBAM attention mechanism is used to extract multi-scale features from the preprocessed image to obtain image feature maps at different scales. The ECBAM attention mechanism enhances the response of key features and suppresses underwater noise interference through channel and spatial dual attention mechanisms. S2.3. Introduce a BIFPN (Bidirectional Feature Pyramid Network) structure on the extracted multi-scale image feature maps to establish a bidirectional feature transfer path between feature layers at different scales. Through a weighted fusion mechanism, realize the dynamic integration of high-level semantic information and low-level texture features, thereby enhancing the detection capability of anchor chain targets. S2.4. Multi-scale anchor boxes are set on the fused image feature map. Candidate bounding boxes and corresponding class confidence scores are generated through the target detection branch, and the keypoint detection branch predicts the coordinates of keypoints at both ends of each anchor chain loop. Specifically: First, predefined anchor boxes are set according to different scale feature layers, covering possible anchor chain target sizes and aspect ratios. Then, these features are input into the target detection branch, and convolution operations are used to generate the candidate bounding box positions and corresponding class confidence scores for each anchor box. Simultaneously, in the keypoint detection branch, regression prediction is performed on the local features of each candidate anchor chain target, outputting the coordinates of keypoints at both ends of the anchor chain loop. Finally, through the joint prediction of candidate boxes and keypoints, accurate localization of anchor chain targets and keypoint calibration at multiple scales are achieved, providing accurate input for subsequent 3D reconstruction and tilt angle calculation. S2.5. Utilize the Sigmoid activation function to output the confidence scores of candidate bounding boxes. Perform Non-Maximum Suppression (NMS) on all candidate boxes to remove redundant detection boxes with high overlap, thereby improving detection accuracy. Specifically: First, map the class score of each anchor box to the [0,1] interval using the Sigmoid activation function to obtain the confidence value of each candidate box. Then, sort all candidate boxes according to their confidence scores from high to low, and perform NMS sequentially: For the box with the highest current confidence score, retain it, and calculate its overlap (IoU) with the remaining boxes. Any box with an overlap exceeding a set threshold (e.g., 0.5) is removed. Repeat this process until all candidate boxes are traversed, thereby removing redundant boxes with high overlap and retaining only the optimal bounding box, improving the accuracy and stability of the detection results. S2.6. Based on the detection results processed by the non-maximum suppression (NMS) algorithm, select the effective candidate bounding boxes, i.e. anchor chain target boxes, according to the preset confidence threshold (empirical value is 0.5), and output the bounding box of each anchor chain loop and the coordinates of the key pixel points at both ends.
[0025] S3. Using the principle of triangulation, the coordinates of key pixels are converted into three-dimensional spatial coordinates, and the sequence of key pixels in each frame of underwater image is organized by timestamp to form the data input for tilt angle calculation. In this embodiment, the coordinates of key pixels are converted into three-dimensional spatial coordinates using the principle of triangulation, and the sequence of key pixels in each frame of underwater image is organized by timestamp, including the following steps: S3.1, Record the coordinates of the key pixels in the left and right view images obtained in step S2 as follows: and Using image pairs that have undergone stereo calibration, ensure that the same spatial point has the same row coordinates in the left and right views (i.e., This satisfies the epipolar constraint condition; if the row coordinate deviation exceeds a preset threshold (e.g., 2 pixels), the key point is considered a failed match and is removed. S3.2 Calculate the horizontal disparity of the keypoint pairs matched in step S1.7. And based on the baseline length obtained from system calibration and focal length The depth of this key point is calculated using the principle of triangulation. ; in, This represents the depth distance of a keypoint relative to the camera coordinate system. When the parallax value is too small (e.g., ...), When dealing with pixels, to prevent division by zero error, interpolation or neighborhood averaging is used to correct the depth value. S3.3, Based on depth value Combined with the focal length parameter in the camera intrinsic parameter matrix coordinates of the principal point Convert pixel coordinates to 3D coordinates in the camera coordinate system ( , At the same time, the external parameter matrix (rotation matrix) calibrated by the system is used. Translation vector Convert points in the camera coordinate system to three-dimensional coordinates in the world coordinate system. ; S3.4 Perform geometric consistency verification on the three-dimensional coordinates of the two key points at both ends of the same anchor chain link, calculate the Euclidean distance between the two points and compare it with the standard geometric dimensions of the anchor chain link (referring to the theoretical length or dimensions specified in the design or manufacturing of the anchor chain link); if the dimensional error exceeds 3%, the key point is determined to be a false detection point and is removed to improve the accuracy and stability of subsequent inclination angle calculations. S3.5. Add unified timestamp information to the underwater images from the left and right perspectives to ensure that the binocular data is synchronized within the same sampling period, and to convert the three-dimensional coordinates... By binding with timestamps, a structured time-series dataset is formed.
[0026] S4. In each frame, perform spatial geometric calculations on the three-dimensional spatial coordinates of two adjacent key pixels to obtain the tilt angle of each anchor chain relative to the horizontal plane. In this embodiment, spatial geometric calculations are performed on the three-dimensional spatial coordinates of two adjacent key pixels to obtain the inclination angle of each anchor chain segment relative to the horizontal plane, including the following steps: S4.1 Read the valid keypoint sequence of the current frame from the structured time-series dataset, and according to the order of the anchor chains in the image, perform keypoint analysis on adjacent pairs of points. Pairing is performed to form a set of anchor chain segments to be calculated. In the formula, The number of valid keypoints detected in the current frame; in, For anchor chain index; S4.2 For each pair of adjacent keypoints, calculate its spatial vector in the world coordinate system. , where the vector represents the first The orientation of the anchor chain segment in space; S4.3, using spatial vectors Projection vector to the horizontal plane The included angle between them is taken as the inclination angle of that section of the anchor chain. ; in, ; ; The angle It reflects the pitch of that section of the anchor chain relative to the horizontal plane; S4.4. Perform dip angle outlier screening and validity verification on all calculated dip angle results. Specifically, this involves: screening all calculated dip angle results for outliers and verifying their validity. Perform statistical analysis; if the length of the anchor chain segment corresponding to any inclination angle deviates from the actual size of the standard anchor chain ring by more than 3%, or the inclination angle change rate is abnormal (greater than the set threshold), then the calculation of that segment is deemed invalid and it is discarded; only the valid inclination angle data that has passed the verification are retained for the next step of processing; S4.5 To reduce single-point errors and local noise interference, the effective tilt angle set of the current frame is subjected to extreme value removal and averaging to generate an average tilt angle. (To further reduce errors and avoid large errors caused by incorrect selection of a single pixel, the maximum and minimum values of each tilt angle can be removed, and the average value of the remaining tilt angles can be taken.) ; In the formula, The number after sorting by size One tilt angle value, The effective tilt angle; S4.6, Based on average dip angle The final output tilt angle value is obtained by introducing a short-term trend constraint mechanism. The short-term trend constraint mechanism is used to suppress transient abnormal fluctuations caused by noise, false detection of key points or underwater disturbances; In underwater anchor chain tilt angle measurement, key point detection in a single frame image may be affected by factors such as illumination changes, suspended particles, occlusion, or noise, leading to instantaneous anomalies or sudden changes in the calculated tilt angle. This affects the continuity and reliability of the tilt angle data. The short-term trend constraint mechanism forms a sliding window with the average tilt angle of the current frame and the historical average tilt angle of the previous few frames, and performs weighted fusion. This smooths the temporal changes in the anchor chain tilt angle, effectively suppresses the interference of single-frame anomalies on the measurement results, and generates a stable tilt angle output. This mechanism can reduce the impact of occasional noise and outliers on tilt angle measurement, improve measurement accuracy and robustness, and retain the true movement trend of the anchor chain in a short period of time, making the data more continuous and facilitating subsequent analysis or control decisions. Furthermore, based on the mean dip angle The final output tilt angle value is obtained by introducing a short-term trend constraint mechanism. The specific steps involved are as follows: The average tilt angle calculated from consecutive sampled frames... The time sequence is formed by caching in chronological order, and the current frame is compared with the previous frame. Establish a short-time sliding window between the average tilt angle of the frames ( (Select 3–5 frames); calculate the mean of the historical average tilt angle within this window as the short-term trend tilt angle. According to the weighting coefficient (Take a value of 0.6–0.8) for the average tilt angle of the current frame. with trend angle Weighted fusion is performed to obtain the final output tilt angle. ; in, Indicates time; Furthermore, the final output tilt angle value .
[0027] Example 2: This example provides a contactless mooring anchor chain tilt angle detection system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the contactless mooring anchor chain tilt angle detection method described above.
[0028] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A non-contact method for detecting the inclination angle of mooring anchor chains, characterized in that, Includes the following steps: S1. Acquire underwater images of the area where the anchor chain is located from the left and right perspectives, and perform preprocessing and stereo correction on the underwater images; S2. Using the improved YOLOv7-w6 model that incorporates the ECBAM attention mechanism and the BIFPN feature fusion structure, joint target detection and key point detection are performed on the corrected underwater image to identify the anchor chain target area and output the coordinates of key pixels at both ends of each anchor chain ring. S3. Using the principle of triangulation, the coordinates of key pixels are converted into three-dimensional spatial coordinates, and the sequence of key pixels in each frame of underwater image is organized by timestamp to form the data input for tilt angle calculation. S4. Perform spatial geometric calculations on the three-dimensional spatial coordinates of two adjacent key pixels to obtain the inclination angle of each anchor chain segment relative to the horizontal plane.
2. The non-contact mooring anchor chain tilt angle detection method according to claim 1, characterized in that: In step S1, the underwater image is preprocessed and stereoscopically corrected, including the following steps: S1.1 Convert the underwater image to a grayscale image; S1.
2. The grayscale image is smoothed using a median filtering algorithm; S1.3 Perform adaptive histogram equalization on the grayscale image; S1.
4. Based on camera intrinsic parameters and distortion coefficients, perform geometric distortion correction on underwater images from the left and right perspectives; S1.
5. Based on the extrinsic parameters of the binocular camera, establish the epipolar geometric relationship between the left and right camera views so that the projection of the same spatial point in the two underwater images from the left and right perspectives lies on the corresponding epipolar line. S1.
6. Based on the epipolar geometry relationship, perform epipolar correction on the underwater images from the left and right perspectives, and reproject the scan lines of the two underwater images from the left and right perspectives onto a unified row direction so that the corresponding pixels are located on the same horizontal row. S1.
7. Based on the underwater images from the left and right perspectives after epipolar alignment, a semi-global block matching algorithm is used for stereo matching and 3D coordinate reconstruction.
3. The non-contact mooring anchor chain tilt angle detection method according to claim 2, characterized in that: In step S1.7, based on the left and right images after epipolar alignment, a semi-global block matching algorithm is used for stereo matching, including the following steps: Set the parameters for the semi-global block matching algorithm; A semi-global block matching algorithm is performed on the underwater images of the left and right views after epipolar alignment to calculate the disparity value of each pixel and generate a preliminary disparity map; For the missing measurement points in the preliminary disparity map, two rectangular search areas are defined around the measurement points to collect depth information of neighboring pixels. Extract the depth values of the participating pixels within the search area, and calculate the maximum and minimum depth values; Calculate the rank value for each pixel within the search area; Based on the filtering criteria, pixels whose values are greater than the minimum value and less than the grade value are retained from the pixels that participated in the search. The median of the filtered pixel depth values is used to calculate the final depth value of the measurement point, which is then used to fill in the missing pixel positions to obtain a complete depth map.
4. The non-contact mooring anchor chain tilt angle detection method according to claim 1, characterized in that: In step S2, the target area of the anchor chain is identified, and the coordinates of key pixels at both ends of each anchor chain loop are output, including the following steps: S2.1 Input the stereo-corrected underwater images from the left and right perspectives into the YOLOv7-POSE model respectively; S2.2 Utilize the backbone network with integrated ECBAM attention mechanism to perform multi-scale feature extraction on the preprocessed image to obtain image feature maps at different scales; S2.
3. Introduce a BIFPN structure on the extracted multi-scale image feature map, establish a bidirectional feature transfer path between feature layers of different scales, and enhance the detection capability of anchor chain targets through a weighted fusion mechanism; S2.4 Set multi-scale anchor boxes on the feature map of the fused image, generate candidate bounding boxes and corresponding category confidence scores through the target detection branch, and predict the coordinates of key points at both ends of each anchor chain link through the key point detection branch; S2.
5. Utilize the Sigmoid activation function to output the confidence scores of candidate bounding boxes, and perform non-maximum suppression algorithm on all candidate boxes; S2.
6. For the detection results processed by the non-maximum suppression algorithm, select the effective candidate bounding boxes, i.e., anchor chain target boxes, according to the preset confidence threshold, and output the bounding box of each anchor chain loop and the coordinates of the key pixel points at both ends.
5. The non-contact mooring anchor chain tilt angle detection method according to claim 4, characterized in that: In step S2.2, the preprocessed image is extracted using a backbone network with an integrated ECBAM attention mechanism. The specific steps are as follows: the preprocessed underwater image is input into the backbone network, and primary features of different receptive fields are extracted through a multi-scale convolution module. At the same time, the ECBAM attention mechanism is integrated to perform channel and spatial weighting on the features at each scale to enhance the response of key channels and spatial regions, suppress underwater noise, and generate a multi-scale feature map that has both low-level texture information and high-level semantic information.
6. The non-contact mooring anchor chain tilt angle detection method according to claim 4, characterized in that: In S2.3, a BIFPN structure is introduced to establish a bidirectional feature transfer path between feature layers of different scales, and the detection capability of anchor chain targets is enhanced through a weighted fusion mechanism. The specific steps involved are as follows: The BIFPN structure is introduced to align and fuse the texture information of low-level features with the semantic information of high-level features through bidirectional feature transfer from bottom to top and from top to bottom. The features of each scale are linearly combined and iteratively enhanced through a learnable weighted mechanism to generate a multi-scale feature map with both high-resolution details and rich semantics.
7. The non-contact mooring anchor chain tilt angle detection method according to claim 4, characterized in that: In step S3, the coordinates of key pixels are converted into three-dimensional spatial coordinates using the principle of triangulation, and the sequence of key pixels in each frame of underwater image is organized by timestamp, including the following steps: S3.1, Record the coordinates of the key pixels in the left and right view images obtained in step S2 as follows: and ; S3.2 Calculate the horizontal disparity of the keypoint pairs matched in step S1.
7. And based on baseline length and focal length The depth of this key point is calculated using the principle of triangulation. ; S3.3, Based on depth value Combined with the focal length parameter in the camera intrinsic parameter matrix coordinates of the principal point Convert pixel coordinates to 3D coordinates in the camera coordinate system Simultaneously, the extrinsic parameter matrix is used to transform points in the camera coordinate system into three-dimensional coordinates in the world coordinate system. ; S3.4 Perform geometric consistency verification on the three-dimensional coordinates of the key points at both ends of the same anchor chain link, and calculate and compare the Euclidean distance between the two points with the standard geometric dimensions of the anchor chain link; S3.
5. Add unified timestamp information to the underwater images from the left and right perspectives, and convert the three-dimensional coordinates... By binding with timestamps, a structured time-series dataset is formed.
8. The non-contact mooring anchor chain tilt angle detection method according to claim 7, characterized in that: In step S4, spatial geometric calculations are performed on the three-dimensional spatial coordinates of two adjacent key pixels to obtain the inclination angle of each anchor chain segment relative to the horizontal plane, including the following steps: S4.1 Read the valid keypoint sequence of the current frame from the structured time-series dataset, and according to the order of the anchor chains in the image, perform keypoint analysis on adjacent pairs of points. Pairing is performed to form a set of anchor chain segments to be calculated. ; in, For anchor chain index; S4.2 For each pair of adjacent key points, calculate its spatial vector in the world coordinate system; S4.3, using spatial vectors Projection vector to the horizontal plane The included angle between them is taken as the inclination angle of that section of the anchor chain. ; S4.
4. Screen for outliers and verify the validity of all calculated dip angle results; S4.5 To reduce single-point errors and local noise interference, the effective tilt angle set of the current frame is subjected to extreme value removal and averaging to generate an average tilt angle. ; S4.6, Based on average dip angle The final output tilt angle value is obtained by introducing a short-term trend constraint mechanism. .
9. The non-contact mooring anchor chain tilt angle detection method according to claim 8, characterized in that: In S4.6, based on the average tilt angle The final output tilt angle value is obtained by introducing a short-term trend constraint mechanism. The specific steps involved are as follows: The average tilt angle calculated from consecutive sampled frames... The time sequence is formed by caching in chronological order, and the current frame is compared with the previous frame. A short-term sliding window is established between the frame average tilt angles; the mean of the historical average tilt angles is calculated within this window as the short-term trend tilt angle. According to the weighting coefficient Average tilt angle of the current frame with trend angle Weighted fusion is performed to obtain the final output tilt angle. ; in, Indicates time.
10. A contactless mooring anchor chain tilt angle detection system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes a computer program to implement the non-contact mooring anchor chain tilt angle detection method as described in any one of claims 1-9.