A dynamic water surface adaptive monocular camera visual ranging method and system
An adaptive ranging method that real-time corrects the extrinsic parameters of a monocular camera and the dynamic water level plane parameters solves the ranging problem in outdoor dynamic water surface scenarios, achieving high-precision, low-latency water surface target measurement, adapting to complex environments and reducing system maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGHAI UNIVERSITY
- Filing Date
- 2026-04-27
- Publication Date
- 2026-07-31
AI Technical Summary
Existing visual ranging technologies struggle to adapt to real-time changes in water height, dynamic camera pose drift, and spatiotemporal mismatches in multi-source sensor data in outdoor dynamic water surface scenarios, resulting in distorted ranging results and insufficient system robustness.
By real-time correction of the monocular camera's extrinsic parameters, combined with dynamic three-dimensional water level plane parameters and multi-source data synchronization, an adaptive ranging system is constructed, including a camera parameter correction module, a water level data acquisition module, and a distance calculation module. This system enables the calculation of the physical distance between the real spatial locations of any two points in an image and includes a confidence assessment mechanism.
It improves the system's robustness and real-time performance in dynamic outdoor environments, reduces manual maintenance costs, ensures the accuracy and reliability of ranging results, adapts to complex lighting and wave interference, and is compatible with various monitoring cameras and markers.
Smart Images

