CN-121997592-A - Matlab-based high-precision coordinate calculation method
Abstract
The invention discloses a Matlab-based high-precision coordinate calculation method, which belongs to the fields of coordinate calculation technology and data processing and comprises the steps of firstly utilizing a specific combination generating function to obtain combinations of all points and vectors, then initializing a result vector, calculating intersection point coordinates and parameters by means of an accurate geometric intersection point calculating function and storing the intersection point coordinates and parameters in the result vector, then distributing the intersection point coordinates and parameters to a working area according to rules by means of a working area assignment function, then obtaining a midpoint coordinate matrix by means of a midpoint calculating function based on the intersection point coordinates, calculating distances among the points, determining a clustering center by means of a clustering algorithm, screening points in an intersection point concentrated area according to distance characteristics in the clustering, finally combining priori knowledge and weights, and calculating the high-precision coordinates by means of a weighted average calculating function. The method can effectively improve the coordinate calculation precision, has good noise immunity, can fully integrate priori knowledge, and is suitable for a plurality of fields with higher requirements on the coordinate precision.
Inventors
- LI JIAZHU
- WANG YUXIN
- LV YUBO
- HE JIANXING
- ZHENG XING
- ZHANG HAORAN
- GONG TAO
- WANG DINGBO
- LIN ZIYANG
Assignees
- 合肥工业大学
- 安徽赞声环保科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260123
Claims (9)
- 1. A Matlab-based high-precision coordinate calculation method is characterized by comprising the following steps: S1, generating combinations of all points and vectors, namely generating all two-point combinations from a given point set by using a combination generating function, wherein the combination generating function determines all possible point pair combinations based on a mathematical combination algorithm; S2, initializing a result vector, namely creating a unit array for storing the coordinates of the subsequent intersection points and related parameters; S3, calculating intersection points of all combinations, namely extracting corresponding points and vectors for each pair of generated point combinations, calculating intersection point coordinates and related parameters through an accurate geometric intersection point calculation function, and storing the intersection point coordinates and related parameters in a result vector; S4, distributing the result to a working area, namely distributing the intersection point coordinates and related parameters to the Matlab working area by using a working area assignment function through circularly traversing the result vector according to a specific naming rule so as to facilitate subsequent processing; S5, calculating all midpoints, namely calculating midpoint coordinates of all intersection point pairs through a midpoint calculation function based on the intersection point coordinates distributed to the working area, and storing the midpoint coordinates in a midpoint coordinate matrix; S6, finding the most concentrated area of the intersection points, namely calculating the distance between all points in the midpoint coordinate matrix, clustering the points through a clustering algorithm, determining a clustering center, and screening out the points which are closer to the clustering center according to the statistical characteristics of the distance between the points in the clusters, wherein the points are used as the points in the most concentrated area of the intersection points; and S7, calculating a weighted average of the residual intersection points, namely calculating a final high-precision coordinate through a weighted average calculation function according to the points of the screened intersection point concentrated region and combining given priori knowledge and weights.
- 2. The method of claim 1, wherein in step S1, the combination generating function is nchoosek functions, and all combinations of any 2 different elements from 1 to a given point number are generated by the functions and stored in combinations variables.
- 3. The method of claim 1, wherein in step S2, the creation unit array is specifically two result vectors t_vals and E_vals.
- 4. The method of claim 1, wherein in step S3, the geometric intersection point calculation function is a calculation_ intersection function.
- 5. The method for calculating high-precision coordinates based on Matlab according to claim 1, wherein in step S4, the work area assignment function is assignin functions.
- 6. The method of claim 1, wherein in step S5, the midpoint calculating function obtains midpoint coordinates by vector-adding each pair of intersection coordinates and dividing by 2.
- 7. The Matlab-based high-precision coordinate calculation method of claim 1, wherein in the step S6, the clustering algorithm is a kmeans clustering algorithm, the points in the midpoint coordinate matrix are clustered into a preset number of classes through the algorithm, the clustering center is determined, the method for screening the points is to set a threshold value based on the median of the inter-cluster point distances, and the points with the distance from the clustering center being smaller than or equal to the threshold value are selected.
- 8. The method for calculating high-precision coordinates based on Matlab as defined in claim 1, wherein in step S7, the weighted average calculation function obtains final coordinates by weighted summing the average value of the points of the selected intersection point concentrated region with given prior knowledge according to preset weights.
- 9. A Matlab-based high-precision coordinate calculation method as defined in claim 1-8, further comprising S8, assigning the final result to the work area, and assigning the weighted average result obtained by the final calculation to the work area.
Description
Matlab-based high-precision coordinate calculation method Technical Field The invention mainly relates to the technical field of coordinate calculation and data processing, in particular to a Matlab-based high-precision coordinate calculation method. Background In the existing coordinate calculation method, when a plurality of points and vectors are combined, a certain error may be introduced in each calculation step, and the error may be accumulated continuously with the increase of calculation steps. For example, in calculating a plurality of intersections and midpoints, each numerical calculation may generate small deviations due to the floating point calculation accuracy limitation of the computer, and these deviations may cause a large error in the final coordinate result after a plurality of calculations. Some prior art techniques employ mathematical models that are not accurate enough in coordinate calculation. For example, when dealing with complex geometric relationships, simplified approximation algorithms may be employed, which, although capable of obtaining coordinate results to some extent, fail to meet accuracy requirements in application scenarios requiring high accuracy (e.g., precision measurement, high-accuracy mapping, etc.). The existing method may not find the intersection point accurately when processing a large amount of data, or the calculation result is inaccurate in the presence of noise. Therefore, it is necessary to provide a high-precision coordinate calculation method that improves the accuracy of coordinate estimation. Disclosure of Invention The technical scheme of the invention aims at the technical problem that the prior art is too single, provides a solution which is obviously different from the prior art, and mainly provides a Matlab-based high-precision coordinate calculation method which is used for solving the technical problem that the prior coordinate calculation method provided in the background art is insufficient in accuracy. The technical scheme adopted for solving the technical problems is as follows: A Matlab-based high-precision coordinate calculation method comprises the following steps: S1, generating combinations of all points and vectors, namely generating all two-point combinations from a given point set by using a combination generating function, wherein the combination generating function determines all possible point pair combinations based on a mathematical combination algorithm; S2, initializing a result vector, namely creating a unit array for storing the coordinates of the subsequent intersection points and related parameters; S3, calculating intersection points of all combinations, namely extracting corresponding points and vectors for each pair of generated point combinations, calculating intersection point coordinates and related parameters through an accurate geometric intersection point calculation function, and storing the intersection point coordinates and related parameters in a result vector; S4, distributing the result to a working area, namely distributing the intersection point coordinates and related parameters to the Matlab working area by using a working area assignment function through circularly traversing the result vector according to a specific naming rule so as to facilitate subsequent processing; S5, calculating all midpoints, namely calculating midpoint coordinates of all intersection point pairs through a midpoint calculation function based on the intersection point coordinates distributed to the working area, and storing the midpoint coordinates in a midpoint coordinate matrix; S6, finding the most concentrated area of the intersection points, namely calculating the distance between all points in the midpoint coordinate matrix, clustering the points through a clustering algorithm, determining a clustering center, and screening out the points which are closer to the clustering center according to the statistical characteristics of the distance between the points in the clusters, wherein the points are used as the points in the most concentrated area of the intersection points; S7, calculating a weighted average value of the residual intersection points, namely calculating a final high-precision coordinate through a weighted average calculation function according to the points of the screened intersection point concentrated region and by combining given priori knowledge and weights; And S8, distributing the final result to the working area, namely distributing the weighted average result obtained by final calculation to the working area. In step S1, the combination generating function is nchoosek functions by which all combinations of any 2 different elements from 1 to a given number of points are generated and stored in the combinations variable. In step S2, the creation unit array specifically initializes two result vectors t_vals and e_vals. In step S3, the geometric intersection point calculating function is a calculate_