A railway line target three-dimensional positioning and mileage coordinate mapping method based on track geometric constraints and device prior
Patent Information
- Application Number
- CN202610964261.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-25
AI Technical Summary
现有基于视觉的检测方法大多仅输出目标在图像中的二维位置,未能建立从图像坐标到真实世界坐标的稳定映射关系;即使部分方法涉及三维重建,也多依赖多视角或高成本传感器,难以适用于常规随车视频场景
(1)在单目视频条件下实现设备三维空间定位,降低系统硬件成本
Smart Images

Figure QLYQS_3 
Figure QLYQS_4 
Figure QLYQS_5
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional positioning technology along railway lines, and in particular to a method for three-dimensional positioning and mileage coordinate mapping of targets along railway lines based on track geometric constraints and equipment prior knowledge. Background Technology
[0002] With the development of railway informatization and intelligent operation and maintenance, railway infrastructure detection and positioning technologies based on visual and multi-source sensor data have gradually become a research hotspot. Currently, related technologies mainly focus on the following areas:
[0003] 1. Vision-based railway facility inspection technology. Existing research and engineering systems utilize onboard cameras or drones to acquire images, combining them with deep learning target detection algorithms to identify tracks, overhead contact lines, and related equipment, achieving defect detection and condition assessment. For example, convolutional neural networks can be used to detect targets such as overhead contact line components, track structures, or tunnel entrances, outputting their location and category information in the image. This type of technology has been widely used in railway inspection, but its results typically remain at the "image coordinate level," lacking a precise representation of the actual spatial location of the target.
[0004] 2. Multi-view or LiDAR-based 3D reconstruction technologies. Some technologies utilize multi-view images, LiDAR, or structured light equipment to reconstruct 3D models of railway scenes, obtaining 3D models of the tracks and surrounding environment. Examples include 3D reconstruction methods for railway lines based on multi-view images, or contact wire geometric parameter measurement systems based on visual measurements. These methods typically rely on multi-sensor or multi-view data, enabling the acquisition of high-precision 3D information; however, they are complex, costly, and subject to stringent deployment requirements.
[0005] 3. Equipment positioning technology based on positioning sensors. Some existing solutions use positioning devices such as GPS, BeiDou, or inertial measurement units (IMUs) to pinpoint the location of facilities along railway lines. For example, combining GPS / IMUs with image acquisition systems can locate anomalies in the overhead contact system or the location of electrical arcs. These methods rely on external positioning systems and can typically obtain the approximate geographical location of the equipment, but they suffer from insufficient positioning accuracy in obstructed environments (such as tunnels or mountainous areas) or in scenarios requiring high precision.
[0006] 4. Inspection systems combining detection and positioning. In recent years, some systems have attempted to combine visual inspection and positioning technologies to achieve integrated "detection + positioning" processing. For example, they combine target detection results with odometers or track inspection systems to achieve coarse-grained position marking. However, these methods mostly use simple time synchronization or mileage alignment methods and have not yet formed a complete three-dimensional spatial inverse calculation and precise mapping mechanism.
[0007] Although the above technologies have made some progress in the field of intelligent railway inspection, there are still the following obvious shortcomings in "achieving precise spatial positioning at the equipment level based on onboard video": 1. Lack of an effective mapping mechanism from images to real 3D space. Most existing vision-based detection methods only output the two-dimensional position of the target in the image, failing to establish a stable mapping relationship from image coordinates to real-world coordinates; even if some methods involve 3D reconstruction, they mostly rely on multi-view or high-cost sensors, making them difficult to apply to conventional in-vehicle video scenarios.
[0008] 2. Insufficient utilization of structural constraints in railway scenarios. Railway lines have clear geometric features, such as continuous track centerlines, fixed track gauge, and segmented curves. However, existing localization or reconstruction methods often treat these as general vision or SLAM problems, failing to incorporate track geometry as a constraint into pose estimation or spatial inverse calculation processes, thus limiting localization stability and accuracy.
[0009] 3. Lack of spatial prior modeling for specific equipment types. Different equipment along railway lines (such as section insulators, weights, overpasses, etc.) have relatively fixed spatial distribution characteristics, such as height range and positional relationship relative to the track. However, existing methods usually treat the target as a general object and do not introduce these "equipment-level priors" into the 3D positioning process, resulting in unstable spatial solution results or multiple solutions.
[0010] 4. Cannot be directly mapped to the railway engineering coordinate system (mileage coordinates). Railway operation and maintenance actually uses the "line mileage coordinate system" (such as K161+944.66), rather than a general three-dimensional coordinate system. However, existing technologies often only output geographic coordinates or local three-dimensional coordinates, lacking the ability to map the positioning results to engineering semantic coordinates such as line mileage, lateral offset, and altitude, making it difficult to directly serve asset management and operation and maintenance systems.
[0011] 5. High system complexity or insufficient engineering adaptability. Some 3D reconstruction or high-precision positioning methods rely on lidar, multi-camera systems, or high-precision external positioning equipment, resulting in high system costs and complex deployment, making them unsuitable for large-scale promotion to video inspection scenarios of conventional track inspection vehicles or work vehicles.
[0012] In summary, existing technologies lack a technical solution that, under monocular or limited sensing conditions, fully integrates railway track geometric constraints and equipment spatial priors to achieve the inverse calculation of the three-dimensional position of equipment along the line and its mapping to the line mileage coordinates. Summary of the Invention
[0013] In view of the above technical problems, this disclosure provides a method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge. This patent addresses the shortcomings of existing technologies in the field of railway equipment positioning by identifying and clarifying the following four core technical problems:
[0014] 1. The problem of 3D positioning scale uncertainty under monocular video conditions
[0015] In railway equipment detection scenarios based on vehicle-mounted monocular video, target detection methods can only output the two-dimensional position (pixel coordinates) of the equipment in the image, and cannot directly obtain the position of the equipment in the real three-dimensional space. Projecting the two-dimensional observations in the image into three-dimensional space introduces inherent scale uncertainty under monocular conditions: that is, the three-dimensional points corresponding to the same image observation are distributed along a ray along the line of sight, making it impossible to determine a unique three-dimensional position. Existing solutions typically rely on one of the following methods: binocular vision (high cost, complex calibration); LiDAR assistance (high cost, unsuitable for routine inspection scenarios); multi-frame triangulation (requires long accumulation time, poor real-time performance). However, none of these methods utilize the prior spatial knowledge of the railway equipment itself, resulting in the inability to achieve stable three-dimensional positioning under single-frame or few-frame conditions.
[0016] 2. The general positioning method does not utilize the structural constraints of the railway track, resulting in insufficient stability of pose estimation.
[0017] Railway vehicle motion is subject to strict geometric constraints: the camera moves along the track with the vehicle, its position always near the track centerline, and its direction of motion is consistent with the track tangent. Existing GNSS / IMU-based positioning methods or visual SLAM methods typically treat camera motion as six-degree-of-freedom motion, failing to incorporate the aforementioned geometric constraints into the pose estimation process. This leads to: pose drift caused by sensor noise accumulation; a sharp increase in pose estimation error in GNSS failure scenarios such as tunnels and occlusion; and difficulty in maintaining precise alignment with the track coordinate system. These problems directly affect the accuracy of subsequent 3D positioning calculations.
[0018] 3. The positioning results are incompatible with the railway engineering coordinate system and cannot be directly used for engineering applications.
[0019] Even when the three-dimensional coordinates of the equipment are obtained (such as coordinates in a camera coordinate system or a geodetic coordinate system), their representation differs fundamentally from the coordinate system actually used in railway engineering. Railway operation and maintenance management uses an engineering coordinate system based on line mileage (including mileage K-value, lateral offset, and height components), while the general three-dimensional coordinates output by existing positioning methods cannot be directly used in: railway GIS systems; equipment asset management platforms; and line maintenance and construction positioning. Existing technologies lack an automatic mapping mechanism from general three-dimensional coordinates to railway line mileage coordinates.
[0020] 4. The spatial distribution differences among different equipment types have not been effectively utilized, and the positioning constraints are insufficient.
[0021] Different types of equipment along railway lines (such as overhead contact line equipment, weights, and overpasses) exhibit relatively fixed spatial distribution patterns, including characteristics such as height range, lateral position, and structural orientation. Existing general visual positioning methods treat all types of targets equally, failing to incorporate the aforementioned "equipment-level spatial priors" into the positioning calculation. This leads to: insufficient 3D positioning constraints, resulting in multiple solutions or unstable solutions; inability to differentiate and improve the positioning accuracy of different types of equipment; and high noise in the positioning results when the quality of target feature point extraction is low.
[0022] According to one aspect of this disclosure, a method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment priors is provided, comprising the following steps: S1 Data Acquisition and Time Synchronization: Through a monocular camera, global navigation satellite system receiver, inertial measurement unit and odometer mounted on a railway inspection vehicle, video images, global positioning data, inertial attitude data and cumulative displacement data along the track direction are collected synchronously. S2 Track Geometric Model Construction: Obtain the three-dimensional spatial parameter curve of the railway line centerline, and establish a following coordinate system with the line mileage as the parameter; S3 Camera pose estimation based on orbit constraints: The initial camera pose is obtained by fusing the data from the Global Navigation Satellite System, Inertial Measurement Unit and Odometry, and a joint optimization objective function is constructed. The joint optimization objective function introduces position constraint term and attitude constraint term to limit the camera pose to the neighborhood of the orbit centerline and constrain the camera attitude to be consistent with the orbit tangent direction. The accurate camera pose of each frame image is obtained by solving the problem. S4 Railway Line Equipment Target Detection and Image Observation Modeling: Target detection is performed on video images to identify railway line equipment and extract its image observation vectors; S5 3D position inverse calculation based on device priors: For a target detected in a single frame image, a spatial ray is constructed using the precise camera pose and image observation vector, and a spatial prior constraint on the device category to which the target belongs is introduced. The initial 3D position of the target is uniquely determined through optimization. The spatial prior constraints include height prior constraints, lateral position prior constraints, and structural orientation prior constraints. S6 3D coordinate to track mileage coordinate mapping: Project the initial 3D position of the target onto the parametric curve of the track centerline, obtain the corresponding track mileage, calculate its lateral offset and height relative to the track centerline, and finally output the structured positioning record of the target in a standardized format of track mileage parameters, lateral offset components, and height components.
[0023] In S1, the monocular camera is installed at a fixed position on the vehicle, with its lens facing forward or to the side, continuously acquiring video data along the railway line. The camera completes internal parameter calibration and obtains its focal length. , Principal point coordinates The distortion coefficients and intrinsic parameter matrix are denoted as: ; Global Navigation Satellite System (GNSS) receivers are used to provide the vehicle's absolute position in the geodetic coordinate system, including latitude, longitude, and elevation. The output frequency is 1–10 Hz, which is used to provide global coordinate reference. The inertial measurement unit is used to provide triaxial acceleration and triaxial angular velocity, with an output frequency typically of 100–200 Hz. It is used to calculate the instantaneous attitude of the vehicle and to compensate for the lack of low-frequency updates from the global navigation satellite system. The odometer is installed at the wheel axle and provides cumulative displacement information along the track direction. Its output frequency is usually comparable to the video frame rate. It is used to maintain displacement tracking along the track direction in scenarios where global navigation satellite system signals are missing.
[0024] Synchronous data collection includes the following steps: Using a high-precision clock as the time base, all sensor data is stamped with a unified timestamp; linear interpolation is used for low-frequency sensor data, including global navigation satellite systems, to obtain frame-by-frame sensor data aligned with video frames; finally, a synchronized data stream organized by frame number is constructed. ; in: : The image of frame t; Position coordinates provided by the Global Navigation Satellite System, in meters, converted to a local Cartesian coordinate system; Quaternion attitude calculated by the inertial measurement unit; : Accumulated displacement of the odometer, in meters.
[0025] The construction of the orbital geometry model in S2 specifically includes the following steps: (1) Parametric representation of the orbit centerline The railway centerline is represented as a three-dimensional spatial curve with the line mileage s as a parameter: ; Where: s: line mileage parameter, in meters, consistent with the measurement unit of mileage stakes in railway engineering; x(s), y(s): horizontal coordinate components; z(s): elevation coordinate components; The geometric characteristics of each segment of the line are as follows: Straight line segment: curvature is zero, x(s) and y(s) are linear functions of s; Circular curve segment: curvature is constant k=1 / R, where R is the curve radius; Transition curve segment: curvature changes linearly from zero to 1 / R, described by a spiral curve or a cubic parabola; Vertical curve segment: z(s) is a quadratic function of s. (2) Establishment of the moving coordinate system Establish a moving coordinate system along the orbit centerline to convert all subsequent 3D calculations from the global coordinate system to a local coordinate system based on the orbit: ; Where: T(s): tangent vector, along the direction of travel on the track; N(s): principal normal vector, perpendicular to the tangent vector, pointing laterally to the track (inside the curve); B(s): binormal vector, perpendicular to the track plane and pointing upwards, determined by the right-hand rule; Any three-dimensional point X in the coordinate system at mileage s can be decomposed into: ; Where: n=(XC(s))•N(s): lateral offset component, in meters, a positive value indicates deviating towards the inside of the curve, and a negative value indicates deviating towards the outside; h=(XC(s))•B(s): height component, in meters, representing the vertical height of the target point relative to the track reference plane; The track geometry model was obtained through the following methods: railway survey and design database, track inspection vehicle measured data, and high-precision railway map data.
[0026] The camera pose estimation based on orbital constraints in S3 specifically includes the following steps: (1) Establishment of camera installation geometry: The camera is installed at a fixed position on the vehicle. The rigid body transformation between the camera and the vehicle coordinate system is obtained through on-site calibration. When the vehicle moves on the track, the relationship between the vehicle coordinate system and the track coordinate system is determined by the following parameters: Camera installation height : The vertical distance from the camera's optical center to the orbital reference plane, in meters; Camera lateral mounting offset : The lateral distance from the optical center of the camera to the center line of the track, in meters; Camera pitch angle α and yaw angle β: angular deviations of the camera's principal optical axis relative to the tangent direction of the track; (2) Initial pose estimation: Based on the global navigation satellite system, inertial measurement unit and odometry data in the synchronous data stream, multi-source fusion is performed by extended Kalman filtering to obtain the initial pose estimation for each frame: ; in: Rotation matrix from world coordinate system to camera coordinate system; : The position vector of the camera's optical center in the world coordinate system; (3) Orbit-constrained pose optimization: Based on the initial pose, orbital geometric constraints are introduced for refinement optimization, and a joint optimization objective function including sensor observation terms and orbital constraint terms is constructed: ; in, This is the sensor observation error term. ; in: , , These are information matrices for the Global Navigation Satellite System, the Inertial Measurement Unit, and the Odometer, determined by the accuracy of each sensor. The original observations of the inertial measurement unit, These are the inertial measurement unit observation predictions obtained from pre-integration of adjacent poses; v τ Let τ be the camera velocity vector for the τ-th frame, and Δτ be the inter-frame time interval.
[0027] For position constraint terms: ; The position constraint requires that the deviation between the camera position and its nominal installation position in the orbital coordinate system be minimized, strictly constraining the camera position within a neighborhood with the orbital centerline as a reference.
[0028] For attitude constraints: ; Where R track (s t )∈SO(3) is the basis vector of the orbital coordinate system (T(s) t ),N(s t ),B(s t The theoretical attitude matrix is composed of the camera mounting angle (α,β) and the camera mounting angle (α,β). log(•) is the logarithmic mapping on SO(3), and the attitude error in the form of a rotation vector is output. The attitude constraint requires that the camera attitude be consistent with the tangent direction of the orbit, and restricts the camera from deviating from the orbit direction in the yaw and pitch directions; λ1 and λ2 are the weighting coefficients for position and attitude constraints, which are adaptively set according to the sensor accuracy and the reliability of the orbit data. In the scenario of failure of the global navigation satellite system signal, λ1 and λ2 are increased to strengthen the orbit constraints and maintain the stability of the attitude estimation.
[0029] (4) Optimized solution and output: The nonlinear least squares problem is solved iteratively within a sliding time window, processing a fixed window length of W frames of data each time, supporting real-time or near-real-time processing; The final output is the precise camera pose corresponding to each frame: ; in Let be the rotation matrix from the world coordinate system to the camera coordinate system. This is the precise position vector of the camera's optical center in the world coordinate system. This pose result will serve as the basic input for the fifth-stage 3D position inverse calculation. The target detection and image observation modeling of equipment along the line in S4 specifically includes the following steps: (1) Target detection: For each frame of image in the synchronous data stream Perform object detection and obtain the detection results for all devices in the current frame: ; Where: (u i ,v i ): The pixel coordinates of the center point of the i-th object detection box; w i ,h i : Detection box width and height (pixels); c i ∈C: Device category label; σ i ∈(0,1): Detection confidence; Equipment category set C includes: segment insulators, electrical connections, weights, anchor ropes, contact wire positioning devices, tunnel entrances, and overpasses; (2) Image observation vector establishment: After distortion correction of the distorted image, stable feature points are extracted for each detected target, and back-projected onto the normalized image plane through the camera intrinsic parameter matrix K to obtain the image observation vector: ; The image observation vector represents the direction vector of the target in the camera coordinate system and is the starting point of the fifth-stage ray back projection.
[0030] The inverse calculation of the three-dimensional position based on the prior knowledge of the device in step S5 specifically includes the following steps: (1) Spatial ray back projection: Based on the precise camera pose output by S3 The image observation vector obtained from S4 Construct the spatial ray of the target in the world coordinate system: ; in: The rotation matrix from the camera coordinate system to the world coordinate system = The transpose of ; λ is the depth parameter along the ray direction, and is the unknown quantity; the unit direction vector of the ray is . ; (2) Equipment Category Prior Constraint Modeling: For different equipment categories along the railway line, three types of quantifiable spatial prior constraint models are established: Constraint 1: Height Prior Constraint The installation height of different types of equipment has a defined engineering range, establishing categorized soft height constraints: ; in: ; represents the height component of point X relative to the orbital reference plane. For category c i The corresponding prior height constraint interval; Constraint 2: Prior constraint on lateral position The lateral offset of different devices relative to the track centerline exhibits engineering regularities; therefore, lateral soft constraints are established. ; in: ; represents the lateral offset component of point X relative to the centerline of the track. For category c i Maximum permissible lateral offset; Constraint 3: Prior constraints on structural orientation Some devices have specific spatial structural orientations, which constrain the orientation of the target's local structure. ; in Let be the direction vector of the target local structure. (Estimated by the projection of the major axis of the detection frame in space) For category c i The prior structure orientation is B(s) for the weight and T(s) for the electrical connection. (3) Three-dimensional position optimization solution: Integrating ray geometry constraints and prior constraints of the three types of equipment into a unified optimization problem: ; The ray geometry constraint term is: ; That is, from point X to ray L i The square of the distance is zero when X is strictly on the ray; the weighting coefficients λ3, λ4, and λ5 are set according to different equipment categories and the reliability of various constraints, and the corresponding weights are increased for categories with high constraint reliability. The optimization problem is solved in a coordinate system: the unknown X is parameterized into three components (s,n,h), and each prior constraint is expressed in n andh. The three-dimensional optimization problem is transformed into a low-dimensional parameter optimization, and the gradient descent or L-BFGS method is used to solve iteratively. (4) Multi-frame fusion enhancement: For the same target detected in multiple consecutive frames, cross-frame target tracking and matching are used to fuse multi-frame ray constraints to establish an overdetermined optimization problem, further improving the positioning accuracy. ; Where T i Let i be the set of frames continuously detected for target i. Multi-frame fusion changes the ray constraint from underdetermined to overdetermined, which, together with the prior constraint, determines the unique optimal 3D position and suppresses the influence of single-frame detection noise on the localization result. The resulting 3D coordinates In the next stage, mileage mapping is performed based on the orbital centerline C(s) constructed in the second stage, forming a complete computational closed loop with the orbital geometric model.
[0031] The mapping from three-dimensional coordinates to line mileage coordinates in S6 specifically includes the following steps: (1) Projection of 3D points to the center line of the track: the 3D points output in the fifth stage Find the nearest point on the orbital centerline C(s) to obtain the corresponding odometer parameters: ; For segmented parameterized orbit curves, the problem is solved using Newton's iteration method or the golden section method within each segment, and the mileage parameter corresponding to the global minimum is taken as the result. (2) Calculation of the three components of the coordinate system: Based on the projection results, the three components of the coordinate system are calculated. Mileage In the Frenet coordinate system, it is decomposed into three engineering semantic components: Lateral offset component: The unit is meters; a positive value indicates a deviation towards the inside of the curve, and a negative value indicates a deviation towards the outside. Height component: The unit is meters, representing the vertical height of the target point relative to the orbital reference plane. (3) Engineering mileage format conversion: converting continuous mileage parameters Convert to the general mileage labeling format for railway engineering: ; =123456m, then the output mileage identifier is K123+456; (4) Structured location record output: The above calculation results are integrated into the structured location record of each target device to form a standardized output. The structured record is connected to the railway geographic information system, equipment asset management platform or line digital twin system as the basic data of equipment spatial ledger.
[0032] The beneficial effects of this invention are as follows: (1) Achieve three-dimensional spatial positioning of equipment under monocular video conditions, thereby reducing system hardware costs. This patent, using only a monocular camera, transforms the inherent scale uncertainty problem in monocular vision into a constrained optimization problem by introducing prior constraints on device category space, thus enabling the solution of the three-dimensional spatial position of devices along the line.
[0033] Compared to existing technologies that rely on binocular vision, lidar, or high-precision measurement equipment, this method: requires no additional sensors; requires no complex calibration or multi-device synchronization; and can directly utilize the standard configuration of existing railway inspection vehicles (monocular camera + global navigation satellite system / inertial measurement unit + odometer); thus significantly reducing system deployment costs and engineering implementation complexity, making it suitable for large-scale railway inspection application scenarios.
[0034] (2) Effectively suppress pose drift by utilizing orbital geometric constraints to improve positioning stability and accuracy. This patent introduces the geometry of railway tracks into the camera pose estimation process. By constructing position and attitude constraints based on the track centerline, the original six-degree-of-freedom free pose estimation problem is transformed into a low-degree-of-freedom constrained optimization problem along the track curve.
[0035] This method has the following effects: it effectively limits the error accumulation path of camera position deviation from the track; it ensures that the vehicle's movement direction is consistent with the track tangent direction, suppressing attitude drift; and it can still maintain stable positioning by relying on track constraints even when the global navigation satellite system signal is weak or fails (such as in tunnel scenarios). Therefore, compared with general SLAM or pure global navigation satellite system / inertial measurement unit methods that do not utilize track constraints, this patent can significantly improve the positioning stability and accuracy consistency in long-distance continuous operation scenarios.
[0036] (3) Introduce spatial priors for equipment categories to achieve differentiated high-precision positioning. This patent establishes a multi-dimensional prior constraint model, including height range, lateral offset, and structural orientation, based on the spatial distribution patterns of different types of railway equipment (such as catenary equipment, weights, and overpasses) in actual engineering projects.
[0037] By incorporating the aforementioned prior information into the 3D position inverse calculation process, this method can: significantly reduce the range of the 3D solution space and improve the uniqueness of the solution; achieve stable positioning under single-frame conditions and reduce dependence on multi-frame triangulation; adopt differentiated constraints for different device types to improve overall positioning accuracy; and compared with general visual positioning methods that do not utilize device priors, this patent can still obtain stable and reliable positioning results under complex scenes and weak feature conditions.
[0038] (4) Realize the automatic conversion from three-dimensional coordinates to railway mileage coordinates, directly serving engineering applications. This patent automatically maps three-dimensional spatial coordinates to a common railway engineering coordinate form based on the track centerline parameter curve and the Frenet coordinate system, including: track mileage (K value); lateral offset; and relative track surface height.
[0039] The conversion process has the following advantages: the output results conform to the data standards of railway operation and maintenance systems, eliminating the need for secondary conversion; it can be directly used in railway GIS systems, equipment asset management platforms, and digital twin systems; it supports precise equipment positioning, spatial querying, and operation and maintenance decision analysis; compared with existing technologies that only output general three-dimensional coordinates, this patent achieves a direct conversion from "visual perception results" to "engineering semantic data," significantly enhancing the engineering application value of the technological achievement.
[0040] (5) The overall solution has a clear structure and strong scalability, and is suitable for various types of railway scenarios. This patent adopts a layered modeling approach of "track constraints + equipment prior knowledge", with clear decoupling between modules and good engineering scalability: the track geometry model can be adapted to different lines (conventional railways, high-speed railways, urban rail transit); the equipment prior knowledge model can be expanded according to the new equipment type; the three-dimensional positioning and coordinate mapping module can be independently integrated into the existing inspection system; In summary, this patent, without increasing hardware costs, achieves a leap from "image detection" to "engineering-level spatial positioning" of railway line equipment by introducing track geometric constraints and equipment category priors, and directly converts the positioning results into railway mileage coordinates for output, combining high precision, strong stability and good engineering applicability. Detailed Implementation
[0041] The preferred embodiments of the present invention are described below. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention. Example 1
[0042] This patent proposes a method for 3D positioning of targets along railway lines and mapping of railway coordinates based on track geometric constraints and equipment prior knowledge. This method uses onboard monocular video as the primary information source, integrating sensor data from GNSS, IMU, and odometers—commonly used in railway inspection vehicles. By introducing railway track geometric constraints and spatial prior knowledge of equipment categories, the 3D spatial positioning problem of key equipment along the railway line is transformed into a strongly constrained optimization problem. The positioning results are then converted into the commonly used railway engineering format of line mileage coordinates for output.
[0043] The fundamental differences from existing technologies are reflected in the following three points: (1) Hardware level: This method only requires a monocular camera, GNSS / IMU and odometer, all of which are standard configurations for railway inspection vehicles. No lidar, binocular vision system or high-precision measurement equipment is required. The scale uncertainty problem inherent in monocular conditions is solved at the algorithm level by the equipment prior constraint mechanism proposed in this patent, rather than relying on additional hardware; (2) Algorithm level: This method introduces the geometric structure of the railway track into the pose estimation process, transforming the original spatial positioning problem with high degree of freedom into a low degree of freedom constraint estimation problem along the track curve, which fundamentally improves the positioning stability and overcomes the problems of large cumulative error and serious drift of the general visual SLAM method in the railway scene; (3) Output level: This method directly maps the three-dimensional positioning results into the mileage coordinate expression (mileage + lateral offset + height) commonly used in railway engineering, which can be directly connected to railway asset management, GIS and digital twin systems, rather than remaining in the output of the general spatial coordinate system.
[0044] This example discloses a method for three-dimensional positioning and mileage coordinate mapping of targets along a railway line based on track geometric constraints and equipment priors, including the following steps: S1 Data Acquisition and Time Synchronization: Through a monocular camera, global navigation satellite system receiver, inertial measurement unit and odometer mounted on a railway inspection vehicle, video images, global positioning data, inertial attitude data and cumulative displacement data along the track direction are collected synchronously. S2 Track Geometric Model Construction: Obtain the three-dimensional spatial parameter curve of the railway line centerline, and establish a following coordinate system with the line mileage as the parameter; S3 Camera pose estimation based on orbit constraints: The initial camera pose is obtained by fusing data from the Global Navigation Satellite System, Inertial Measurement Unit and odometry, and a joint optimization objective function is constructed. The joint optimization objective function introduces position constraint term and attitude constraint term to limit the camera pose to the neighborhood of the orbit centerline and constrain the camera attitude to be consistent with the orbit tangent direction. The accurate camera pose of each frame image is obtained by solving the problem. S4 Railway Line Equipment Target Detection and Image Observation Modeling: Target detection is performed on video images to identify railway line equipment and extract its image observation vectors; S5 3D position inverse calculation based on device priors: For a target detected in a single frame image, a spatial ray is constructed using the precise camera pose and image observation vector, and a spatial prior constraint on the device category to which the target belongs is introduced. The initial 3D position of the target is uniquely determined through optimization. The spatial prior constraints include height prior constraints, lateral position prior constraints, and structural orientation prior constraints. S6 3D coordinate to track mileage coordinate mapping: Project the initial 3D position of the target onto the parametric curve of the track centerline, obtain the corresponding track mileage, and calculate its lateral offset and height relative to the track centerline. Finally, output the structured positioning record of the target in a standardized format of track mileage parameters, lateral offset components, and height components.
[0045] The S1 monocular camera is mounted in a fixed position on the vehicle, with its lens facing forward or to the side. It continuously collects video data along the railway line. The camera completes internal parameter calibration and obtains its focal length. , Principal point coordinates The distortion coefficients and intrinsic parameter matrix are denoted as: ; Global Navigation Satellite System (GNSS) receivers are used to provide the vehicle's absolute position in the geodetic coordinate system, including latitude, longitude, and elevation. The output frequency is 1–10 Hz, which is used to provide global coordinate reference. The inertial measurement unit is used to provide triaxial acceleration and triaxial angular velocity, with an output frequency typically of 100–200 Hz. It is used to calculate the instantaneous attitude of the vehicle and to compensate for the lack of low-frequency updates from the global navigation satellite system. The odometer is installed at the wheel axle and provides cumulative displacement information along the track direction. Its output frequency is usually comparable to the video frame rate. It is used to maintain displacement tracking along the track direction in scenarios where global navigation satellite system signals are missing.
[0046] Synchronous data collection includes the following steps: Using a high-precision clock as the time base, all sensor data is stamped with a unified timestamp; linear interpolation is used for low-frequency sensor data, including global navigation satellite systems, to obtain frame-by-frame sensor data aligned with video frames; finally, a synchronized data stream organized by frame number is constructed. ; in: : The image of frame t; Position coordinates provided by the Global Navigation Satellite System, in meters, converted to a local Cartesian coordinate system; Quaternion attitude calculated by the inertial measurement unit; : Accumulated displacement of the odometer, in meters.
[0047] The construction of the orbital geometry model in S2 includes the following steps: (1) Parametric representation of the orbit centerline The railway centerline is represented as a three-dimensional spatial curve with the line mileage s as a parameter: ; Where: s: line mileage parameter, in meters, consistent with the measurement unit of mileage stakes in railway engineering; x(s), y(s): horizontal coordinate components; z(s): elevation coordinate components; The geometric characteristics of each segment of the line are as follows: Straight line segment: curvature is zero, x(s) and y(s) are linear functions of s; Circular curve segment: curvature is constant k=1 / R, where R is the curve radius; Transition curve segment: curvature changes linearly from zero to 1 / R, described by a spiral curve or a cubic parabola; Vertical curve segment: z(s) is a quadratic function of s. (2) Establishment of the moving coordinate system Establish a moving coordinate system along the orbit centerline to convert all subsequent 3D calculations from the global coordinate system to a local coordinate system based on the orbit: ; Where: T(s): tangent vector, along the direction of travel on the track; N(s): principal normal vector, perpendicular to the tangent vector, pointing laterally to the track (inside the curve); B(s): binormal vector, perpendicular to the track plane and pointing upwards, determined by the right-hand rule; Any three-dimensional point X in the coordinate system at mileage s can be decomposed into: ; Where: n=(XC(s))•N(s): lateral offset component, in meters, a positive value indicates deviating towards the inside of the curve, and a negative value indicates deviating towards the outside; h=(XC(s))•B(s): height component, in meters, representing the vertical height of the target point relative to the track reference plane; The track geometry model was obtained through the following methods: railway survey and design database, track inspection vehicle measured data, and high-precision railway map data.
[0048] The camera pose estimation based on orbital constraints in S3 specifically includes the following steps: Technical Motivation Explanation: General visual positioning methods (such as visual SLAM) treat camera pose as a free estimation problem with full six degrees of freedom in three-dimensional space, which is prone to accumulated errors and drift in long-distance railway travel scenarios. The key difference of this method is that the railway camera moves with the track vehicle, and its motion is strictly constrained by the track geometry—the camera position is always within the neighborhood of the track centerline, and the direction of motion is always consistent with the track tangent. This method explicitly introduces this physical constraint into pose estimation, compressing the six-degree-of-freedom problem into a low-degree-of-freedom estimation problem with the mileage parameter s as the main variable, thereby significantly improving positioning stability and maintaining reliable performance even in GNSS failure scenarios such as tunnels.
[0049] (1) Establishment of camera installation geometry: The camera is installed at a fixed position on the vehicle. The rigid body transformation between the camera and the vehicle coordinate system is obtained through on-site calibration. When the vehicle moves on the track, the relationship between the vehicle coordinate system and the track coordinate system is determined by the following parameters: Camera installation height : The vertical distance from the camera's optical center to the orbital reference plane, in meters; Camera lateral mounting offset : The lateral distance from the optical center of the camera to the center line of the track, in meters; Camera pitch angle α and yaw angle β: angular deviations of the camera's principal optical axis relative to the tangent direction of the track; (2) Initial pose estimation: Based on the global navigation satellite system, inertial measurement unit and odometry data in the synchronous data stream, multi-source fusion is performed by extended Kalman filtering to obtain the initial pose estimation for each frame: ; in: Rotation matrix from world coordinate system to camera coordinate system; : The position vector of the camera's optical center in the world coordinate system; (3) Orbit-constrained pose optimization: Based on the initial pose, orbital geometric constraints are introduced for refinement optimization, and a joint optimization objective function including sensor observation terms and orbital constraint terms is constructed: ; in, This is the sensor observation error term. ; in: , , These are information matrices for the Global Navigation Satellite System, the Inertial Measurement Unit, and the Odometer, determined by the accuracy of each sensor. The original observations of the inertial measurement unit, These are the inertial measurement unit observation predictions obtained from pre-integration of adjacent poses; v τ Let τ be the camera velocity vector for the τ-th frame, and Δτ be the inter-frame time interval.
[0050] For position constraint terms: ; The position constraint requires that the deviation between the camera position and its nominal installation position in the orbital coordinate system be minimized, strictly constraining the camera position within a neighborhood with the orbital centerline as a reference.
[0051] For attitude constraints: ; Where R track (s t )∈SO(3) is the basis vector of the orbital coordinate system (T(s) t ),N(s t ),B(s t The theoretical attitude matrix is composed of the camera mounting angle (α,β) and the camera mounting angle (α,β). log(•) is the logarithmic mapping on SO(3), and the attitude error in the form of a rotation vector is output. The attitude constraint requires that the camera attitude be consistent with the tangent direction of the orbit, and restricts the camera from deviating from the orbit direction in the yaw and pitch directions; λ1 and λ2 are the weighting coefficients for position and attitude constraints, which are adaptively set according to the sensor accuracy and the reliability of the orbit data. In the scenario of failure of the global navigation satellite system signal, λ1 and λ2 are increased to strengthen the orbit constraints and maintain the stability of the attitude estimation.
[0052] (4) Optimized solution and output: The nonlinear least squares problem is solved iteratively within a sliding time window, processing a fixed window length of W frames of data each time, supporting real-time or near-real-time processing; The final output is the precise camera pose corresponding to each frame: ; in Let be the rotation matrix from the world coordinate system to the camera coordinate system. This is the precise position vector of the camera's optical center in the world coordinate system. This pose result will serve as the basic input for the fifth-stage 3D position inverse calculation. The target detection and image observation modeling of equipment along the line in S4 specifically includes the following steps: (1) Target detection: For each frame of image in the synchronous data stream Perform object detection and obtain the detection results for all devices in the current frame: ; Where: (u i ,v i ): The pixel coordinates of the center point of the i-th object detection box; w i ,h i : Detection box width and height (pixels); c i ∈C: Device category label; σ i ∈(0,1): Detection confidence; Equipment category set C includes: segment insulators, electrical connections, weights, anchor ropes, contact wire positioning devices, tunnel entrances, and overpasses; (2) Image observation vector establishment: After distortion correction of the distorted image, stable feature points are extracted for each detected target, and back-projected onto the normalized image plane through the camera intrinsic parameter matrix K to obtain the image observation vector: ; The image observation vector represents the direction vector of the target in the camera coordinate system and is the starting point of the fifth-stage ray back projection.
[0053] The inverse 3D position calculation based on device priors in S5 specifically includes the following steps: Technical Motivation: Monocular cameras inherently suffer from depth unobservability—for a detection point in an image, its distance along the line of sight cannot be determined from a single image, resulting in scale uncertainty. Existing general methods typically require multi-frame triangulation or LiDAR assistance to address this issue. The innovation of this method lies in the fact that railway equipment has relatively fixed spatial distribution characteristics (height range, lateral position, structural orientation), which are known in engineering. By introducing these prior constraints of equipment categories into the ray-based back-projection process, the scale uncertainty problem can be transformed into a constrained optimization problem under single-frame conditions, thereby uniquely or approximately uniquely determining the 3D position of the target without relying on LiDAR or binocular cameras.
[0054] (1) Spatial ray back projection: Based on the precise camera pose output by S3 The image observation vector obtained from S4 Construct the spatial ray of the target in the world coordinate system: ; in: The rotation matrix from the camera coordinate system to the world coordinate system = The transpose of ; λ is the depth parameter along the ray direction, and is the unknown quantity; the unit direction vector of the ray is . ; (2) Equipment Category Prior Constraint Modeling: For different equipment categories along the railway line, three types of quantifiable spatial prior constraint models are established: Constraint 1: Height Prior Constraint The installation height of different types of equipment has a defined engineering range, establishing categorized soft height constraints: ; in: ; represents the height component of point X relative to the orbital reference plane. For category c i The corresponding prior height constraint interval; Constraint 2: Prior constraint on lateral position The lateral offset of different devices relative to the track centerline exhibits engineering regularities; therefore, lateral soft constraints are established. ; in: ; represents the lateral offset component of point X relative to the centerline of the track. For category c i Maximum permissible lateral offset; Constraint 3: Prior constraints on structural orientation Some devices have specific spatial structural orientations, which constrain the orientation of the target's local structure. ; in Let be the direction vector of the target local structure. (Estimated by the projection of the major axis of the detection frame in space) For category c i The prior structure orientation is B(s) for the weight and T(s) for the electrical connection. (3) Three-dimensional position optimization solution: Integrating ray geometry constraints and prior constraints of the three types of equipment into a unified optimization problem: ; The ray geometry constraint term is: ; That is, from point X to ray L i The square of the distance is zero when X is strictly on the ray; the weighting coefficients λ3, λ4, and λ5 are set according to different equipment categories and the reliability of various constraints, and the corresponding weights are increased for categories with high constraint reliability. The optimization problem is solved in a coordinate system: the unknown X is parameterized into three components (s,n,h), and each prior constraint is expressed in n andh. The three-dimensional optimization problem is transformed into a low-dimensional parameter optimization problem, and gradient descent or L-BFGS method is used for iterative solution. (4) Multi-frame fusion enhancement: For the same target detected in multiple consecutive frames, cross-frame target tracking and matching are used to fuse multi-frame ray constraints to establish an overdetermined optimization problem, further improving the positioning accuracy. ; Where T i Let i be the set of frames continuously detected for target i. Multi-frame fusion changes the ray constraint from underdetermined to overdetermined, which, together with the prior constraint, determines the unique optimal 3D position and suppresses the influence of single-frame detection noise on the localization result. The resulting 3D coordinates In the next stage, mileage mapping is performed based on the orbital centerline C(s) constructed in the second stage, forming a complete computational closed loop with the orbital geometric model.
[0055] The mapping from three-dimensional coordinates to line mileage coordinates in S6 specifically includes the following steps: Technical Motivation: In railway engineering operation and maintenance systems, equipment locations are uniformly represented using a coordinate system of "track mileage + lateral offset + height" (e.g., K123+456, 0.3m to the left, 5.2m high), rather than a general three-dimensional spatial coordinate system. This stage, based on the track parameter curve C(s) and coordinate system constructed in the second stage, converts the three-dimensional coordinates output in the fifth stage into railway engineering semantic coordinates. This achieves a direct mapping from "computer vision results" to "railway engineering data," allowing the positioning results to be directly imported into the railway operation and maintenance system without manual conversion.
[0056] L <L min At that time, it was considered that the trajectory only appeared occasionally in a few frames, and was judged as an unreliable detection; (1) Projection of 3D points to the center line of the track: the 3D points output in the fifth stage Find the nearest point on the orbital centerline C(s) to obtain the corresponding odometer parameters: ; For segmented parameterized orbit curves, the problem is solved using Newton's iteration method or the golden section method within each segment, and the mileage parameter corresponding to the global minimum is taken as the result. (2) Calculation of the three components of the coordinate system: Based on the projection results, the three components of the coordinate system are calculated. Mileage In the Frenet coordinate system, it is decomposed into three engineering semantic components: Lateral offset component: The unit is meters; a positive value indicates a deviation towards the inside of the curve, and a negative value indicates a deviation towards the outside. Height component: The unit is meters, representing the vertical height of the target point relative to the orbital reference plane. (3) Engineering mileage format conversion: converting continuous mileage parameters Convert to the general mileage labeling format for railway engineering: ; =123456m, then the output mileage identifier is K123+456; (4) Structured location record output: The above calculation results are integrated into the structured location record of each target device to form a standardized output. The structured record is connected to the railway geographic information system, equipment asset management platform or line digital twin system as the basic data of equipment spatial ledger.
[0057] Although some preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.
[0058] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for three-dimensional positioning and mileage coordinate mapping of targets along a railway line based on track geometric constraints and equipment prior knowledge, characterized in that, Includes the following steps: S1 Data Acquisition and Time Synchronization: Through a monocular camera, global navigation satellite system receiver, inertial measurement unit and odometer mounted on a railway inspection vehicle, video images, global positioning data, inertial attitude data and cumulative displacement data along the track direction are collected synchronously. S2 Track Geometric Model Construction: Obtain the three-dimensional spatial parameter curve of the railway line centerline, and establish a following coordinate system with the line mileage as the parameter; S3 Camera pose estimation based on orbit constraints: The initial camera pose is obtained by fusing the data from the Global Navigation Satellite System, Inertial Measurement Unit and Odometry, and a joint optimization objective function is constructed. The joint optimization objective function introduces position constraint term and attitude constraint term to limit the camera pose to the neighborhood of the orbit centerline and constrain the camera attitude to be consistent with the orbit tangent direction. The accurate camera pose of each frame image is obtained by solving the problem. S4 Railway Line Equipment Target Detection and Image Observation Modeling: Target detection is performed on video images to identify railway line equipment and extract its image observation vectors; S5 3D position inverse calculation based on device priors: For a target detected in a single frame image, a spatial ray is constructed using the precise camera pose and image observation vector, and a spatial prior constraint on the device category to which the target belongs is introduced. The initial 3D position of the target is uniquely determined through optimization. The spatial prior constraints include height prior constraints, lateral position prior constraints, and structural orientation prior constraints. S6 3D coordinate to track mileage coordinate mapping: Project the initial 3D position of the target onto the parametric curve of the track centerline, obtain the corresponding track mileage, calculate its lateral offset and height relative to the track centerline, and finally output the structured positioning record of the target in a standardized format of track mileage parameters, lateral offset components, and height components.
2. The method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge as described in claim 1, characterized in that: In S1, the monocular camera is installed at a fixed position on the vehicle, with its lens facing forward or to the side, continuously acquiring video data along the railway line. The camera completes internal parameter calibration and obtains its focal length. , Principal point coordinates The distortion coefficients and intrinsic parameter matrix are denoted as: ; Global Navigation Satellite System (GNSS) receivers are used to provide the vehicle's absolute position in the geodetic coordinate system, including latitude, longitude, and elevation. The output frequency is 1–10 Hz, which is used to provide global coordinate reference. The inertial measurement unit is used to provide triaxial acceleration and triaxial angular velocity, with an output frequency typically of 100–200 Hz. It is used to calculate the instantaneous attitude of the vehicle and to compensate for the lack of low-frequency updates from the global navigation satellite system. The odometer is installed at the wheel axle and provides cumulative displacement information along the track direction. Its output frequency is usually comparable to the video frame rate. It is used to maintain displacement tracking along the track direction in scenarios where global navigation satellite system signals are missing. Synchronous data collection includes the following steps: Using a high-precision clock as the time base, all sensor data is stamped with a unified timestamp; linear interpolation is used for low-frequency sensor data, including global navigation satellite systems, to obtain frame-by-frame sensor data aligned with video frames; finally, a synchronized data stream organized by frame number is constructed. ; in: : The image of frame t; Position coordinates provided by the Global Navigation Satellite System, in meters, converted to a local Cartesian coordinate system; Quaternion attitude calculated by the inertial measurement unit; : Accumulated displacement of the odometer, in meters.
3. The method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge as described in claim 1, characterized in that: The construction of the orbital geometry model in S2 specifically includes the following steps: (1) Parametric representation of the orbit centerline The railway centerline is represented as a three-dimensional spatial curve with the line mileage s as a parameter: ; Where: s: line mileage parameter, in meters, consistent with the measurement unit of mileage stakes in railway engineering; x(s), y(s): horizontal coordinate components; z(s): elevation coordinate components; The geometric characteristics of each segment of the line are as follows: Straight line segment: curvature is zero, x(s) and y(s) are linear functions of s; Circular curve segment: curvature is constant k=1 / R, where R is the curve radius; Transition curve segment: curvature changes linearly from zero to 1 / R, described by a spiral curve or a cubic parabola; Vertical curve segment: z(s) is a quadratic function of s. (2) Establishment of the moving coordinate system Establish a moving coordinate system along the orbit centerline to convert all subsequent 3D calculations from the global coordinate system to a local coordinate system based on the orbit: ; Where: T(s): tangent vector, along the direction of travel on the track; N(s): principal normal vector, perpendicular to the tangent vector, pointing laterally to the track (inside the curve); B(s): binormal vector, perpendicular to the track plane and pointing upwards, determined by the right-hand rule; Any three-dimensional point X in the coordinate system at mileage s can be decomposed into: ; Where: n=(XC(s))•N(s): lateral offset component, in meters, a positive value indicates deviating towards the inside of the curve, and a negative value indicates deviating towards the outside; h=(XC(s))•B(s): height component, in meters, representing the vertical height of the target point relative to the track reference plane; The track geometry model was obtained through the following methods: railway survey and design database, track inspection vehicle measured data, and high-precision railway map data.
4. The method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge as described in claim 1, characterized in that: The camera pose estimation based on orbital constraints in S3 specifically includes the following steps: (1) Establishment of camera installation geometry: The camera is installed at a fixed position on the vehicle. The rigid body transformation between the camera and the vehicle coordinate system is obtained through on-site calibration. When the vehicle moves on the track, the relationship between the vehicle coordinate system and the track coordinate system is determined by the following parameters: Camera installation height : The vertical distance from the camera's optical center to the orbital reference plane, in meters; Camera lateral mounting offset : The lateral distance from the optical center of the camera to the center line of the track, in meters; Camera pitch angle α and yaw angle β: angular deviations of the camera's principal optical axis relative to the tangent direction of the track; (2) Initial pose estimation: Based on the global navigation satellite system, inertial measurement unit and odometry data in the synchronous data stream, multi-source fusion is performed by extended Kalman filtering to obtain the initial pose estimation for each frame: ; in: Rotation matrix from world coordinate system to camera coordinate system; : The position vector of the camera's optical center in the world coordinate system; (3) Orbit-constrained pose optimization: Based on the initial pose, orbital geometric constraints are introduced for refinement optimization, and a joint optimization objective function including sensor observation terms and orbital constraint terms is constructed: ; in, This is the sensor observation error term. ; in: , , These are information matrices for the Global Navigation Satellite System, the Inertial Measurement Unit, and the Odometer, determined by the accuracy of each sensor. The original observations of the inertial measurement unit, These are the inertial measurement unit observation predictions obtained from pre-integration of adjacent poses; v τ Let τ be the camera velocity vector for the τth frame, and Δτ be the inter-frame time interval; For position constraint terms: ; The position constraint requires that the deviation between the camera position and its nominal installation position in the orbital coordinate system be minimized, and the camera position is strictly constrained within a neighborhood with the orbital centerline as a reference. For attitude constraints: ; Where R track (s t )∈SO(3) is the basis vector of the orbital coordinate system (T(s) t ),N(s t ),B(s t The theoretical attitude matrix is composed of the camera mounting angle (α,β) and the camera mounting angle (α,β). log(•) is the logarithmic mapping on SO(3), and the attitude error in the form of a rotation vector is output. The attitude constraint requires that the camera attitude be consistent with the tangent direction of the orbit, and restricts the camera from deviating from the orbit direction in the yaw and pitch directions; λ1 and λ2 are the weighting coefficients of position and attitude constraints, which are adaptively set according to the sensor accuracy and the reliability of orbit data. In the scenario of failure of global navigation satellite system signal, λ1 and λ2 are increased to strengthen orbit constraints and maintain the stability of attitude estimation. (4) Optimized solution and output: The nonlinear least squares problem is solved iteratively within a sliding time window, processing a fixed window length of W frames of data each time, supporting real-time or near-real-time processing; The final output is the precise camera pose corresponding to each frame: ; in Let be the rotation matrix from the world coordinate system to the camera coordinate system. This is the precise position vector of the camera's optical center in the world coordinate system; the pose result will serve as the basic input for the fifth-stage 3D position inverse calculation.
5. The method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge as described in claim 1, characterized in that: The target detection and image observation modeling of equipment along the line in S4 specifically includes the following steps: (1) Target detection: For each frame of image in the synchronous data stream Perform object detection and obtain the detection results for all devices in the current frame: ; Among them: (u i ,v i ): The pixel coordinates of the center point of the i-th object detection box; w i ,h i : Detection box width and height (pixels); c i ∈C: Device category label; σ i ∈(0,1): Detection confidence; Equipment category set C includes: segment insulators, electrical connections, weights, anchor ropes, contact wire positioning devices, tunnel entrances, and overpasses; (2) Image observation vector establishment: After distortion correction of the distorted image, stable feature points are extracted for each detected target, and back-projected onto the normalized image plane through the camera intrinsic parameter matrix K to obtain the image observation vector: ; The image observation vector represents the direction vector of the target in the camera coordinate system and is the starting point of the fifth-stage ray back projection.
6. The method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge as described in claim 1, characterized in that: The inverse calculation of the three-dimensional position based on the prior knowledge of the device in step S5 specifically includes the following steps: (1) Spatial ray back projection: Based on the precise camera pose output by S3 The image observation vector obtained from S4 Construct the spatial ray of the target in the world coordinate system: ; in: The rotation matrix from the camera coordinate system to the world coordinate system = The transpose of ; λ is the depth parameter along the ray direction, and is the unknown quantity; the unit direction vector of the ray is . ; (2) Equipment Category Prior Constraint Modeling: For different equipment categories along the railway line, three types of quantifiable spatial prior constraint models are established: Constraint 1: Height Prior Constraint The installation height of different types of equipment has a defined engineering range, establishing categorized soft height constraints: ; in: ; represents the height component of point X relative to the orbital reference plane. For category c i The corresponding prior height constraint interval; Constraint 2: Prior constraint on lateral position The lateral offset of different devices relative to the track centerline exhibits engineering regularities; therefore, lateral soft constraints are established. ; in: ; represents the lateral offset component of point X relative to the centerline of the track. For category c i Maximum permissible lateral offset; Constraint 3: Prior constraints on structural orientation Some devices have specific spatial structural orientations, which constrain the orientation of the target's local structure. ; in Let be the direction vector of the target local structure. (Estimated by the projection of the major axis of the detection frame in space) For category c i The prior structure orientation is B(s) for the weight and T(s) for the electrical connection. (3) Three-dimensional position optimization solution: Integrating ray geometry constraints and prior constraints of the three types of equipment into a unified optimization problem: ; The ray geometry constraint term is: ; That is, from point X to ray L i The square of the distance is zero when X is strictly on the ray; the weighting coefficients λ3, λ4, and λ5 are set according to different equipment categories and the reliability of various constraints, and the corresponding weights are increased for categories with high constraint reliability. The optimization problem is solved in a coordinate system: the unknown X is parameterized into three components (s,n,h), and each prior constraint is expressed in n andh. The three-dimensional optimization problem is transformed into a low-dimensional parameter optimization, and the gradient descent or L-BFGS method is used to solve iteratively. (4) Multi-frame fusion enhancement: For the same target detected in multiple consecutive frames, cross-frame target tracking and matching are used to fuse multi-frame ray constraints to establish an overdetermined optimization problem, further improving the positioning accuracy. ; Where T i Let i be the set of frames continuously detected for target i. Multi-frame fusion changes the ray constraint from underdetermined to overdetermined, which, together with the prior constraint, determines the unique optimal 3D position and suppresses the influence of single-frame detection noise on the localization result. The resulting 3D coordinates In the next stage, mileage mapping is performed based on the orbital centerline C(s) constructed in the second stage, forming a complete computational closed loop with the orbital geometric model.
7. The method for three-dimensional positioning and mileage coordinate mapping of railway targets based on track geometric constraints and equipment prior knowledge as described in claim 1, characterized in that: The mapping from three-dimensional coordinates to line mileage coordinates in S6 specifically includes the following steps: (1) Projection of 3D points to the center line of the track: the 3D points output in the fifth stage Find the nearest point on the orbital centerline C(s) to obtain the corresponding odometer parameters: ; For segmented parameterized orbit curves, the problem is solved using Newton's iteration method or the golden section method within each segment, and the mileage parameter corresponding to the global minimum is taken as the result. (2) Calculation of the three components of the coordinate system: Based on the projection results, the three components of the coordinate system are calculated. Mileage In the Frenet coordinate system, it is decomposed into three engineering semantic components: Lateral offset component: The unit is meters; a positive value indicates a deviation towards the inside of the curve, and a negative value indicates a deviation towards the outside. Height component: The unit is meters, representing the vertical height of the target point relative to the orbital reference plane. (3) Engineering mileage format conversion: converting continuous mileage parameters Convert to the general mileage labeling format for railway engineering: ; =123456m, then the output mileage identifier is K123+456; (4) Structured location record output: The above calculation results are integrated into the structured location record of each target device to form a standardized output. The structured record is connected to the railway geographic information system, equipment asset management platform or line digital twin system as the basic data of equipment spatial ledger.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 6.