A computer-aided image-based method and system for measuring the deadweight of a ship

CN122657210BActive Publication Date: 2026-10-16NANJING JINLIJIANYAN CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611114612.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-16
Estimated Expiration
2046-07-27

AI Technical Summary

Technical Problem

[0005]为此,本发明提供一种基于计算机辅助图像的船舶载重量测量方法和系统,用以克服现有技术中缺乏对船舶动态运动特性的有效应对机制、对雨雪等恶劣天气的适应性较差以及缺乏针对瞬态遮挡的补偿机制的问题

Benefits of technology

其一,本发明通过光流法跟踪生成二维运动轨迹,并利用快速傅里叶变换分别提取水平方向主频和垂直方向主频,从而准确获取横摇周期与纵倾周期,计算角速度同时趋近于零的候选稳定时刻,同时当模型与实际运动偏差时利用最新监测数据自适应更新相位函数并重新预测,形成闭环校正机制,解决了现有方法依赖人工经验判断稳定状态、无法同步考虑横摇与纵倾耦合运动、以及固定模型在海况变化时失效的技术难题,显著提高了船舶稳定时刻的判定精度与采集触发的可靠性,增强了系统对复杂海况的适应能力和自校正能力,有效降低了因船舶动态运动导致的吃水线读取偏差。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122657210B_ABST
    Figure CN122657210B_ABST
Patent Text Reader

Abstract

The application provides a ship load measurement method and system based on computer-aided images, and relates to the technical fields of computer vision and image processing. In view of the problems that in the prior art, when load measurement is performed, an effective response mechanism for the dynamic motion characteristics of a ship is lacked, the adaptability to bad weather such as rain and snow is poor, and a transient occlusion compensation mechanism is lacked, the application adopts an unmanned aerial vehicle to cruise and collect video images, determines ship roll periods, trim periods and water splash distribution based on an optical flow method and a fast Fourier transform, constructs a motion phase function to predict a stable time and monitor a posture angle change rate in real time, controls the unmanned aerial vehicle to descend at a rain and snow actual falling speed to collect a draft image when the ship is stable, generates a composite image through multi-frame projection and time domain median filtering, and then performs rain and snow erasing and water splash removing, so that the interference of rain and snow and water splash on draft identification is reduced. The application improves the measurement precision, operation efficiency and environmental adaptability of load measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology, and in particular to a method and system for measuring ship load capacity based on computer-aided images. Background Technology

[0002] With the continued growth of global trade and the continuous improvement of port logistics intelligence, ship load factor measurement, as a key link in shipping trade settlement, cargo loading and unloading control, and ship navigation safety assessment, has increasingly attracted industry attention regarding its accuracy and efficiency. In recent years, the rapid development of drone technology and continuous breakthroughs in computer vision algorithms have provided a new path for image-based ship load factor measurement. Utilizing drones equipped with high-definition cameras to collect aerial images of the ship's waterline area, and combining image recognition and deep learning technologies to automatically extract the waterline, identify scale numbers, and then calculate the ship's load factor, has become an important development direction for intelligent port construction. This technology has significant advantages such as high operational efficiency, low personnel safety risks, and remote operation capabilities, demonstrating broad application prospects in smart ports and unmanned ship inspection scenarios.

[0003] However, existing methods still have many shortcomings, making it difficult to achieve stable and reliable high-precision measurements under complex environmental conditions. First, existing technologies generally lack effective mechanisms to address the dynamic motion characteristics of ships. Ships are constantly subject to rolling and pitching motions due to wind and waves while moored or anchored, and the acquired images often capture the instantaneous state of the ship's tilt, resulting in a significant deviation between the waterline reading and the actual average draft. Second, existing methods are poorly adaptable to severe weather conditions such as rain and snow. Rain and snow particles create motion trajectories in front of the lens, generating significant noise interference in the image. Traditional image enhancement algorithms struggle to effectively remove rain and snow while preserving edge details. Third, splashing water and crashing waves can obscure key scale areas, making it impossible to obtain effective readings, and there is a lack of compensation mechanisms for transient obstruction. Furthermore, the overall robustness and environmental adaptability of existing solutions are insufficient.

[0004] Therefore, there is an urgent need for a computer-aided image-based method for measuring ship load capacity that can comprehensively consider ship motion characteristics, weather interference, and dynamic water surface obstruction. Summary of the Invention

[0005] To address these issues, the present invention provides a method and system for measuring ship load capacity based on computer-aided images, thereby overcoming the problems in the prior art, such as the lack of an effective mechanism to respond to the dynamic motion characteristics of ships, poor adaptability to severe weather such as rain and snow, and the lack of a compensation mechanism for transient occlusion.

[0006] To achieve the above objectives, the present invention provides a method for measuring ship load capacity based on computer-aided images, comprising: S1 controls the drone to cruise along the outside of the ship and collect video images; S2, based on the correspondence between the cruise flight time and video images, determines the ship's roll period, pitch period, and the distribution of water splash at each preset acquisition point; S3. Based on the ship's roll period and pitch period, predict the ship's stable moment, control the UAV to hover directly above the preset collection point, and detect the ship's attitude angle change rate at the stable moment. If the attitude angle change rate is less than the first threshold, determine that the ship is in a stable state. S4, control the drone to hover at a preset altitude and wait. When the ship is in a stable state, control the drone to descend at the speed of falling rain and snow, and continuously collect images of the ship's draft at preset collection points during the descent. S5, the ship's draft image at each preset acquisition point is projected onto the ship's fixed coordinate system according to the acquisition time and the attitude data of the UAV, and temporal median filtering is performed at the pixel level to generate a composite image of each preset point; S6, perform rain and snow erasure and water splash removal on the synthesized image to generate a denoised image; S7. Based on the denoised image, determine the ship's draft, and based on the ship's draft and the ship's hydrostatic curve, calculate the ship's current displacement by interpolation, and subtract the ship's empty weight to obtain the ship's current load capacity.

[0007] Furthermore, the preset collection points include bow, midship, and stern points arranged sequentially along the length of the ship, as well as symmetrical points set on the port and starboard sides of the ship respectively; wherein, the port bow, port midship, and port stern points, together with the starboard bow, starboard midship, and starboard stern points, constitute six preset collection points, and the spatial position of each preset collection point corresponds to the reading position of the ship's waterline marker.

[0008] Furthermore, the determination of the ship's roll period, pitch period, and water splash distribution at each preset acquisition point based on the correspondence between cruise flight time and video images includes: S21, extract fixed structural feature points of the ship from the video image, and use optical flow to track the fixed structural feature points between consecutive frames to generate a two-dimensional motion trajectory of each feature point in the time series. S22, for the two-dimensional motion trajectory of each feature point, perform time-domain decomposition along the horizontal and vertical directions respectively, use fast Fourier transform to extract the main frequency component, determine the period corresponding to the main frequency component in the horizontal direction as the roll period of the ship, and determine the period corresponding to the main frequency component in the vertical direction as the pitch period of the ship. S23, The visual background extraction algorithm is used to identify transient motion areas located near the boundary between the hull and the water surface, which are irregularly shaped and last for less than a preset number of frames, and these areas are marked as water splash areas. S24. Divide the ship along its length into the bow area, midship area and stern area, count the frequency and coverage of water splashing areas in each area, and generate water splashing distribution data for each preset collection point.

