Method and device for positioning spatial position of camera

The camera's pitch angle, roll angle and azimuth angle are obtained through integrated attitude sensors, combined with relative offset and height difference, the camera's accurate spatial positioning is achieved, solving the problems of low accuracy and complicated operation in traditional methods, and improving the stability and adaptability of the system.

CN120451259APending Publication Date: 2025-08-08WUHAN UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510291952.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional cameras rely on external attitude acquisition equipment to determine attitudes, which have problems such as low accuracy, complicated operation and high maintenance costs.

Method used

The actual pitch angle, roll angle and azimuth angle of the camera are obtained through the integrated attitude sensor, combined with the relative offset and height difference, and the real-time three-dimensional attitude and spatial position are determined by multi-dimensional data fusion, so as to achieve accurate conversion of video image pixels and geospatial positions.

Benefits of technology

It improves positioning accuracy, reduces dependence on external devices, enhances system stability and adaptability, and provides reliable location data support for applications such as video spatialization and monitoring and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451259A_ABST
    Figure CN120451259A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, in particular to a spatial position positioning method and device of a camera, and the method comprises the steps: obtaining an actual pitch angle and an actual roll angle of the camera based on an attitude sensor, and further obtaining an azimuth angle of the camera, the real-time three-dimensional attitude of the camera is obtained according to the azimuth angle, the actual pitch angle and the actual roll angle, the relative offset of the camera and the height difference between the camera and the plane are obtained, and the real-time three-dimensional space position of the camera is determined based on the relative offset and the height difference; and according to the real-time three-dimensional attitude and the real-time three-dimensional space position, determining a mutual conversion coordinate value of the video image pixel of the camera and the geographic space position, so as to obtain a space coordinate of the video image pixel of the camera based on the mutual conversion coordinate value. Therefore, the problems of low precision, complicated operation, high maintenance cost and the like due to the fact that a traditional camera depends on external attitude acquisition equipment to determine the attitude in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a method and device for spatial positioning of a camera. Background Art

[0002] Video spatialization technology refers to the combination of video content and GIS (Geographic Information System) data to achieve the mutual mapping of video frame coordinates and geographic coordinates, thereby embedding spatial information in the video so that it can be located and displayed in the geographic information system. This technology makes the video content not only media information, but also has spatial attributes that can correspond to the actual geographic location. In related technologies, traditional cameras do not have the function of outputting their own posture. They usually need to rely on external posture acquisition equipment, and then use external applications to comprehensively process these two parts of data to finally determine the posture of the camera, build a corresponding mathematical model or formula, substitute the acquired posture and other data into the computer vision related model or formula, and calculate the spatial position of the camera imaging center based on the imaging principle.

[0003] However, the accuracy of camera pose data obtained by external pose acquisition equipment directly affects the accuracy of video spatialization. The accuracy is affected by the installation method and the degree of overlap between the capture equipment and the camera's optical center. In addition, the attached pose acquisition equipment is usually the moving vehicle itself, requiring complex calibration and measurement to match it with the camera. In particular, when large vehicles (such as ships) need to install multiple cameras in different locations, the operation is complicated and difficult to implement, the maintenance cost is high, and the accuracy is low, making it difficult to use for subsequent video spatialization conversion work, and it is in urgent need of improvement. Summary of the Invention

[0004] The present application provides a method for spatial positioning of a camera to solve the problems in related technologies in which traditional cameras rely on external posture acquisition equipment to determine their posture, resulting in low accuracy, complicated operation and high maintenance costs.

[0005] The first aspect of the present application provides a method for spatial positioning of a camera, comprising the following steps: obtaining the actual pitch angle and actual roll angle of the camera based on the attitude sensor; obtaining the azimuth angle of the camera, and obtaining the real-time three-dimensional attitude of the camera based on the azimuth angle, the actual pitch angle and the actual roll angle; obtaining the relative offset of the camera and the height difference between the camera and a preset plane, and determining the real-time three-dimensional spatial position of the camera based on the relative offset and the height difference, determining the mutual conversion coordinate values of the video image pixels of the camera and the geographic space position based on the real-time three-dimensional attitude and the real-time three-dimensional spatial position, so as to obtain the spatial coordinates of the video image pixels of the camera based on the mutual conversion coordinate values.

[0006] Through the above technical solution, the embodiments of the present application can determine the real-time three-dimensional posture and three-dimensional spatial position by obtaining the actual pitch angle, roll angle, azimuth angle, relative offset, and height difference of the camera, thereby obtaining a positioning result. Through multi-dimensional data fusion, precise positioning is achieved, effectively resolving the problems of traditional methods that rely on external equipment, such as accuracy affected by installation and complicated operation. This improves positioning accuracy, reduces dependence on external equipment, enhances system stability and adaptability, and provides reliable position data support for applications such as video spatialization and surveillance security.

[0007] Optionally, in one embodiment of the present application, before obtaining the actual pitch angle and the actual roll angle of the camera, it also includes: making the coordinate system of the attitude angle sensor parallel or perpendicular to the coordinate system formed by the imaging plane and the optical axis of the camera.

