A mobile terminal augmented reality lofting guiding method, device and terminal equipment
By using quaternion attitude calculation and elevation difference adaptive correction in mobile augmented reality lofting, the error problems caused by Euler angle gimbal lock and elevation difference are solved, and high-precision and stable AR lofting guidance is achieved in extreme pitch scenarios.
Patent Information
- Application Number
- CN202611203307.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, Euler angle attitude calculation suffers from gimbal lock in extreme pitch scenarios, leading to algorithm failure and point drift, especially in construction scenarios such as foundation pits and slopes where accurate positioning is impossible.
Quaternions are used for attitude calculation, and singular thresholds are set for correction under extreme attitudes. At the same time, adaptive projection correction and compensation based on elevation difference are used, and precise coordinate transformation is performed by combining IMU and camera structure offset parameters to avoid errors caused by Euler angle gimbal lock and elevation difference.
It improves the accuracy and stability of coordinate calculation in extreme pitch scenarios, ensures the accuracy and consistency of AR layout guidance, and enhances construction efficiency and precision.
Smart Images

Figure CN123181587A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of engineering surveying and setting out, and in particular to a mobile augmented reality setting out guidance method, apparatus, and terminal device. Background Technology
[0002] In the construction of buildings, municipal works, pipelines, roads, and other engineering projects, point setting is a core procedure in on-site surveying, requiring construction personnel to accurately mark the coordinate points on the design drawings onto the actual site. With the rapid popularization of mobile smart terminals, RTK (real-time dynamic differential positioning) high-precision positioning, inertial measurement units, and real-time visual augmented reality technology, engineering setting is gradually shifting from traditional total station manual setting to mobile AR (augmented reality) visual setting.
[0003] Traditional pure numerical navigation and planar map navigation modes have the shortcoming of insufficient visual intuitiveness. Therefore, the industry has gradually developed a visual lofting solution that integrates GNSS (Global Navigation Satellite System), IMU (Inertial Measurement Unit) and camera, which provides intuitive guidance by projecting the design coordinates onto the real scene of the mobile phone.
[0004] However, existing technologies generally use Euler angles for attitude calculation, but when the pitch angle is close to ±90°, the roll axis and yaw axis coincide, making it impossible to distinguish between roll rotation and yaw rotation, thus losing a rotation dimension. Summary of the Invention
[0005] This invention provides a mobile augmented reality lofting guidance method, device, and terminal equipment to solve the technical problem of gimbal lock in Euler angle attitude calculation, which causes algorithm failure and point drift in extreme pitch scenarios such as foundation pits and slopes.
[0006] To address the aforementioned technical problems, embodiments of the present invention provide a mobile augmented reality lofting guidance method, comprising: Obtain calibration parameters, including camera intrinsic parameters; Acquire sensor data, which includes the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point, reference ellipsoid parameters, and device attitude quaternions; Based on the reference ellipsoid parameters and the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point are converted into the first station center coordinates of the stakeout target point relative to the camera position using a coordinate transformation algorithm. Based on the device attitude quaternion, the first station center coordinates are mapped to the camera coordinate system through quaternion conjugate rotation to obtain the first camera coordinates; Based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the lofting target point in the camera image. The first pixel coordinates are linearly mapped from CCD resolution to screen resolution to obtain the first screen coordinates of the lofting target point. Based on the first screen coordinates, AR lofting guidance information is rendered in the real-world video footage.
[0007] Understandably, compared to existing technologies that use Euler angles for attitude calculation, this invention uses quaternions for coordinate calculation and attitude processing throughout the entire process. This avoids the problem of Euler angle gimbal lock from the root, avoids the technical problems of algorithm failure and point drift in extreme pitch scenarios such as foundation pits and slopes, and improves the accuracy and stability of coordinate calculation.
[0008] Furthermore, after acquiring sensor data, the process also includes: The device attitude quaternion is converted into Euler angles. During the conversion process, a singular threshold is set. When the pitch angle is detected to enter the singular threshold range, a correction operation is performed on the pitch angle.
[0009] Understandably, this invention sets a singular threshold and performs correction during the quaternion to Euler angle conversion process to avoid interface angle value jumps under extreme postures, thus achieving intuitive visualization of equipment posture. At the same time, Euler angles are only used for human-machine interface display, which meets the needs of operators to read equipment posture, without allowing Euler angles to participate in coordinate rotation transformation, avoiding the impact of Euler angle gimbal lock defects on lofting coordinate calculation, and ensuring the accuracy and stability of AR lofting projection calculation.
[0010] Furthermore, after obtaining the first screen coordinates of the target point for lofting, the process also includes: Obtain the vertical component of the first station center coordinates, and use the vertical component of the first station center coordinates as the elevation difference between the stakeout target point and the camera position; If the elevation difference is less than a preset elevation difference threshold, the first screen coordinates will be used as the target display coordinates; If the elevation difference is greater than or equal to the preset elevation difference threshold, the elevation value of the stakeout target point is set to zero, and the elevation of the camera position is compensated according to the vertical component of the pole tip in the station center coordinate system. Then, the projection calculation from the geodetic coordinates to the screen coordinates of the stakeout target point is re-executed to update the first screen coordinates.
[0011] Understandably, this invention achieves adaptive projection correction by judging the elevation difference between the target point and the camera position. When the elevation difference is small, the projection result is directly reused. When the elevation difference exceeds the elevation difference threshold, the target elevation is set to 0. The projection is then recalculated after compensating the camera elevation by combining the vertical component of the pole tip center coordinate. This effectively overcomes the defect of horizontal parallax offset in three-dimensional projection in scenarios with large elevation differences such as high slopes and foundation pits, and improves the orientation accuracy of AR stakeout guidance in undulating terrain.
[0012] Furthermore, before rendering AR lofting guidance information in the real-world video footage, the following steps are also included: The calibration parameters also include: IMU and camera structure offset parameters and IMU-to-camera rotation quaternions; Based on the IMU and camera structure offset parameters, antenna height, and rotation quaternion from IMU to camera, construct the pole tip IMU coordinate system coordinates; Based on rigid body transformation and quaternion rotation, the coordinates of the rod tip IMU coordinate system are converted into the three-dimensional coordinates of the rod tip in the camera coordinate system; The pinhole imaging model is used to convert the three-dimensional coordinates of the rod tip in the camera coordinate system into the coordinates of the second pixel.
[0013] Understandably, existing AR lofting guidance schemes typically select the GNSS antenna phase center or camera position as the starting point of the AR guide line. Such schemes do not consider the installation offset and height difference between the IMU, camera, and GNSS antenna. This invention solves for the pixel coordinates corresponding to the rod tip by using the IMU and camera structural offset parameters, antenna height, and the rotation quaternion from the IMU to the camera. This compensates for sensor assembly errors and achieves matching between the virtual reference and the actual work point. It provides a reliable calculation basis for subsequent guidance beyond the screen boundary and effectively improves the accuracy of AR lofting guidance.
[0014] Furthermore, after converting the three-dimensional coordinates of the rod tip in the camera coordinate system to the second pixel coordinates using the pinhole imaging model, the process also includes: Use the second pixel coordinate as the starting point of the AR guide line; Determine whether the coordinates of the first pixel exceed the screen boundary: If the first pixel coordinates are within the screen boundary, then the first pixel coordinates are used as the endpoint of the AR guide line; If it exceeds the screen boundary, the intersection point of the line segment pointing from the second pixel coordinate to the first pixel coordinate and the screen boundary is calculated. The intersection point is taken as the end point of the AR guide line, and the visible segment of the line segment within the screen boundary is extracted for rendering.
[0015] Understandably, this solution can continuously provide directional guidance at the edge of the screen when the target point for layout exceeds the screen range. The visual guidance is coherent and natural, which can help operators quickly rotate the equipment toward the target point for layout, effectively improving the efficiency of layout work. At the same time, the AR guide line segments are clipped, and only the visible line segments inside the screen are rendered to avoid rendering invalid graphics and reduce the rendering load on mobile devices.
[0016] Furthermore, after obtaining the coordinates of the first camera, it also includes: Obtain the depth value in the camera coordinate system and determine the position of the lofting target point: If the depth value is greater than zero, it is determined that the target point for the layout is in front of the camera, and the coordinates of the first camera are calculated by projection using the pinhole imaging model. If the depth value is zero, the lofted target point will be projected onto the principal point position in the camera's view. If the depth value is less than zero, the components of the first camera coordinates are inverted to complete the reverse guidance projection calculation of the lofting target point.
[0017] Understandably, this invention processes depth values in different scenarios, covering three situations: the target is in front of the camera, the camera's reference plane, and behind the camera. For the case where the target's layout point is behind the camera, coordinates are inverted to achieve reverse guidance. It can continuously output effective AR guidance information in various scenarios, meeting the needs of multi-angle and recursive surveying and layout operations in on-site construction, and improving the versatility of the solution.
[0018] Further, the step of rendering AR lofting guidance information in the real-world video frame based on the first screen coordinates includes: Identify the current layout mode, which includes point layout, line layout, and CAD layout; If the identified lofting mode is point lofting, then obtain the geodetic coordinates of the lofting target point and perform projection rendering on the lofting target point separately. If the identified stakeout mode is line stakeout, obtain the geodetic coordinates of the stakeout target point, all line nodes, the starting point of the line and the ending point of the line, perform projection rendering on the stakeout target point, perform path rendering on the line nodes, and perform over-mileage judgment on the stakeout target point. If the identified lofting mode is CAD lofting, obtain the geodetic coordinates of the lofting target point and all CAD design path nodes, perform projection rendering on the lofting target point, and simultaneously perform path rendering on the CAD path nodes; when performing path rendering, perform projection calculation from geodetic coordinates to screen coordinates on each CAD path node, include nodes whose coordinates are within the screen extension range in the drawing list, and draw path segments.
[0019] Understandably, this solution is compatible with various construction conditions such as point layout, line layout, and CAD layout, and realizes multi-mode integrated AR rendering to meet the needs of various engineering layout scenarios.
[0020] Furthermore, the simultaneous path rendering of line nodes and the determination of mileage exceeding the target point for lofting include: Determine whether the target point for the staking out is located between the starting point and the ending point of the route: If the target for staking is not between the start and end points of the line, it is determined to be an over-mileage state. The distance from the pole tip to the start and end points of the line is calculated respectively. The closer end point of the line is selected as the end point of the AR guide line. The guide line is used to connect the pole tip and the end point of the line for rendering prompts.
[0021] Understandably, this invention, through its over-mileage judgment mechanism, can identify over-mileage conditions in real time during the line layout process, automatically select the nearest line endpoint as the guiding target, and remind workers that they have exceeded the designed line range through visual warnings of the guiding line, guiding workers to move closer to the nearest line endpoint, reducing the number of ineffective searches on site, and improving the work efficiency of long road and pipeline line layout.
[0022] Another embodiment of the present invention provides a mobile augmented reality lofting guidance device, including: a parameter acquisition module, a data acquisition module, a coordinate calculation module and an AR rendering module; The parameter acquisition module is used to acquire calibration parameters, which include camera intrinsic parameters; The data acquisition module is used to acquire sensor data, which includes the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point, the reference ellipsoid parameters, and the device attitude quaternion. The coordinate calculation module is used to convert the geodetic coordinates of the stakeout target point into the first station center coordinates of the stakeout target point relative to the camera position based on the reference ellipsoid parameters and a coordinate transformation algorithm. Based on the device attitude quaternion, the first station center coordinates are mapped to the camera coordinate system through quaternion conjugate rotation to obtain the first camera coordinates; Based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the lofting target point in the camera image. The first pixel coordinates are linearly mapped from CCD resolution to screen resolution to obtain the first screen coordinates of the lofting target point. The AR rendering module is used to render AR lofting guidance information in real-world video footage.
[0023] Another embodiment of the present invention provides a terminal device, including a processor and a memory, characterized in that the memory stores machine-readable instructions executable by the processor, which, when executed, are used to implement the steps of a mobile augmented reality lofting guidance method as described in the present invention.
[0024] The embodiments of the present invention have the following beneficial effects: The present invention provides the following solution: Calibration parameters are obtained, including camera intrinsic parameters; sensor data is obtained, including geodetic coordinates of the camera position, geodetic coordinates of the stakeout target point, reference ellipsoid parameters, and device attitude quaternions; based on the reference ellipsoid parameters and the geodetic coordinates of the camera position, a coordinate transformation algorithm is used to convert the geodetic coordinates of the stakeout target point into first station center coordinates relative to the camera position; based on the device attitude quaternions, the first station center coordinates are mapped to the camera coordinate system through quaternion conjugate rotation to obtain first camera coordinates; based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the stakeout target point in the camera image; a linear mapping from CCD resolution to screen resolution is performed on the first pixel coordinates to obtain the first screen coordinates of the stakeout target point; based on the first screen coordinates, AR stakeout guidance information is rendered in the real-world video image. This invention uses quaternions for calculation in each coordinate transformation, which solves the problem of Euler angle universal joints, avoids the problems of algorithm failure and point drift in extreme pitch scenarios such as foundation pits and slopes, reduces cumulative errors, improves calculation accuracy, and enhances calculation stability. Attached Figure Description
[0025] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating a mobile augmented reality lofting guidance method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a mobile augmented reality lofting guidance device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of super-screen boundary guidance provided in an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the term "comprising" and any variations thereof in the specification, claims and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0029] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "several" means two or more, unless otherwise explicitly defined.
[0030] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] Please refer to Figure 1 To address the technical problem in existing technologies where Euler angle attitude calculation suffers from gimbal lock, leading to algorithm failure and point drift in extreme pitch scenarios such as foundation pits and slopes, an embodiment of this invention provides a mobile augmented reality lofting guidance method. This method includes steps S100 to S400, each step as follows: S100. Obtain calibration parameters, including camera intrinsic parameters; Preferably, the calibration parameters further include: IMU and camera structure offset parameters and IMU-to-camera rotation quaternions.
[0032] It should be noted that the IMU and the camera cannot be physically aligned. There are offsets in their installation positions and angles within the device. If this installation deviation is not compensated for, and the IMU attitude is directly taken as the camera attitude and the IMU origin is taken as the camera optical center, the coordinate calculation will introduce systematic installation errors. This will cause the calculated second pixel coordinates to deviate from the actual position of the pole tip in the image, resulting in misalignment of the AR guide line starting point. In the real scene, the actual pole tip and the AR virtual guide mark on the screen will not be aligned, and the accuracy of the lofting guidance will decrease.
[0033] S200. Acquire sensor data, which includes the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point, the reference ellipsoid parameters, and the device attitude quaternion. It should be noted that geodetic coordinates are surface coordinates on an ellipsoid and cannot be directly used for three-dimensional spatial vector operations. By introducing reference ellipsoid parameters, the model reference problem of converting ellipsoidal geodetic coordinates to a local station-centered rectangular coordinate system can be solved, ensuring the accuracy of the calculation of the relative spatial position between different points.
[0034] Furthermore, after acquiring sensor data, the process also includes: The device attitude quaternion is converted into Euler angles. During the conversion process, a singular threshold is set. When the pitch angle is detected to enter the singular threshold range, a correction operation is performed on the pitch angle.
[0035] It should be noted that during the layout operation, operators sometimes need to obtain the attitude of the equipment. Quaternions are a four-dimensional mathematical form, and operators cannot intuitively understand the values of quaternions; while Euler angles can output heading, pitch and roll angles, and can intuitively display the orientation and tilt of the equipment on the electronic handheld interface.
[0036] It is understandable that the process of converting quaternions to Euler angles may have Euler angle singularities (gimbal lock): when the pitch angle is close to ±90°, the yaw and roll angles may change abruptly. By setting a singularity threshold, the pitch angle is corrected when it enters the singularity threshold range to avoid abrupt changes in the output Euler angle values and ensure smooth and reliable attitude display on the interface. At the same time, the calculation of coordinate transformation and projection is still completed using quaternions to avoid introducing singularity risks.
[0037] S300. Based on the reference ellipsoid parameters and the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point are converted into the first station center coordinates of the stakeout target point relative to the camera position using a coordinate transformation algorithm. S400. Based on the device attitude quaternion, the first station center coordinates are mapped to the camera coordinate system by quaternion conjugate rotation to obtain the first camera coordinates. Furthermore, the depth value in the camera coordinate system is obtained, and the position of the lofting target point is determined: If the depth value is greater than zero, it is determined that the target point for the layout is in front of the camera, and the coordinates of the first camera are calculated by projection using the pinhole imaging model. If the depth value is zero, the lofted target point will be projected onto the principal point position in the camera's view. If the depth value is less than zero, the components of the first camera coordinates are inverted to complete the reverse guidance projection calculation of the lofting target point.
[0038] It should be noted that the depth value is the Z vector of the first camera coordinates.
[0039] In this embodiment, after rotation transformation of the station center coordinates, the first camera coordinates of the stakeout target point are obtained as (0.6, 1.1, -4.2). The depth value is -4.2m, which is less than 0, indicating that the stakeout target point is located behind the camera. Inverting the coordinate components of the first camera coordinates yields (-0.6, -1.1, 4.2). After the inversion operation, the depth value is greater than 0, which satisfies the input condition (depth value greater than 0) of the pinhole imaging model. Based on the camera intrinsic parameters, the coordinates of the first pixel are calculated through the pinhole imaging model, and then the CCD resolution is mapped to the screen resolution to obtain the first screen coordinates.
[0040] Understandably, the coordinates are inverted when the target layout point is behind the camera to provide reverse guidance and prompts, guiding the operator to rotate the equipment toward the target layout point.
[0041] S500. Based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the lofting target point in the camera image. S600: Perform a linear mapping from CCD resolution to screen resolution on the first pixel coordinates to obtain the first screen coordinates of the lofting target point. Furthermore, the vertical component of the first station center coordinates is obtained, and the vertical component of the first station center coordinates is used as the elevation difference between the stakeout target point and the camera position. If the elevation difference is less than a preset elevation difference threshold, the first screen coordinates will be used as the target display coordinates; If the elevation difference is greater than or equal to the preset elevation difference threshold, the elevation value of the stakeout target point is set to zero, and the elevation of the camera position is compensated according to the vertical component of the pole tip in the station center coordinate system. Then, the projection calculation from the geodetic coordinates to the screen coordinates of the stakeout target point is re-executed to update the first screen coordinates.
[0042] In this embodiment, the elevation difference threshold is set to 0.5m, the ground elevation of the camera position is 23.2m, the ground elevation of the target point is 23.4m, and the elevation difference between the target point and the camera position is 0.2m, which is less than the preset elevation difference threshold of 0.5m. The first screen coordinates obtained after coordinate transformation, pinhole imaging projection, and resolution mapping are directly used as the final target display coordinates, and AR layout guidance information is rendered based on the first screen coordinates.
[0043] In another embodiment, the elevation difference threshold is set to 0.5m, the geodetic height of the camera position is 23.2m, the geodetic height of the target point is 25.1m, and the elevation difference between the target point and the camera position is 1.9m, which is greater than the preset elevation difference threshold of 0.5m, requiring compensation for the camera elevation. First, the elevation value of the target point is set to 0; second, the vertical component of the pole tip in the station center coordinate system is obtained, and this vertical component is used to compensate for the elevation of the camera position, resulting in the compensated geodetic elevation of the camera position; next, using the geodetic coordinates of the target point with zero elevation and the geodetic coordinates of the compensated camera position, the complete projection process is re-executed: the geodetic coordinates are converted to station center coordinates, and the station center coordinates are transformed by quaternion rotation to obtain the three-dimensional coordinates of the camera coordinate system; finally, the first pixel coordinates are obtained through the pinhole imaging model, and then updated to the new first screen coordinates through a linear mapping from CCD resolution to screen resolution. The updated first screen coordinates are used as the target display coordinates for subsequent AR guided rendering.
[0044] Understandably, this elevation adaptive correction process can effectively overcome the defect of horizontal parallax offset in 3D projection under large elevation difference scenarios such as high slopes and foundation pits, and improve the horizontal guidance accuracy of AR projection between the stakeout target and the equipment under large elevation difference scenarios.
[0045] Furthermore, in the specific implementation process, the IMU and camera structure offset parameters and the IMU-to-camera rotation quaternion are pre-calibrated, and the antenna height is obtained simultaneously. Based on the antenna height, the pole tip IMU coordinate system is constructed in the IMU coordinate system. Based on the IMU-to-camera rotation quaternion and the IMU-to-camera structure offset parameters, a rigid body transformation and quaternion rotation are performed on the pole tip IMU coordinate system to transform the pole tip coordinates to the camera coordinate system, obtaining the three-dimensional coordinates of the pole tip in the camera coordinate system. Then, the three-dimensional coordinates are substituted into the pinhole imaging model, and the second pixel coordinates of the pole tip are obtained by combining the camera intrinsic parameters.
[0046] like Figure 3 As shown, it should be noted that when the first pixel coordinates exceed the screen boundary, the second pixel coordinates are used as the starting point of the AR guide line. The line segment between the second pixel coordinates and the first pixel coordinates is calculated, and the intersection of the line segment and the screen boundary is used as the ending point of the AR guide line. The part of the line segment within the screen boundary is used for AR rendering.
[0047] In another embodiment, the first pixel coordinates are located within the screen boundary. The first pixel coordinates are used as the endpoint of the AR guide line. The line segment between the second pixel coordinates and the first pixel coordinates is solved, and the line segment is used for AR rendering.
[0048] S700: Based on the first screen coordinates, render AR lofting guidance information in the real-world video frame.
[0049] Furthermore, identifying the current layout mode, it should be noted that the layout mode includes point layout, line layout, and CAD layout.
[0050] If the identified lofting mode is point lofting, then obtain the geodetic coordinates of the lofting target point and perform projection rendering on the lofting target point separately. If the identified stakeout mode is line stakeout, obtain the geodetic coordinates of the stakeout target point, all line nodes, the starting point of the line and the ending point of the line, perform projection rendering on the stakeout target point, perform path rendering on the line nodes, and perform over-mileage judgment on the stakeout target point. If the identified lofting mode is CAD lofting, obtain the geodetic coordinates of the lofting target point and all CAD design path nodes, perform projection rendering on the lofting target point, and simultaneously perform path rendering on the CAD path nodes; when performing path rendering, perform projection calculation from geodetic coordinates to screen coordinates on each CAD path node, include nodes whose coordinates are within the screen extension range in the drawing list, and draw path segments.
[0051] Specifically, the simultaneous path rendering of line nodes and the determination of mileage exceedance for stakeout target points include: Determine whether the target point for the staking out is located between the starting point and the ending point of the route: If the target for staking is not between the start and end points of the line, it is determined to be an over-mileage state. The distance from the pole tip to the start and end points of the line is calculated respectively. The closer end point of the line is selected as the end point of the AR guide line. The guide line is used to connect the pole tip and the end point of the line for rendering prompts.
[0052] Understandably, this solution can identify point layout, line layout, and CAD layout modes, adapting to different engineering layout operations. Simultaneously, the line layout mode can recognize exceeding mileage limits; when the layout target point exceeds the start and end range of the line, it selects the line endpoint closer to the pole tip to generate an AR guidance prompt, alerting workers that they have exceeded the valid line range and preventing incorrect layout. CAD layout only adds path nodes within the screen's extended range to the drawing list, reducing computational load and improving the smoothness of AR rendering.
[0053] like Figure 2 Based on the above-described method embodiments, an embodiment of the present invention provides a mobile augmented reality lofting guidance device, which includes modules S1 to S4, the specific details of which are as follows: The parameter acquisition module S1 is used to acquire calibration parameters, including camera intrinsic parameters; Data acquisition module S2 is used to acquire sensor data, which includes the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point, the reference ellipsoid parameters, and the device attitude quaternion. The coordinate calculation module S3 is used to convert the geodetic coordinates of the stakeout target point into the first station center coordinates of the stakeout target point relative to the camera position based on the reference ellipsoid parameters and a coordinate transformation algorithm. Based on the device attitude quaternion, the first station center coordinates are mapped to the camera coordinate system through quaternion conjugate rotation to obtain the first camera coordinates; Based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the lofting target point in the camera image. The first pixel coordinates are linearly mapped from CCD resolution to screen resolution to obtain the first screen coordinates of the lofting target point. The AR rendering module S4 is used to render AR lofting guidance information in real-world video footage.
[0054] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the mobile augmented reality lofting guidance method provided by any of the above-described method embodiments of the present invention.
[0055] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0056] Based on the above-described method embodiments, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a mobile augmented reality lofting guidance method according to any embodiment of the present invention.
[0057] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0058] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc.
[0059] The terminal device may include, but is not limited to, a processor and a memory.
[0060] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0061] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A mobile augmented reality lofting guidance method, characterized in that, include: Obtain calibration parameters, including camera intrinsic parameters; Acquire sensor data, which includes the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point, reference ellipsoid parameters, and device attitude quaternions; Based on the reference ellipsoid parameters and the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point are converted into the first station center coordinates of the stakeout target point relative to the camera position using a coordinate transformation algorithm. Based on the device attitude quaternion, the first station center coordinates are mapped to the camera coordinate system through quaternion conjugate rotation to obtain the first camera coordinates; Based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the lofting target point in the camera image. The first pixel coordinates are linearly mapped from CCD resolution to screen resolution to obtain the first screen coordinates of the lofting target point. Based on the first screen coordinates, AR lofting guidance information is rendered in the real-world video footage.
2. The mobile augmented reality lofting guidance method as described in claim 1, characterized in that, After acquiring sensor data, the process also includes: The device attitude quaternion is converted into Euler angles. During the conversion process, a singular threshold is set. When the pitch angle is detected to enter the singular threshold range, a correction operation is performed on the pitch angle.
3. The mobile augmented reality lofting guidance method as described in claim 1, characterized in that, After obtaining the first screen coordinates of the target point for lofting, the following is also included: Obtain the vertical component of the first station center coordinates, and use the vertical component of the first station center coordinates as the elevation difference between the stakeout target point and the camera position; If the elevation difference is less than a preset elevation difference threshold, the first screen coordinates will be used as the target display coordinates; If the elevation difference is greater than or equal to the preset elevation difference threshold, the elevation value of the stakeout target point is set to zero, and the elevation of the camera position is compensated according to the vertical component of the pole tip in the station center coordinate system. Then, the projection calculation from the geodetic coordinates to the screen coordinates of the stakeout target point is re-executed to update the first screen coordinates.
4. The mobile augmented reality lofting guidance method as described in claim 3, characterized in that, Before rendering AR lofting guidance information in the live video footage, the following steps are also included: The calibration parameters also include: IMU and camera structure offset parameters and IMU-to-camera rotation quaternions; Based on the IMU and camera structure offset parameters, antenna height, and rotation quaternion from IMU to camera, construct the pole tip IMU coordinate system coordinates; Based on rigid body transformation and quaternion rotation, the coordinates of the rod tip IMU coordinate system are converted into the three-dimensional coordinates of the rod tip in the camera coordinate system; The pinhole imaging model is used to convert the three-dimensional coordinates of the rod tip in the camera coordinate system into the coordinates of the second pixel.
5. The mobile augmented reality lofting guidance method as described in claim 4, characterized in that, After converting the three-dimensional coordinates of the rod tip in the camera coordinate system to the second pixel coordinates using the pinhole imaging model, the following is also included: Use the second pixel coordinate as the starting point of the AR guide line; Determine whether the coordinates of the first pixel exceed the screen boundary: If the first pixel coordinates are within the screen boundary, then the first pixel coordinates are used as the endpoint of the AR guide line; If the first pixel coordinates exceed the screen boundary, then the intersection point of the line segment pointing from the second pixel coordinates to the first pixel coordinates and the screen boundary is calculated. The intersection point is taken as the end point of the AR guide line, and the visible segment of the line segment within the screen boundary is extracted for rendering.
6. The mobile augmented reality lofting guidance method as described in claim 1, characterized in that, After obtaining the coordinates of the first camera, the following is also included: Obtain the depth value in the camera coordinate system and determine the position of the lofting target point: If the depth value is greater than zero, it is determined that the target point for the layout is in front of the camera, and the coordinates of the first camera are calculated by projection using the pinhole imaging model. If the depth value is zero, the lofted target point will be projected onto the principal point position in the camera's view. If the depth value is less than zero, the components of the first camera coordinates are inverted to complete the reverse guidance projection calculation of the lofting target point.
7. The mobile augmented reality lofting guidance method as described in claim 1, characterized in that, The step of rendering AR lofting guidance information in the real-world video frame based on the first screen coordinates includes: Identify the current layout mode, which includes point layout, line layout, and CAD layout; If the identified lofting mode is point lofting, then obtain the geodetic coordinates of the lofting target point and perform projection rendering on the lofting target point separately. If the identified stakeout mode is line stakeout, obtain the geodetic coordinates of the stakeout target point, all line nodes, the starting point of the line and the ending point of the line, perform projection rendering on the stakeout target point, perform path rendering on the line nodes and perform over-mileage judgment on the stakeout target point. If the identified lofting mode is CAD lofting, obtain the geodetic coordinates of the lofting target point and all CAD design path nodes, perform projection rendering on the lofting target point, and simultaneously perform path rendering on the CAD path nodes; when performing path rendering, perform projection calculation from geodetic coordinates to screen coordinates on each CAD path node, include nodes whose coordinates are within the screen extension range in the drawing list, and draw path segments.
8. The mobile augmented reality lofting guidance method as described in claim 7, characterized in that, The simultaneous path rendering of line nodes and over-mileage judgment of stakeout target points includes: Determine whether the target point for the staking out is located between the starting point and the ending point of the route: If the target for staking is not between the start and end points of the line, it is determined to be an over-mileage state. The distance from the pole tip to the start and end points of the line is calculated respectively. The closer end point of the line is selected as the end point of the AR guide line. The guide line is used to connect the pole tip and the end point of the line for rendering prompts.
9. A mobile augmented reality lofting guidance device, characterized in that, include: Parameter acquisition module, data acquisition module, coordinate calculation module, and AR rendering module; The parameter acquisition module is used to acquire calibration parameters, which include camera intrinsic parameters; The data acquisition module is used to acquire sensor data, which includes the geodetic coordinates of the camera position, the geodetic coordinates of the stakeout target point, the reference ellipsoid parameters, and the device attitude quaternion. The coordinate calculation module is used to convert the geodetic coordinates of the stakeout target point into the first station center coordinates of the stakeout target point relative to the camera position based on the reference ellipsoid parameters and a coordinate transformation algorithm. Based on the device attitude quaternion, the first station center coordinates are mapped to the camera coordinate system through quaternion conjugate rotation to obtain the first camera coordinates; Based on the camera intrinsic parameters, the first camera coordinates are projected onto the pixel plane using a pinhole imaging model to obtain the first pixel coordinates of the lofting target point in the camera image. The first pixel coordinates are linearly mapped from CCD resolution to screen resolution to obtain the first screen coordinates of the lofting target point. The AR rendering module is used to render AR lofting guidance information in real-world video footage.
10. A mobile augmented reality lofting guidance terminal device, comprising a processor and a memory, characterized in that, The memory stores machine-readable instructions that can be executed by a processor, which, when executed, are used to implement a mobile augmented reality lofting guidance method as described in any one of claims 1 to 8.