[0009] Furthermore, the method of predicting the ship's stable moment based on the ship's roll and pitch periods, controlling the UAV to hover directly above the preset data collection point, and detecting the ship's attitude angle change rate at the stable moment, and determining that the ship is in a stable state if the attitude angle change rate is less than a first threshold, includes: S31, based on the ship's roll period and pitch period, construct the roll motion phase function and pitch motion phase function respectively; S32, based on the roll motion phase function and the pitch motion phase function, calculate the curves of roll angular velocity versus time and pitch angular velocity versus time respectively; the moment when both roll angular velocity and pitch angular velocity approach zero is taken as the candidate stable moment; S33, taking the candidate stable moment as the center, extend forward and backward by a preset time to form a collection time window; S34. While the UAV hovers directly above the preset collection point, the attitude angle change rate of the ship is monitored in real time. When the collection time window is entered and the attitude angle change rate is less than the first threshold, it is determined that the stable moment has arrived. If no attitude angle change rate that meets the conditions is detected within the collection time window, the roll motion phase function and pitch motion phase function are updated according to the latest attitude angle change rate data, and steps S31 to S34 are executed again.

[0010] Furthermore, the controlled drone hovers at a preset altitude and waits. When the ship is in a stable state, the controlled drone descends vertically at the speed of falling rain and snow, and continuously collects images of the ship's draft at various preset collection points during the descent, including: S41, while the drone hovers at a preset height at a preset acquisition point, it acquires a video stream containing rain and snow particles; S42, perform image analysis on the continuous frames in the video stream, identify the motion trajectory of rain and snow particles in the image, and calculate the projection velocity of rain and snow particles in the horizontal and vertical directions respectively. S43, based on the projected velocity of rain and snow particles in the horizontal and vertical directions and the current altitude of the drone, the actual falling velocity and actual falling direction of the rain and snow particles are obtained through geometric conversion; S44, When the ship is in a stable state, control the UAV to descend from the preset height according to the actual falling speed and actual falling direction, and continuously collect images at the same time. The collection process covers the entire process from the preset height to the lowest collection height, and obtains a continuous frame image sequence of the ship's draft at the preset collection point. S45: After completing the image acquisition of the current preset acquisition point, control the drone to rise to the preset altitude and fly to the next preset acquisition point. Repeat steps S41 to S43 until the image acquisition of all preset acquisition points is completed.

[0011] Furthermore, when the ship is in a stable state, controlling the drone to descend from a preset height according to the actual descent speed and actual descent direction includes: S441, During the drone's hovering period, the video stream is continuously acquired, and rain and snow particles are detected in each frame of the image to generate a rain and snow particle distribution map; S442, based on the aforementioned rain and snow particle distribution map, determine the following conditions in real time: Condition A: If the number of rain and snow particles detected is lower than the second threshold, it is determined that there is an intermittent rain and snow in the lens; Condition B: If rain and snow particles are detected and distributed within a preset edge area, it is determined that there is no interference in the center. S443, when at least one of conditions A and B is met, record the current time as the optimal descent trigger time; if the optimal descent trigger time is within the acquisition time window, then trigger the drone descent action; If the optimal descent trigger time is outside the data collection window, the drone will remain hovering and return to S441 to continue rain and snow particle detection.

[0012] Furthermore, the step of removing rain and snow and water splashes from the synthesized image to generate a denoised image includes: S61, acquire the composite image of each preset point, perform grayscale processing on the composite image, and use an adaptive threshold segmentation algorithm to extract the high-brightness area in the image; S62, extract the shape features of each high-brightness area, mark the candidate regions of rain and snow particles based on the shape features, and perform connected component analysis on the candidate regions of rain and snow particles to generate a rain and snow mask image. S63, morphological opening operation is used to dilate the rain and snow mask image to expand the coverage of rain and snow particles; the pixels marked by the rain and snow mask in the synthesized image are traversed, and multi-directional interpolation is performed using the neighboring pixels not covered by the rain and snow mask to fill the image, and the filled image is used as the intermediate image after the rain and snow are wiped. S64, obtain the water splash distribution, and in conjunction with the intermediate image, extract pixel regions with high brightness, low saturation and radial distribution of edge gradient direction within the water splash distribution area, and mark them as water splash candidate regions. S65, perform connected component analysis on the candidate water splash regions to eliminate isolated noise regions; for the remaining candidate water splash regions, use a region growing algorithm to determine the complete boundary of the water splash regions; and remove water splashes based on the complete boundary to generate a denoised image.

[0013] Furthermore, the hydrostatic curve is a pre-stored set of ship hydrostatic characteristic curves, and the hydrostatic curve includes at least the curve showing the relationship between draft and displacement.

[0014] The present invention also provides a load capacity measurement system based on computer-aided imagery, the system being used to implement any of the aforementioned computer-aided imagery-based ship load capacity measurement methods, the system comprising: The video acquisition module is used to control the drone to cruise along the outside of the ship and acquire video images; The motion sensing module, connected to the video acquisition module, is used to determine the ship's roll period, pitch period, and water splash distribution at each preset acquisition point based on the correspondence between the cruise flight time and video images. The stability prediction module, connected to the motion sensing module, is used to predict the ship's stable moment based on the ship's roll period and pitch period, control the UAV to hover directly above the preset collection point, and detect the ship's attitude angle change rate at the stable moment. If the attitude angle change rate is less than a first threshold, the ship is determined to be in a stable state. The descent acquisition module, connected to the stability prediction module, is used to control the UAV to hover and wait at a preset altitude. When the ship is in a stable state, the UAV is controlled to descend at the speed of falling rain and snow, and continuously acquire ship draft images at preset acquisition points during the descent. The image synthesis module, connected to the descent acquisition module, is used to project the ship's draft image at each preset acquisition point onto the ship's fixed coordinate system based on the acquisition time and the attitude data of the UAV, and perform temporal median filtering at the pixel level to generate a synthesized image for each preset point. An image denoising module, connected to the image synthesis module, is used to remove rain and snow and water splashes from the synthesized image to generate a denoised image. The load calculation module, connected to the image denoising module, is used to determine the ship's draft based on the denoised image, and to calculate the ship's current displacement by interpolation based on the ship's draft and the ship's hydrostatic curve, and then subtract the ship's empty weight to obtain the ship's current load capacity.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: Firstly, this invention generates a two-dimensional motion trajectory by tracking using optical flow and extracts the dominant frequencies in the horizontal and vertical directions using fast Fourier transform, thereby accurately obtaining the roll and pitch periods and calculating candidate stable moments when the angular velocities simultaneously approach zero. Furthermore, when the model deviates from the actual motion, the latest monitoring data is used to adaptively update the phase function and re-predict, forming a closed-loop correction mechanism. This solves the technical problems of existing methods that rely on manual experience to judge the stable state, cannot simultaneously consider the coupled motion of roll and pitch, and cause the fixed model to fail when sea conditions change. It significantly improves the accuracy of determining the ship's stable moment and the reliability of data acquisition triggering, enhances the system's adaptability and self-correction capabilities to complex sea conditions, and effectively reduces draft reading deviations caused by the ship's dynamic motion.

[0016] Secondly, this invention acquires video streams containing rain and snow particles, analyzes consecutive frames to identify the trajectories of these particles, calculates their projected velocities in the horizontal and vertical directions, and uses the UAV's current altitude and the camera's imaging model to geometrically calculate the actual falling speed and direction of the particles. When the ship is in a stable state, the UAV is controlled to descend from a preset altitude according to this actual velocity vector and continuously acquire images, keeping the UAV and the rain and snow particles relatively stationary, thereby eliminating rain and snow trails and motion blur. This significantly improves the clarity and signal-to-noise ratio of the acquired draft images, reduces the number of invalid acquisitions and the energy consumption of repeated flights, enabling the method to adapt to severe weather conditions such as rain and snow, truly achieving all-weather, highly robust load measurement operations.