[0008] Through the above technical solution, the embodiments of the present application can set the attitude angle sensor to be parallel or perpendicular to the camera's coordinate system, allowing the attitude angle sensor to accurately sense changes in the camera's attitude. Its specific axis orientation ensures that the actual pitch and roll angles collected accurately reflect the camera's tilt relative to the ground, laying the foundation for subsequent acquisition of accurate camera attitude data.

[0009] Optionally, in one embodiment of the present application, the real-time three-dimensional posture of the camera is obtained according to the azimuth angle, the actual pitch angle and the actual roll angle, including: calculating the azimuth angle of the camera based on the relative offset angle when the camera is installed; the actual pitch angle is the angular deviation of the camera relative to the X-axis of the large ground plane, the actual roll angle is the angular deviation of the camera relative to the Y-axis of the large ground plane, and the azimuth angle is the angular deviation of the camera relative to the Z-axis of the large ground plane, and the real-time three-dimensional posture of the camera is constituted by the angular deviation of the X-axis, the angular deviation of the Y-axis and the angular deviation of the Z-axis.

[0010] Through the above technical solution, the embodiments of the present application can construct a real-time 3D pose by calculating the camera's azimuth angle based on the relative installation offset angle, combining the actual pitch and roll angles as the camera's angular deviations on the X and Y axes relative to the ground plane, respectively, and using the calculated azimuth angle as the Z-axis angular deviation. By fully considering installation factors and the ground plane reference, the real-time pose of the camera in space can be accurately obtained, providing accurate pose data support for the camera's spatial positioning.

[0011] Optionally, in one embodiment of the present application, determining the real-time three-dimensional spatial position of the camera based on the relative offset and the height difference includes: calculating the spatial position of the camera based on the calibrated relative offset of the camera through a geographic coordinate calculation algorithm, wherein the spatial position is the projection position of the camera on the preset plane; measuring the vertical distance between the camera installation position and the preset plane to obtain the height difference; and obtaining the real-time three-dimensional spatial position based on the projection position and the height difference.

[0012] Through the above technical solution, the embodiments of the present application can use a calibrated relative offset and a geographic coordinate calculation algorithm to determine the projected position of a camera on a preset plane, then obtain the height difference by measuring the vertical distance, and finally combine the two to obtain the real-time three-dimensional spatial position. By comprehensively considering the camera's planar position and vertical height information, the calculation process is scientific and rigorous, and can accurately locate the camera's spatial position. This not only avoids the errors caused by relying solely on single data for positioning, but also improves the accuracy and reliability of positioning.

[0013] Optionally, in one embodiment of the present application, determining the mutual conversion coordinate values of the video image pixels of the camera and the geographic space position based on the real-time three-dimensional posture and the real-time three-dimensional spatial position includes: using the data of the real-time three-dimensional posture, combined with a preset correction algorithm, to compensate for the deviation of the azimuth angle; based on the compensated azimuth angle and the real-time three-dimensional spatial position, obtaining the mutual conversion coordinate values of the video image pixels of the camera and the geographic space position.

[0014] Through the above technical solution, the embodiments of the present application can improve positioning accuracy by utilizing real-time 3D posture data combined with a certain correction algorithm to compensate for azimuth deviation, and then determine the coordinate values for the conversion between the camera video image pixels and the geographic spatial position based on the compensated azimuth and the real-time 3D spatial position. Taking into full consideration the fact that the azimuth of the camera is easily affected by various factors and causes deviation in actual use, the algorithm compensation effectively reduces the positioning error caused by the deviation, making the positioning result more consistent with the actual position of the camera, and providing a more reliable data foundation for applications that rely on precise positioning, such as video surveillance and geographic information fusion.

[0015] The second aspect of the present application provides a spatial position positioning device for a camera, including: a first acquisition module, used to obtain the actual pitch angle and actual roll angle of the camera based on the attitude sensor; a second acquisition module, used to obtain the azimuth angle of the camera, and obtain the real-time three-dimensional attitude of the camera based on the azimuth angle, the actual pitch angle and the actual roll angle; a positioning module, used to obtain the relative offset of the camera and the height difference between the camera and a preset plane, and determine the real-time three-dimensional spatial position of the camera based on the relative offset and the height difference, determine the mutual conversion coordinate values of the video image pixels of the camera and the geographic space position based on the real-time three-dimensional attitude and the real-time three-dimensional spatial position, so as to obtain the spatial coordinates of the video image pixels of the camera based on the mutual conversion coordinate values.

[0016] Through the above technical solution, the embodiments of the present application can determine the real-time three-dimensional posture and three-dimensional spatial position by obtaining the actual pitch angle, roll angle, azimuth angle, relative offset, and height difference of the camera, thereby obtaining a positioning result. Through multi-dimensional data fusion, precise positioning is achieved, effectively resolving the problems of traditional methods that rely on external equipment, such as accuracy affected by installation and complicated operation. This improves positioning accuracy, reduces dependence on external equipment, enhances system stability and adaptability, and provides reliable position data support for applications such as video spatialization and surveillance security.

