An airborne hyperspectral image compression method, system, device and medium

CN123015708APending Publication Date: 2026-10-30GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610840959.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-11
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0006]因此,本发明解决的技术问题是:当两个协方差矩阵在欧氏意义下被视为接近时,它们在流形几何上可能实际相距甚远,反之亦然,由此造成聚类结果失真,所构建的光谱基码本对原始光谱结构的代表性不足

Benefits of technology

[0018]本发明的有益效果:通过空间分块及计算光谱协方差矩阵后进行全局聚类得到第一码本,使得第一码本能够匹配不同空间块的光谱分布特性;通过为各空间块匹配重构误差最小的最优基矩阵并进行空间投影,降低了投影系数图对原始数据的近似误差;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015708A_ABST
    Figure CN123015708A_ABST
Patent Text Reader

Abstract

The application discloses an airborne hyperspectral image compression method, system, device and medium, and belongs to the technical field of image compression. The method comprises the following steps: spatially dividing an airborne hyperspectral image, calculating the inter-band spectral covariance matrix of each spatial block, globally clustering the spectral covariance matrix, and obtaining a first codebook; reconstructing the spectrum of each spatial block through a projection coefficient map, obtaining a projection residual map, and performing first-level allocation on each spatial block according to the projection residual map to obtain a first allocation scheme; quantizing and encoding the projection coefficient map and the projection residual map of each spatial block according to the first allocation scheme, merging the quantization and encoding result with the first codebook, and outputting a compressed code stream. The first codebook is obtained by globally clustering after spatial division and calculation of the spectral covariance matrix, so that the first codebook can match the spectral distribution characteristics of different spatial blocks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image compression technology, specifically to an airborne hyperspectral image compression method, system, device, and medium. Background Technology

[0002] In the field of airborne hyperspectral image compression, existing methods typically divide the image spatially into blocks, calculate the inter-band covariance matrix of each block, and then construct a spectral codebook through clustering to achieve subspatial projection and compression encoding of the hyperspectral data of each spatial block. However, when clustering the covariance matrix, Euclidean distance is commonly used as a similarity criterion between matrices. This approach ignores the inherent Riemannian manifold geometry of the covariance matrix as a symmetric positive definite matrix, resulting in the matrix mean and distance calculated in Euclidean space failing to accurately reflect the intrinsic differences between matrices.

[0003] In other words, when two covariance matrices are considered close in the Euclidean sense, they may actually be far apart in manifold geometry, and vice versa. This results in distorted clustering results, and the constructed spectral base code is not representative of the original spectral structure.

[0004] For example, when processing an airborne hyperspectral image that simultaneously covers urban buildings, vegetation, and water bodies, the covariance matrix eigenvalues ​​of a certain urban block may be concentrated in a few principal directions, while the covariance matrix of a certain vegetation block exhibits a more dispersed distribution of eigenvalues. These two blocks should belong to different clusters on the Riemannian manifold. However, due to the inflation effect of the Euclidean distance metric, the distance between these two types of matrices in Euclidean space may be underestimated, leading to their incorrect classification into the same cluster. Using a distorted Euclidean mean matrix as a representative, the spectral basis matrix obtained from its eigenvalue decomposition cannot accurately describe the principal spectral directions of the urban block. Ultimately, this results in larger projection reconstruction residuals for both types of spatial blocks, leading to a decrease in compression quality. Summary of the Invention

[0005] In view of the above-mentioned problems, the present invention provides an airborne hyperspectral image compression method, system, device and medium.

[0006] Therefore, the technical problem solved by this invention is that when two covariance matrices are considered close in the Euclidean sense, they may actually be far apart in manifold geometry, and vice versa, which causes the clustering results to be distorted and the constructed spectral base code is not representative of the original spectral structure.