[0017] Thirdly, this invention eliminates the need for personnel to board the ship or approach the hull in a small boat, thus eliminating safety hazards. At the same time, the drone automatically flies and collects data according to a preset route, avoiding subjective errors and perspective limitations caused by manual operation. It also solves the problem of interference from the dynamic movement of the ship on the waterline reading and breaks through the technical bottleneck of image quality degradation in rainy and snowy weather. Furthermore, through image processing methods such as pre-statistical analysis of water splash distribution and temporal median filtering, shape feature screening, multi-directional interpolation repair, and radial edge discrimination of water splashes, it effectively eliminates transient occlusion of water splashes and foam. From drone cruise, motion perception, stable prediction, and adaptive descent acquisition, to multi-frame projection synthesis, temporal median filtering, rain and snow erasure and water splash removal, and then to draft depth identification and load calculation, it constructs a complete, closed-loop, and highly automated load measurement technology system, which comprehensively improves the measurement accuracy, operational efficiency, and environmental adaptability of load measurement. Attached Figure Description

[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a method for measuring ship load capacity based on computer-aided images, provided in an embodiment of the present invention; Figure 2 This is a structural block diagram of a ship load capacity measurement system based on computer-aided image processing, provided as an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.

[0021] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0022] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.

[0023] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0024] Example 1 like Figure 1 As shown, the present invention provides a method for measuring ship load capacity based on computer-aided images, comprising: S1 controls the drone to cruise along the outside of the ship and collect video images; S2, based on the correspondence between cruise flight time and video images, determines the ship's roll period, pitch period, and water splash distribution at each preset acquisition point, including: S21, extract fixed structural feature points of the ship from the video image, and use optical flow to track the fixed structural feature points between consecutive frames to generate a two-dimensional motion trajectory of each feature point in the time series. S22, for the two-dimensional motion trajectory of each feature point, perform time-domain decomposition along the horizontal and vertical directions respectively, use fast Fourier transform to extract the main frequency component, determine the period corresponding to the main frequency component in the horizontal direction as the roll period of the ship, and determine the period corresponding to the main frequency component in the vertical direction as the pitch period of the ship. S23, The visual background extraction algorithm is used to identify transient motion areas located near the boundary between the hull and the water surface, which are irregularly shaped and last for less than a preset number of frames, and these areas are marked as water splash areas. S24. Divide the ship along its length into the bow area, midship area and stern area, count the frequency and coverage of water splashing areas in each area, and generate water splashing distribution data for each preset collection point.

[0025] The preset data collection points include the bow point, midship point, and stern point set sequentially along the length of the ship, as well as symmetrical points set on the port and starboard sides of the ship respectively; wherein, the port bow point, port midship point, port stern point, and starboard bow point, starboard midship point, and starboard stern point constitute six preset data collection points, and the spatial position of each preset data collection point corresponds to the reading position of the ship's waterline mark.

[0026] In one possible implementation, operators first set the drone's cruise route at a shore-based or shipboard control station. This route is planned to circle the outer side of the vessel under test, centered on the waterline, within a horizontal distance of approximately 5 to 10 meters and a vertical height of approximately 10 to 15 meters from the hull, cruising at a constant speed of approximately 0.5 to 1 meter per second. The drone is equipped with a high-resolution, high-frame-rate visible light camera, continuously acquiring video images during the cruise. To ensure image quality, the drone's gimbal remains stable, maintaining an angle of approximately 45 to 60 degrees between the camera's optical axis and the plane containing the vessel's waterline, in order to clearly capture details such as the hull side, waterline, and splashes. The entire cruise covers the entire port and starboard sides of the vessel, particularly the entire length from bow to stern.

[0027] After the UAV completes its cruise flight and acquires time-stamped video images, the image processing and analysis module on the ground control station or cloud server processes the video data. Specifically, the video images are first preprocessed, including noise reduction and contrast enhancement. Subsequently, stable feature points are extracted from the ship's fixed structures, such as side stiffeners, deck edges, the fixed borders of waterline markers, and drainage holes, using Scale Invariant Feature Transform (SIFT) or Accelerated Robust Feature Transform (SURF) algorithms. These feature points are rigidly connected to the hull, and their motion represents the overall motion of the hull.

[0028] Taking one feature point as an example, a sparse optical flow method, such as the Lucas-Kanade optical flow method, is used to track the feature point between consecutive video frames. The pixel coordinates (x, y) of the feature point in each frame are recorded through frame-by-frame calculation. As time progresses, the timestamp of each frame is associated with the corresponding pixel coordinates to form a complete two-dimensional motion trajectory sequence. Since the ship is in motion during the cruise acquisition, this trajectory simultaneously includes the projections of multiple motion components such as ship roll, pitch, and heave caused by waves onto the image plane. For the trajectories of all feature points generated in S21, their horizontal components (x-direction) and vertical components (y-direction) are processed separately. Taking the horizontal component as an example, the pixel coordinates of the feature point in the horizontal direction are used as a signal that varies with time. Since the ship's roll motion causes significant periodic horizontal swaying of the hull in the image, the horizontal displacement signal contains the main frequency information of the roll.

[0029] The signal is transformed from the time domain to the frequency domain using a Fast Fourier Transform (FFT). In the frequency spectrum, the frequency component with the largest amplitude is identified; this component represents the dominant frequency of the horizontal motion. The ship's roll period is the reciprocal of this dominant frequency. Similarly, for the vertical component, its dominant frequency is primarily caused by the ship's pitch motion (changes in pitch cause the bow or stern to rise and fall in the image). The dominant frequency in the vertical direction is obtained through FFT, thus determining the pitch period. To improve accuracy, the average of the periods calculated from multiple feature points can be used as the final result.

[0030] While determining the ship's motion period, a separate parallel processing step is performed on the video images to identify water splashes. The Visual Background Extraction (ViBe) algorithm is employed, which efficiently detects moving foreground objects by building a background model for each pixel based on historical samples. Due to the transient and irregular nature of water splashes, the ViBe algorithm can distinguish them from the relatively stationary ship hull and water surface background. During processing, the foreground regions detected by the ViBe algorithm are spatially matched with regions near the ship-water boundary. The boundary is determined using edge detection algorithms (such as the Canny operator) combined with prior knowledge of the ship's contour. Only foreground regions located near the boundary, with small areas (e.g., less than a preset threshold, such as 500 pixels), irregular shapes (e.g., circularity below a threshold, such as 0.6), and short durations (e.g., disappearing after appearing for less than 5 consecutive frames) are ultimately labeled as water splash regions. The video frame number, coordinate range in the image, and shape of each water splash region are recorded.

[0031] Finally, the distribution of water splashes was statistically analyzed based on the preset data collection points. There were six preset data collection points, corresponding to the waterline reading positions on the port and starboard sides: bow, midships, and stern. Therefore, firstly, based on the ship's outline in the video image, combined with the UAV's GPS and attitude data, the coordinates in the image space were mapped to the ship's own coordinate system. Then, the ship was divided into three regions along its length: bow, midships, and stern.

[0032] For each region on both the port and starboard sides, the area of ​​water splashing within that region is statistically analyzed. Statistical parameters include: frequency of occurrence, for example, the percentage of frames marked as splashing areas within that region during the total duration of cruise flight; and coverage, for example, the total pixel area occupied by splashing areas within that region, or its maximum vertical extension.

[0033] Finally, a splash distribution data set was generated for each of the six preset collection points. For example, for the port bow point, the distribution data showed a frequency of 30% and a coverage area of ​​frequent occurrence within 0.5 meters above and below the waterline, while for the port midship point, the distribution data showed a frequency of 5% and a coverage area of ​​sporadic occurrence.