[0017] Optionally, in one embodiment of the present application, before obtaining the actual pitch angle and the actual roll angle of the camera, it also includes: making the coordinate system of the attitude angle sensor parallel or perpendicular to the coordinate system formed by the imaging plane and the optical axis of the camera.

[0018] Through the above technical solution, the embodiments of the present application can set the attitude angle sensor to be parallel or perpendicular to the camera's coordinate system, allowing the attitude angle sensor to accurately sense changes in the camera's attitude. Its specific axis orientation ensures that the actual pitch and roll angles collected accurately reflect the camera's tilt relative to the ground, laying the foundation for subsequent acquisition of accurate camera attitude data.

[0019] Optionally, in one embodiment of the present application, the second acquisition module includes: a first calculation unit, used to calculate the azimuth angle of the camera based on the relative offset angle when the camera is installed; a construction unit, used to use the actual pitch angle as the angular deviation of the camera relative to the X-axis of the large ground plane, the actual roll angle as the angular deviation of the camera relative to the Y-axis of the large ground plane, and the azimuth angle as the angular deviation of the camera relative to the Z-axis of the large ground plane, and to construct the real-time three-dimensional posture of the camera with the angular deviation of the X-axis, the angular deviation of the Y-axis and the angular deviation of the Z-axis.

[0020] Through the above technical solution, the embodiments of the present application can construct a real-time 3D pose by calculating the camera's azimuth angle based on the relative installation offset angle, combining the actual pitch and roll angles as the camera's angular deviations on the X and Y axes relative to the ground plane, respectively, and using the calculated azimuth angle as the Z-axis angular deviation. By fully considering installation factors and the ground plane reference, the real-time pose of the camera in space can be accurately obtained, providing accurate pose data support for the camera's spatial positioning.

[0021] Optionally, in one embodiment of the present application, the positioning module includes: a second calculation unit, used to calculate the spatial position of the camera based on the calibrated relative offset of the camera through a geographic coordinate calculation algorithm, wherein the spatial position is the projection position of the camera on the preset plane; a measuring unit, used to measure the vertical distance between the camera installation position and the preset plane to obtain the height difference; and a third calculation unit, used to obtain the real-time three-dimensional spatial position based on the projection position and the height difference.

[0022] Through the above technical solution, the embodiments of the present application can use a calibrated relative offset and a geographic coordinate calculation algorithm to determine the projected position of a camera on a preset plane, then obtain the height difference by measuring the vertical distance, and finally combine the two to obtain the real-time three-dimensional spatial position. By comprehensively considering the camera's planar position and vertical height information, the calculation process is scientific and rigorous, and can accurately locate the camera's spatial position. This not only avoids the errors caused by relying solely on single data for positioning, but also improves the accuracy and reliability of positioning.

[0023] Optionally, in one embodiment of the present application, the positioning module includes: a compensation unit for compensating for the deviation of the azimuth angle by utilizing the real-time three-dimensional posture data in combination with a preset correction algorithm; and a fourth calculation unit for obtaining the mutual conversion coordinate values of the video image pixels of the camera and the geographic space position based on the compensated azimuth angle and the real-time three-dimensional space position.

[0024] Through the above technical solution, the embodiments of the present application can improve positioning accuracy by utilizing real-time 3D posture data combined with a certain correction algorithm to compensate for azimuth deviation, and then determine the coordinate values for the conversion between the camera video image pixels and the geographic spatial position based on the compensated azimuth and the real-time 3D spatial position. Taking into full consideration the fact that the azimuth of the camera is easily affected by various factors and causes deviation in actual use, the algorithm compensation effectively reduces the positioning error caused by the deviation, making the positioning result more consistent with the actual position of the camera, and providing a more reliable data foundation for applications that rely on precise positioning, such as video surveillance and geographic information fusion.

[0025] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the spatial positioning method of a camera as described in the above embodiment.

[0026] A fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned method for spatial positioning of a camera.

[0027] A fifth aspect of the present application provides a computer program product, including a computer program, which is executed to implement the above-mentioned method for spatial positioning of a camera.

[0028] The embodiments of the present application can obtain multi-dimensional data such as actual pitch angle, roll angle, azimuth angle, relative offset and height difference, and determine the real-time three-dimensional posture and three-dimensional spatial position through fusion, and then obtain the positioning result. In the data acquisition link, the posture angle sensor and the camera-related coordinate system are set to be parallel or perpendicular, so that the sensor can accurately sense the posture changes and accurately collect the pitch angle and roll angle that reflect the tilt of the camera relative to the horizontal plane of the earth, laying the foundation for obtaining accurate posture data. When calculating the real-time three-dimensional posture, the azimuth angle is calculated based on the installation relative offset angle, and the three-dimensional posture is constructed by combining the angular deviation relative to the earth plane on the X, Y, and Z axes. The installation factors and the earth plane reference are fully considered to provide accurate posture data support for positioning. In terms of determining the real-time three-dimensional spatial position, the calibrated relative offset and geographic coordinate calculation algorithm are used to obtain the projection position on the plane, and combined with the measured vertical height difference, scientific and rigorous precise positioning is achieved. Finally, by using real-time three-dimensional posture data combined with a correction algorithm to compensate for azimuth deviation, the final positioning result is determined based on the compensated azimuth and three-dimensional spatial position, effectively reducing positioning errors and providing a more reliable data foundation for applications such as video surveillance and geographic information fusion, greatly improving positioning accuracy.