[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an airborne hyperspectral image compression method, comprising the following steps: spatially dividing the airborne hyperspectral image into blocks, calculating the inter-band spectral covariance matrix of each spatial block, and performing global clustering on the spectral covariance matrix to obtain a first codebook; matching the optimal basis matrix for each spatial block using the first codebook, and spatially projecting the hyperspectral data of each spatial block to obtain a projection coefficient map; spectrally reconstructing each spatial block using the projection coefficient map to obtain a projection residual map, and performing a first-level allocation on each spatial block according to the projection residual map to obtain a first allocation scheme; quantizing and encoding the projection coefficient map and projection residual map of each spatial block according to the first allocation scheme, merging the quantization and encoding results with the first codebook, and outputting a compressed bitstream.

[0008] As a preferred embodiment of the airborne hyperspectral image compression method of the present invention, the step of global clustering of the spectral covariance matrix includes: constructing a band observation matrix for the hyperspectral data of each spatial block; calculating the covariance of the band observation matrix to obtain the spectral covariance matrix of each spatial block; clustering all the spectral covariance matrices; taking the Riemann mean of the spectral covariance matrix within each cluster to obtain the representative covariance matrix of each cluster; performing eigenvalue decomposition on each representative covariance matrix; constructing a spectral basis matrix based on the eigenvalue decomposition results; and summing up the spectral basis matrices of all clusters to obtain the first codebook.

[0009] As a preferred embodiment of the airborne hyperspectral image compression method of the present invention, the step of clustering all the spectral covariance matrices includes: selecting initial cluster centers from all spectral covariance matrices according to a first principle; calculating the Riemann distance between each spectral covariance matrix and each cluster center, inputting each spectral covariance matrix into the cluster with the smallest Riemann distance, updating the cluster centers by recalculating the Riemann mean, and obtaining intermediate cluster centers; calculating the Riemann distance between the Riemann mean of all intermediate cluster centers and the Riemann mean of the previous round of cluster centers, and outputting the clustering result in response to the Riemann distance being lower than the set iteration standard.

[0010] In a preferred embodiment of the airborne hyperspectral image compression method of the present invention, the step of obtaining the projection coefficient map includes: projecting and reconstructing the hyperspectral data of the spatial block with each spectral basis matrix, calculating the reconstruction error between each reconstruction result and the original hyperspectral data; selecting the spectral basis matrix with the smallest reconstruction error as the optimal basis matrix; using the optimal basis matrix as the projection basis, performing projection operations on the hyperspectral data of the spatial block to obtain projection coefficients; and arranging the projection coefficients to obtain the projection coefficient map.

[0011] As a preferred embodiment of the airborne hyperspectral image compression method of the present invention, the step of performing projection operation on the hyperspectral data of the spatial block includes: decomposing the optimal basis matrix and determining the projection dimension based on the energy contribution of the decomposition result; extracting the first projection dimension column from the optimal basis matrix to form a dimension-reduced projection matrix; and projecting the band vector of each spatial pixel in the spatial block onto the dimension-reduced projection matrix to obtain the projection coefficients.

[0012] As a preferred embodiment of the airborne hyperspectral image compression method of the present invention, the step of performing the first-level allocation includes: for the projection residual map of each spatial block, determining the residual energy of each spatial block according to the amplitude level of all residual values ​​in the spatial block; summing the residual energies of all spatial blocks to obtain the total residual energy of the entire image; dividing the residual energy of each spatial block by the total residual energy of the entire image to obtain the residual energy ratio of each spatial block; multiplying the preset total coding bit budget by the residual energy ratio of each spatial block to obtain the initial bit allocation amount of each spatial block; rounding the initial bit allocation amount, and sequentially compensating the remaining bits to the corresponding spatial blocks according to the residual energy ratio to obtain the final number of coding bits allocated to each spatial block as the first allocation scheme.

[0013] As a preferred embodiment of the airborne hyperspectral image compression method of the present invention, the step of compensating the remaining bits to the corresponding spatial blocks according to the residual energy ratio includes: sorting all spatial blocks according to the residual energy ratio to obtain a sorted spatial block sequence; calculating the preset total coding bit budget minus the sum of the number of bits after rounding down in all spatial blocks, and using the calculation result as the number of remaining bits; in response to the remaining bit number being greater than 0, increasing the final coding bit number of the spatial block by 1, decreasing the remaining bit number by 1, and continuing to traverse the next spatial block until the remaining bit number is 0 and then stopping the compensation.

[0014] This invention provides an airborne hyperspectral image compression system.

[0015] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an airborne hyperspectral image compression system, comprising: a spatial block calculation module, used to spatially divide the airborne hyperspectral image into blocks and calculate the inter-band spectral covariance matrix of each spatial block; The codebook generation module is used to perform global clustering on the spectral covariance matrix to obtain the first codebook; The projection module matches the optimal basis matrix to each spatial block using the first codebook, and performs spatial projection on the hyperspectral data of each spatial block to obtain a projection coefficient map. The bit allocation module is used to perform spectral reconstruction on each spatial block through the projection coefficient map to obtain the projection residual map, and to perform a first-level allocation on each spatial block according to the projection residual map to obtain a first allocation scheme. The bitstream merging module is used to quantize and encode the projection coefficient map and projection residual map of each spatial block according to the first allocation scheme, merge the quantization and encoding results with the first codebook, and output a compressed bitstream.

[0016] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the airborne hyperspectral image compression method described above.

[0017] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the airborne hyperspectral image compression method described above.

[0018] The beneficial effects of this invention are as follows: by dividing the space into blocks and calculating the spectral covariance matrix, global clustering is performed to obtain the first codebook, which enables the first codebook to match the spectral distribution characteristics of different spatial blocks; by matching the optimal basis matrix with the minimum reconstruction error for each spatial block and performing spatial projection, the approximation error of the projection coefficient map on the original data is reduced. The projection residual map is obtained by spectral reconstruction, and a first-level allocation is performed on each spatial block according to the projection residual map to obtain the first allocation scheme, which realizes the skewed allocation of the number of encoded bits on the spatial blocks with larger residuals. The projection coefficient map and the projection residual map are quantized and encoded according to the first allocation scheme and merged with the first codebook for output. Under the limited code rate, the coding accuracy of the high residual region is guaranteed first, thereby improving the overall reconstruction quality and coding efficiency of the compressed hyperspectral image. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 The above is a flowchart of an airborne hyperspectral image compression method provided in one embodiment of the present invention.

[0021] Figure 2 This is a flowchart of the first codebook acquisition process for an airborne hyperspectral image compression method according to an embodiment of the present invention.

[0022] Figure 3This is a flowchart of a non-uniform bit allocation scheme for the output of an airborne hyperspectral image compression method provided in one embodiment of the present invention. Detailed Implementation

[0023] To make the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0024] Example 1, referring to Figure 1 This is one embodiment of the present invention, which provides an airborne hyperspectral image compression method, including the following steps: The airborne hyperspectral image is spatially divided into blocks, the inter-band spectral covariance matrix of each spatial block is calculated, and the spectral covariance matrix is ​​globally clustered to obtain the first codebook.