[0034] This invention addresses the problems of traditional manual draft surveys, which require personnel to board the ship or approach the hull in small boats, posing safety hazards and limiting the observation angle, by controlling a drone to adaptively cruise along the outer side of the vessel and acquire video images. This improves the safety and flexibility of data acquisition. Furthermore, the drone's stable flight along a preset route reduces random errors caused by human error or subjective selection of observation points. By extracting fixed structural feature points from the video images and using optical flow to generate a two-dimensional motion trajectory through continuous frame tracking, and then combining this with Fast Fourier Transform to perform frequency domain decomposition of the horizontal and vertical motion components to extract the dominant frequency components, this invention solves the problems of traditional methods, such as difficulty in simultaneously and accurately measuring the ship's roll and pitch periods and susceptibility to non-periodic wave interference. This improves the accuracy and real-time performance of ship motion state perception, providing quantified motion characteristic parameters for accurately predicting the ship's stable moment. By employing visual... The background extraction algorithm processes video images to identify transient motion regions located near the boundary between the hull and the water surface, exhibiting irregular shapes and lasting for less than a preset number of frames. These regions are then marked as water splash areas. This solves the problem of traditional manual observation, which struggles to quantitatively record the spatiotemporal distribution of water splashes and relies solely on subjective judgment of their interference level. It improves the objectivity and quantification of waterline interference source identification, providing clear regional prior information for subsequent image denoising. By dividing the ship along its length into bow, midship, and stern regions and statistically analyzing the frequency and coverage of water splash areas in each region, water splash distribution data is generated for each preset acquisition point. This addresses the lack of spatial differentiation in water splash interference assessment and the inability to adopt differentiated denoising strategies for different acquisition points in traditional methods. This improves the targeting and effectiveness of subsequent image denoising processing and reduces the waterline identification error rate caused by water splash interference.

[0035] S3, based on the ship's roll and pitch periods, predict the ship's stable moment, control the UAV to hover directly above the preset data collection point, and detect the ship's attitude angle change rate at the stable moment. If the attitude angle change rate is less than a first threshold, determine that the ship is in a stable state, including: S31, based on the ship's roll period and pitch period, construct the roll motion phase function and pitch motion phase function respectively; S32, based on the roll motion phase function and the pitch motion phase function, calculate the curves of roll angular velocity versus time and pitch angular velocity versus time respectively; the moment when both roll angular velocity and pitch angular velocity approach zero is taken as the candidate stable moment; S33, taking the candidate stable moment as the center, extend forward and backward by a preset time to form a collection time window; S34. While the UAV hovers directly above the preset collection point, the attitude angle change rate of the ship is monitored in real time. When the collection time window is entered and the attitude angle change rate is less than the first threshold, it is determined that the stable moment has arrived. If no attitude angle change rate that meets the conditions is detected within the collection time window, the roll motion phase function and pitch motion phase function are updated according to the latest attitude angle change rate data, and steps S31 to S34 are executed again.

[0036] In one possible implementation, the ship's roll period T has been obtained through the aforementioned step S2. roll and the tilt period T pitch After completing its cruise flight, the UAV has reached directly above the preset data collection point (e.g., the port bow point) and hovers, with its onboard camera pointing vertically downwards or at a preset angle towards the ship's waterline marker area. It is assumed that the ship's roll and pitch motions under wave action are approximately simple harmonic motions. Based on the motion trajectories of the fixed structural feature points identified in step S2, the current phase angles of the roll and pitch motions are extracted. These phase angles can be obtained by fitting curves of the feature point motion trajectories near a stable moment. Subsequently, roll and pitch motion phase functions are constructed respectively.

[0037] Differentiating the phase functions of roll and pitch motions yields the angular velocity functions. The search is then conducted on the time axis to find moments where both the roll and pitch angular velocities simultaneously approach zero. At these moments, the ship's theoretical instantaneous rotational speed is at its minimum, indicating a relatively "stable" state. These moments are marked as candidate stable moments. Considering the periodicity of motion, multiple candidate moments are typically searched; the one closest to the current time and located on the future time axis is prioritized.

[0038] To address the discrepancy between actual motion and ideal harmonic motion, a data acquisition time window is set for each candidate stable moment. Specifically, a time window is formed by extending a preset duration forward and backward from the candidate stable moment. The preset duration can be set based on the ship's motion cycle and practical experience, for example, taking 1 / 10 to 1 / 5 of the smaller of the roll and trim periods; a typical value is 0.5 to 1 second. The physical significance of the time window is that even if the ship's instantaneous stable moment deviates somewhat from the theoretical prediction, a valid stable state can still be considered captured within this window.

[0039] Before image acquisition, the drone hovers continuously directly above the preset acquisition point. The onboard computer or ground control system of the drone receives data from the drone's attitude sensors in real time. Simultaneously, the onboard camera tracks fixed feature points on the ship's hull in real time to assist in calculating the ship's relative attitude angle change rate. The ship's attitude angle change rate detected here refers to the combined value of the ship's angular velocities in both the roll and pitch directions.

[0040] When the data acquisition window is entered, the real-time detected rate of change of attitude angles is compared. If, at any moment within the window, the root mean square or maximum value of the ship's rate of change of attitude angles (i.e., the roll rate and pitch rate) is less than a preset first threshold (in this embodiment, the first threshold is 0.1° / s), then this moment is determined to be the actual stable moment, and a trigger signal is output to initiate the UAV descent and image acquisition actions in subsequent steps.

[0041] If no attitude angle change rate that meets the conditions is detected after the entire acquisition time window has been traversed, it indicates that there is a deviation between the motion model built based on historical data and the current actual motion state, such as a period or phase shift caused by changes in wave conditions. At this time, the latest attitude angle change rate real-time monitoring data accumulated from the start of hovering to the current moment will be used to refit the parameters of the roll motion phase function and the pitch motion phase function, such as updating the phase angle, and then returning to step S31 to recalculate the candidate stabilization moment and acquisition time window.

[0042] This invention constructs roll and pitch phase functions based on the ship's roll and pitch periods, respectively, and calculates the curves of roll and pitch angular velocities over time. The moment when the angular velocities in both directions simultaneously approach zero is designated as a candidate stabilization moment. This solves the problems of traditional methods relying solely on visual assessment of ship stability, lacking quantitative data, and failing to simultaneously consider multi-degree-of-freedom motion coupling. It improves the scientific rigor and accuracy of stabilization moment prediction, providing a quantitative time benchmark for subsequent data acquisition. By extending preset time windows forward and backward from the candidate stabilization moment, it addresses the issue of slight deviations between theoretical and actual stabilization moments due to the non-ideal nature of actual sea wave conditions, and the risk of missing optimal acquisition times if relying solely on single-point predictions. The timing of the data collection improves the tolerance and robustness to fluctuations in actual motion states, reducing the risk of data acquisition failure due to prediction bias. By monitoring the ship's attitude angle change rate in real time during UAV hovering and determining the arrival of a stable moment when the data acquisition window is entered and the attitude angle change rate is less than a first threshold, the problem of relying solely on historical data for prediction cannot respond to dynamic changes in the ship's motion state in real time is solved, improving the real-time performance and reliability of stable moment determination. At the same time, when no attitude angle change rate meeting the conditions is detected within the data acquisition window, the motion phase function is updated based on the latest monitoring data and the prediction is re-executed, solving the problem of fixed models failing when wave conditions change, improving adaptability and self-correction capabilities to complex sea conditions, and reducing the probability of data acquisition failure due to environmental changes.