[0029] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0031] Figure 1 This is a flow chart of a method for spatial positioning of a camera provided in accordance with an embodiment of the present application;

[0032] Figure 2A schematic diagram of an XYZ coordinate system after the attitude angle sensor is installed according to a specific embodiment of the present application;

[0033] Figure 3 This is a schematic diagram of the camera installation position according to a specific embodiment of the present application;

[0034] Figure 4 Schematic diagram of the structure of a spatial position positioning device for a camera provided according to an embodiment of the present application;

[0035] Figure 5 This is a diagram illustrating an example structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0037] The following describes the spatial position positioning method and device of the camera of the embodiment of the present application with reference to the accompanying drawings. In view of the related technologies mentioned in the above background technology, traditional cameras rely on external posture acquisition equipment to determine the posture, which has problems such as low accuracy, complicated operation and high maintenance cost. The present application provides a spatial position positioning method for a camera. In this method, the real-time three-dimensional posture and three-dimensional spatial position of the camera can be determined by obtaining the actual pitch angle, roll angle, azimuth, relative offset and height difference of the camera, and then the positioning result is obtained. Accurate positioning is achieved by multi-dimensional data fusion, which effectively solves the problems of the accuracy being affected by installation and complicated operation caused by the traditional method relying on external equipment, improves positioning accuracy, reduces dependence on external equipment, enhances system stability and adaptability, and provides reliable position data support for applications such as video spatialization, monitoring and security. As a result, the problem of traditional cameras relying on external posture acquisition equipment to determine the posture in the related technology, which has low accuracy, complicated operation and high maintenance cost, is solved.

[0038] Specifically, Figure 1 A schematic flow chart of a method for spatially locating a camera provided in an embodiment of the present application.

[0039] like Figure 1 As shown, the spatial position positioning method of the camera includes the following steps:

[0040] In step S101 , the actual pitch angle and actual roll angle of the camera are acquired based on the attitude sensor.

[0041] It should be noted that conventional cameras do not have integrated attitude and angle sensors. The embodiment of the present application integrates attitude and angle sensors into conventional cameras to solve many problems faced by conventional cameras in actual application scenarios.

[0042] Specifically, in one embodiment of the present application, before obtaining the actual pitch angle and actual roll angle of the camera, it also includes: making the coordinate system of the attitude angle sensor parallel or perpendicular to the coordinate system formed by the imaging plane and optical axis of the camera.

[0043] It is understood that the attitude angle sensor is a device that has been precisely calibrated and can obtain high-precision pitch X and roll Y angle values of the module relative to the ground level in real time at high speed. It is precisely calibrated at the factory. During the installation process, it is necessary to ensure that the attitude angle sensor XYZ coordinate system is as parallel or perpendicular as possible to the coordinate system formed by the camera imaging plane (image center) and the optical axis. The X-axis direction of the attitude angle sensor is parallel or perpendicular to the optical axis of the camera, and the Y-axis direction is perpendicular or parallel to the optical axis. Figure 2 As shown, both horizontal and vertical installation modes are provided, which will not affect the accuracy and is only considered for the convenience of the component layout of the improved camera.

[0044] Furthermore, based on the above-mentioned installation layout and attitude angle sensor, the pitch angle and roll angle of the camera in Euler angle are obtained in real time. The pitch angle relative to the ground is obtained by rotating the X-axis around the Y-axis, and the roll angle relative to the ground is obtained by rotating the Y-axis around the X-axis.

[0045] The embodiments of the present application can integrate an attitude angle sensor into a conventional camera, arranging its coordinate system parallel or perpendicular to the coordinate system formed by the camera's imaging plane and optical axis. This not only utilizes the attitude angle sensor's ability to acquire high-precision pitch and roll angles in real time at high speed, but also provides both horizontal and vertical mounting options for convenient component placement, ensuring that the acquired angles accurately reflect the camera's attitude changes relative to the ground plane. This provides reliable and accurate basic data for determining the camera's real-time three-dimensional attitude, effectively resolving the problem of conventional cameras being unable to acquire their own attitude data and improving the camera's performance and adaptability in practical application scenarios.

[0046] In step S102, the azimuth angle of the camera is acquired, and the real-time three-dimensional posture of the camera is obtained according to the azimuth angle, the actual pitch angle and the actual roll angle.