Figure CN122486552A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of water target ranging, and in particular to a dynamic water surface adaptive monocular camera visual ranging method, system, device, computer-readable medium, and program product. Background Technology
[0002] In numerous application scenarios, such as modern water conservancy project inspection, safety supervision of rivers and reservoirs, and autonomous navigation of unmanned surface vessels (USVs), non-contact, visualized distance measurement of water surface targets is an extremely urgent engineering requirement. Accurately obtaining the actual physical distance between any two points on a lake or river is a core element in replacing traditional, inefficient manual measurement methods and significantly improving the efficiency of hydrological monitoring and the level of engineering safety supervision.
[0003] Traditional methods for water surface ranging and target localization often rely heavily on sonar systems, LiDAR sensors, or Global Navigation Satellite Systems (GNSS). However, these traditional sensing methods exhibit significant physical and economic limitations in practical lake surface applications. GNSS requires cooperative installation on the object being measured and cannot range or locate randomly appearing non-cooperative targets on the lake surface. While LiDAR equipment can provide high-precision 3D point clouds, its cost is extremely high, and due to the inherent physical and optical properties of the water surface, laser beams are prone to strong specular reflection when illuminating the lake surface, causing photons that should return to the sensor to be lost, resulting in large "blind spots" or false point clusters in the point cloud data. Sonar systems are primarily used for underwater detection and are difficult to use for measuring the relative distance to surface targets.
[0004] With the rapid development of artificial intelligence and intelligent sensing technologies, computer vision technology, with its advantages of low equipment cost, flexible deployment, and ability to capture extremely rich environmental semantic features, has gradually become the mainstream development direction of water surface sensing technology. Utilizing vision systems, especially the most common and economical monocular camera, and combining the camera's intrinsic and extrinsic parameter models with the principles of geometric projection, it is theoretically possible to deduce three-dimensional spatial information from two-dimensional images, thereby achieving pixel-level ranging capabilities. Due to its practicality and scalability, vision-based water surface ranging technology has immeasurable engineering reference and promotion value in the intelligent upgrading of smart water conservancy.
[0005] Currently, vision-based 3D spatial ranging technology is mainly divided into two major technical routes: binocular stereo vision ranging and monocular vision ranging.
[0006] Binocular stereo vision technology mimics the binocular parallax principle of the human visual system, using two rigorously spatially calibrated cameras to simultaneously capture images of the same water surface area. The system first performs epipolar correction on the two images, then uses a feature matching algorithm to find corresponding pixels in the left and right views. Finally, through triangulation, it directly calculates the depth information of each pixel in the scene. This type of technology can reconstruct three-dimensional dense or sparse point clouds of a scene without requiring prior external knowledge.
[0007] Monocular vision ranging technology relies solely on a single camera. Because monocular cameras undergo a dimensionality reduction projection from 3D space to a 2D plane during imaging, depth information is inherently lost. To recover the target's 3D coordinates, existing monocular ranging algorithms generally employ the "Flat Earth Assumption" to introduce additional geometric constraints. Specifically, the algorithm presupposes that all targets to be measured lie on a fixed 3D reference plane. The system obtains the camera's intrinsic parameters and distortion matrix using a calibration plate of known size, and acquires the camera's external attitude parameters relative to this fixed plane through an offline calibration process. During ranging, the algorithm maps the 2D pixel coordinates on the image plane to a ray in the camera coordinate system and calculates the intersection of this ray with the pre-set fixed horizontal plane, thereby obtaining the target's absolute physical coordinates in the world coordinate system and calculating the Euclidean distance.
[0008] Although existing visual ranging technologies have matured in controlled indoor environments or static flat road surfaces, they face extremely severe challenges and insurmountable defects when engineering their application to complex outdoor dynamic water surface scenarios.
[0009] First, binocular stereo vision systems exhibit extremely poor robustness in aquatic environments and face excessively high maintenance barriers. The core of binocular ranging accuracy lies in the absolute stability of the baseline distance and relative pose between the two cameras. However, in outdoor water monitoring environments, the equipment is frequently affected by non-rigid dynamic environmental factors such as wind loads, thermal expansion and contraction of the base, and mechanical vibrations caused by water waves. This makes the external parameters of the binocular cameras highly susceptible to minute physical drifts, causing even precisely calibrated parameters to quickly become invalid. Furthermore, lakes and rivers possess strong dynamic reflections, shadow interference, and constantly changing water ripple textures. This highly dynamic texture environment, lacking stable feature points, makes traditional stereo matching algorithms prone to getting trapped in local optima or complete failure, generating numerous incorrect matches and resulting in severely distorted depth maps. In practical engineering applications, long-term stable operation cannot be guaranteed.
[0010] Secondly, existing monocular vision ranging methods are typically built upon the prior assumption of a static and flat environment, completely ignoring the highly dynamic characteristics of the hydrological environment. In real natural environments such as reservoirs and rivers, water levels are not constant but undergo drastic changes in absolute elevation due to seasonal changes, rainfall, tidal movements, and the opening and closing of sluice gates. If the monocular system adheres to the water level height at the initial calibration, once the actual water surface rises due to a surge in water level, the intersection of the camera's actual projected ray with the actual water surface will be much closer than the intersection with the static theoretical plane. This "water level model mismatch" leads to severe scale system errors, causing the calculated distance to be much larger or much smaller than the actual physical distance, ultimately resulting in completely distorted ranging results due to water level fluctuations.
[0011] Furthermore, existing monocular systems struggle to adapt to high-frequency dynamic changes in camera pose. Under complex weather conditions, outdoor surveillance cameras (both bullet and PTZ) are highly susceptible to pose shifts. Current technologies typically employ one-time static calibration; when the camera is subjected to external forces causing even a small change of a few degrees in pitch or yaw angle, the projection model accumulates significant nonlinear errors, causing the measured target to rapidly deviate from the true coordinate system. Existing systems severely lack adaptive compensation mechanisms that automatically detect, recalculate in real-time, and dynamically update extrinsic parameters when camera pose changes occur.
[0012] Furthermore, existing methods often lack in-depth defensive design and confidence assessment mechanisms regarding the geometric boundaries and numerical stability of algorithmic processing. When conducting wide-angle monitoring of an open lake, the target ray at the far end of the frame is almost parallel to the water surface. In this case, the denominator of traditional algebraic equations approaches zero when solving for the intersection of the ray and the plane. Algorithms lacking protection mechanisms can lead to numerical explosions or the calculation of physical pseudo-intersections located behind the camera, causing system-wide crashes or extremely absurd outputs. Simultaneously, existing systems only provide cold, final distance values without considering the camera's pose quality and the grazing angle of the geometric projection to provide a reliability assessment of the data. This makes it difficult for downstream safety warning modules to determine the high reliability of the measurement data, increasing the engineering risk of false alarms.
[0013] Finally, regarding the fusion of multi-source data, the independent radar level gauges and visual cameras deployed at water conservancy project sites often suffer from problems such as system clock asynchrony, data acquisition frequency misalignment, and data transmission delays. Existing visual solutions, when attempting to incorporate water level data, often employ a simplistic nearest neighbor assignment approach, failing to properly handle time offset errors and boundary flow interruption anomalies. This results in a spatiotemporal misalignment between the selected reference water level and the actual water level at the time of image capture, severely limiting the accuracy of the compensation mechanism.
[0014] In summary, existing visual ranging methods often rely on static planar assumptions or fixed extrinsic parameter calibration, making it difficult to adapt to real-time changes in water surface height, dynamic camera pose drift, and temporal mismatches in multi-source hydrological data. Furthermore, traditional algorithms are prone to numerical singularities under complex lighting and wave interference, leading to system crashes or loss of output confidence, thus failing to meet the engineering requirements for rapid, non-contact ranging in dynamic water surface scenarios. Summary of the Invention
[0015] This application provides a dynamic water surface adaptive monocular camera visual ranging method, system, device, computer-readable storage medium, and program product, which solves the problems of poor adaptability of static models, easy failure of camera extrinsic parameters, spatiotemporal mismatch of multi-source sensor data, and insufficient robustness of algorithms under extreme projection angles in existing technologies in hydrological ranging scenarios, and significantly improves the robustness and real-time performance of the system in outdoor dynamic environments.
[0016] One aspect of this application provides a dynamic water surface adaptive monocular camera visual ranging method, comprising:
[0017] The parameters of the monocular camera are processed, images of the water surface to be measured are acquired, and the extrinsic parameters of the camera are corrected in real time.
[0018] Acquire real-time water level data synchronized with the acquisition time of each frame of image;
[0019] The real-time water level data is converted into dynamic three-dimensional water level plane parameters;
[0020] Based on the camera parameters and dynamic 3D water level plane parameters corresponding to each frame of the image, calculate the physical distance between the real spatial locations corresponding to any two points in the image.
[0021] According to a preferred embodiment of the present invention, the step of performing parameter processing on the monocular camera, acquiring an image of the water surface to be measured, and performing real-time correction on the camera's extrinsic parameters further includes:
[0022] The intrinsic parameters of the monocular camera are analyzed and encapsulated into an independent and decoupled internal data model.
[0023] Multiple three-dimensional reference point markers are set in the water surface scene to be tested, and feature extraction and tracking algorithms are continuously run to determine whether the extrinsic parameters of the monocular camera have shifted.
[0024] When the extrinsic parameters shift, the extrinsic parameters of the monocular camera are recalculated using the three-dimensional reference point identifier extracted from the current image and its corresponding three-dimensional world physical coordinates.
[0025] According to a preferred embodiment of the present invention, acquiring real-time water level data synchronized with the acquisition time of each frame of image further includes:
[0026] Get the acquisition time of the current image frame;
[0027] A time-synchronous retrieval algorithm is constructed to calculate the corrected acquisition time based on the acquisition time of the current image frame and the calculated time offset parameter.
[0028] The corresponding water level data is determined based on the corrected collection time.
[0029] According to a preferred embodiment of the present invention, the step of converting the real-time water level data into dynamic three-dimensional water level plane parameters further includes:
[0030] Set the initial horizontal reference plane;
[0031] Based on the acquired real-time water level data, the initial horizontal reference plane is translated vertically to transform it into a real-time floating three-dimensional plane, generating dynamic three-dimensional water level plane parameters.
[0032] According to a preferred embodiment of the present invention, the step of calculating the physical distance between the real spatial locations corresponding to any two points in the image based on the camera parameters and dynamic three-dimensional water level plane parameters corresponding to each frame of the image further includes:
[0033] Based on the camera parameters corresponding to each frame of the image, the coordinates of any two points in the image are converted into three-dimensional spatial coordinates in the real spatial coordinate system through the inverse transformation of perspective projection.
[0034] The physical distance between them is calculated using the Euclidean distance formula.
[0035] According to a preferred embodiment of the present invention, the method further includes:
[0036] A confidence assessment model is constructed, including a geometric projection confidence assessment module and a camera pose prior confidence assessment module, to evaluate the accuracy of the calculated physical distance.
[0037] Another aspect of this application provides a dynamic water surface adaptive monocular camera visual ranging system, the system comprising:
[0038] The camera parameter correction module is used to process the parameters of the monocular camera, acquire images of the water surface to be measured, and correct the camera's extrinsic parameters in real time.
[0039] The water level data acquisition module is used to acquire real-time water level data synchronized with the acquisition time of each frame of image;
[0040] The water level data conversion module is used to convert the real-time water level data into dynamic three-dimensional water level plane parameters;
[0041] The distance calculation module is used to calculate the physical distance between any two points in the image based on the camera parameters and dynamic three-dimensional water level plane parameters corresponding to each frame of the image.
[0042] Another aspect of this application provides a dynamic water surface adaptive monocular camera visual ranging device, the device comprising:
[0043] At least one processor; and
[0044] A memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described above.
[0046] In another aspect, this application provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor to implement the method described above.
[0047] In another aspect of this application, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described above.
[0048] In the solution provided in this application embodiment, the system firstly eliminates its dependence on "static dead water level" by seamlessly integrating a three-dimensional reference surface dynamic floating mechanism with multi-source hydrological data streams. Even in extreme environments with drastic water level fluctuations, the system can still update the elevation in real time and implement accurate projection, which greatly improves environmental adaptability and solves the risk of scale distortion.
[0049] Secondly, the built-in adaptive extrinsic parameter update module gives the system excellent resistance to wave interference and pose self-healing robustness, and can automatically recalibrate when the camera attitude deviates severely, which greatly reduces the manual maintenance cost of field deployment.
[0050] Furthermore, the system employs a timestamp offset compensation algorithm to eliminate heterogeneous data misalignment contamination and utilizes pure geometric inference to replace computationally expensive stereo matching, achieving an extremely lightweight ranging pipeline. This not only enables the algorithm to run at full capacity in edge monitoring boxes with limited computing power but also endows the system with astonishing real-time response capabilities. Moreover, the system possesses broad calibration versatility and hardware decoupling attributes, seamlessly adapting to various monitoring cameras and markers.
[0051] Overall, this invention, through anti-crash logic and a joint ranging confidence quantification system, comprehensively overcomes the limitations of existing technologies in hydrological engineering transformation, providing high-precision, high-safety, and low-latency surveying-grade technical support for water traffic control and unmanned vehicle navigation, and has broad application prospects. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0054] Figure 1 A flowchart illustrating a dynamic water surface adaptive monocular camera visual ranging method provided in an embodiment of this application;
[0055] Figure 2 A schematic diagram of ranging error curves for different methods under a combined disturbance scenario provided in an embodiment of this application;
[0056] Figure 3 A schematic diagram illustrating the success rate of extrinsic parameter correction under different reference point visibility conditions, provided for an embodiment of this application;
[0057] Figure 4 A radar chart showing key performance results provided in an embodiment of this application;
[0058] Figure 5 A schematic diagram of a dynamic water surface adaptive monocular camera visual ranging system provided in an embodiment of this application;
[0059] Figure 6 This is a schematic diagram of the structure of a device suitable for implementing the solutions in the embodiments of this application.
[0060] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0063] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0064] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer program instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0065] In practical scenarios, the execution entity of this method can be a user device, or a device formed by integrating a user device and a network device through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0066] This invention first constructs a generalized framework supporting dynamic water level compensation and adaptive correction of extrinsic parameters. Secondly, it achieves accurate distance calculation between any two points through multi-source temporal synchronization and a coplanar constrained ray intersection algorithm. Furthermore, it introduces a joint confidence assessment mechanism to ensure measurement reliability. By introducing benchmark-driven adaptive extrinsic parameter updates, real-time water level plane reconstruction, and a low-level error-proofing strategy, this invention overcomes the limitations of existing technologies and provides a more flexible, efficient, and engineering-applicable non-contact lake surface ranging solution.
[0067] Figure 1 This is a flowchart illustrating a dynamic water surface adaptive monocular camera visual ranging method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes at least the following processing steps:
[0068] Step S101: Perform parameter processing on the monocular camera, acquire images of the water surface to be measured, and correct the extrinsic parameters of the camera in real time.
[0069] Specifically, the parameters of the monocular camera are first adjusted before ranging. The cornerstone of monocular vision ranging lies in establishing an accurate perspective projection mathematical model. The primary core aspect of this invention is analyzing the inherent internal optical characteristics of the camera and its external attitude in world space. To achieve a highly universal system architecture, this invention designs a low-level access mechanism compatible with parameters from multiple manufacturers' devices.
[0070] Regarding camera intrinsic parameters, the system of this invention can directly parse the focal length parameters extracted from multi-view calibration. ), optical principal point ( And the distortion coefficient vector, which reflects the nonlinear optical distortion of the lens, including radial distortion. With tangential distortion These parameters are then encapsulated into independent and decoupled internal data models.
[0071] For camera extrinsic parameters, this invention constructs an adaptive correction mechanism. This involves pre-setting various types of 3D reference point markers on fixed structures within the monitoring field of view of the water surface scene under test. For example, a monocular camera (1920×1080 resolution, 30fps) is mounted on a UAV-borne platform to ensure the camera's field of view covers the target area on the water surface. An IMU module (100Hz sampling frequency) is simultaneously installed and time-synchronized with the monocular camera. Lightweight feature extraction and tracking algorithms run continuously in the background. For instance, the adaptive median filter window range of the image preprocessing module is set to 3×3 to 9×9, and the scale parameters of the multi-scale Retinex algorithm are [15, 80, 250]. The ORB feature extraction algorithm is initialized with 500 feature points. Using the state transition matrix and observation matrix of the Kalman filter, the feature matching accuracy can be improved to 92%. By predicting the next frame position of the target feature points through Kalman filtering, even if the target vessel moves at a speed of 5m / s, the feature tracking loss rate is less than 5%.
[0072] When the system detects a shift in the camera's physical pose through inter-frame difference calculation or feature point matching quality assessment, it automatically triggers a closed-loop recalculation process. Utilizing the Perspective N-Point (PnP) algorithm, the system uses the sub-pixel-level reference point center coordinates extracted from the current image and its known world physical coordinates to inversely recalculate the latest camera pose, thus achieving highly reliable feedback with immediate automatic calibration upon deviation. Furthermore, the camera supports adaptive exposure and white balance adjustment to adapt to the water surface imaging requirements under different lighting conditions.
[0073] Step S102: Obtain real-time water level data synchronized with the acquisition time of each frame image.
[0074] Specifically, in order to break the technical constraints of traditional ranging algorithms that rely on static planes, this invention deeply integrates an environmental water level monitoring subsystem into the perception architecture. This subsystem is responsible for scheduling, parsing, and aligning the liquid level data transmitted by various external hydrological sensors, ensuring that the elevation reference surface of the visual model remains dynamic and real-time.
[0075] Regarding data structuring and time zone standardization, the system unifies the format for carrying hydrological information, covering three dimensions: water level scalars, collection timestamps, and source tracing labels. Considering that distributed water conservancy networks often transmit data without time zone identifiers due to configuration oversights, this invention incorporates mandatory time zone awareness logic during the data initialization phase. When faced with data without a specified time zone, the system immediately initiates a standardization process, forcibly assigning it Coordinated Universal Time (UTC) attributes, ensuring absolute consistency of the global clock between the main visual processing thread and the asynchronous sensing thread.
[0076] To address heterogeneous sensor data protocols, this invention designs an abstract data access layer and derives three parallel instantiation approaches. The first is a static water level source, serving as a backup solution for areas without automated equipment, responding to height queries with a fixed configuration. The second is a memory streaming source, specifically designed for interfacing with high-speed IoT message queues, maintaining a dynamic linked list in memory based on timestamp sorting to support high-throughput real-time reading. The third is a full-format file offline source, with a built-in powerful semantic analysis engine that can automatically map and parse multi-dimensional time-series data in historical log files, seamlessly pushing it into a memory management queue.
[0077] Due to the unavoidable transmission time difference and device clock drift between image capture and radar level gauge acquisition, this invention constructs a rigorous time-series synchronization retrieval algorithm with clock offset correction. Once the camera parameters are adjusted, continuous image data of the dynamic water surface scene is acquired, and the acquisition time (absolute reference time) of each frame is recorded. And combined with the rational-order time offset parameters obtained from on-site network delay calibration Calculate the corrected target query time. .
[0078] Subsequently, the sorted historical queue is scanned to extract all instances where the generation time is less than or equal to... The candidate dataset is selected, and the latest message in the subset is locked as the optimal physical water level data for the current moment.
[0079] Step S103: Convert the real-time water level data into dynamic three-dimensional water level plane parameters.
[0080] Specifically, after obtaining physical water level data that is absolutely aligned with a specific frame image in time and space, this invention transforms a one-dimensional height scalar into a three-dimensional geometric constraint model with mathematical significance in the world coordinate system.
[0081] First, a standard horizontal reference plane is predefined, and the direction of Earth's gravity is set to the opposite direction. The axis, at this time the normal vector of the reference plane is The base offset is .
[0082] To achieve dynamic elevation of the plane, this invention utilizes the real-time water level height variable obtained in step S102. Without altering the orientation of the original plane's normal vector, a vertical translation of the spatial plane is performed along the normal direction. Since the standard form of the plane equation in computer 3D graphics is defined as... To prevent scaling distortion caused by unnormalized normal vectors, the algorithm first performs a rigorous L2 norm normalization check on the input normals, ensuring... Subsequently, the algorithm directly resets the bias term coefficients through mathematical derivation, generating entirely new water level plane parameters. This process precisely transforms the rise and fall of rivers in the physical world into the real-time floating of a dynamic three-dimensional water level plane within a computer virtual space.
[0083] Step S104: Calculate the physical distance between any two points in the image based on the camera parameters and dynamic three-dimensional water level plane parameters corresponding to each frame of the image.
[0084] Specifically, after obtaining the camera pose and dynamic 3D water level plane of the current frame, two points arbitrarily selected by the user on the 2D screen are projected onto the dynamic water surface through inverse geometric mapping, thereby restoring its true spatial physical scale.
[0085] Back-projecting selected points in the image into three-dimensional spatial rays: Before performing distance calculations, establishing a multi-dimensional mathematical expression: using two-dimensional floating-point vectors. The target pixel coordinates, the system intrinsic parameter matrix, and the distortion coefficient vector are denoted as follows: and The world-to-camera transformation provided by the extrinsic parameter update module is defined as a rotation matrix. With translation vector The local rays, world rays, and camera optical center derived subsequently were defined as follows: , and The water surface model is determined by the normal. With dynamic scaling intercept The ray step size scaling factor is denoted as .
[0086] The solution process first performs lens nonlinear distortion filtering and ray initialization. Addressing the barrel or pincushion distortion that is easily generated by wide-angle lenses, the algorithm applies a nonlinear distortion equation based on the intrinsic parameter matrix. With distortion coefficient The original input two-dimensional coordinate points The reverse correction is performed to normalized physical plane coordinates under the ideal projection model. Subsequently, the corrected points are expanded to homogeneous coordinates and a rigorous vector normalization operation is performed, mathematically generating a local unit direction vector originating from the camera's optical center, passing through the target pixel, and pointing forward into the three-dimensional space. .
[0087] Next, a spatial basis transformation is performed, jumping the camera system to the world system. This is due to the rotation matrix. The matrix is orthogonal, and its inverse is mathematically equivalent to its transpose. The algorithm uses matrix multiplication to multiply the local camera ray by the transpose of the rotation matrix, achieving absolute coordinate mapping of the direction. Meanwhile, the camera's true three-dimensional physical position is obtained through inverse derivation of extrinsic parameters, and the algorithm rigorously calculates the origin of the optical center in the world system: .
[0088] Representing the ray as a parametric equation Substitute it into the dynamic water surface equation In the middle, through algebraic transformations, the dot product of the water surface normal vector and the world ray vector is calculated as the denominator. Finally, the scaling factor was determined:
[0089]
[0090] Will Substituting back into the original ray equation, the absolute three-dimensional spatial coordinates of the pixel on the real water surface can be calculated. The system performs this calculation on any two selected points on the lake surface to obtain two three-dimensional physical coordinate points. and .
[0091] To address the extreme viewing angles caused by outdoor water surface reflections and long-distance detection, this invention innovatively incorporates a dual-layered foolproof safety check into the intersection algorithm. The first layer intercepts extreme grazing rays and parallel failures. The algorithm monitors the denominator of the sine of the angle between the ray and the plane in real time. If its absolute value is lower than a preset minimum threshold, indicating the ray is almost parallel to the water surface, the algorithm will instantly intercept the calculation and throw a system-level anomaly, avoiding false alarms caused by numerical overflow. The second layer intercepts physically negative crossings through verification... The symbol, if This means that the intersection point is located behind the sensor's physical location, indicating a serious deviation in the extrinsic parameter matrix. The system will also block the output and issue a warning.
[0092] After the target point smoothly passes the security checkpoint, the algorithm uses the classic L2 norm operation of Euclidean geometry to calculate... and The three-dimensional vector difference magnitude is used to output extremely high-precision physical distance values. :
[0093]
[0094] Monocular ranging accuracy is highly sensitive to the projection angle. To enable the security early warning backend to assess the reliability of the data provided by this method, this invention also constructs a confidence evaluation model, including a geometric projection confidence evaluation module and a camera pose prior confidence evaluation module, used to evaluate the accuracy of the calculated physical distance, wherein:
[0095] Geometric projection confidence assessment module: Since the closer the angle of incidence of light is to perpendicular, the smaller the projection error; the closer it is to parallel grazing, the greater the spatial offset even with minute pixel jitter. This invention extracts the absolute value of the denominator in the spatial analytical solution, which is naturally equivalent to the cosine function of the angle of incidence of light. The system directly maps this nonlinearly into a geometric score reflecting the physical limits of stability in distance measurement.
[0096] Pose prior confidence assessment module: The accuracy of the camera's extrinsic parameters directly determines the stability of the system's foundation. This score comes from the real-time quantitative evaluation of the calibration board matching accuracy by the extrinsic parameter adaptive recalculation module.
[0097] The final comprehensive scoring equation is set as follows:
[0098]
[0099] This combined computing mechanism, which prioritizes geometric perspective features and uses external parameter tracking quality as a secondary factor (40% weight), enables the present invention not only to calculate distances but also to become an intelligent measurement engine with complete self-diagnosis and evaluation capabilities.
[0100] To verify the adaptability of this invention in dynamic water surface scenarios, it was tested in simulation and prototype verification environments. The test distance covered 2.0 m to 50.0 m; 80 Monte Carlo samplings were performed at each distance point; the user-selected point noise was set to a Gaussian distribution σ=1.2 px; the dynamic water level disturbance was set to +1.5 m; the attitude drift was set to approximately 3° rotation and centimeter-level translation; the comparison methods included fixed extrinsic parameters + fixed water level, fixed extrinsic parameters + dynamic water level, adaptive extrinsic parameters + fixed water level, and the complete method of this invention.
[0101] The test conditions are divided into four categories: static standard scenario, water level change only, attitude drift only, and combined water level and attitude disturbance. Each of the four categories corresponds to a different source of error and can be used to distinguish the boundaries at which dynamic water level compensation and external parameter adaptive correction each play their respective roles.
[0102] Table 1. Comparison of average relative errors of different methods in four typical scenarios (unit: %)
[0103] method Static standard scene Water level changes only only attitude drift Joint disturbance Fixed external parameters + fixed water level 0.600 14.336 33.890 61.895 Fixed external parameters + dynamic water level 0.665 0.643 33.842 41.843 Adaptive extrinsic parameters + fixed water level 0.606 14.306 0.622 14.386 Method of the present invention 0.599 0.635 0.612 0.673
[0104] As shown in Table 1, the fixed extrinsic parameter and fixed water level method exhibits the highest error under combined perturbation, indicating that the main error source in dynamic water surface scenarios is not a single factor. Introducing only dynamic water level compensation significantly reduces the error in the "water level change only" scenario, but fails to maintain accuracy in the attitude drift scenario. Introducing only adaptive extrinsic parameters can suppress projection distortion caused by attitude changes, but still results in systematic scale bias in the face of water level changes. Only by simultaneously introducing dynamic water level compensation and adaptive extrinsic parameter correction can the system maintain a low error level under all four typical operating conditions.
[0105] The joint perturbation scenario most closely resembles the real deployment environment; therefore, this invention examines the error variation trend at different target distances. The focus is on whether various methods exhibit significant error amplification as the ranging distance expands from short to long distances.
[0106] Table 2 Comparison of representative distance point errors under joint disturbance scenarios (unit: %)
[0107] Distance / m Fixed external parameters + fixed water level Method of the present invention 2 40.478 2.125 5 39.026 0.785 10 39.252 0.447 20 45.876 0.258 30 63.601 0.309 40 86.566 0.382 50 118.462 0.406
[0108] Table 2 presents the error comparison results for several representative distance points. As can be seen from Table 2, the error of the traditional static method increases continuously with increasing distance, while the method of this invention maintains a low error range within the range of 2m to 50m. This indicates that the present invention is not only effective at a single scale, but also maintains good ranging consistency in close, medium, and long-range scenarios.
[0109] Figure 2 This is a schematic diagram of ranging error curves for different methods under a joint disturbance scenario provided in an embodiment of this application, as shown below. Figure 2 As shown, if the system lacks both water level compensation and external parameter correction, the error accumulates rapidly with increasing target distance, especially above 30m. While compensating for water level or correcting external parameters alone can suppress one type of error source, the curve still exhibits a significant deviation. The error curve corresponding to the method of this invention remains close to the horizontal axis, indicating that it maintains good scale stability even at long distances.
[0110] Besides ranging errors, the ability to correct extrinsic parameters directly determines whether the system can remain usable during long-term deployment. This invention statistically analyzes the success rate of extrinsic parameter correction in two scenarios: when the reference point is clearly visible and when the main reference point is occluded and the correction is handled by a Circle-type marker. Figure 3 A schematic diagram illustrating the success rate of extrinsic parameter correction under different reference point visibility conditions, as provided in an embodiment of this application, is shown below. Figure 3 As shown, this invention can reliably complete extrinsic parameter updates when the main reference point is visible; even if the ArUco marker is obscured, this method can still complete backup corrections using Circle-type markers, maintaining a high success rate. This result demonstrates that the reference point system of this invention has redundancy, reducing the impact of a single marker failure on the overall measurement link.
[0111] Figure 4 A radar chart of key performance results provided for an embodiment of this application, such as... Figure 4 As shown, the present invention has achieved or exceeded the preset targets in terms of correction success rate, accuracy recovery rate, latency margin and device compatibility, indicating that the present invention is not only effective in individual indicators, but also has relatively balanced overall performance.
[0112] The method described in this invention demonstrates excellent performance in both relative ranging error and system response time—two core indicators for evaluating waterborne ranging performance—through comparative testing under standard conditions. Compared to traditional visual ranging methods, this invention strictly controls the relative error to an extremely small range within a large distance range of 2-50 meters above the water surface, and achieves extremely low computation time throughout the entire process, balancing high precision and low latency. This fully meets the real-time decision-making requirements of scenarios such as collision avoidance warning. Furthermore, the system's robustness has been verified: through built-in blocking and elimination logic, this method effectively avoids program deadlock when facing abnormal operations, resulting in safer and more stable operation. For extreme conditions with severe pose deviations, the adaptive system of this invention exhibits extremely strong environmental anti-interference capabilities, with a very high self-healing success rate, instantly restoring to the initial fine calibration state. It significantly outperforms existing fixed calibration systems in terms of accuracy recovery ratio and stability.
[0113] This application also provides a dynamic water surface adaptive monocular camera visual ranging system. Figure 5 This is a schematic diagram of a dynamic water surface adaptive monocular camera visual ranging system provided in an embodiment of this application, as shown below. Figure 5 As shown, the system includes:
[0114] The camera parameter correction module 11 is used to process the parameters of the monocular camera, acquire the image of the water surface to be measured, and correct the external parameters of the camera in real time.
[0115] The water level data acquisition module 22 is used to acquire real-time water level data synchronized with the acquisition time of each frame of image;
[0116] Water level data conversion module 33 is used to convert the real-time water level data into dynamic three-dimensional water level plane parameters;
[0117] The distance calculation module 44 is used to calculate the physical distance between any two points in the image based on the camera parameters and dynamic three-dimensional water level plane parameters corresponding to each frame of the image.
[0118] The above system can execute the dynamic water surface adaptive monocular camera visual ranging method in the foregoing embodiments, wherein,
[0119] The camera parameter correction module 11 executes step S101, which parses the intrinsic parameters of the monocular camera and encapsulates them into an independent and decoupled internal data model; sets multiple three-dimensional reference point markers in the water surface scene to be measured, continuously runs feature extraction and tracking algorithms, and determines whether the extrinsic parameters of the monocular camera have shifted; when the extrinsic parameters have shifted, the extrinsic parameters of the monocular camera are recalculated using the three-dimensional reference point markers extracted from the current image and their corresponding three-dimensional world physical coordinates.
[0120] The water level data acquisition module 22 executes step S102 to acquire the acquisition time of the current image frame; constructs a time-series synchronous retrieval algorithm to calculate the corrected acquisition time based on the acquisition time of the current image frame and the calculated time offset parameter; and determines the corresponding water level data based on the corrected acquisition time.
[0121] The water level data conversion module 33 executes step S103, setting an initial horizontal reference plane; based on the acquired real-time water level data, it performs a vertical translation transformation on the initial horizontal reference plane, converting it into a real-time floating three-dimensional plane, and generating dynamic three-dimensional water level plane parameters.
[0122] The distance calculation module 44 executes step S104, which converts the coordinates of any two points in the image into three-dimensional spatial coordinates in the real space coordinate system by inverse transformation of perspective projection based on the camera parameters corresponding to each frame image; and calculates the physical distance between them using the Euclidean distance formula.
[0123] In addition, this system also includes a confidence assessment module, which is used to evaluate the accuracy of the calculated physical distance, specifically including geometric projection confidence assessment and camera pose prior confidence assessment.
[0124] Based on the same inventive concept, this application also provides an electronic device. The method corresponding to the electronic device can be the dynamic water surface adaptive monocular camera visual ranging method in the foregoing embodiments, and its problem-solving principle is similar to that method. The electronic device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.
[0125] The electronic device can be a user device, or a device formed by integrating user devices and network devices through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0126] Figure 6 This is a schematic diagram of a device suitable for implementing the solutions in the embodiments of this application. The device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage portion 1208 into a random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for system operation. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0127] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 1208 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0128] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, it performs the functions defined in the methods of this application.
[0129] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.
[0130] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0131] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0132] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0133] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0134] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or page components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0138] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0139] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
[0141] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A dynamic water surface adaptive monocular camera visual odometry method, characterized in that, include: The parameters of the monocular camera are processed, images of the water surface to be measured are acquired, and the extrinsic parameters of the camera are corrected in real time. Acquire real-time water level data synchronized with the acquisition time of each frame of image; The real-time water level data is converted into dynamic three-dimensional water level plane parameters; Based on the camera parameters and dynamic 3D water level plane parameters corresponding to each frame of the image, calculate the physical distance between the real spatial locations corresponding to any two points in the image.
2. The dynamic water surface adaptive monocular camera visual odometry method of claim 1, wherein, The step of processing parameters of a monocular camera, acquiring images of the water surface to be measured, and real-time correcting of the camera's extrinsic parameters further includes: The intrinsic parameters of the monocular camera are analyzed and encapsulated into an independent and decoupled internal data model. Multiple three-dimensional reference point markers are set in the water surface scene to be tested, and feature extraction and tracking algorithms are continuously run to determine whether the extrinsic parameters of the monocular camera have shifted. When the extrinsic parameters shift, the extrinsic parameters of the monocular camera are recalculated using the three-dimensional reference point identifier extracted from the current image and its corresponding three-dimensional world physical coordinates.
3. The dynamic water surface adaptive monocular camera visual ranging method according to claim 1, characterized in that, The acquisition of real-time water level data synchronized with the acquisition time of each frame of image further includes: Get the acquisition time of the current image frame; A time-synchronous retrieval algorithm is constructed to calculate the corrected acquisition time based on the acquisition time of the current image frame and the calculated time offset parameter. The corresponding water level data is determined based on the corrected collection time.
4. The dynamic water surface adaptive monocular camera visual ranging method according to claim 1, characterized in that, The step of converting the real-time water level data into dynamic three-dimensional water level plane parameters further includes: Set the initial horizontal reference plane; Based on the acquired real-time water level data, the initial horizontal reference plane is translated vertically to transform it into a real-time floating three-dimensional plane, generating dynamic three-dimensional water level plane parameters.
5. The dynamic water surface adaptive monocular camera visual ranging method according to claim 1, characterized in that, The step of calculating the physical distance between any two points in the image based on the camera parameters and dynamic three-dimensional water level plane parameters corresponding to each frame of the image further includes: Based on the camera parameters corresponding to each frame of the image, the coordinates of any two points in the image are converted into three-dimensional spatial coordinates in the real spatial coordinate system through the inverse transformation of perspective projection. The physical distance between them is calculated using the Euclidean distance formula.
6. The dynamic water surface adaptive monocular camera visual ranging method according to claim 1, characterized in that, The method further includes: A confidence assessment model is constructed, including a geometric projection confidence assessment module and a camera pose prior confidence assessment module, to evaluate the accuracy of the calculated physical distance.
7. A dynamic water surface adaptive monocular camera visual ranging system, characterized in that, The system includes: The camera parameter correction module is used to process the parameters of the monocular camera, acquire images of the water surface to be measured, and correct the camera's extrinsic parameters in real time. The water level data acquisition module is used to acquire real-time water level data synchronized with the acquisition time of each frame of image; The water level data conversion module is used to convert the real-time water level data into dynamic three-dimensional water level plane parameters; The distance calculation module is used to calculate the physical distance between any two points in the image based on the camera parameters and dynamic three-dimensional water level plane parameters corresponding to each frame of the image.
8. A dynamic water surface adaptive monocular camera visual ranging device, the electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.
9. A computer-readable medium having stored thereon computer program instructions that can be executed by a processor to implement the method as described in any one of claims 1 to 6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.