[0043] S4, control the drone to hover at a preset altitude and wait. When the ship is in a stable state, control the drone to descend at the speed of falling rain and snow, and continuously collect images of the ship's draft at preset collection points during the descent, including: S41, while the drone hovers at a preset height at a preset acquisition point, it acquires a video stream containing rain and snow particles; S42, perform image analysis on the continuous frames in the video stream, identify the motion trajectory of rain and snow particles in the image, and calculate the projection velocity of rain and snow particles in the horizontal and vertical directions respectively. S43, based on the projected velocity of rain and snow particles in the horizontal and vertical directions and the current altitude of the drone, the actual falling velocity and actual falling direction of the rain and snow particles are obtained through geometric conversion; S44, When the ship is in a stable state, control the UAV to descend from the preset height according to the actual falling speed and actual falling direction, and continuously collect images at the same time. The collection process covers the entire process from the preset height to the lowest collection height, and obtains a continuous frame image sequence of the ship's draft at the preset collection point. S45: After completing the image acquisition of the current preset acquisition point, control the drone to rise to the preset altitude and fly to the next preset acquisition point. Repeat steps S41 to S43 until the image acquisition of all preset acquisition points is completed.

[0044] When the ship is in a stable state, control the drone to descend from a preset altitude according to the actual descent speed and direction, including: S441, During the drone's hovering period, the video stream is continuously acquired, and rain and snow particles are detected in each frame of the image to generate a rain and snow particle distribution map; S442, based on the aforementioned rain and snow particle distribution map, determine the following conditions in real time: Condition A: If the number of rain and snow particles detected is lower than the second threshold, it is determined that there is an intermittent rain and snow in the lens; Condition B: If rain and snow particles are detected and distributed within a preset edge area, it is determined that there is no interference in the center. S443, when at least one of conditions A and B is met, record the current time as the optimal descent trigger time; if the optimal descent trigger time is within the acquisition time window, then trigger the drone descent action; If the optimal descent trigger time is outside the data collection window, the drone will remain hovering and return to S441 to continue rain and snow particle detection.

[0045] In one possible implementation, the drone hovers at a pre-set data acquisition point, such as directly above the waterline marker on the port bow, at a preset height of 5 meters above the waterline to ensure that the descent fully covers the waterline reading range. While hovering, the drone's onboard camera remains pointed downwards or tilted towards the ship's waterline area, continuously acquiring a video stream at 60 frames per second. This video stream includes not only the ship and its waterline marker but also streaks or spots created by rain and snow particles moving across the camera's field of view. Due to the small size and high speed of rain and snow particles, they typically appear as short lines or blurry spots in a single frame, but as continuous motion trajectories in consecutive frames.

[0046] Real-time image analysis is performed on the acquired video stream. First, moving foregrounds are extracted using background subtraction or frame difference methods. Since rain and snow particles exhibit significant motion characteristics relative to the stationary hull and background, candidate regions for rain and snow particles can be initially screened by setting brightness and area thresholds, such as connected regions with a pixel area less than 10 pixels. Then, matching and tracking of the same rain and snow particle is performed between consecutive frames. Kalman filtering or optical flow methods can be used to generate the particle's two-dimensional motion trajectory on the image plane. For each successfully tracked rain and snow particle, its displacement in the horizontal direction (image x-axis) and vertical direction (image y-axis) is calculated. Combined with the time interval between adjacent frames, the horizontal and vertical projection velocities are obtained. The projection velocities of multiple rain and snow particles are statistically averaged to reduce random errors, yielding the average horizontal projection velocity and the average vertical projection velocity.

[0047] Due to perspective projection in camera imaging, there is a nonlinear mapping between pixel velocity in the image and actual spatial velocity. Given the UAV's current altitude, camera intrinsic parameters, and the camera's tilt angle relative to the vertical, the average image projection velocity obtained in S42 is converted into the actual horizontal and vertical velocities of rain and snow particles in three-dimensional space based on the pinhole imaging model. Finally, the actual falling velocity and direction of the rain and snow particles are synthesized using the angle between these velocities and the vertically downward direction. Since raindrops fall approximately vertically in still conditions but exhibit horizontal offset in windy conditions, the calculation results reflect the true motion vector of rain and snow in the current environment.

[0048] Once S3 determines that the ship is in a stable state, it immediately triggers the descent control of the UAV. Receiving the actual descent speed and direction calculated by S43 as speed commands, the UAV will adjust its attitude and rotor thrust to descend along this speed vector. That is, the magnitude of the descent speed is equal to the falling speed of the rain and snow particles, and the descent direction is consistent with the falling direction of the rain and snow. For example, if raindrops fall at an angle due to wind, the UAV will also descend along the same tilted trajectory.

[0049] During the hovering wait, not only is the velocity of the rain and snow particles calculated, but a spatial distribution map of the rain and snow particles on the image plane is also generated in real time. This distribution map uses binarization to indicate whether each pixel location is covered by rain and snow particles. Specifically, a rain and snow particle detection algorithm (such as a shape and motion feature-based classifier) ​​is run on each frame of the image. The detected rain and snow particle areas are marked as foreground, and the remaining areas are marked as background, forming a binary mask image of the same size as the image, i.e., the rain and snow particle distribution map. The total number of foreground pixels in the rain and snow particle distribution map of the current frame, or the number of individual rain and snow particles detected, is counted. If this number is less than a preset second threshold (in this embodiment, the second threshold is set to 5), it is considered that the rain and snow density is low, and a brief window of no rain or snow or light rain and snow appears in the camera's field of view, which is defined as a rain and snow intermittent.

[0050] A central region is predefined in the image, for example, a rectangular area centered on the image center and occupying 50% of the image area, and an edge region (the surrounding area outside the central region). Then, the rain and snow particle distribution map is analyzed to determine if all foreground pixels are located within the edge region, while the central region has no rain or snow particles. If this condition is met, it indicates that although rain and snow are present, the key imaging area where the waterline marker is located is not obscured, and is defined as having no central interference.

[0051] Continuously monitor the two conditions mentioned above. Once at least one of conditions A or B is met, record the current moment as the optimal descent trigger moment. Then, check if this moment falls within the acquisition time window defined in S33. If so, it means that both the ship stability condition and the minimum rain / snow interference condition are met, and immediately trigger the UAV's descent action, starting the adaptive speed descent and image acquisition in S44. If the optimal descent trigger moment is outside the acquisition time window, for example, when the ship is not yet stable during rain / snow intermittent periods, or when the stability window has passed, do not trigger the descent, but return to S441 to continue acquiring the video stream and detecting rain / snow particle distribution, waiting for the next moment when the conditions are met.

[0052] During descent, the drone's onboard camera continuously captures images at a constant frame rate, starting from a preset altitude and ending at the lowest capture altitude, covering the entire waterline reading range. The purpose of this is that when the drone maintains a relatively stationary descent speed relative to the rain and snow particles, the relative velocity of the particles in the camera image approaches zero, thus significantly reducing motion blur and improving image clarity.

[0053] After completing the descent and data acquisition at the current location, the drone hovers or immediately ascends back to the preset altitude. Then, the drone flies to the next preset data acquisition location along the preset route. Upon reaching each location, steps S41 to S44 are repeated: hovering again, detecting the speed of rain and snow particles, waiting for a stable state, and adaptively descending to acquire data. In this way, the image acquisition task for all six preset data acquisition locations is completed sequentially.

[0054] This invention addresses the problem of relative motion between the drone and rain / snow particles during drone hovering, which causes image trailing and motion blur in images. It involves capturing video streams containing rain and snow particles while the drone is hovering, analyzing consecutive frames, calculating their horizontal and vertical projection velocities in the images, and using geometric calculations based on the drone's current altitude to determine the actual falling speed and direction of the particles. This solves the problem of relative motion between the drone and rain / snow particles during a fixed descent, which leads to rain / snow trailing and motion blur in the images. It improves the clarity of water-bearing images captured in rain and snow environments and reduces image degradation caused by relative motion. Furthermore, by controlling the drone to descend from a preset altitude according to its actual falling speed and direction, and continuously capturing images during the descent to cover the entire process from the preset altitude to the lowest acquisition altitude, it resolves the mismatch between the drone's descent speed and the falling speed of rain and snow. The system addresses the issue of rain and snow particles forming long trajectories that obstruct water level readings in images. It improves the synchronization of UAV movement with rain and snow environments, reduces the visibility of rain and snow stripes in images, and thus enhances the reliability of waterline identification. By continuously acquiring video streams and generating rain and snow particle distribution maps during UAV hovering, it can determine conditions A (the number of rain and snow particles is below the second threshold, and rain and snow intermittents occur) and B (rain and snow particles are all distributed within a preset edge area, with no interference in the center) in real time. When at least one of conditions A and B is met, the optimal descent trigger time is recorded. The descent action is triggered only when this time falls within the acquisition time window. This solves the problem of blindly descending and causing invalid image acquisition when rain and snow are dense or key areas are obstructed, improving the success rate of image acquisition and reducing the number of invalid acquisitions and repeated flight energy consumption caused by rain and snow obstruction.