[0047] It can be understood that the posture of the camera includes azimuth, pitch and roll angles, among which the azimuth angle is the angle formed by rotating clockwise from east to south to west with due north as the starting point at 0°, that is, the angle of the camera coordinate system X-axis direction around the Z-axis; the pitch angle is the angle of the camera coordinate system X-axis rotation around the Y-axis, and the angle formed with the horizontal plane of the earth; the roll angle is the angle of the camera coordinate system Y-axis rotation around the X-axis, and the angle formed with the horizontal plane of the earth.

[0048] Optionally, in one embodiment of the present application, the real-time three-dimensional posture of the camera is obtained according to the azimuth angle, the actual pitch angle and the actual roll angle, including: calculating the azimuth angle of the camera based on the relative offset angle when the camera is installed; the actual pitch angle is the angular deviation of the camera relative to the X-axis of the large ground plane, the actual roll angle is the angular deviation of the camera relative to the Y-axis of the large ground plane, and the azimuth angle is the angular deviation of the camera relative to the Z-axis of the large ground plane, and the real-time three-dimensional posture of the camera is constituted by the angular deviation of the X-axis, the angular deviation of the Y-axis and the angular deviation of the Z-axis.

[0049] Specifically, during camera installation, a relative offset angle exists due to its relative position to the carrier. This angle is crucial for calculating the azimuth angle. A specific calculation method takes this relative offset angle into account to calculate the camera's azimuth angle in the current environment. For example, when using the heading angle output by an external GNSS device, the device uses satellite positioning technology to obtain the carrier's heading information. The angle between this heading information and true north is the heading angle. However, due to differences in the installation position and orientation of the camera and the GNSS device, the heading angle must be adjusted and converted based on the relative relationship between the two and the camera's installation posture to determine the camera's actual azimuth angle. Similarly, the heading angle output by a compass device, which indicates the direction of the ship's bow, also requires considering the relative position and posture of the camera and the compass device for appropriate conversion calculations. Calibrated fixed azimuth angles are suitable for non-moving carriers or specific installation scenarios. During installation, the angle relative to a fixed direction is pre-determined. This fixed angle, combined with the camera's installation conditions, is then used to calculate the actual azimuth angle.

[0050] Furthermore, according to the correspondence between the actual pitch angle, the actual roll angle and the azimuth angle and the coordinate axes of the geodetic plane, the three angle deviations are combined to form the real-time three-dimensional posture of the camera.

[0051] When acquiring azimuth angles, the embodiments of the present application fully consider the relative offset angle between the camera and the mounting surface during installation. For different azimuth angle acquisition sources, precise adjustments and conversions are performed based on the relative position and posture of the camera and the corresponding device, ensuring that the acquired azimuth angle accurately reflects the camera's actual orientation. Furthermore, the actual pitch angle, actual roll angle, and calculated azimuth angle are used to construct a real-time 3D posture, which comprehensively and accurately describes the camera's posture in space.

[0052] In step S103, the relative offset of the camera and the height difference between the camera and the preset plane are obtained, and the real-time three-dimensional spatial position of the camera is determined based on the relative offset and the height difference. The mutual conversion coordinate values of the video image pixels of the camera and the geographic space position are determined according to the real-time three-dimensional posture and the real-time three-dimensional spatial position, so as to obtain the spatial coordinates of the video image pixels of the camera based on the mutual conversion coordinate values.

[0053] In actual application scenarios, due to cost considerations, the camera itself does not integrate the GNSS global positioning system. However, if you want to accurately locate the position of the video image pixels, it is particularly important to determine the exact position of the camera. For details, please refer to Figure 3 When the camera is installed on a moving carrier, the carrier itself is usually equipped with a GNSS device. In this case, the spatial position information of the carrier can be directly obtained; for a fixed carrier, only the spatial position of the camera installation location needs to be measured.

[0054] The embodiment of the present application can calculate the spatial position positioning results of the camera's video image pixels based on the computer vision observer model and perspective projection imaging theory, that is, the mutual conversion coordinate values of the video image pixels and the geographic space positions, so as to obtain the pixel address, that is, the spatial coordinate, after the camera observes the external world and forms an image.

[0055] Optionally, in one embodiment of the present application, the real-time three-dimensional spatial position of the camera is determined based on the relative offset and the height difference, including: based on the calibrated relative offset of the camera, calculating the spatial position of the camera through a geographic coordinate calculation algorithm, the spatial position being the projection position of the camera on a preset plane; measuring the vertical distance between the camera installation position and the preset plane to obtain the height difference; and obtaining the real-time three-dimensional spatial position based on the projection position and the height difference.

[0056] It is understood that the relative offset of a camera is precisely calibrated after installation through a series of professional measurement and calibration methods. It reflects the camera's positional deviation relative to a known reference point or reference coordinate system. The geographic coordinate calculation algorithm is a complex calculation method based on mathematical models and geospatial principles. Based on known geographic coordinate information and combined with the calibrated relative offset of the camera, it gradually derives the projected position of the camera on a plane through mathematical operations. The plane is usually a plane with a clear geographical meaning, such as the ground or a specific monitoring plane, which is pre-set based on the actual application scenario and requirements. During the actual calculation process, the algorithm can take into account the influence of geographical factors such as the curvature of the earth and the undulations of the terrain on the coordinate calculation to ensure the accuracy and reliability of the calculation results.