[0025] The optimal basis matrix is ​​matched to each spatial block using the first codebook, and the hyperspectral data of each spatial block is spatially projected to obtain a projection coefficient map.

[0026] The projection coefficient map is used to reconstruct the spectrum of each spatial block to obtain the projection residual map, and the first-level allocation is performed on each spatial block according to the projection residual map to obtain the first allocation scheme.

[0027] According to the first allocation scheme, the projection coefficient map and projection residual map of each spatial block are quantized and encoded, and the quantization and encoding results are merged with the first codebook to output a compressed bitstream.

[0028] An airborne hyperspectral image simultaneously covering urban buildings, vegetation, and water bodies was segmented. The covariance matrix eigenvalues ​​of one urban block were concentrated in a few principal directions, while the covariance matrix of a vegetation block exhibited a more dispersed distribution of eigenvalues. These two blocks should belong to different clusters on the Riemannian manifold. However, due to the inflation effect of the Euclidean distance metric, the distance between these two types of matrices in Euclidean space may be underestimated, leading to their incorrect classification into the same cluster. Using a distorted Euclidean mean matrix as a representative, the spectral basis matrix obtained through eigenvalue decomposition fails to accurately describe the principal spectral directions of the urban block. Ultimately, this results in excessively large projection reconstruction residuals for both types of spatial blocks, leading to a decrease in compression quality.

[0029] This invention obtains a first codebook by spatial partitioning and global clustering after calculating the spectral covariance matrix, enabling the first codebook to match the spectral distribution characteristics of different spatial blocks; by matching the optimal basis matrix with the minimum reconstruction error for each spatial block and performing spatial projection, the approximation error of the projection coefficient map to the original data is reduced. The projection residual map is obtained by spectral reconstruction, and a first-level allocation is performed on each spatial block according to the projection residual map to obtain the first allocation scheme, which realizes the skewed allocation of the number of encoded bits on the spatial blocks with larger residuals. The projection coefficient map and the projection residual map are quantized and encoded according to the first allocation scheme and merged with the first codebook for output. Under the limited code rate, the coding accuracy of the high residual region is guaranteed first, thereby improving the overall reconstruction quality and coding efficiency of the compressed hyperspectral image.

[0030] Example 2, refer to Figures 1-3 As an embodiment of the present invention, an airborne hyperspectral image compression method is provided based on the previous embodiment, comprising the following steps: S1. Spatially divide the airborne hyperspectral image into blocks, calculate the inter-band spectral covariance matrix of each spatial block, and perform global clustering on the spectral covariance matrix to obtain the first codebook.

[0031] In this embodiment, an airborne hyperspectral image with a spatial resolution of 512×512 pixels and 200 bands is used as an example.

[0032] Reference Figure 2 As shown, the steps for global clustering of the spectral covariance matrix include S1.1 to S1.3: S1.1 Construct a band observation matrix for the hyperspectral data of each spatial block, calculate the covariance of the band observation matrix, and obtain the spectral covariance matrix of each spatial block.

[0033] Each spatial block contains 32×32=1024 spatial pixels, and each pixel has an observation value in 200 bands.

[0034] A band observation matrix is ​​constructed using the pixel values ​​of each band image within the spatial block. The b-th row of the band observation matrix corresponds to the observation values ​​of all 1024 pixels of the b-th band within the block.

[0035] After removing the mean from each row of the band observation matrix, the inter-band covariance matrix is ​​calculated. ; in, The band observation matrix after removing the mean is shown in this example as follows: Therefore, we obtain The (i,j)th element represents the degree of spectral correlation between the i-th band and the j-th band, where R is the set of real numbers.

[0036] The eigenvalues ​​of the covariance matrix calculated in a spatial block of a certain urban area show a rapidly decaying distribution, with the sum of the first 5 eigenvalues ​​accounting for 92% of the total sum of all eigenvalues, indicating that the spectral energy of this block is highly concentrated in a few principal directions; The eigenvalues ​​of the other vegetation block are relatively flat, with the top 5 eigenvalues ​​accounting for only 61% of the total, indicating that its spectral variations are more dispersed.

[0037] The calculations were repeated for all 256 spatial blocks, resulting in 256 spectral covariance matrices of size 200×200.

[0038] S1.2. Cluster all the spectral covariance matrices, and take the Riemann mean of the spectral covariance matrices in each cluster to obtain the representative covariance matrix of each cluster.

[0039] In this embodiment, the number of clusters is set to 16, and K-means clustering is performed on the Riemannian manifold for all 256 spectral covariance matrices. Two symmetric positive definite matrices are used. and The Riemann distance between them is defined as ,in, For matrix logarithm operations, It is the Frobenius norm.

[0040] Assuming the above urban block covariance matrix Covariance matrix of vegetation blocks The calculated Riemann distance between them is The Euclidean Frobenius distance is used. The Euclidean metric shows that the distance between the two matrices is only 0.83, which is lower than the true difference reflected by the Riemann distance. This indicates that the Euclidean metric underestimates the intrinsic difference between the two matrices in the geometry of the manifold in this case.