[0055] S5, the ship's draft image at each preset acquisition point is projected onto the ship's fixed coordinate system according to the acquisition time and the attitude data of the UAV, and temporal median filtering is performed at the pixel level to generate a composite image of each preset point; S6, perform rain and snow erasure and water splash removal on the synthesized image to generate a denoised image, including: S61, acquire the composite image of each preset point, perform grayscale processing on the composite image, and use an adaptive threshold segmentation algorithm to extract the high-brightness area in the image; S62, extract the shape features of each high-brightness area, mark the candidate regions of rain and snow particles based on the shape features, and perform connected component analysis on the candidate regions of rain and snow particles to generate a rain and snow mask image. S63, morphological opening operation is used to dilate the rain and snow mask image to expand the coverage of rain and snow particles; the pixels marked by the rain and snow mask in the synthesized image are traversed, and multi-directional interpolation is performed using the neighboring pixels not covered by the rain and snow mask to fill the image, and the filled image is used as the intermediate image after the rain and snow are wiped. S64, obtain the water splash distribution, and in conjunction with the intermediate image, extract pixel regions with high brightness, low saturation and radial distribution of edge gradient direction within the water splash distribution area, and mark them as water splash candidate regions. S65, perform connected component analysis on the candidate water splash regions to eliminate isolated noise regions; for the remaining candidate water splash regions, use a region growing algorithm to determine the complete boundary of the water splash regions; and remove water splashes based on the complete boundary to generate a denoised image.

[0056] In one possible implementation, after adaptive descent and acquisition of images from a preset acquisition point, a sequence of consecutive frames of ship draft images is obtained. Each frame is accompanied by a precise timestamp and the UAV's attitude data at that moment, including the UAV's three-dimensional position coordinates, yaw angle, pitch angle, and roll angle. Since slight swaying or trajectory deviation is inevitable during the UAV's descent, the pixel coordinates of the same physical point in different frames are not identical. To eliminate this perspective variation and utilize multi-frame information to suppress random noise and transient occlusion, a unified fixed ship coordinate system is established. This coordinate system is referenced to the ship's design waterline plane, with the bow and stern lines as the X-axis (positive pointing towards the bow), the direction from port to starboard as the Y-axis, and the vertically upward direction as the Z-axis. The physical origin of this coordinate system can be calibrated based on the known location of the ship's waterline marker.

[0057] For each frame of the original image, a perspective projection mapping relationship from image pixel coordinates to spatial points in the ship's fixed coordinate system is established using the camera extrinsic parameters from the UAV attitude data (calculated from the UAV position, gimbal angle, etc.) and the known camera intrinsic parameters. Specifically, for any pixel in the image, the intersection point of its corresponding spatial ray with the hull surface can be calculated using the collinearity equation. Since the shape of the hull surface is known, each pixel is back-projected into the ship's fixed coordinate system, generating a coordinate mapping table. Subsequently, all pixels of each frame of the original image are resampled according to this mapping table to obtain a projected image on a regular grid in the ship's fixed coordinate system. This projected image eliminates the perspective distortion caused by UAV motion, aligning pixels at the same spatial position between different frames. After projecting all frames, a spatially aligned image sequence is obtained, and temporal median filtering is performed at the pixel level. For each fixed pixel position in the projected image, the pixel grayscale value at that position in all frames is collected, and the median of all pixel grayscale values ​​is calculated. The median is used as the final value of the synthesized image at that pixel position. Since transient disturbances such as rain and snow particles and splashing water appear as sparse outliers in the time domain, while static structures such as ship draft gauges and markings are stable in most frames, median filtering can effectively remove these transient anomalies while preserving edge details. Finally, a composite image is generated for each preset acquisition point.

[0058] After obtaining the synthesized image, it is converted into a grayscale image. Since rain and snow particles and water splashes typically have high reflectivity, they appear as high-brightness areas in the image. An adaptive thresholding algorithm, such as adaptive thresholding based on local means or Otsu's global thresholding method, is used to calculate a dynamic threshold for each pixel or its neighborhood in the grayscale image. Regions with pixel grayscale values ​​exceeding this threshold are marked as high-brightness regions, generating a binary high-brightness mask. Shape features are extracted from each connected region in the binary high-brightness mask. These features include area, aspect ratio, roundness, and elongation. Rain and snow particles typically appear as small, approximately elliptical spots in the image, characterized by small area, aspect ratio close to 1, or short lines. Based on these features, discrimination rules are set, and high-brightness regions matching the morphological characteristics of rain and snow particles are marked as candidate regions. Then, connected component analysis is performed on these candidate regions, merging adjacent or overlapping candidate regions to generate a binary rain and snow mask image, where the marked pixels represent the possible locations covered by rain and snow particles.

[0059] Since the edges of rain and snow particles may be dark or partially transparent, the mask generated by S62 may not be able to completely cover all pixels affected by rain and snow. Therefore, a morphological dilation operation is first performed on the rain and snow mask image. This involves sliding a structuring element (such as a 3×3 circular kernel) on the mask to expand the mask area outward by several pixels, thereby obtaining a slightly larger mask to ensure full coverage of the rain and snow effects.

[0060] Then, all pixels marked by a slightly larger mask in the composite image are traversed. For each pixel to be repaired, valid pixels not covered by the mask are searched in its neighborhood, for example, within a 15×15 window centered on the pixel to be repaired. From these valid pixels, the nearest neighboring valid pixel values ​​are selected according to multiple directions, such as 0°, 45°, 90°, and 135°, and the new pixel value of the pixel to be repaired is calculated using bilinear interpolation or radial basis function-based interpolation. This multi-directional interpolation avoids texture distortion introduced by unidirectional reference. After filling all pixels within the mask, an intermediate image after rain and snow erasure is obtained.

[0061] From the water splash distribution data obtained in step S2, read the water splash area corresponding to the current preset sampling point. For example, for the port bow, water splashes mainly occur in a specific area within 0.5 meters above and below the waterline. Then, convert the intermediate image to the HSV color space. Within the water splash distribution area, extract pixels that simultaneously meet the following conditions: High brightness, V channel value is higher than a preset threshold (e.g., greater than 0.8); Low saturation, with the S channel value below a preset threshold (e.g., less than 0.3), because the water splashes are mostly white or transparent; The gradient direction at the edge is radial. The gradient direction of each pixel is calculated. Water splashes typically spread outwards from the point of impact, so the gradient direction at the edge roughly presents a radial distribution from the center outwards. Water splash characteristics are confirmed by detecting the consistency of the gradient direction and the radial pattern within local regions.