[0057] After completing the calculation of the projection position of the camera on the plane, it is necessary to measure the vertical distance between the camera installation position and the plane to obtain the height difference. In the embodiment of the present application, considering that the subsequent calculation uses the relative height relative to the ground or water surface, and the accuracy of the elevation output by GNSS itself is poor, a more reliable method is adopted. The relative height difference is set by calibrating the lowest point of the carrier as the zero elevation point. For example, for a vehicle carrier, the bottom of the wheel can be used as the zero elevation point; for a ship carrier, the bottom of the ship is generally used as the zero elevation point, but due to the particularity of the bottom of the ship when traveling on the water, the draft of the ship needs to be considered. At this time, the height of the camera relative to the water surface is the set installation height minus the draft of the ship; for a fixed carrier, it is only necessary to select a relatively flat point on the site as the zero elevation point, and then measure the height value of the camera installation position relative to this point.

[0058] Furthermore, by combining the derived projection position and height difference of the camera on the plane, these key information are integrated to determine the real-time three-dimensional spatial position of the camera. For example, assuming that the coordinates of the projection position in the plane rectangular coordinate system are (X P ,Y P ), the height difference between the camera installation position and the plane is H. A three-dimensional rectangular coordinate system is constructed based on the plane. In this Orthogonal coordinate system, the Z axis is perpendicular to the plane and the upward direction is the positive direction. The real-time three-dimensional spatial position coordinates of the camera can be obtained as (X, Y, Z), where X = X P , Y=Y P , Z=H, that is, the horizontal coordinate and vertical coordinate of the projection position are directly used as the horizontal coordinate component of the camera in the three-dimensional space, and the height difference is used as the coordinate component in the vertical direction.

[0059] Optionally, in one embodiment of the present application, the mutual conversion coordinate values of the camera's video image pixels and the geographic space position are determined based on the real-time three-dimensional posture and the real-time three-dimensional spatial position, including: using the real-time three-dimensional posture data in combination with a preset correction algorithm to compensate for the azimuth deviation; based on the compensated azimuth and the real-time three-dimensional spatial position, obtaining the mutual conversion coordinate values of the camera's video image pixels and the geographic space position.

[0060] Specifically, after acquiring real-time 3D pose data, the azimuth angle can be input into the correction algorithm. The correction algorithm comprehensively analyzes the input azimuth angle based on a series of parameters and logic. For example, the algorithm may reference the camera's historical pose data and compare azimuth angle trends over different time periods to determine whether the current azimuth angle exhibits abnormal fluctuations. Furthermore, the algorithm can combine real-time pitch and roll angle data, utilizing spatial geometry and kinematic principles, to comprehensively assess the accuracy of the azimuth angle. If the algorithm detects an azimuth angle deviation, it calculates a corresponding compensation value based on the predefined compensation rules to correct the azimuth angle deviation.

[0061] Furthermore, by combining the real-time three-dimensional posture of the camera obtained in step 102, the camera's orientation in the horizontal plane is determined by the azimuth angle, the camera's tilt state in the vertical plane is determined by the actual pitch angle and actual roll angle, and the real-time spatial position obtained in step S103, the camera's position and posture can be accurately described. Based on computer vision theory, the coordinate values for the mutual conversion between the camera's full-scene video image pixels and the geographic spatial position can be calculated. By applying relevant data models and algorithms, the camera's posture information, spatial information, and video image pixel information can be deeply integrated and calculated to achieve a precise conversion from video image pixels to geographic spatial positions, and vice versa. This mutually converted coordinate value has extremely high application value, allowing the video image captured by the camera to be closely integrated with the actual geographic spatial position, and has broad application prospects in many fields such as video surveillance, geographic information systems, intelligent transportation, and virtual reality.

[0062] The embodiments of the present application can adopt a reasonable method to obtain basic information about the camera position based on the different characteristics of moving or fixed carriers. When determining the real-time three-dimensional spatial position, the calibrated relative offset is combined with the geographic coordinate calculation algorithm to accurately calculate the plane projection position. At the same time, the height difference is measured through a reliable zero-elevation point calibration method, and the two are cleverly integrated to obtain a high-precision three-dimensional spatial position. When obtaining the coordinate values of the mutual conversion between video image pixels and geographic spatial positions, the correction algorithm is used to comprehensively analyze and compensate for azimuth deviation based on the camera's historical posture data and real-time pitch and roll angle data to improve positioning accuracy. Ultimately, combining real-time three-dimensional posture and spatial position can not only accurately describe the camera state, but also realize the precise mutual conversion between video image pixels and geographic spatial positions based on computer vision theory. This lays a solid foundation for applications in many fields, such as accurate tracking of targets in video surveillance, integration of video content in geographic information systems, precise navigation of intelligent transportation vehicles, and providing realistic scenes in virtual reality, greatly enhancing the system's adaptability, reliability, and practicality.