[0041] After performing clustering based on Riemann distance, calculate the Riemann mean for all covariance matrices within the k-th cluster. The formula for calculating the Riemann mean is as follows: ; in, It is the average matrix of the k-th class. This is the current guess of the average matrix. It is the covariance matrix of the i-th sample in the k-th class. It is the total number of samples in the k-th class. It is the square root of the matrix. It is the reciprocal of the square root of the matrix.

[0042] The process continues until the update amount falls below the convergence threshold, at which point the convergence result is taken as the representative covariance matrix of the cluster.

[0043] It is important to know that the steps for dividing all spectral covariance matrices into several clusters include A1~A3: A1. Select initial cluster centers from all spectral covariance matrices according to the first principle, that is, select initial cluster centers from all spatial blocks according to the principle of maximizing the Riemann distance between matrices.

[0044] In this embodiment, a maximum distance initialization strategy on the Riemannian manifold is used to select 16 initial cluster centers to avoid cluster degradation problems that may be caused by random initialization.

[0045] Randomly select one of the 256 spectral covariance matrices as the first initial cluster center; calculate the Riemann distance between each of the remaining covariance matrices and all centers in the selected center set, take the minimum Riemann distance from each matrix to the current center set, and select the matrix with the largest minimum distance as the next initial center; until all 16 initial cluster centers are selected.

[0046] For example, after selecting 3 initial centers, the Riemann distances of the remaining 253 matrices to the nearest center are calculated. It is found that the Riemann distance from the covariance matrix of a certain water block to the nearest center is 4.21, which is the largest among all candidate matrices. Therefore, it is selected as the 4th initial cluster center.

[0047] A2. Calculate the Riemann distance between each spectral covariance matrix and each cluster center. Input each spectral covariance matrix into the cluster with the smallest Riemann distance. Update the cluster centers by recalculating the Riemann mean to obtain the intermediate cluster centers.

[0048] In the first iteration, the Riemann distance between each of the 256 spectral covariance matrices and the 16 initial cluster centers was calculated, and each matrix was assigned to the cluster with the smallest distance.

[0049] Taking the covariance matrix of a certain spatial block as an example, the Riemann distances between it and the 16 initial centers are calculated as [2.13, 3.87, 1.42, 4.05, ...]. The Riemann distance corresponding to the 3rd center is the smallest, 1.42. Therefore, the covariance matrix is ​​assigned to the 3rd cluster.

[0050] After classifying all 256 matrices, the Riemann mean of all covariance matrices within each cluster is recalculated, and the corresponding initial cluster centers are replaced with the updated Riemann mean to obtain 16 intermediate cluster centers after this round of iteration.

[0051] In this embodiment, after the first iteration, the size of each cluster ranges from a minimum of 8 to a maximum of 27. The intermediate cluster centers are shifted on the Riemann manifold relative to the initial centers, with an average shift Riemann distance of 0.76.

[0052] A3. Calculate the Riemann distance between the Riemann mean of all intermediate cluster centers and the Riemann mean of the previous round of cluster centers. If the Riemann distance is lower than the set iteration standard, output the clustering result.

[0053] The iteration convergence threshold is set to 0.01. After each iteration, the Riemann distance between the 16 intermediate cluster centers in the current iteration and the 16 cluster centers in the previous iteration is calculated, and the maximum value is taken as the convergence criterion.

[0054] In one specific implementation, the maximum Riemann offset of each center is 0.76 after the first iteration, drops to 0.18 after the third iteration, drops to 0.034 after the sixth iteration, and drops to 0.007 after the ninth iteration. When it first falls below the convergence threshold of 0.01, the iteration terminates.

[0055] The final output is the clustering result after 9 rounds of iterations, with 256 spatial blocks divided into 16 clusters.

[0056] S1.3 Perform eigenvalue decomposition on each representative covariance matrix, construct the spectral basis matrix based on the eigenvalue decomposition results, and summarize the spectral basis matrices of all clusters to obtain the first codebook.

[0057] Eigenvalue decomposition was performed on the representative covariance matrices of the 16 clusters to obtain 200 eigenvalues ​​and their corresponding eigenvectors.

[0058] Taking the representative covariance matrix of cluster No. 3 as an example, after arranging its eigenvalues ​​from largest to smallest, the cumulative contribution rate of the first 10 eigenvalues ​​has reached 95.3%, and the cumulative contribution rate of the first 20 eigenvalues ​​has reached 99.1%.

[0059] Based on the preset energy retention ratio threshold, which is set to 95% in this embodiment, the first 10 principal feature vectors are taken and arranged in columns to form a spectral basis matrix, which serves as the representative spectral basis of the third cluster.

[0060] Eigenvalue decomposition and principal eigenvector extraction are performed on the representative covariance matrices of the remaining 15 clusters in the same manner. All 16 spectral basis matrices are then aggregated to obtain a spectral basis matrix codebook containing 16 entries. In this embodiment, the spectral basis matrix codebook is used as the first codebook.

[0061] S2. Match the optimal basis matrix to each spatial block using the first codebook, and perform spatial projection on the hyperspectral data of each spatial block to obtain a projection coefficient map.