[0062] These qualified pixel regions are marked as candidate splash regions, generating a splash mask. Connectivity analysis is performed on the splash mask, and the area of ​​each connected component is calculated. Isolated regions with too small an area are considered noise and removed from the mask. For the remaining splash candidate regions, they are used as seed points, and a region growing algorithm is employed: in the original pixel space of the intermediate image, similar pixels around the seed point are gradually incorporated into the region based on color similarity (e.g., RGB Euclidean distance less than a threshold) and spatial adjacency, thereby determining the complete boundary of the splash region. This process can compensate for the splash edge parts that may be missed by detection based solely on brightness / saturation thresholds. After obtaining the complete splash boundary mask, splash regions in the intermediate image are removed. The removal method can be to directly set the pixel value of the region to the background color, or, more preferably, to use an interpolation filling method similar to step S63, utilizing the effective image information around the splash region for repair. Finally, a clean, denoised image is generated in which the water level gauge lines, characters, and water surface boundary lines are clearly visible, which can be used for subsequent automatic draft recognition.

[0063] This invention addresses the problem that rain and snow particles and water splashes appear bright in images due to their reflective properties, but a fixed threshold cannot adapt to different lighting conditions and local contrast changes. It improves the adaptability and accuracy of high-brightness region extraction by performing grayscale processing on the synthesized image and employing an adaptive threshold segmentation algorithm to extract high-brightness regions, thus reducing the false positive or false negative rate caused by uneven lighting. Furthermore, by extracting the shape features of each high-brightness region and marking candidate regions for rain and snow particles based on these features, followed by connected component analysis to generate a rain and snow mask image, it solves the problem that brightness information alone cannot distinguish rain and snow particles from other bright structures such as water level gauge lines and ship rust spots. This improves the specificity and accuracy of rain and snow particle recognition and reduces the probability of misclassifying non-rain and snow bright areas as rain and snow. Finally, by using morphological opening operations to dilate the rain and snow mask image to expand the rain and snow coverage area, and by traversing the masked pixels in the synthesized image and using uncovered neighboring pixels for multi-directional interpolation filling, it solves the problems of incomplete masks caused by the transparency of rain and snow particle edges and single-directional interpolation. This approach addresses the issue of easily introducing texture distortion or artifacts, improving the integrity of rain and snow erasure and image restoration quality, and reducing the visual abruptness of the restored area. By acquiring pre-calculated water splash distribution data and combining it with intermediate images, pixel regions that simultaneously meet the requirements of high brightness, low saturation, and radial distribution of edge gradient directions are extracted from the water splash distribution area and marked as water splash candidate regions. This solves the problem that relying solely on brightness or color cannot effectively distinguish water splashes from similar visual features such as spray and reflections, improving the targeting and accuracy of water splash region detection and reducing the risk of false rejection of non-water splash regions. By performing connected component analysis on water splash candidate regions and removing isolated noise regions, a region growing algorithm is used to determine the complete boundary of the water splash region based on color similarity and spatial adjacency. Finally, water splashes are removed based on the complete boundary, solving the problem that the initial water splash candidate regions may have breaks, incomplete edges, or contain isolated noise points. This improves the boundary integrity and spatial continuity of water splash removal and reduces the draft recognition error caused by water splash residue or accidental deletion of water gauge lines.

[0064] S7. Based on the denoised image, determine the ship's draft, and based on the ship's draft and the ship's hydrostatic curve, calculate the ship's current displacement by interpolation, and subtract the ship's empty weight to obtain the ship's current load capacity.

[0065] The hydrostatic curve is a pre-stored set of ship hydrostatic characteristic curves, and the hydrostatic curve includes at least the curve showing the relationship between draft and displacement.

[0066] In one possible implementation, each denoised image is processed as follows: First, an image recognition algorithm, such as deep learning-based semantic segmentation or traditional edge detection combined with projection, is used to locate the waterline marker area. Then, the characters on the waterline markings are identified, and the height of each character is determined. Next, the pixel coordinates of the waterline in the waterline image are found by detecting the position of the boundary line between the water surface and the hull. Based on the known actual heights corresponding to the marking characters, the pixel distance is converted into physical distance to obtain the draft reading at the preset sampling point. For six points on the port and starboard sides—bow, midships, and stern—six draft values ​​are obtained, and the average draft of the vessel is calculated.

[0067] The system pre-stores hydrostatic curve data for the target vessel. This hydrostatic curve is a set of curves describing the vessel's hydrostatic characteristics, including at least the curve showing the relationship between draft and displacement (i.e., the displacement curve), and may also include auxiliary curves such as tons per centimeter of draft (TPC) and longitudinal position of the center of buoyancy. This data is typically stored in a database in tabular or polynomial fitting format.

[0068] Example 2 like Figure 2 As shown, the present invention also provides a computer-aided image-based load capacity measurement system, which is used to implement the computer-aided image-based ship load capacity measurement method described in any of Embodiment 1. The system includes: The video acquisition module is used to control the drone to cruise along the outside of the ship and acquire video images; The motion sensing module, connected to the video acquisition module, is used to determine the ship's roll period, pitch period, and water splash distribution at each preset acquisition point based on the correspondence between the cruise flight time and video images. The stability prediction module, connected to the motion sensing module, is used to predict the ship's stable moment based on the ship's roll period and pitch period, control the UAV to hover directly above the preset collection point, and detect the ship's attitude angle change rate at the stable moment. If the attitude angle change rate is less than a first threshold, the ship is determined to be in a stable state. The descent acquisition module, connected to the stability prediction module, is used to control the UAV to hover and wait at a preset altitude. When the ship is in a stable state, the UAV is controlled to descend at the speed of falling rain and snow, and continuously acquire ship draft images at preset acquisition points during the descent. The image synthesis module, connected to the descent acquisition module, is used to project the ship's draft image at each preset acquisition point onto the ship's fixed coordinate system based on the acquisition time and the attitude data of the UAV, and perform temporal median filtering at the pixel level to generate a synthesized image for each preset point. An image denoising module, connected to the image synthesis module, is used to remove rain and snow and water splashes from the synthesized image to generate a denoised image. The load calculation module, connected to the image denoising module, is used to determine the ship's draft based on the denoised image, and to calculate the ship's current displacement by interpolation based on the ship's draft and the ship's hydrostatic curve, and then subtract the ship's empty weight to obtain the ship's current load capacity.

[0069] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for measuring ship load capacity based on computer-aided image processing, characterized in that, include: S1 controls the drone to cruise along the outside of the ship and collect video images; S2, based on the correspondence between the cruise flight time and video images, determines the ship's roll period, pitch period, and the distribution of water splash at each preset acquisition point; S3. Based on the ship's roll period and pitch period, predict the ship's stable moment, control the UAV to hover directly above the preset collection point, and detect the ship's attitude angle change rate at the stable moment. If the attitude angle change rate is less than the first threshold, determine that the ship is in a stable state. S4, control the drone to hover at a preset altitude and wait. When the ship is in a stable state, control the drone to descend at the speed of falling rain and snow, and continuously collect images of the ship's draft at preset collection points during the descent. S5, the ship's draft image at each preset acquisition point is projected onto the ship's fixed coordinate system according to the acquisition time and the attitude data of the UAV, and temporal median filtering is performed at the pixel level to generate a composite image of each preset point; S6, perform rain and snow erasure and water splash removal on the synthesized image to generate a denoised image; S7. Based on the denoised image, determine the ship's draft, and based on the ship's draft and the ship's hydrostatic curve, calculate the ship's current displacement by interpolation, and subtract the ship's empty weight to obtain the ship's current load capacity. The determination of the ship's roll period, pitch period, and water splash distribution at each preset acquisition point based on the correspondence between cruise flight time and video images includes: S21, extract fixed structural feature points of the ship from the video image, and use optical flow to track the fixed structural feature points between consecutive frames to generate a two-dimensional motion trajectory of each feature point in the time series. S22, for the two-dimensional motion trajectory of each feature point, perform time-domain decomposition along the horizontal and vertical directions respectively, use fast Fourier transform to extract the main frequency component, determine the period corresponding to the main frequency component in the horizontal direction as the roll period of the ship, and determine the period corresponding to the main frequency component in the vertical direction as the pitch period of the ship. S23, The visual background extraction algorithm is used to identify transient motion areas located near the boundary between the hull and the water surface, which are irregularly shaped and last for less than a preset number of frames, and these areas are marked as water splash areas. S24. Divide the ship along its length into the bow area, midship area and stern area, count the frequency and coverage of water splashing areas in each area, and generate water splashing distribution data for each preset collection point.