[0063] The spatial positioning method for a camera proposed in the embodiments of this application can determine the real-time three-dimensional posture and three-dimensional spatial position of the camera by acquiring its actual pitch, roll, azimuth, relative offset, and height difference, thereby obtaining a positioning result. This multi-dimensional data fusion achieves precise positioning, effectively resolving issues such as the accuracy impacted by installation and complex operation caused by traditional methods that rely on external equipment. This improves positioning accuracy, reduces reliance on external equipment, enhances system stability and adaptability, and provides reliable position data support for applications such as video spatialization and surveillance security.

[0064] Next, the spatial positioning device for a camera according to an embodiment of the present application will be described with reference to the accompanying drawings.

[0065] Figure 4 Schematic diagram of a block diagram of a spatial positioning device for a camera according to an embodiment of the present application.

[0066] like Figure 4 As shown, the spatial position positioning device 10 of a camera includes: a first acquisition module 100 , a second acquisition module 200 and a positioning module 300 .

[0067] Specifically, the first acquisition module 100 is configured to acquire an actual pitch angle and an actual roll angle of the camera based on a posture sensor.

[0068] The second acquisition module 200 is used to acquire the azimuth angle of the camera and obtain the real-time three-dimensional posture of the camera according to the azimuth angle, the actual pitch angle and the actual roll angle.

[0069] The positioning module 300 is used to obtain the relative offset of the camera and the height difference between the camera and a preset plane, and determine the real-time three-dimensional spatial position of the camera based on the relative offset and the height difference. According to the real-time three-dimensional posture and the real-time three-dimensional spatial position, the mutually converted coordinate values of the video image pixels of the camera and the geographic space position are determined to obtain the spatial coordinates of the video image pixels of the camera based on the mutually converted coordinate values.

[0070] Optionally, in one embodiment of the present application, before obtaining the actual pitch angle and actual roll angle of the camera, the method further includes: making the coordinate system of the attitude angle sensor parallel or perpendicular to the coordinate system formed by the imaging plane and optical axis of the camera.

[0071] Optionally, in one embodiment of the present application, the second acquisition module 200 includes: a first calculation unit and a composition unit.

[0072] The first calculation unit is used to calculate the azimuth angle of the camera based on the relative offset angle when the camera is installed.

[0073] The composition unit is used to use the actual pitch angle as the angular deviation of the camera's X axis relative to the ground plane, the actual roll angle as the angular deviation of the camera's Y axis relative to the ground plane, and the azimuth angle as the angular deviation of the camera's Z axis relative to the ground plane, and to construct the real-time three-dimensional posture of the camera with the angular deviation of the X axis, the angular deviation of the Y axis, and the angular deviation of the Z axis.

[0074] Optionally, in one embodiment of the present application, the positioning module 300 includes: a second calculation unit, a measurement unit, and a third calculation unit.

[0075] The second calculation unit is used to calculate the spatial position of the camera based on the relative offset of the calibrated camera through a geographic coordinate calculation algorithm, where the spatial position is the projection position of the camera on a preset plane.

[0076] The measuring unit is used to measure the vertical distance between the camera installation position and the preset plane to obtain the height difference.

[0077] The third calculation unit is used to obtain a real-time three-dimensional spatial position based on the projection position and the height difference.

[0078] Optionally, in one embodiment of the present application, the positioning module 300 includes: a compensation unit and a fourth calculation unit.

[0079] The compensation unit is used to compensate for the deviation of the azimuth angle by utilizing the real-time three-dimensional posture data in combination with a preset correction algorithm.

[0080] The fourth calculation unit is used to obtain the mutual conversion coordinate value between the video image pixels of the camera and the geographic space position based on the compensated azimuth angle and the real-time three-dimensional space position.

[0081] It should be noted that the above explanation of the embodiment of the method for spatially locating the position of a camera is also applicable to the device for spatially locating the position of a camera in this embodiment, and will not be repeated here.

[0082] The spatial positioning device for a camera, as proposed in the embodiments of this application, can determine the real-time three-dimensional posture and three-dimensional spatial position of the camera by acquiring its actual pitch, roll, azimuth, relative offset, and height difference, thereby obtaining a positioning result. This multi-dimensional data fusion achieves precise positioning, effectively resolving issues such as the accuracy impact of installation and complex operation caused by traditional methods that rely on external equipment. This improves positioning accuracy, reduces reliance on external equipment, enhances system stability and adaptability, and provides reliable position data support for applications such as video spatialization and surveillance security.

[0083] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0084] Memory 501 , processor 502 , and computer programs stored in the memory 501 and executable on the processor 502 .

[0085] When the processor 502 executes the program, the spatial position positioning method of the camera provided in the above embodiment is implemented.

[0086] Furthermore, the electronic device further includes:

[0087] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0088] The memory 501 is used to store computer programs that can be run on the processor 502 .

