GPU-CPU collaborative raster data fast coordinate conversion method and system
Through the GPU-CPU collaboration method, the three-dimensional point cloud data set and regular grid parameter block processing are used to solve the problem of inefficient conversion of traditional raster data coordinates, and efficient and accurate image data conversion is achieved, and the conversion efficiency is improved. Multiple times.
Patent Information
- Application Number
- CN202111347774.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-11-15
AI Technical Summary
Traditional raster data coordinate conversion efficiency is inefficient, especially when converting huge image images, which affects the conversion accuracy and makes it difficult to achieve efficient conversion.
Using GPU-CPU collaboration method, efficient data conversion is achieved by constructing a three-dimensional point cloud data set, generating triangular network and regular grid parameters, processing raster data in blocks, and using GPU for coordinate conversion and interpolation.
The data conversion efficiency is significantly improved. Compared with CPU processing alone, the overall efficiency of the GPU algorithm is greatly improved by multiple times, solving the problems of inefficiency and data distortion, and achieving efficient coordinate conversion.
Smart Images

Figure CN114022649B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and in particular relates to a GPU-CPU collaborative raster data fast coordinate conversion method and system. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Geographical spatial data mainly consists of vector and raster data. With the improvement of sensor resolution and the increase of data acquisition frequency, the scale of raster data is getting larger and larger. Remote sensing images are the main representative of raster data. Since images have multiple coordinate systems, the efficiency of data conversion is high. The coordinate conversion of massive raster data greatly limits the conversion efficiency. At the same time, traditional coordinate conversion parameters, especially when facing the conversion of large raster data, will cause data distortion and affect the conversion accuracy. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a GPU-CPU collaborative raster data fast coordinate conversion method and system, which can solve the problems of low efficiency of traditional raster data coordinate conversion and the inability to convert some large images, thereby truly realizing high-efficiency data conversion.
[0005] According to some embodiments, the present invention adopts the following technical solutions:
[0006] A GPU-CPU collaborative raster data fast coordinate conversion method comprises the following steps:
[0007] Construct a 3D point cloud dataset;
[0008] Based on the three-dimensional point cloud data set, a triangulated network is generated, and data in the triangulated network is extracted and interpolated into a regular grid, so as to realize the construction and assignment of regular grid parameters for the entire coordinate transformation;
[0009] Loading the original grid data, using the regular grid parameters to obtain relevant information of the target grid, and generating blank target grid data;
[0010] According to the data information on the CPU side, the raster data is divided into blocks;
[0011] Use the information of regular grid parameters to construct the memory pointer on the CPU side, apply for the memory space on the GPU side, and copy the memory information on the CPU side to the GPU side;
[0012] According to the range of the raster data block on the CPU side, a regular grid parameter memory space of the corresponding range is established, and it is iteratively executed in the target raster data block memory space to perform coordinate conversion and interpolation on the original raster data, save the current raster data block data, and release the current GPU data block memory.
[0013] As an optional implementation, when constructing a three-dimensional point cloud dataset, the three-dimensional point cloud dataset is constructed using the difference in the X direction and the Y direction as the Z value according to the input control point data of the same name in different coordinate systems.
[0014] As an optional implementation method, the specific process of constructing and assigning the parameters of the regular grid for the entire coordinate transformation includes: using a divide-and-conquer triangulation algorithm to generate a Delaunay triangulation network, and assigning a Z value to each node of the triangulation network; constructing a regular grid with a certain resolution, and extracting the value of each grid from the triangulation network through a Kriging interpolation algorithm.
[0015] As an optional implementation, the relevant information includes four-dimensional information, number of bands, resolution, band arrangement and coordinate information.
[0016] As an optional implementation, the data information on the CPU side includes data size, number of bands and CPU available memory.
[0017] As an optional implementation, when coordinate conversion is performed in the target grid data block display memory space, the target grid data block display memory space is applied for, and the X and Y coordinates of the target coordinate system are obtained using conversion parameters.
[0018] As an optional implementation, the interpolation on the original raster data adopts bilinear interpolation.
[0019] A GPU-CPU collaborative raster data fast coordinate conversion system, comprising:
[0020] A point cloud dataset construction module is configured to construct a three-dimensional point cloud dataset;
[0021] A regular grid parameter generation module is configured to generate a triangulated network based on the three-dimensional point cloud data set, extract data from the triangulated network and interpolate it into the regular grid, so as to realize the construction and assignment of the regular grid parameters of the entire coordinate transformation;
[0022] The raster data reading and writing module is configured to load the original raster data, obtain the relevant information of the target raster using the regular grid parameters, and generate blank target raster data;
[0023] The data segmentation module is configured to segment the raster data into blocks according to the data information on the CPU side;
[0024] The memory interaction module is configured to construct a memory pointer on the CPU side using the information of the regular grid parameters, apply for the memory space on the GPU side, and copy the memory information on the CPU side to the GPU side;
[0025] The coordinate conversion module is configured to establish a regular grid parameter memory space of a corresponding range according to the range of the raster data block on the CPU side, iteratively execute in the target raster data block memory space, perform coordinate conversion and interpolation on the original raster data, save the current raster data block data, and release the current GPU data block memory.
[0026] An electronic device comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the above method are completed.
[0027] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the steps in the above method are completed.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The present invention adopts an image parallel processing method, which can realize fast raster processing, solve the problems of low efficiency of traditional raster data coordinate conversion and the inability to convert some large images, thereby truly realizing high-efficiency data conversion. It has been verified that data conversion is performed from different parameter angles, and the conversion efficiency is statistically analyzed. The overall efficiency of the GPU algorithm is several times higher than that of CPU coordinate conversion.
[0030] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0032] Figure 1 The present invention is a flowchart of at least one embodiment of the present invention. DETAILED DESCRIPTION
[0033] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0034] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0036] Embodiment 1:
[0037] A GPU-CPU collaborative raster data fast conversion method comprises the following steps:
[0038] (1) Construction of regular grid parameters.
[0039] ① Construct a 3D point cloud dataset. Use the input control point data of the same name in different coordinate systems and use the difference in the X and Y directions as the Z value to construct a 3D point cloud dataset (X, Y, Z).
[0040] Z x =x a -x b
[0041] Z y =y a -y b
[0042] Points a and b are a pair of control points with the same name, and x and y are the horizontal and vertical coordinates of the points.
[0043] ②Construction of regular grid parameters
[0044] First, using the 3D point cloud data set, the divide-and-conquer triangulation algorithm is used to generate the Delaunay triangulation network, and the Z value is assigned to each node of the triangulation network; then, a regular grid with a resolution of 1km*1km is constructed, and the value of each grid is extracted from the triangulation network through the Kriging interpolation algorithm to complete the construction and assignment of the regular grid parameters of the entire coordinate transformation. The grid parameters serve as the mathematical basis for the entire raster data coordinate transformation. In this step, the parameters are constructed on the CPU side and stored in the memory.
[0045] (2) Load the original raster data, read the data boundaries, resolution and other information, use the regular grid parameters in (1) to obtain the boundary information, number of bands, resolution, band arrangement and coordinate information of the target grid, and generate blank target raster data.
[0046] (3) Establish a CPU-side raster data partitioning strategy, partition the data into rows based on data size, number of bands, CPU available memory, and other information to obtain the number of data blocks.
[0047] (4) The memory interaction setting of the CPU-GPU side of the regular grid parameters is to use the information of the regular grid parameters to build the memory pointer on the CPU side, and then apply for the memory space on the GPU side, copy the CPU side memory information to the GPU side, and realize the efficient reading and calculation of the regular grid parameters.
[0048] In this step, the parameters are copied to the GPU side. The actual acquisition is from the GPU side. The parameters on the GPU side and the CPU side are the same, but the reading method is different.
[0049] (5) For each raster data block, GPU-side data block is performed according to the available GPU memory, and then iterative processing is performed:
[0050] ① According to the range of the raster data block, establish the regular grid parameter memory space of the corresponding range, and obtain the corresponding conversion parameters from step (4) by interpolation.
[0051] ② Apply for the target grid data block memory space, use the parameter results in ① to obtain the X and Y coordinates of the target coordinate system, perform bilinear interpolation on the original grid data, and assign the extracted values to the target grid.
[0052] ③Save the current grid block data and complete the release of the current GPU data block memory.
[0053] In order to verify the coordinate conversion efficiency of the method provided in Example 1, three data are selected according to parameters such as data volume and resolution for data conversion, and the conversion efficiency is statistically analyzed. The specific results are shown in Table 1. The overall efficiency of the GPU algorithm is about 10 times higher than that of the CPU coordinate conversion.
[0054] Table 1
[0055]
[0056] The present invention also provides the following product embodiments:
[0057] A GPU-CPU collaborative raster data fast coordinate conversion system, comprising:
[0058] A point cloud dataset construction module is configured to construct a three-dimensional point cloud dataset;
[0059] A regular grid parameter generation module is configured to generate a triangulated network based on the three-dimensional point cloud data set, extract data from the triangulated network and interpolate it into the regular grid, so as to realize the construction and assignment of the regular grid parameters of the entire coordinate transformation;
[0060] The raster data reading and writing module is configured to load the original raster data, obtain the relevant information of the target raster using the regular grid parameters, and generate blank target raster data;
[0061] The data segmentation module is configured to segment the raster data into blocks according to the data information on the CPU side;
[0062] The memory interaction module is configured to construct a memory pointer on the CPU side using the information of the regular grid parameters, apply for the memory space on the GPU side, and copy the memory information on the CPU side to the GPU side;
[0063] The coordinate conversion module is configured to establish a regular grid parameter memory space of a corresponding range according to the range of the raster data block on the CPU side, iteratively execute in the target raster data block memory space, perform coordinate conversion and interpolation on the original raster data, save the current raster data block data, and release the current GPU data block memory.
[0064] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the method provided in the first embodiment are completed.
[0065] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the steps in the method provided in embodiment 1 are completed.
[0066] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0067] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0068] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0069] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0070] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A GPU-CPU collaborative raster data fast coordinate conversion method, Its characteristics are: The following steps are involved: Construct a 3D point cloud dataset, using the input control point data of the same name in different coordinate systems, and use the difference between the X and Y directions as the Z value to construct a 3D point cloud dataset (Z,X,Y); Z x =x a -x b Z y =and a -and b Points a and b are a pair of control points with the same name, and x and y are the horizontal and vertical coordinates of the points; Based on the three-dimensional point cloud data set, a triangulated network is generated, and the data in the triangulated network is extracted and interpolated into a regular grid, so as to realize the construction and assignment of the parameters of the regular grid of the entire coordinate transformation; The specific process of constructing and assigning the grid parameters to realize the entire coordinate transformation rule includes: First, using the 3D point cloud data set, the divide-and-conquer triangulation algorithm is used to generate the Delaunay triangulation network, and the Z value is assigned to each node of the triangulation network; then, a regular grid with a resolution of 1km*1km is constructed, and the value of each grid is extracted from the triangulation network through the Kriging interpolation algorithm to complete the construction and assignment of the regular grid parameters of the entire coordinate transformation. The grid parameters serve as the mathematical basis for the entire raster data coordinate transformation. In this step, the parameters are constructed on the CPU side and stored in the memory; Loading the original grid data, using the regular grid parameters to obtain relevant information of the target grid, and generating blank target grid data; According to the data information on the CPU side, the raster data is divided into blocks; Use the information of regular grid parameters to construct the memory pointer on the CPU side, apply for the memory space on the GPU side, and copy the memory information on the CPU side to the GPU side; According to the range of the raster data block on the CPU side, a regular grid parameter memory space of the corresponding range is established, and it is iteratively executed in the target raster data block memory space to perform coordinate conversion and interpolation on the original raster data, save the current raster data block data, and release the current GPU data block memory.
2. A GPU-CPU collaborative raster data fast coordinate conversion method as claimed in claim 1, Its characteristics are: The relevant information includes four-dimensional information, number of bands, resolution, band arrangement and coordinate information.
3. The GPU-CPU collaborative raster data fast coordinate conversion method according to claim 1, Its characteristics are: The data information on the CPU side includes data size, number of bands and CPU available memory.
4. The GPU-CPU collaborative raster data fast coordinate conversion method according to claim 1, Its characteristics are: The target grid data block display memory space, when performing coordinate conversion, apply for the target grid data block display memory space, and use the conversion parameters to obtain the X and Y coordinates of the target coordinate system.
5. The GPU-CPU collaborative raster data fast coordinate conversion method according to claim 1, Its characteristics are: The interpolation on the original grid data adopts bilinear interpolation.
6. A GPU-CPU collaborative raster data fast coordinate conversion system, Its characteristics are: include: The point cloud dataset construction module is configured to construct a three-dimensional point cloud dataset, using the input control point data of the same name in different coordinate systems and using the difference between the X direction and the Y direction as the Z value to construct the three-dimensional point cloud dataset (Z, X, Y); Z x =x a -x b Z y =and a -and b Points a and b are a pair of control points with the same name, and x and y are the horizontal and vertical coordinates of the points; A regular grid parameter generation module is configured to generate a triangulated network based on the three-dimensional point cloud data set, extract data from the triangulated network and interpolate it into the regular grid, so as to realize the construction and assignment of the regular grid parameters of the entire coordinate transformation; The specific process of constructing and assigning the grid parameters to realize the entire coordinate transformation rule includes: First, using the 3D point cloud data set, the divide-and-conquer triangulation algorithm is used to generate the Delaunay triangulation network, and the Z value is assigned to each node of the triangulation network; then, a regular grid with a resolution of 1km*1km is constructed, and the value of each grid is extracted from the triangulation network through the Kriging interpolation algorithm to complete the construction and assignment of the regular grid parameters of the entire coordinate transformation. The grid parameters serve as the mathematical basis for the entire raster data coordinate transformation. In this step, the parameters are constructed on the CPU side and stored in the memory; The raster data reading and writing module is configured to load the original raster data, obtain the relevant information of the target raster using the regular grid parameters, and generate blank target raster data; The data segmentation module is configured to segment the raster data into blocks according to the data information on the CPU side; The memory interaction module is configured to construct a memory pointer on the CPU side using the information of the regular grid parameters, apply for the memory space on the GPU side, and copy the memory information on the CPU side to the GPU side; The coordinate conversion module is configured to establish a regular grid parameter memory space of a corresponding range according to the range of the raster data block on the CPU side, iteratively execute in the target raster data block memory space, perform coordinate conversion and interpolation on the original raster data, save the current raster data block data, and release the current GPU data block memory.
7. An electronic device, Its characteristics are: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps in the method according to any one of claims 1 to 5 are completed.
8. A computer-readable storage medium, Its characteristics are: Used to store computer instructions, which, when executed by a processor, complete the steps of the method according to any one of claims 1 to 5.