2. The method for measuring ship load capacity based on computer-aided images according to claim 1, characterized in that, The preset data collection points include bow, midship, and stern points arranged sequentially along the length of the ship, as well as symmetrical points set on the port and starboard sides of the ship respectively; wherein, the port bow, port midship, and port stern points, together with the starboard bow, starboard midship, and starboard stern points, constitute six preset data collection points, and the spatial position of each preset data collection point corresponds to the reading position of the ship's waterline marker.

3. The method for measuring ship load capacity based on computer-aided images according to claim 1, characterized in that, The method of predicting the ship's stable moment based on the ship's roll and pitch periods, controlling the UAV to hover directly above the preset data collection point, and detecting the ship's attitude angle change rate at the stable moment, determining that the ship is in a stable state if the attitude angle change rate is less than a first threshold, includes: S31, based on the ship's roll period and pitch period, construct the roll motion phase function and pitch motion phase function respectively; S32, based on the roll motion phase function and the pitch motion phase function, calculate the curves of roll angular velocity versus time and pitch angular velocity versus time respectively; the moment when both roll angular velocity and pitch angular velocity approach zero is taken as the candidate stable moment; S33, taking the candidate stable moment as the center, extend forward and backward by a preset time to form a collection time window; S34. While the UAV hovers directly above the preset collection point, the attitude angle change rate of the ship is monitored in real time. When the collection time window is entered and the attitude angle change rate is less than the first threshold, it is determined that the stable moment has arrived. If no attitude angle change rate that meets the conditions is detected within the collection time window, the roll motion phase function and pitch motion phase function are updated according to the latest attitude angle change rate data, and steps S31 to S34 are executed again.

4. The method for measuring ship load capacity based on computer-aided images according to claim 1, characterized in that, The controlled drone hovers at a preset altitude and waits. When the ship is in a stable state, the controlled drone descends at the speed of falling rain or snow, and continuously collects images of the ship's draft at preset collection points during the descent, including: S41, while the drone hovers at a preset height at a preset acquisition point, it acquires a video stream containing rain and snow particles; S42, perform image analysis on the continuous frames in the video stream, identify the motion trajectory of rain and snow particles in the image, and calculate the projection velocity of rain and snow particles in the horizontal and vertical directions respectively. S43, based on the projected velocity of rain and snow particles in the horizontal and vertical directions and the current altitude of the drone, the actual falling velocity and actual falling direction of the rain and snow particles are obtained through geometric conversion; S44, When the ship is in a stable state, control the UAV to descend from the preset height according to the actual falling speed and actual falling direction, and continuously collect images at the same time. The collection process covers the entire process from the preset height to the lowest collection height, and obtains a continuous frame image sequence of the ship's draft at the preset collection point. S45: After completing the image acquisition of the current preset acquisition point, control the drone to rise to the preset altitude and fly to the next preset acquisition point. Repeat steps S41 to S43 until the image acquisition of all preset acquisition points is completed.

5. The method for measuring ship load capacity based on computer-aided images according to claim 4, characterized in that, When the ship is in a stable state, controlling the drone to descend from a preset height according to the actual descent speed and actual descent direction includes: S441, During the drone's hovering period, the video stream is continuously acquired, and rain and snow particles are detected in each frame of the image to generate a rain and snow particle distribution map; S442, based on the aforementioned rain and snow particle distribution map, determine the following conditions in real time: Condition A: If the number of rain and snow particles detected is lower than the second threshold, it is determined that there is an intermittent rain and snow in the lens; Condition B: If rain and snow particles are detected and distributed within a preset edge area, it is determined that there is no interference in the center. S443, when at least one of conditions A and B is met, record the current time as the optimal descent trigger time; if the optimal descent trigger time is within the acquisition time window, then trigger the drone descent action; If the optimal descent trigger time is outside the data collection window, the drone will remain hovering and return to S441 to continue rain and snow particle detection.

6. The method for measuring ship load capacity based on computer-aided images according to claim 1, characterized in that, The step of removing rain and snow and water splashes from the synthesized image to generate a denoised image includes: S61, acquire the composite image of each preset point, perform grayscale processing on the composite image, and use an adaptive threshold segmentation algorithm to extract the high-brightness area in the image; S62, extract the shape features of each high-brightness area, mark the candidate regions of rain and snow particles based on the shape features, and perform connected component analysis on the candidate regions of rain and snow particles to generate a rain and snow mask image. S63, morphological opening operation is used to dilate the rain and snow mask image to expand the coverage of rain and snow particles; the pixels marked by the rain and snow mask in the synthesized image are traversed, and multi-directional interpolation is performed using the neighboring pixels not covered by the rain and snow mask to fill the image, and the filled image is used as the intermediate image after the rain and snow are wiped. S64, obtain the water splash distribution, and in conjunction with the intermediate image, extract pixel regions with high brightness, low saturation and radial distribution of edge gradient direction within the water splash distribution area, and mark them as water splash candidate regions. S65, perform connected component analysis on the candidate water splash regions to eliminate isolated noise regions; for the remaining candidate water splash regions, use a region growing algorithm to determine the complete boundary of the water splash regions; and remove water splashes based on the complete boundary to generate a denoised image.

7. The method for measuring ship load capacity based on computer-aided images according to claim 1, characterized in that, The hydrostatic curve is a pre-stored set of ship hydrostatic characteristic curves, and the hydrostatic curve includes at least the curve showing the relationship between draft and displacement.

8. A ship load capacity measurement system based on computer-aided image processing, characterized in that, The system is used to implement the ship load capacity measurement method based on computer-aided images according to any one of claims 1 to 7, and the system comprises: The video acquisition module is used to control the drone to cruise along the outside of the ship and acquire video images; The motion sensing module, connected to the video acquisition module, is used to determine the ship's roll period, pitch period, and water splash distribution at each preset acquisition point based on the correspondence between the cruise flight time and video images. The stability prediction module, connected to the motion sensing module, is used to predict the ship's stable moment based on the ship's roll period and pitch period, control the UAV to hover directly above the preset collection point, and detect the ship's attitude angle change rate at the stable moment. If the attitude angle change rate is less than a first threshold, the ship is determined to be in a stable state. The descent acquisition module, connected to the stability prediction module, is used to control the UAV to hover and wait at a preset altitude. When the ship is in a stable state, the UAV is controlled to descend at the speed of falling rain and snow, and continuously acquire ship draft images at preset acquisition points during the descent. The image synthesis module, connected to the descent acquisition module, is used to project the ship's draft image at each preset acquisition point onto the ship's fixed coordinate system based on the acquisition time and the attitude data of the UAV, and perform temporal median filtering at the pixel level to generate a synthesized image for each preset point. An image denoising module, connected to the image synthesis module, is used to remove rain and snow and water splashes from the synthesized image to generate a denoised image. The load calculation module, connected to the image denoising module, is used to determine the ship's draft based on the denoised image, and to calculate the ship's current displacement by interpolation based on the ship's draft and the ship's hydrostatic curve, and then subtract the ship's empty weight to obtain the ship's current load capacity.

Citation Information

Patent Citations

  • Ship empty and heavy load identification method based on machine vision

    CN111361700A

  • Freeboard segmentation ship load line identification method based on dimension reduction regression

    CN115456970A