[0062] The steps for obtaining the projection coefficient map include S2.1 to S2.4: S2.1 Project and reconstruct the hyperspectral data of the spatial block with each spectral basis matrix, and calculate the reconstruction error between each reconstruction result and the original hyperspectral data.

[0063] For a given spatial block, its hyperspectral data can be represented as a matrix. Where 200 represents the band number and 1024 represents the number of spatial pixels within the block. For the k-th spectral basis matrix in the codebook... ;d k Given the number of columns in the basis matrix, i.e., the number of principal eigenvectors, project and reconstruct Y. The reconstruction result is: ; The reconstruction error between the reconstructed result and the original hyperspectral data is calculated and expressed by the formula: ; Taking a spatial block in a certain urban area as an example, for all 16 spectral basis matrices in the first codebook, the reconstruction error is calculated one by one, and all the results are expressed as [312.4,289.7,156.3,401.2,278.5,334.8,190.6,423.1,267.4,381.9,145.2,310.7,258.3,374.6,302.1,418.8].

[0064] S2.2 Select the spectral basis matrix with the smallest reconstruction error as the optimal basis matrix.

[0065] In this example, the reconstruction error norm corresponding to the 11th spectral basis matrix is ​​145.2, which is the smallest among all 16 candidate basis matrices. Therefore, the 11th spectral basis matrix is ​​selected as the optimal basis matrix for this block.

[0066] S2.3. Using the optimal basis matrix as the projection basis, perform projection operations on the hyperspectral data of the spatial block to obtain the projection coefficients.

[0067] The steps for performing projection operations on the band vectors include B1 to B5: B1. Decompose the optimal basis matrix and determine the projection dimension based on the energy contribution of the decomposition result. That is, arrange the eigenvectors of each column of the optimal basis matrix in descending order of their corresponding eigenvalues ​​and calculate the cumulative contribution rate of each eigenvalue to the sum of all eigenvalues.

[0068] The eigenvalues ​​of the representative covariance matrices corresponding to the optimal basis matrix are arranged from largest to smallest as follows: λ1≥λ2≥……≥λ 200 ≥0. Cumulative contribution rate of the first m eigenvalues. Defined as: ; in, For the sum of eigenvalues.

[0069] Taking the representative covariance matrix of the 11th cluster matched by the urban block as an example, after the eigenvalues ​​are arranged in descending order, the cumulative contribution rate of the first 5 eigenvalues ​​is 88.6%, the cumulative contribution rate of the first 8 eigenvalues ​​is 93.4%, the cumulative contribution rate of the first 10 eigenvalues ​​is 96.1%, and the cumulative contribution rate of the first 15 eigenvalues ​​is 98.7%.

[0070] Then, the previously mentioned projection dimension columns are extracted from the optimal basis matrix to form a dimension-reduced projection matrix, specifically by executing steps B2 to B4: B2. Perform eigenvalue decomposition on the optimal basis matrix to obtain eigenvalues ​​and corresponding eigenvectors in each column, and arrange the eigenvectors according to the magnitude of the eigenvalues.

[0071] The eigenvalue decomposition of the representative covariance matrix is ​​expressed by the following formula: ; in, It is a diagonal matrix composed of eigenvalues. The corresponding eigenvector matrix has its columns arranged in descending order of their corresponding eigenvalues, i.e., the eigenvectors. Corresponding to the largest eigenvalue .

[0072] In this embodiment, after performing eigenvalue decomposition on the representative covariance matrix of cluster No. 11, 200 eigenvalues ​​and corresponding 200 eigenvectors are obtained, among which the largest eigenvalue is 1823.6 and the smallest eigenvalue is 0.31, with a large range of eigenvalues.

[0073] B3. Calculate the proportion of each eigenvalue to the sum of all eigenvalues, and use this as the contribution rate of the eigenvector.

[0074] The contribution rate of the i-th eigenvector is calculated using the following formula: ; In this example, Λ=9647.2, and the contribution rates of each eigenvector are r1=18.9%, r2=15.3%, r3=12.7%, r4=10.4%, r5=8.6%, ... The contribution rate decreases rapidly as the eigenvalue index increases. The sum of the contribution rates of the last 100 eigenvectors is 1.8%, which shows that high-dimensional spectral information can be effectively represented by a few principal eigenvectors.

[0075] B4. In descending order, the contribution rate of each feature vector is accumulated sequentially. When the calculation result is greater than the preset energy retention ratio for the first time, the number of accumulated feature vectors is used as the projection dimension.

[0076] In this example, the iterative calculation result of the cumulative contribution rate is: , , The cumulative contribution rate exceeded 95% for the first time at the 10th feature vector, so the projection dimension of the urban spatial block was determined to be 10.

[0077] B5. Project the band vector of each spatial pixel within the spatial block using the reduced-dimensional projection matrix to obtain the projection coefficients.

[0078] The dimension-reduced projection matrix obtained in steps B2-B4 is represented as follows: Represented as: ; For the nth spatial pixel within the current spatial block, its original band vector is Perform matrix multiplication on the pixel using the reduced-dimensional projection matrix to obtain the projection coefficient vector: ; In this example, the urban area spatial block contains a total of 32×32=1024 spatial pixels, and the dimension-reduced projection matrix... After performing the above matrix multiplication on the 200-dimensional band vector of each pixel, a 10-dimensional projection coefficient vector is obtained, realizing spectral dimensionality reduction from 200-dimensional to 10-dimensional, with a compression ratio of 20:1.