[0089] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0090] If the memory 501, processor 502, and communication interface 503 are implemented independently, the communication interface 503, memory 501, and processor 502 can be interconnected via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0091] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0092] The processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0093] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for spatial positioning of a camera.

[0094] An embodiment of the present application further provides a computer program product, including a computer program, which is executed to implement the above-mentioned method for spatial positioning of a camera.

[0095] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0096] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0097] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing a custom logical function or process step, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed in a different order than shown or discussed, including performing functions in a substantially simultaneous manner or in a reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application pertain.

[0098] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or N wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program can be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing it in other suitable ways as necessary, and then storing it in a computer memory.

[0099] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented using hardware, as in another embodiment, it can be implemented using any one or a combination of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0100] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0101] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0102] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A method for spatial positioning of a camera, characterized in that: The camera is integrated with a gesture sensor, wherein the method comprises the following steps: Based on the attitude sensor, obtaining the actual pitch angle and actual roll angle of the camera; Acquiring the azimuth angle of the camera, and obtaining the real-time three-dimensional posture of the camera according to the azimuth angle, the actual pitch angle, and the actual roll angle; Obtain a relative offset of the camera and a height difference from a preset plane, determine a real-time three-dimensional spatial position of the camera based on the relative offset and the height difference, determine mutually converted coordinate values between video image pixels of the camera and geographic spatial positions based on the real-time three-dimensional posture and the real-time three-dimensional spatial position, and obtain spatial coordinates of the video image pixels of the camera based on the mutually converted coordinate values.

2. The method according to claim 1, characterized in that Before obtaining the actual pitch angle and the actual roll angle of the camera, the method further includes: The coordinate system of the attitude angle sensor is made parallel or perpendicular to the coordinate system formed by the imaging plane and the optical axis of the camera.

3. The method according to claim 1, characterized in that Obtaining the real-time three-dimensional posture of the camera according to the azimuth angle, the actual pitch angle, and the actual roll angle includes: Calculating the azimuth angle of the camera based on the relative offset angle when the camera is installed; The actual pitch angle is the angular deviation of the camera relative to the X-axis of the ground plane, the actual roll angle is the angular deviation of the camera relative to the Y-axis of the ground plane, and the azimuth angle is the angular deviation of the camera relative to the Z-axis of the ground plane. The real-time three-dimensional posture of the camera is composed of the angular deviation of the X-axis, the angular deviation of the Y-axis, and the angular deviation of the Z-axis.

4. The method according to claim 1, wherein Determining the real-time three-dimensional spatial position of the camera based on the relative offset and the height difference includes: Based on the calibrated relative offset of the camera, the spatial position of the camera is calculated by a geographic coordinate calculation algorithm, where the spatial position is the projection position of the camera on the preset plane; Measuring a vertical distance between the camera installation position and the preset plane to obtain the height difference; The real-time three-dimensional spatial position is obtained based on the projection position and the height difference.

5. The method according to claim 1, wherein The step of determining the conversion coordinate values between the video image pixels of the camera and the geographic space position according to the real-time three-dimensional posture and the real-time three-dimensional space position includes: Using the real-time three-dimensional posture data in combination with a preset correction algorithm, the deviation of the azimuth angle is compensated; Based on the compensated azimuth angle and the real-time three-dimensional spatial position, the coordinate values of the mutual conversion between the video image pixels of the camera and the geographic spatial position are obtained.

6. A spatial positioning device for a camera, characterized in that: The camera is integrated with a posture sensor, wherein the device includes: A first acquisition module is used to acquire an actual pitch angle and an actual roll angle of the camera based on the attitude sensor; a second acquisition module, configured to acquire the azimuth angle of the camera, and obtain a real-time three-dimensional posture of the camera according to the azimuth angle, the actual pitch angle, and the actual roll angle; A positioning module is used to obtain a relative offset of the camera and a height difference from a preset plane, determine the real-time three-dimensional spatial position of the camera based on the relative offset and the height difference, determine the mutually converted coordinate values of the video image pixels of the camera and the geographic spatial position based on the real-time three-dimensional posture and the real-time three-dimensional spatial position, and obtain the spatial coordinates of the video image pixels of the camera based on the mutually converted coordinate values.

7. The device according to claim 6, characterized in that Before obtaining the actual pitch angle and the actual roll angle of the camera, the method further includes: The coordinate system of the attitude angle sensor is made parallel or perpendicular to the coordinate system formed by the imaging plane and the optical axis of the camera.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the spatial positioning method of a camera with an integrated attitude sensor according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the spatial position positioning method of a camera according to any one of claims 1 to 5.

10. A computer program product comprising a computer program, characterized in that The computer program is executed to implement the method for spatial positioning of a camera according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Real-time spatial positioning method for mobile monitoring target in geographical scene

    CN103226838A

  • Imaging method for aerial camera, and system thereof

    CN104835115A

  • Automatic registration method and device for unmanned aerial vehicle images and electronic device

    CN110176030A

  • Target positioning method based on synthetic vision

    CN112184786A

  • Method and equipment for acquiring image position information of target object

    CN115439528A