Panorama coordinate and WGS84 latitude and longitude mapping parameter calculation method and system
By partitioning the panoramic map and setting marking points, the mapping parameters of the panoramic coordinates to Mercator coordinates are calculated, and the accurate acquisition of the panoramic map and latitude and longitude mapping relationship is solved, and accurate positioning and dynamic monitoring of the panoramic map are realized.
Patent Information
- Application Number
- CN202411575778.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-11
AI Technical Summary
Existing technologies are difficult to accurately obtain the relationship between panoramic maps and latitude and longitude mapping, especially under complex changes such as cropping, rotation, shear, etc. of the image during image stitching, it is impossible to effectively correct geometric distortion, resulting in failure of mapping parameters.
By partitioning the panorama by angle range, setting several marking points, recording their panoramic coordinates, and obtaining their corresponding WGS84 latitude and longitude coordinates, converting them into Mercator coordinates, and calculating the mapping parameters of the panoramic coordinates to Mercator coordinates, combining the relationship between Mercator coordinates and WGS84 latitude and longitude coordinates, the conversion of panoramic coordinates to WGS84 latitude and longitude coordinates is completed.
Eliminate the influence of geometric distortion during panoramic image imaging, accurately obtain the WGS84 latitude and longitude coordinates corresponding to the panoramic image coordinates, and realize the accurate positioning of panoramic images such as airports.
Smart Images