[0079] Taking a specific pixel as an example, its original band vector The coefficient vector is obtained after projection. .

[0080] S2.4 Arrange the projection coefficients to obtain the projection coefficient map of the space block.

[0081] Arrange the projection coefficients of all 1024 spatial pixels within the current spatial block according to the original spatial position of the pixels within the spatial block, and then determine the projection coefficient corresponding to the nth pixel. The i-th component is assigned to the corresponding spatial position of the i-th projection coefficient channel, thus obtaining the projection coefficient map. , which is a coefficient map with d channels, each with the same spatial resolution as the original spatial block.

[0082] The projection dimension of this urban spatial block is d=10, therefore its projection coefficient map contains 10 coefficient channels, each containing 32×32=1024 coefficient values. Compared to the original hyperspectral data, the data volume of the projection coefficient map is reduced from 200×1024 to 10×1024.

[0083] Repeat steps S2.1 to S2.4 for all 256 spatial blocks to obtain the projection coefficient maps for each of the 256 spatial blocks.

[0084] Reference Figure 3 As shown, S3, the spectral reconstruction of each spatial block is performed through the projection coefficient map to obtain the projection residual map, and the first-level allocation is performed on each spatial block according to the projection residual map to obtain the first allocation scheme.

[0085] The steps for performing a first-level allocation include S3.1 to S3.3: S3.1 For the projection residual map of each spatial block, determine the residual energy of each spatial block based on the amplitude level of all residual values ​​in the spatial block. When determining, calculate the sum of squares of the residual values ​​of all spatial pixels in all bands in the spatial block to obtain the residual energy of each spatial block.

[0086] For the p-th spatial block, its original hyperspectral data is The coefficient matrix corresponding to the projection coefficient map obtained in step S2 is: The optimal basis matrix is The original hyperspectral data was reconstructed using the projection coefficient map. The reconstruction result is shown below: ; The residual matrix corresponding to the projected residual plot is defined as the difference between the original data and the reconstructed data, expressed as: ; in, The (b,n)th element This represents the residual value of the nth spatial pixel within the pth spatial block in the bth band.

[0087] The residual energy of a spatial block is obtained by summing the squares of the residual values ​​of all spatial pixels in all bands.

[0088] Taking the urban spatial block described in step S2, designated as spatial block number 11, as an example, its projection dimension... After spectral reconstruction, the residual matrix The residual energy was calculated. .

[0089] Repeat this step for all 256 spatial blocks to obtain the residual energy of each spatial block.

[0090] S3.2. Sum the residual energies of all spatial blocks to obtain the total residual energy of the entire graph. Divide the residual energy of each spatial block by the total residual energy of the entire graph to obtain the residual energy percentage of each spatial block.

[0091] Summing the residual energies of all 256 spatial blocks yields the total residual energy of the entire graph, and the percentage of residual energy for the p-th spatial block is given. Defined as: ; in, The total residual energy of the entire graph. Let be the residual energy of the space block.

[0092] The sum of the residual energy proportions of each space block is always 1, satisfying the normalization condition, and can be directly used as the weighting coefficient for bit allocation.

[0093] In this embodiment, the summation of the residual energies of the 256 spatial blocks yields a total residual energy of 2.38 × 10⁻⁶ for the entire image. 8 The residual energy percentage of Block 11 is 8.74 × 10⁻⁶. 5 / 2.38×10 8 =0.367%, the residual energy percentage of vegetation block No. 23 is 3.21×10 5 / 2.38×10 8 =0.135%, the residual energy percentage of water block No. 57 is 1.56×10 6 / 2.38×10 8 =0.655%.

[0094] The residual energy distribution of all 256 spatial blocks shows that there are differences between spatial blocks corresponding to different land cover types. The ratio of the residual energy of the block with the largest residual energy to that of the block with the smallest residual energy is about 8.3:1, which demonstrates the necessity of non-uniform bit allocation.

[0095] S3.3 Multiply the preset total coding bit budget by the residual energy ratio of each space block to obtain the initial bit allocation of each space block. After rounding down the initial bit allocation, the remaining bits are compensated to the corresponding space blocks in descending order of residual energy ratio to obtain the final number of coding bits allocated to each space block.

[0096] In this embodiment, the preset total coding bit budget is set to 10240 bits. The initial bit allocation for the p-th spatial block is: ; in, It is the initial bit allocation. It is the preset total encoding bit budget. It is the percentage of residual energy.

[0097] Round down the initial bit allocation to obtain the integer bit allocation for each space block.

[0098] In this example, the initial allocation for the 11th urban block is 10240 × 0.367% = 37.6 bits, which is 37 bits after rounding; the initial allocation for the 23rd vegetation block is 10240 × 0.135% = 13.8 bits, which is 13 bits after rounding; and the initial allocation for the 57th water block is 10240 × 0.655% = 67.1 bits, which is 67 bits after rounding.

[0099] Since rounding down will result in a total number of allocated bits that are insufficient to meet the budget, the remaining bits are allocated as compensation through steps C1~C3: C1. Sort all space blocks in descending order of residual energy percentage to obtain the sorted space block sequence.

