A method for grid co - location of satellite remote sensing images based on matrix calculation
By constructing co-localizing grid coordinate files and using matrix calculation methods, the problem of low co-localization efficiency of satellite remote sensing image grids is solved, and fast and efficient image conversion is achieved.
Patent Information
- Application Number
- CN202310688356.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-06-12
AI Technical Summary
The existing satellite remote sensing image grid co-localization method adopts point-to-point search method, which leads to low computing efficiency, especially when processing large data volumes are too long.
Using a matrix-based calculation method, by constructing a co-localized grid coordinate file, multiple points are merged into batches, and the batch-to-batch index matrix is used to calculate alternative time-consuming loop searches, and the co-localized point correspondence relationship is saved to achieve rapid conversion.
The number of iterations of co-local points is greatly reduced, and the calculation is optimized using GPU and deep learning library, and the video memory space is exchanged for time, which significantly shortens the image conversion time and improves the computing efficiency.
Smart Images

Figure CN116664671B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of satellite remote sensing image processing, and particularly to a satellite remote sensing image grid co - localization method based on matrix calculation. Background Art
[0002] Monitoring sea - ice density plays an important role in studying the impact of polar sea - ice melting on global climate change and ensuring the safety of ship navigation. The development of satellite remote sensing technology has brought a large number of remote sensing images with different grids and different spatial resolutions. Scholars have proposed many different algorithms to derive sea - ice density images from satellite remote sensing images. In order to verify the effectiveness and accuracy of the algorithms, it is often necessary to unify different sea - ice density images to the same grid and resolution for comparison.
[0003] The basic principle of the existing satellite remote sensing image grid co - localization method is to find the point with the closest distance in the longitude - latitude grid of the source image according to the longitude - latitude coordinates of each pixel point (i.e., a cell in the grid) in the target image. After obtaining the grid coordinates of this point in the source image, read the value of this point from the source image and store it in the target image. By traversing all the cells of the target longitude - latitude grid in turn, the target image is obtained. For example, in the article "Satellite passive microwave sea - ice concentration data set inter - comparison for Arctic summer conditions" published in the journal "Cryosphere", Volume 14, Issue 7 in 2020, when co - localizing the passive microwave sea - ice product using the EASE 2.0 grid and the MODIS sea - ice product using the Polar Stereo grid, first convert the longitude - latitude coordinates to meta - coordinates in kilometers using the WGS84 ellipsoid, and then find the pair of cells with the closest distance from the 25 - km - resolution EASE 2.0 grid and the 500 - m - resolution Polar Stereo grid. It is necessary to find the corresponding cells in the 500 - m Polar Stereo grid for 186,624 cells in the 25 - km EASE 2.0 grid in turn to complete the grid co - localization.
[0004] According to the above content, the existing satellite remote sensing image grid co - localization method uses a point - to - point search method, that is, for each calculation of a target longitude - latitude grid point, a search needs to be performed in the longitude - latitude grid of the source image. The number of iterations required is relatively large, and if the dimensions of the source image and the target image are large, the amount of data to be processed is very large, resulting in low overall computational efficiency. Summary of the Invention
[0005] The present invention proposes a method for grid co - registration of satellite remote - sensing images based on matrix calculation, saving the corresponding relationship of co - registration points between remote - sensing images of different grids and resolutions into a co - registration grid coordinate file. When co - registration conversion of new images with the same grid and resolution is required, only by reading the file, the fast conversion of the images can be realized by using matrix indexing technology.
[0006] The present invention provides a method for grid co - registration of satellite remote - sensing images based on matrix calculation, comprising the following steps:
[0007] Obtain the satellite remote - sensing source image to be co - registered;
[0008] Construct a co - registration grid coordinate file;
[0009] Input the satellite remote - sensing source image to be co - registered into the co - registration grid coordinate file to obtain the co - registered target image;
[0010] The construction of the co - registration grid coordinate file includes:
[0011] Obtain satellite remote - sensing source images with the same grid and resolution;
[0012] Obtain the longitude - latitude matrix of the source image according to the satellite remote - sensing source image;
[0013] Define the longitude - latitude matrix of the target image and reshape and slice it to obtain multiple slices;
[0014] Merge multiple grid points to obtain multiple batches;
[0015] Based on the batch - to - batch method, perform index cycling on multiple slices to obtain multiple index matrices, and export the multiple index matrices to obtain the co - registration grid coordinate file.
[0016] Preferably, the shape of the satellite remote - sensing image is (m, n), the shape of the longitude - latitude matrix of the source image is (m, n, 2); the shape of the longitude - latitude matrix of the target image is (s, t, 2), and the shape of the reshaped longitude - latitude matrix of the target image is (s×t, 2), where m and s are both widths, and n and t are both heights.
[0017] Preferably, select the batch size according to the memory or video - memory size, and slice the reshaped longitude - latitude matrix of the target image along the first axis according to the batch size to obtain multiple slices with the shape of (batch, 2).
[0018] Preferably, select the batch size according to the following formula:
[0019]
[0020] In the formula, Memory reqIt represents the video memory or memory size required by the program. Batch represents the size of a batch, and it is a positive integer, with its value range being [1, s×t].
[0021] Preferably, by dividing the value of s×t by the value of batch, the number of slices is obtained. If batch cannot be divided evenly by s×t, the shape of the last loop slice is (s×t%batch, 2), where % represents the remainder operation.
[0022] Preferably, based on the batch-by-batch method, index looping is performed on multiple slices to obtain multiple index matrices and export them to obtain a co-location grid coordinate file, including the following steps:
[0023] Define a column vector Indices0 with all zeros and the number of elements being s×t;
[0024] Define a loop variable i, 0≤i≤N, and N = s×t;
[0025] Input the loop variable i. When i = 0, find the batch of points in the source image longitude and latitude matrix that are closest to the batch of points in the first slice, and obtain the index matrix of these batch of points in the source image;
[0026] Store the index matrix in Indices0 at the index positions from i to i+batch to obtain Indices1;
[0027] When the loop variable i is greater than N, export the obtained Indices1 as a co-location grid coordinate file.
[0028] Preferably, when the loop variable i is less than N, increase the value of the loop variable by batch, find the batch of points in the source image longitude and latitude matrix that are closest to the batch of points in the next slice, obtain a new index matrix, and update Indices1.
[0029] Preferably, input the satellite remote sensing source image to be co-located into the co-location grid coordinate file to obtain the co-located target image, including:
[0030] Flatten the source image into a column vector including m×n elements, obtain a target column vector with the number of elements being s×t according to Indices1, and reshape it into a two-dimensional matrix with the shape of (s, t) to obtain the co-located target image (s, t).
[0031] Preferably, finding the batch of points in the source image longitude and latitude matrix that are closest to the batch of points in the first slice and obtaining the index matrix of these batch of points in the source image includes the following steps:
[0032] The first slice is expanded in dimensions, changing from shape (batch, 2) to (batch, 1, 1, 2), and tiled m times and n times along the second axis and the third axis respectively, resulting in a first matrix of shape (batch, m, n, 2);
[0033] The latitude and longitude matrix of the source image is expanded in dimensions, changing from shape (m, n, 2) to (1, m, n, 2), and tiled batch times along the first axis, resulting in a second matrix of shape (batch, m, n, 2);
[0034] The first matrix and the second matrix are subtracted to obtain a third matrix. The third matrix is squared element by element and summed along the last axis, resulting in a third matrix of shape (batch, m, n);
[0035] The third matrix is square-rooted element by element and expanded along the second axis and the third axis, resulting in a result matrix of shape (batch, m×n);
[0036] The index of the minimum value is found along the second axis of the result matrix, obtaining an index matrix of the batch corresponding points in the source image latitude and longitude matrix for the first slice batch points in the target image latitude and longitude matrix;
[0037] Preferably, the latitude and longitude information of the image is stored in the last axis of the source image latitude and longitude matrix and the target image latitude and longitude matrix, and the latitude and longitude order is the same.
[0038] Compared with the prior art, the beneficial effects of the present invention are:
[0039] The present invention provides a satellite remote sensing image grid co-location method based on matrix calculation. By merging multiple points into a batch, the point-to-point search method is changed to a batch-to-batch method, and matrix calculation is used to replace time-consuming loops. In addition, the index matrix obtained after looping through all batches is saved as a co-location grid coordinate file. When a new remote sensing image with the same grid and resolution needs to be co-located and converted, only this file needs to be read, and combined with matrix index technology, the co-location conversion of the remote sensing image can be quickly completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0041] Figure 1It is a flowchart of a satellite remote sensing image grid co - localization method based on matrix calculation of the present invention;
[0042] Figure 2 It is a flowchart of obtaining an index matrix of the present invention;
[0043] Figure 3 It is the source sea - ice density image of the 25 - km resolution EASE 2.0 grid of this embodiment;
[0044] Figure 4 It is the target sea - ice density image of the 25 - km resolution Polar Stereo grid of this embodiment;
[0045] Figure 5 It is the sea - ice density image of the 25 - km resolution Polar Stereo grid derived by the NASA Team algorithm in the embodiment of the present invention. Specific embodiments
[0046] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0047] Refer to Figure 1 and Figure 2 , the present invention provides a satellite remote sensing image grid co - localization method based on matrix calculation, which specifically includes the following steps:
[0048] The first step: Obtain the satellite remote sensing source image to be co - localized.
[0049] The second step: Construct a co - localization grid coordinate file, including the following steps:
[0050] S1: Obtain a satellite remote sensing source image Src with a shape of (m, n) and a source image longitude - latitude matrix SrcLnLt with a shape of (m, n, 2). The grid and resolution of the satellite remote sensing source image Src are the same as those of the satellite remote sensing source image to be co - localized. Define a target image longitude - latitude matrix DstLnLt with a shape of (s, t, 2), and expand the first two axes of the target image longitude - latitude matrix DstLnLt so that its shape becomes (s×t, 2).
[0051] The longitude - latitude information is stored in the last axis of the source image longitude - latitude matrix SrcLnLt and the target image longitude - latitude matrix DstLnLt, and the longitude - latitude order is the same. It can be longitude first and then latitude, or latitude first and then longitude. If they are inconsistent, they need to be adjusted to be consistent.
[0052] S2: Define a column vector of all zeros with the number of elements being s×t, i.e., Indices0, to record the grid coordinates of each point in the target image Dst in the source image Src after co - localization.
[0053] S3: Determine an appropriate batch size according to the memory or video memory size. In each loop, take out batch points from the latitude - longitude matrix DstLnLt of the target image and find the corresponding batch of points with the smallest distances in the latitude - longitude matrix SrcLnLt of the source image, and obtain the indices of these batch points in the source image Src. The relationship between batch and the required memory or video memory is as follows:
[0054]
[0055] In the formula, Memory req represents the memory or video memory size required by the program, and its unit is Gigabyte. A maximum batch can be estimated according to whether GPU or CPU is used for operation and the memory or video memory size of the computer by this formula. batch must be a positive integer. batch is a positive integer, and its value range is [1, s×t]. If the value is 1, it is the existing algorithm based on point - to - point search. If the value is s×t, all points can be calculated at once without loops, with the fastest calculation speed, but the required video memory or memory is also larger.
[0056] S4: Define a loop variable i, whose initial value is 0, upper limit value is N, and N = s×t.
[0057] S5: Input the loop variable i, slice the latitude - longitude matrix DstLnLt of the target image along the first axis, and the slice shape is (batch, 2), which corresponds to the latitude - longitude coordinates of batch points in the latitude - longitude matrix DstLnLt of the target image. If batch cannot be divided evenly by s×t, the slice shape of the last loop is (s×t % batch, 2), where % represents the remainder operation.
[0058] Find the batch of points with the smallest distances from the batch of points in the slice in the latitude - longitude matrix SrcLnLt of the source image, and obtain the index matrix of these batch points in the source image Src. This index matrix is a column vector containing batch elements.
[0059] S6: Store the obtained index matrix in Indices0 at the index positions from i to i + batch to get the modified Indices vector, i.e., Indices1.
[0060] S7: Determine whether the loop variable i is less than the upper limit value N. If so, increase the value of the loop variable i by batch, and return to step S5 to take the next slice of the longitude and latitude matrix DstLnLt of the target image for searching. If not, end the loop and transfer to step S8.
[0061] S8: Export the modified Indices vector as a file, that is, the co-location grid coordinate file. In the future, if it is necessary to co-locate a new remote sensing image with the same grid and resolution, this file can be directly read and used.
[0062] Search for the batch points in the source image longitude and latitude matrix SrcLnLt that are closest to the batch points in the slice to obtain the index matrix of the batch points in the source image Src. It includes the following steps:
[0063] S51: Expand the slice (index i~i+batch) of the target image longitude and latitude matrix DstLnLt along the first axis, from shape (batch, 2) to (batch, 1, 1, 2), and tile it m times and n times along the second axis and the third axis respectively. After tiling, the slice shape is (batch, m, n, 2).
[0064] S52: Expand the source image longitude and latitude matrix SrcLnLt, from shape (m, n, 2) to (1, m, n, 2), and tile it batch times along the first axis. After tiling, the shape is (batch, m, n, 2).
[0065] S53: Subtract the two matrices with shape (batch, m, n, 2) obtained in step 51 and step 52, then square each element, and then sum along the last axis. After summing, the matrix shape becomes (batch, m, n), then take the square root of each element, and finally expand along the second axis and the third axis to make its shape become (batch, m×n).
[0066] S54: Find the index of the minimum value along the second axis of the result matrix in step 53. The obtained index matrix is a column vector containing batch elements, that is, the index matrix of the batch points corresponding to the batch points in the slice (index i~i+batch) of the target image longitude and latitude matrix DstLnLt in the source image longitude and latitude matrix.
[0067] Step 3: Input the satellite remote sensing source image to be co-located into the co-location grid coordinate file to obtain the co-located target image. Flatten the satellite remote sensing source image to be co-located into a column vector containing m×n elements, and obtain a target column vector with s×t elements according to the modified Indices. Reshape it into a two-dimensional matrix with the shape of (s, t) to obtain the co-located target image (s, t).
[0068] Embodiment
[0069] Refer to Figure 3 , the Arctic sea ice density image Src derived from the Eumetsat-OSI SAF-ESA SICCI2 algorithm downloaded from the OSI-SAF official website on May 9, 2003, is used to read the original nc file using the netCDF4 library of Python. All matrix operations in this embodiment are implemented using the TensorFlow library of Python.
[0070] S11: Parse the source sea ice density matrix from the nc file, with the shape of (432, 432), and parse the longitude and latitude matrices respectively, both with the shape of (432, 432). Combine the longitude and latitude matrices into one matrix, that is, the source grid longitude and latitude matrix SrcLnLt, with the shape of (432, 432, 2). Use Python to read the binary version of the 25-kilometer resolution Polar Stereo grid longitude and latitude files provided by NSIDC and convert them into matrices, both with the shape of (448, 304). First, combine them into a three-dimensional matrix with the shape of (448, 304, 2), and then expand it along the first axis to obtain a two-dimensional matrix with the shape of (136192, 2), that is, the target grid longitude and latitude matrix DstLnLt.
[0071] S12: Define a column vector Indices containing 136192 zero elements to record the grid coordinates of each point in the source image in the co-located target image.
[0072] S13: According to the memory or video memory size, determine a suitable batch. Each time in the loop, calculate the batch nearest points corresponding to the batch points in the target image longitude and latitude matrix DstLnLt in the source image longitude and latitude matrix. The memory or video memory size required for different batches is as follows:
[0073]
[0074] In this embodiment, an NVIDIA 2080Ti graphics card with 11G of video memory is used, and the selected batch is 448, and both m and n are equal to 432.
[0075] S14: Define the loop variable and its upper limit value, that is, let i = 0 and N = 136192.
[0076] S15: Slice the target image longitude and latitude matrix DstLnLt along the first axis, extract the slices with indices from i to i + batch, that is, DstLnLt[i:i + 448, :], and find the indices of the 448 nearest points corresponding to the 448 points in the source image longitude and latitude matrix in this slice. This step includes the following sub-steps:
[0077] S151: Expand the DstLnLt slice with shape (448, 2) into a shape (448, 1, 1, 2), and then tile it 432 times along the second and third axes respectively. After tiling, the slice shape becomes (448, 432, 432, 2).
[0078] S152: Expand the source image longitude and latitude matrix with shape (432, 432, 2) into (1, 432, 432, 2), and then tile it 448 times along the first axis, and the shape becomes (448, 432, 432, 2).
[0079] S153: Subtract the two matrices with shape (448, 432, 432, 2) obtained in step 151 and step 152, then square each element of the matrix, and then sum along the last axis. After summing, the matrix shape becomes (448, 432, 432). Take the square root of each element of the matrix, and finally expand the second and third axes of the matrix to make its shape become (448, 186624).
[0080] S154: Find the index of the minimum value along the second axis of the result matrix in step 153. The obtained index matrix is a column vector containing 448 elements, that is, the indices of the 448 nearest points corresponding to the 448 points in the slice of the target image longitude and latitude matrix DstLnLt in the source image longitude and latitude matrix.
[0081] S16: Store the 448 indices obtained in step S15 at the indices from i to i + 448 of the Indices vector.
[0082] S17: Determine whether the loop variable i is less than its upper limit value 136192. If so, let i = i + 448, return to step S15, and continue to find the next slice from the target image longitude and latitude matrix DstLnLt. If not, end the loop and transfer to step S18.
[0083] In this embodiment, the calculation time of steps S14 to S17 is 25 seconds. If the point-to-point search method is used and matrix calculations and GPU acceleration are used in the search process of each point, the calculation time is 716 seconds. If matrix calculations and GPU acceleration are not used, the time consumption is even longer.
[0084] S18: Export the column vector Indices containing 136,192 elements to a file. In the future, if it is necessary to convert other satellite remote sensing images using the 25-kilometer EASE 2.0 grid to the 25-kilometer Polar Stereo grid, this file can be directly read to save time.
[0085] S19: Refer to Figure 4 , expand the source sea ice density matrix with a shape of (432, 432) parsed in step S11 into a column vector, which contains 186,624 elements. Using the Indices vector, 136,192 elements can be directly selected from the source sea ice density matrix of 186,624 elements to obtain a target column vector containing 136,192 elements, and reshape it into a two-dimensional matrix with a shape of (448, 304).
[0086] Refer to Figure 5 , Figure 5 As shown in Figure 4 , the 25-kilometer Polar Stereo grid sea ice density image derived using the NASA Team algorithm provided by NSIDC for the same day and the same region. By comparing with
[0087] The present invention proposes a method for co-locating satellite remote sensing image grids based on matrix calculation, which can greatly reduce the number of times of searching for co-locating points by loop, make full use of the optimization of matrix operations by GPUs and deep learning libraries such as TensorFlow, and exchange video memory space for operation time, thereby greatly shortening the running time of the program. For example, when converting a sea ice density image with a 25-kilometer resolution EASE 2.0 grid (image size: 432×432 pixels) to a sea ice density image with a 25-kilometer resolution Polar Stereo grid (image size: 448×304 pixels), the running time of the algorithm of the present invention using an NVIDIA 2080Ti graphics card and the TensorFlow library is 25 seconds, while the running time using the loop point-to-point search method is 716 seconds. In addition, the co-location grid coordinate file output in step S8 of the present invention is the coordinate mapping relationship between these two resolution grids and can be directly applied to the conversion of remote sensing images with the same grid and resolution.
[0088] The present invention provides a method for grid co - registration of satellite remote - sensing images based on matrix calculation. The corresponding relationship of co - registration points between remote - sensing images with different grids and resolutions is saved as a co - registration grid coordinate file. When co - registration conversion of new images with the same grid and resolution is required, only by reading the file, the fast conversion of the images can be achieved using matrix indexing technology. The method of the present invention reduces the number of iterations of the existing algorithm by using matrix calculation. When the memory or video memory is large enough, the method of the present invention can complete the query of all co - registration points of the target image at one time without using loops, and has high calculation efficiency.
[0089] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concept. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0090] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims
1. A satellite remote sensing image grid co - localization method based on matrix calculation, characterized in that, It includes the following steps: Obtain the satellite remote sensing source image to be co-located; Construct a co-location grid coordinate file; Input the satellite remote sensing source image to be co-located into the co-location grid coordinate file to obtain the co-located target image; The construction of the co-location grid coordinate file includes: Obtain satellite remote sensing source images with the same grid and resolution; Obtain the source image longitude and latitude matrix from the satellite remote sensing source image; Define the target image longitude and latitude matrix, reshape and slice it to obtain multiple slices; Merge multiple grid points to obtain multiple batches; Perform an index loop on multiple slices based on the batch-to-batch method to obtain multiple index matrices, and export the multiple index matrices to obtain the co-location grid coordinate file.
2. The satellite remote sensing image grid co - localization method based on matrix calculation according to claim 1, characterized in that, The shape of the satellite remote sensing image is (m, n), the shape of the source image longitude and latitude matrix is (m, n, 2); the shape of the target image longitude and latitude matrix is (s, t, 2), and the shape of the reshaped target image longitude and latitude matrix is (s×t, 2). Both m and s are widths, and both n and t are heights.
3. The satellite remote sensing image grid co - localization method based on matrix calculation according to claim 2, characterized in that, Select the batch size according to the memory or video memory size, and slice the reshaped target image longitude and latitude matrix along the first axis according to the batch size to obtain multiple slices with the shape of (batch, 2).
4. The satellite remote sensing image grid co - localization method based on matrix calculation according to claim 3, characterized in that, Select the batch size according to the following formula: where, Memory req represents the video memory or memory size required by the program, batch represents the batch size, and is a positive integer, and its value range is [1, s×t].
5. The satellite remote sensing image grid co - localization method based on matrix calculation according to claim 3, characterized in that, By dividing the value of s×t by the value of batch, obtain the number of slices. If batch cannot be divided evenly by s×t, the shape of the last loop slice is (s×t % batch, 2), where % represents the remainder operation.
6. The satellite remote sensing image grid co - localization method based on matrix calculation according to claim 3, characterized in that, Performing an index loop on multiple slices based on the batch-to-batch method to obtain multiple index matrices, and exporting the multiple index matrices to obtain the co-location grid coordinate file includes the following steps: Define a column vector Indices0 with all zeros and the number of elements s×t; Define the loop variable i, 0 ≤ i ≤ N, and N = s×t; Input the loop variable i. When i = 0, find the batch of points in the source image longitude and latitude matrix that are closest to the batch of points in the first slice, and obtain the index matrix of the batch of points in the source image; Store the index matrix in Indices0 at the index positions from i to i+batch to obtain Indices1; When the loop variable i is greater than N, export the obtained Indices1 as the co-location grid coordinate file.
7. The satellite remote sensing image grid co-localization method based on matrix calculation according to claim 6, wherein When the loop variable i is less than N, increase the value of the loop variable by batch, find the batch of points in the source image longitude and latitude matrix that are closest to the batch of points in the next slice, obtain a new index matrix, and update Indices1.
8. A method for grid co - location of satellite remote sensing images based on matrix calculation according to claim 7, characterized in that, Inputting the satellite remote sensing source image to be co-located into the co-location grid coordinate file to obtain the co-located target image includes: Flatten the source image into a column vector with m×n elements, obtain a target column vector with the number of elements s×t according to Indices1, and reshape it into a two-dimensional matrix with the shape of (s, t) to obtain the co-located target image (s, t).
9. A satellite remote sensing image grid co - localization method based on matrix calculation according to claim 5, characterized in that, Find the batch of points in the source image longitude and latitude matrix that are closest to the batch of points in the first slice, and obtain the index matrix of the batch of points in the source image, including the following steps: Expand the dimension of the first slice, from shape (batch, 2) to (batch, 1, 1, 2), and tile it m times and n times along the second axis and the third axis respectively to obtain the first matrix with shape (batch, m, n, 2); Expand the dimension of the source image longitude and latitude matrix, from shape (m, n, 2) to (1, m, n, 2), and tile it batch times along the first axis to obtain the second matrix with shape (batch, m, n, 2); Subtract the first matrix from the second matrix to obtain the third matrix, square each element of the third matrix, and sum along the last axis to obtain the third matrix with shape (batch, m, n); Take the square root of each element of the third matrix and expand it along the second axis and the third axis to obtain the result matrix with shape (batch, m×n); Find the index of the minimum value along the second axis of the result matrix to obtain the index matrix of the batch of closest points in the source image longitude and latitude matrix corresponding to the batch of points in the first slice of the target image longitude and latitude matrix.
10. A satellite remote sensing image grid co - localization method based on matrix calculation according to claim 1, characterized in that, The longitude and latitude information of the image is stored in the last axis of the source image longitude and latitude matrix and the target image longitude and latitude matrix, and the longitude and latitude order is the same.
Citation Information
Patent Citations
Image object co-localization and irrelevant sample determination method
CN105354826A
Regional monitoring method and device based on remote sensing big data, terminal and storage medium
CN111079515A