Figure CN119600069A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image positioning, and in particular to a method for calculating panoramic image coordinates and latitude and longitude mapping parameters. Background Art
[0002] For targets on the ground, when the camera remains stationary and the focal length is fixed, there is a one-to-one correspondence between the latitude and longitude coordinates of the target and the pixels on the image. The above relationship can be obtained by calculating the homography matrix. At least four sets of corresponding points are needed to calculate the mapping parameters, and then obtain the mapping relationship between the image coordinates and the latitude and longitude coordinates of the target.
[0003] At present, infrared panoramic perimeter security systems can be used as a technical means to prevent intrusion in the perimeter protection of important places such as airports, prisons, power stations, and camps. The airport runway and taxiway anti-intrusion systems mostly use multiple visible light / infrared cameras to monitor designated areas and detect moving targets entering the area.
[0004] However, for panoramas, since the images undergo complex changes such as cropping, rotation, and shearing during the image stitching process, it is impossible to express the mapping relationship between the coordinates and longitude and latitude in the entire panorama in the form of a single analytical expression. In addition, various geometric distortions (radial distortion, tangential distortion, etc.) in the imaging process are often difficult to completely correct in practice, which will lead to the failure of mapping parameters and the inability to accurately obtain the mapping relationship between the panorama coordinates and the longitude and latitude coordinates. Summary of the invention
[0005] The present invention provides a method and system for calculating panoramic map coordinates and WGS84 longitude and latitude mapping parameters, so as to solve the existing problem that the relationship between the airport panoramic map and the longitude and latitude mapping cannot be accurately obtained.
[0006] In order to achieve the above object, the present invention is implemented by the following technical solutions: In a first aspect, the present invention provides a method for calculating panoramic coordinates and WGS84 latitude and longitude mapping parameters, comprising the following steps: Step 1: Obtain a panoramic view of the monitored area through a panoramic camera, and divide the panoramic view into different areas according to the angle range; Step 2: Select one of the partitions in the panorama to set a number of marker points, and record the panorama coordinates of the marker points; Step 3: Obtain the WGS84 longitude and latitude coordinates corresponding to the landmark point, and convert the WGS84 longitude and latitude coordinates into Mercator coordinates; Step 4: Calculate the first mapping parameter of the panoramic coordinates to the Mercator coordinates, obtain the first conversion formula between the panoramic coordinates and the Mercator coordinates from the first mapping parameter, and complete the conversion of the panoramic coordinates of the selected partition to the WGS84 longitude and latitude coordinates by combining the coordinate relationship between the Mercator coordinates and the WGS84 longitude and latitude coordinates.
[0007] Furthermore, the method further includes step 5: selecting other partitions in the panoramic view and repeating steps 2 to 4 to complete the conversion of the panoramic view coordinates of other partitions into WGS84 longitude and latitude coordinates.
[0008] Furthermore, it also includes step 6: selecting a target point, determining the panoramic coordinates of the target point according to the WGS84 longitude and latitude coordinates of the target point, determining the corresponding partition of the target point in the panorama according to the panoramic coordinates of the target point, converting the WGS84 longitude and latitude coordinates of the target point into Mercator coordinates, and calculating the second mapping parameters of the Mercator coordinates of the partition to the panoramic coordinates, obtaining the second conversion formula between the Mercator coordinates of the target point and the panoramic coordinates, and completing the conversion of the WGS84 longitude and latitude coordinates of the target point to the panoramic coordinates.
[0009] Furthermore, the number of the marking points is greater than or equal to 6 and at least 3 of the marking points are not collinear.
[0010] Further, the calculating the first mapping parameter from the panoramic coordinates to the Mercator coordinates includes: constructing a first calculation matrix based on the panoramic coordinates, constructing a second calculation matrix based on the Mercator coordinates, and calculating the first mapping parameter according to the first calculation matrix and the second calculation matrix; The calculation of the first mapping parameter according to the first calculation matrix and the second calculation matrix is expressed as the following formula: ; in, represents the first calculation matrix, represents the second calculation matrix, represents the first mapping parameter, and the marker ; The first calculation matrix The expression is: ; in, For the Mercator coordinates of the calibration points; For the extracted The first of the calibration points The image coordinates of the calibration points; The second calculation matrix The expression is: .
[0011] Furthermore, the first conversion formula is expressed as: ; ; in, , , , , , Both are first mapping parameters.
[0012] Further, the second mapping parameters from Mercator coordinates to panoramic coordinates include: constructing a third calculation matrix based on Mercator coordinates, constructing a fourth calculation matrix based on panoramic coordinates, and calculating the second mapping parameters according to the third calculation matrix and the fourth calculation matrix; The calculation of the second mapping parameter according to the third calculation matrix and the fourth calculation matrix is expressed as the following formula: ; in, represents the second mapping parameter; represents the third calculation matrix; represents the fourth calculation matrix; and the marker ; The third calculation matrix The expression is: ; The fourth calculation matrix The expression is: .
[0013] Furthermore, the second conversion formula is expressed as: ; ; in, , , , , , Both are second mapping parameters.
[0014] In a second aspect, an embodiment of the present application provides a computing system for panoramic coordinates and longitude and latitude mapping parameters, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-described methods when executing the computer program.
[0015] Beneficial effects: The present invention provides a method for calculating panoramic coordinates and WGS84 longitude and latitude mapping parameters. The method adopts a panoramic partitioning method to calculate the mapping parameters of each partition, and obtains the panoramic coordinates and WGS84 longitude and latitude coordinates by manually selecting a number of marking points. The first mapping parameters of the panoramic coordinates and the WGS84 longitude and latitude coordinates are further obtained, eliminating the influence of various geometric distortions in the panoramic imaging process, and accurately obtaining the WGS84 longitude and latitude coordinates corresponding to the panoramic coordinates.
[0016] In the preferred scheme of the present invention, dynamic targets that frequently enter and exit the monitoring area need to be marked. By obtaining the second mapping parameters of the Mercator coordinates and panoramic coordinates of the area, the panoramic coordinates corresponding to the WGS84 longitude and latitude coordinates of the target are further obtained to realize dynamic monitoring and signage processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 The present invention is a flowchart of a method for calculating panoramic coordinates and WGS84 longitude and latitude mapping parameters according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0018] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0020] See also Figure 1 The present application embodiment provides a method for calculating panoramic coordinates and WGS84 latitude and longitude mapping parameters. In this embodiment, the application scenario is a panoramic camera set up at an airport, including the following steps: Step 1: Obtain a panoramic view of the monitored area through a panoramic camera and divide the panoramic view into different areas according to the angle range; In this embodiment, the panoramic camera covers an angle of 360 degrees, and the panoramic image is divided into 6 areas with 60 degrees as the boundary. In other embodiments, the division angle can be adjusted according to the coverage angle of the panoramic camera.
[0021] Step 2: Select one of the partitions in the panorama to set several marker points, and record the panorama coordinates of the marker points; During implementation, 7 marker points are set in the selected area, and the panoramic coordinates of the 7 marker points are recorded. In other embodiments, the number of marker points needs to be greater than or equal to 6 and at least 3 marker points are not collinear.
[0022] The following are the panoramic coordinates of the 7 landmarks recorded: Landmark point 1: (1864,379); Landmark point 2: (2927,345); Landmark point 3: (2405,301); Landmark point 4: (2991,297); Landmark point 5: (2540,287); Landmark point 6: (3034,278); Landmark point 7: (2673,267); Step 3: Obtain the WGS84 longitude and latitude coordinates corresponding to the landmark point, and convert the WGS84 longitude and latitude coordinates into Mercator coordinates; The WGS84 longitude and latitude coordinates corresponding to the above 7 landmarks are obtained through the latitude and longitude meter. The following are the WGS84 longitude and latitude coordinates of the 7 landmarks: Landmark point 1: (X.9935, X.5378); Landmark point 2: (X.9937, X.5376); Landmark point 3: (X.9939, X.5378); Landmark point 4: (X.9940, X.5376); Landmark point 5: (X.9941, X.5378); Landmark point 6: (X.9943, X.5377); Landmark point 7: (X.9943, X.5378); The WGS84 longitude and latitude coordinates of the above 7 landmarks are converted into Mercator coordinates as shown below: Landmark point 1: (6938,5374); Landmark point 2: (6917,5394); Landmark point 3: (6938,5415); Landmark point 4: (6919,5424); Landmark point 5: (6937,5428); Landmark point 6: (6921,5444); Landmark point 7: (6937,5449); Step 4: Calculate the first mapping parameter of the panoramic coordinates to the Mercator coordinates, obtain the first conversion formula between the panoramic coordinates and the Mercator coordinates from the first mapping parameter, and complete the conversion of the panoramic coordinates of the selected partition to the WGS84 longitude and latitude coordinates by combining the coordinate relationship between the Mercator coordinates and the WGS84 longitude and latitude coordinates.
[0023] Specifically, the first calculation matrix is constructed based on the panoramic coordinates , construct the second calculation matrix based on Mercator coordinates , calculate the first mapping parameter according to the first calculation matrix and the second calculation matrix ; First calculate the matrix The expression is: ; in, For the Mercator coordinates of the calibration points; For the extracted The first of the calibration points The image coordinates of the calibration points; The second calculation matrix The expression is: ; exist, ; Order marker , solve the following formula to obtain the first mapping parameter : ; ; in, Indicates that the first mapping parameter The first parameter matrix constructed; ; The first conversion formula is expressed as: ; ; in, , , , , , Both are first mapping parameters.
[0024] Based on the above, the mapping parameters of the panoramic coordinates to the WGS84 longitude and latitude coordinates are: -0.267145731794, -1.997511049702, -0.000456362222, 3.211212216674, 24.016540488004, 0.005487127782585.690568474826, 4377.123438498250, 1.0000000000000.
[0025] The eighth marker point was set, and the above mapping parameters were verified according to the WGS84 latitude and longitude coordinates (X.9945, X.5377) of the eighth marker point and the panoramic coordinates (3070, 265). The positioning error was 28.8 meters, which is much better than the positioning accuracy based on plane constraints.
[0026] In other embodiments, step 5 is also included: selecting other partitions in the panoramic view and repeating steps 2 to 4 to complete the conversion of the panoramic view coordinates of other partitions and the WGS84 longitude and latitude coordinates.
[0027] Step 5 can be used to complete the conversion of the panoramic coordinates of other partitions into WGS84 longitude and latitude coordinates to achieve full-angle positioning.
[0028] In this embodiment, step 6 is also included: selecting a target point, calculating the Mercator coordinates of the target point, determining the corresponding partition in the panorama according to the WGS84 longitude and latitude coordinates of the target point, setting a marker point to calculate the second mapping parameters of the Mercator coordinates of the partition to the panoramic coordinates, and obtaining the second conversion formula between the WGS84 longitude and latitude coordinates of the target point and the panoramic coordinates.
[0029] Specifically, the third calculation matrix is constructed based on Mercator coordinates , construct the fourth calculation matrix based on the panoramic coordinates , calculate the second mapping parameter according to the third calculation matrix and the fourth calculation matrix ; The third calculation matrix The expression is: ; Fourth calculation matrix The expression is: ; exist, ; Order marker , solve the following formula to obtain the second mapping parameter : ; ; in, Indicated by the second mapping parameter The second parameter matrix constructed; ; The second conversion formula is expressed as: ; 。
[0030] Based on the above formula, the accuracy of the license plates for vehicles entering and leaving the airport was tested. For vehicles entering the image, their coordinates in the panoramic image were calculated based on the vehicle's real-time WGS84 longitude and latitude coordinates, with an error of 8 pixels, which meets the license plate requirements for vehicle and aircraft targets.
[0031] An embodiment of the present application also provides a calculation system for panoramic coordinates and WGS84 longitude and latitude mapping parameters, including a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any of the above methods when executing the computer program.
[0032] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for calculating panoramic coordinates and WGS84 latitude and longitude mapping parameters, characterized in that: The steps include: Step 1: Obtain a panoramic view of the monitored area through a panoramic camera and divide the panoramic view into different areas according to the angle range; Step 2: Select one of the partitions in the panorama to set a number of marker points, and record the panorama coordinates of the marker points; Step 3: Obtain the WGS84 longitude and latitude coordinates corresponding to the landmark point, and convert the WGS84 longitude and latitude coordinates into Mercator coordinates; Step 4: Calculate the first mapping parameter of the panoramic coordinates to the Mercator coordinates, obtain the first conversion formula between the panoramic coordinates and the Mercator coordinates from the first mapping parameter, and complete the conversion of the panoramic coordinates of the selected partition to the WGS84 longitude and latitude coordinates by combining the coordinate relationship between the Mercator coordinates and the WGS84 longitude and latitude coordinates.
2. The method for calculating the panoramic coordinates and WGS84 longitude and latitude mapping parameters according to claim 1, characterized in that: The process also includes step 5: selecting other partitions in the panorama and repeating steps 2 to 4 to complete the conversion of the panorama coordinates of other partitions into WGS84 longitude and latitude coordinates.
3. The method for calculating the panoramic coordinates and WGS84 latitude and longitude mapping parameters according to claim 1, characterized in that: It also includes step 6: selecting a target point, determining the panoramic coordinates of the target point according to the WGS84 longitude and latitude coordinates of the target point, determining the corresponding partition of the target point in the panorama according to the panoramic coordinates of the target point, converting the WGS84 longitude and latitude coordinates of the target point into Mercator coordinates, and calculating the second mapping parameters of the Mercator coordinates of the partition to the panoramic coordinates, obtaining the second conversion formula between the Mercator coordinates of the target point and the panoramic coordinates, and completing the conversion of the WGS84 longitude and latitude coordinates of the target point to the panoramic coordinates.
4. The method for calculating the panoramic coordinates and WGS84 latitude and longitude mapping parameters according to claim 1, characterized in that: The number of the marking points is greater than or equal to 6 and at least 3 of the marking points are not collinear.
5. The method for calculating the panoramic coordinates and WGS84 latitude and longitude mapping parameters according to claim 1, characterized in that: The calculating the first mapping parameter from the panoramic coordinates to the Mercator coordinates includes: constructing a first calculation matrix based on the panoramic coordinates, constructing a second calculation matrix based on the Mercator coordinates, and calculating the first mapping parameter according to the first calculation matrix and the second calculation matrix; The calculation of the first mapping parameter according to the first calculation matrix and the second calculation matrix is expressed as the following formula: ; in, represents the first calculation matrix, represents the second calculation matrix, represents the first mapping parameter, and the marker ; The first calculation matrix The expression is: ; in, For the Mercator coordinates of the calibration points; For the extracted The first of the calibration points The image coordinates of the calibration points; The second calculation matrix The expression is: 。 6. The method for calculating the panoramic coordinates and WGS84 latitude and longitude mapping parameters according to claim 1, characterized in that: The first conversion formula is expressed as: ; ; in, , , , , , These are the first mapping parameters.
7. The method for calculating the panoramic coordinates and WGS84 latitude and longitude mapping parameters according to claim 3, characterized in that: The second mapping parameters from Mercator coordinates to panoramic coordinates include: constructing a third calculation matrix based on Mercator coordinates, constructing a fourth calculation matrix based on panoramic coordinates, and calculating the second mapping parameters according to the third calculation matrix and the fourth calculation matrix; The calculation of the second mapping parameter according to the third calculation matrix and the fourth calculation matrix is expressed as the following formula: ; in, represents the second mapping parameter; represents the third calculation matrix; represents the fourth calculation matrix; and the marker ; The third calculation matrix The expression is: ; The fourth calculation matrix The expression is: 。 8. The method for calculating the panoramic coordinates and WGS84 latitude and longitude mapping parameters according to claim 3, characterized in that: The second conversion formula is expressed as: ; ; in, , , , , , Both are second mapping parameters.
9. A computing system for panoramic coordinates and WGS84 latitude and longitude mapping parameters, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.