[0100] Using the residual energy percentage of each spatial block as the sorting key, all 256 spatial blocks are sorted in descending order of residual energy percentage to obtain the sorted spatial block sequence.

[0101] In this example, the top three spatial blocks after sorting are: water block No. 57 (0.655%), suburban block No. 83 (0.601%), and urban block No. 11 (0.367%). Vegetation block No. 23 ranks 196th (0.135%). The last spatial block corresponds to a uniform low-texture region, with a residual energy percentage of 0.079%.

[0102] C2. Calculate the total preset coding bit budget minus the sum of the number of bits after rounding down all space blocks, and use the result as the remaining number of bits.

[0103] The remaining number of bits is defined by the formula: ; in, It is the number of remaining bits. This is the preset total encoding bit budget; the sum of the bits after rounding down through 256 space blocks is... Therefore, the remaining number of bits is 10240-10187=53 bits. The remaining number of bits is much smaller than the total number of space blocks 256, indicating that most space blocks do not require compensation. The compensation operation is applied to the top 53 space blocks with the largest residual energy proportion.

[0104] C3. Traverse the sorted sequence of space blocks. In response to a remaining bit count greater than 0, increase the final encoded bit count of the space block by 1 and decrease the remaining bit count by 1. Continue traversing the next space block until the remaining bit count is 0 and then stop the compensation.

[0105] Based on the sorted sequence obtained in step C1 The compensation logic is expressed as follows: (The text repeats itself here, so the translation is incomplete.) ; In this example, Therefore, after sorting, the first 53 spatial blocks each receive 1 bit of compensation, while the number of encoded bits for the remaining 203 spatial blocks remains unchanged after rounding. The 57th water block ranks first and, after compensation, is allocated 67+1=68 bits; the 11th urban block ranks third and, after compensation, is allocated 37+1=38 bits; the 23rd vegetation block ranks 196th, receives no compensation, and is allocated 13 bits.

[0106] After compensation, the total number of allocated bits was verified to be 10187 + 53 = 10240, consistent with the preset total coding bit budget. Thus, the non-uniform bit allocation scheme for all 256 spatial blocks was obtained. Spatial blocks with larger residual energy received more coding bits, ensuring optimal overall reconstruction quality under a limited bit budget.

[0107] S4. Quantize and encode the projection coefficient map and projection residual map of each spatial block according to the first allocation scheme, merge the quantization and encoding results with the first codebook, and output the compressed bitstream.

[0108] In this embodiment, for all 256 spatial blocks, according to the non-uniform bit allocation scheme in step S3, the projection coefficient map and projection residual map of each spatial block are quantized and encoded respectively. Finally, all encoding results are merged with the first codebook to output a complete compressed bitstream.

[0109] For example, water block No. 57 has a final allocated bit count of 68 bits, a projection dimension of 8, and a projection coefficient map containing 8192 coefficient values. 50 bits are allocated for projection coefficient map quantization, and each channel can be quantized with an average of approximately 6.25 bits. The quantization step size is... The remaining 18 bits are used for residual map quantization encoding, and the quantization step size is... The quantized residual coefficients are compressed and stored using run-length encoding.

[0110] After quantization and encoding of all 256 spatial blocks are completed, each spatial block outputs its corresponding binary encoded sequence. The quantization and encoding results of all spatial blocks are concatenated in spatial order, and the first codebook constructed in step S1 is appended to the header of the bitstream. This codebook records the spectral basis matrices of the 16 clusters and their corresponding spatial block index information. The decoding end can directly look up the table to recover the spectral basis matrix corresponding to each spatial block without having to re-execute the clustering process.

[0111] Example 3 is an embodiment of the present invention, which provides an airborne hyperspectral image compression system, comprising: The spatial segmentation and covariance calculation module is used to spatially segment airborne hyperspectral images and calculate the spectral covariance matrix between bands of each spatial segment. A global clustering and codebook generation module is used to perform global clustering on the spectral covariance matrix to obtain a first codebook; The optimal basis matching and projection module is used to match the optimal basis matrix for each spatial block from the first codebook, and to perform spectral subspace projection on the hyperspectral data of each spatial block to obtain a projection coefficient map. The residual calculation and bit allocation module is used to perform spectral reconstruction on each spatial block through the projection coefficient map to obtain the projection residual map, and to allocate the number of coding bits to each spatial block according to the projection residual map to obtain a non-uniform bit allocation scheme. The quantization encoding and bitstream merging module is used to quantize and encode the projection coefficient map and projection residual map of each spatial block according to the non-uniform bit allocation scheme, and merge the quantization encoding result with the first codebook to output a compressed bitstream.

[0112] This embodiment also provides an electronic device applicable to an airborne hyperspectral image compression method, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the airborne hyperspectral image compression method proposed in the above embodiment.

[0113] This embodiment also provides a storage medium on which a computer program is stored, which, when executed by a processor, implements an airborne hyperspectral image compression method as proposed in the above embodiments.

[0114] The storage medium proposed in this embodiment belongs to the same inventive concept as the airborne hyperspectral image compression method proposed in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0115] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0116] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. An airborne hyperspectral image compression method, characterized in that, Includes the following steps: The airborne hyperspectral image is spatially divided into blocks, the inter-band spectral covariance matrix of each spatial block is calculated, and the spectral covariance matrix is ​​globally clustered to obtain the first codebook. The optimal basis matrix is ​​matched to each spatial block using the first codebook, and the hyperspectral data of each spatial block is spatially projected to obtain a projection coefficient map. The projection coefficient map is used to reconstruct the spectrum of each spatial block to obtain the projection residual map, and the first-level allocation is performed on each spatial block according to the projection residual map to obtain the first allocation scheme. According to the first allocation scheme, the projection coefficient map and projection residual map of each spatial block are quantized and encoded, and the quantization and encoding results are merged with the first codebook to output a compressed bitstream.

2. The airborne hyperspectral image compression method as described in claim 1, characterized in that, The steps for performing global clustering on the spectral covariance matrix include: A band observation matrix is ​​constructed for the hyperspectral data of each spatial block, and the covariance is calculated for the band observation matrix to obtain the spectral covariance matrix of each spatial block. All the spectral covariance matrices are clustered, and the Riemann mean of the spectral covariance matrices within each cluster is taken to obtain the representative covariance matrix of each cluster. Eigenvalue decomposition is performed on each representative covariance matrix, and spectral basis matrices are constructed based on the eigenvalue decomposition results. The spectral basis matrices of all clusters are then summarized to obtain the first codebook.

3. The airborne hyperspectral image compression method as described in claim 2, characterized in that, The steps for clustering all the spectral covariance matrices include: Initial cluster centers are selected from all spectral covariance matrices according to the first principle; Calculate the Riemann distance between each spectral covariance matrix and each cluster center, input each spectral covariance matrix into the cluster with the smallest Riemann distance, update the cluster centers by recalculating the Riemann mean, and obtain the intermediate cluster centers; Calculate the Riemann distance between the Riemann mean of all intermediate cluster centers and the Riemann mean of the previous cluster centers. If the Riemann distance is lower than the set iteration criterion, output the clustering result.

4. The airborne hyperspectral image compression method as described in claim 3, characterized in that, The steps to obtain the projection coefficient map include: The hyperspectral data of the spatial block are projected and reconstructed with each spectral basis matrix, and the reconstruction error between each reconstruction result and the original hyperspectral data is calculated. The spectral basis matrix with the smallest reconstruction error is selected as the optimal basis matrix. Using the optimal basis matrix as the projection basis, projection operations are performed on the hyperspectral data of the spatial block to obtain projection coefficients; The projection coefficients are arranged to obtain a projection coefficient map.

5. The airborne hyperspectral image compression method as described in claim 4, characterized in that, The steps for performing projection operations on the hyperspectral data of the spatial block include: The optimal basis matrix is ​​decomposed, and the projection dimension is determined based on the energy contribution of the decomposition results; The dimension-reduced projection matrix is ​​constructed by extracting the aforementioned projection dimension columns from the optimal basis matrix. The band vector of each spatial pixel within the spatial block is projected using the reduced-dimensional projection matrix to obtain the projection coefficients.

6. The airborne hyperspectral image compression method as described in claim 5, characterized in that, The steps for performing a first-level allocation include: For the projection residual map of each spatial block, the residual energy of each spatial block is determined based on the amplitude level of all residual values ​​within the spatial block; The residual energy of all spatial blocks is summed to obtain the total residual energy of the entire graph. The residual energy of each spatial block is divided by the total residual energy of the entire graph to obtain the residual energy ratio of each spatial block. The initial bit allocation for each space block is obtained by multiplying the preset total coding bit budget by the residual energy ratio of each space block. After rounding the initial bit allocation, the remaining bits are compensated to the corresponding space blocks in sequence according to the residual energy ratio, and the final number of coded bits allocated to each space block is obtained as the first allocation scheme.

7. The airborne hyperspectral image compression method as described in claim 6, characterized in that, The steps of compensating the remaining bits to the corresponding space blocks according to the residual energy percentage include: Sort all spatial blocks according to their residual energy percentage to obtain the sorted spatial block sequence; Calculate the total preset coding bit budget minus the sum of the number of bits after rounding down all spatial blocks, and use the result as the remaining number of bits; In response to a remaining bit count greater than 0, the final encoded bit count of the space block is increased by 1, and the remaining bit count is decreased by 1. The process continues to traverse the next space block until the remaining bit count is 0, at which point the compensation stops.

8. An airborne hyperspectral image compression system, employing an airborne hyperspectral image compression method as described in any one of claims 1 to 7, characterized in that, include: The spatial block calculation module is used to spatially divide the airborne hyperspectral image into blocks and calculate the spectral covariance matrix between the bands of each spatial block. The codebook generation module is used to perform global clustering on the spectral covariance matrix to obtain the first codebook; The projection module is used to match the optimal basis matrix for each spatial block using the first codebook, and to perform spatial projection on the hyperspectral data of each spatial block to obtain a projection coefficient map. The bit allocation module is used to perform spectral reconstruction on each spatial block through the projection coefficient map to obtain the projection residual map, and to perform a first-level allocation on each spatial block according to the projection residual map to obtain a first allocation scheme. The bitstream merging module is used to quantize and encode the projection coefficient map and projection residual map of each spatial block according to the first allocation scheme, merge the quantization and encoding results with the first codebook, and output a compressed bitstream.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the airborne hyperspectral image compression method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the airborne hyperspectral image compression method according to any one of claims 1 to 7.