Hyperspectral glint removal method, system and device based on multi-scale texture guidance

CN122510132APending Publication Date: 2026-08-04XIAN THERMAL POWER RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN THERMAL POWER RES INST CO LTD
Filing Date
2026-05-13
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

[0003]传统的全变分模型对于所有的像素都做相同的平滑处理,没有考虑到图像中的纹理区域和平坦区域存在差异,使得耀斑被去除的同时,绝缘子表面的微小裂纹、污秽纹理等重要细节也被过度平滑,图像保真度降低;除此之外,大部分现有的方法只是利用了空间域的信息,而没有考虑到高光谱图像丰富的光谱维度相关性,在耀斑去除的过程中无法保持光谱曲线的连续性,造成光谱失真;有些基于深度学习的方法虽然取得了一定的效果,但是需要大量的带标签训练数据,并且泛化能力较弱

Benefits of technology

[0022] The beneficial effects of this invention are as follows: A flare degradation equation is constructed based on a physical model, and initial candidate regions are extracted. A multi-scale Log-Gabor filter is used to construct a texture dominance map, and nonlinear enhancement is used to highlight the flare edge texture, effectively distinguishing between real texture and flare regions. The dominant spectral direction is obtained through spectral covariance matrix decomposition, and an anisotropic diffusion tensor is constructed in conjunction with the texture map, achieving a joint measure of spectral similarity and texture similarity. The diffusion tensor is used to find similar pixels within a search window, and a nonlocal self-similarity regularization constraint is constructed to fully utilize the global redundancy information of the image to suppress flare residue. The method unifies the physical degradation model, nonlocal self-similarity constraints, and spectral gradient sparsity constraints within a variational Bayesian framework, enabling synergistic optimization of various constraints and balancing spectral continuity with spatial structure preservation. Furthermore, it achieves dynamic adjustment of the flare detection threshold through wavelet domain residual analysis and texture-aware adaptive threshold updating, avoiding misclassification of texture regions. The method employs alternating direction multipliers to decompose the complex problem into five analytically solvable subproblems, ensuring solution efficiency and convergence. Finally, it utilizes local linear embedding manifold learning and anisotropic diffusion filtering for post-processing to restore misclassified texture details and correct spectral distortion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122510132A_ABST
    Figure CN122510132A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, and device for hyperspectral flare removal based on multi-scale texture guidance, belonging to the field of image processing technology. The method includes: constructing a flare degradation equation and a spectral gradient magnitude map; selecting candidate regions; calculating the dominant spectral direction based on multi-scale geometric features; constructing a diffusion tensor and regularization constraints; establishing a variational Bayesian optimization model; designing an adaptive threshold using residual wavelet transform; obtaining preliminary restoration results through iterative solving using the alternating direction multiplier method; and post-processing with manifold learning and anisotropic diffusion filtering to output the final flare-free hyperspectral image. This invention solves the problem of removing hyperspectral flares while preserving image texture details and spectral continuity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and specifically to a method, system, and device for hyperspectral flare removal based on multi-scale texture guidance. Background Technology

[0002] Hyperspectral imaging technology can simultaneously acquire the spatial geometric information of a target object and the spectral reflectance information of dozens to hundreds of consecutive bands, forming a three-dimensional data cube that integrates image and spectrum. Its applications are increasingly widespread in areas such as power equipment condition monitoring, remote sensing ground object identification, and precision agriculture. However, during actual acquisition, due to the influence of strong ambient light sources or the specular reflectance characteristics of the target surface, local intensity saturation flare areas may appear in hyperspectral images. These flare areas severely obscure the true texture details of the ground object and also alter the normal spectral reflectance curve, leading to significant errors in subsequent spectral unmixing, feature extraction, and target identification. Currently, there are two main methods for flare removal: one is the polarization imaging method using a physical model, and the other is the single-frame post-processing method for image restoration. The physical model method requires additional hardware, making its application cost higher; while in the image restoration method, the total variational regularization model and its variants are widely used due to their simplicity and efficiency.

[0003] Traditional total variational models apply the same smoothing to all pixels, failing to consider the differences between textured and flat regions in an image. This results in the removal of flares while over-smoothing important details such as tiny cracks and dirt textures on the insulator surface, reducing image fidelity. Furthermore, most existing methods only utilize information from the spatial domain, neglecting the rich spectral dimensional correlations in hyperspectral images. This leads to the inability to maintain the continuity of the spectral curve during flare removal, causing spectral distortion. While some deep learning-based methods have achieved certain results, they require a large amount of labeled training data and have weak generalization ability. Summary of the Invention

[0004] In view of the above-mentioned problems, a method, system, device and medium for hyperspectral flare removal based on multi-scale texture guidance are proposed.

[0005] Therefore, the technical problem solved by this invention is to accurately identify and protect the texture structure of an image and maintain the consistency of spectral dimensions while effectively separating the specular reflection components.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a hyperspectral flare removal method based on multi-scale texture guidance, comprising the following steps, Using the original hyperspectral image, a flare degradation equation is constructed, the spectral gradient magnitude map is calculated, initial flare candidate regions are selected, and multi-scale geometric features are extracted based on these regions to construct a texture dominance map. Based on the texture dominance map, the spectral covariance matrix is ​​calculated, the dominant spectral direction is obtained through eigenvalue decomposition, an anisotropic diffusion tensor is constructed, and a nonlocal self-similarity regularization constraint term is constructed based on the anisotropic diffusion tensor to constrain the grayscale consistency of similar pixels. Based on the flare degradation equation, the nonlocal self-similarity regularization constraint term, and the spectral gradient sparsity constraint term, a variational Bayesian optimization model is constructed. Based on the residual between the currently estimated flare-free image and the original image, wavelet transform decomposition is performed to construct an adaptive flare detection threshold. The variational Bayesian optimization model is iteratively solved using the alternating direction multiplier method to obtain a preliminary restored image. The preliminary restored image is then post-processed with manifold learning, and after anisotropic diffusion filtering, the final flare-free hyperspectral image is output.

[0007] As a preferred embodiment of the hyperspectral flare removal method based on multi-scale texture guidance described in this invention, the construction of the texture-dominant map includes: using a filter bank to decompose the image in multiple directions and at multiple scales, calculating the filter response energy at each scale and in each direction, and using the ratio of the maximum response energy at each scale and in each direction to the total response energy as the basic texture energy. A sigmoid function is used to nonlinearly enhance the texture energy of the initial flare candidate region to obtain a texture dominance map.

[0008] As a preferred embodiment of the hyperspectral flare removal method based on multi-scale texture guidance described in this invention, the construction of the anisotropic diffusion tensor includes: calculating the spectral covariance matrix of each pixel, performing eigenvalue decomposition on the covariance matrix, and taking the eigenvector corresponding to the largest eigenvalue as the dominant spectral direction of the current pixel. An anisotropic diffusion tensor is constructed based on the Euclidean distance between the dominant spectral direction and the dominant spectral direction of neighboring pixels, and the difference between the texture dominance map and the texture dominance map of neighboring pixels. The constraint on grayscale consistency of similar pixels includes finding a preset number of most similar pixels within a search window for each pixel. The similarity metric is anisotropic diffusion tensor weighted spectral angular distance, and the weighting coefficient is a texture penalty coefficient set to 0.5. The sum of squared grayscale differences between similar pixels is calculated, and a nonlocal self-similarity regularization constraint term is constructed by using a weighted sum with weights calculated as a negative exponential function of the weighted spectral angular distance squared and the weighted bandwidth ratio.

[0009] As a preferred embodiment of the hyperspectral flare removal method based on multi-scale texture guidance described in this invention, the construction of the variational Bayesian optimization model includes constructing an adaptive variational Bayesian spectral-spatial joint optimization model based on the flare degradation equation, the nonlocal self-similarity regularization constraint term, and the spectral gradient sparsity constraint term, and defining the joint posterior probability density function. The specular reflectance field in the flare degradation equation follows a Laplace distribution, the noise variance follows an inverse gamma distribution, and the spectral gradient sparse constraint term is weighted and combined with the squared L2 norm of the spectral gradient and the nonlocal self-similarity regularization constraint term to form the prior distribution of the image, and the posterior probability density function is jointly constructed.

[0010] As a preferred embodiment of the hyperspectral flare removal method based on multi-scale texture guidance described in this invention, the construction of the adaptive flare detection threshold includes: performing discrete wavelet transform decomposition on the residual to obtain the high-frequency subband coefficients of each layer and each direction; and taking the ratio of the median of the absolute values ​​of the subband coefficients of each direction and each scale to 0.6745 as the noise standard deviation estimate of the current scale and current direction. The logarithmic square root of the number of wavelet coefficients at each scale is calculated, multiplied by the noise standard deviation estimate, and then multiplied by the sum of the texture adjustment coefficient and the normalized value of the texture dominant spectrum to construct the texture-aware adaptive flare detection threshold.

[0011] As a preferred embodiment of the hyperspectral flare removal method based on multi-scale texture guidance described in this invention, the method for obtaining the preliminary restored image includes introducing auxiliary variables to decompose the original problem into a subproblem of updating the flare-free image, updating the specular reflectance field, updating the auxiliary variable, updating the noise variance, and updating the Lagrange multiplier. The subproblem of updating the flare-free image is solved by combining a noise variance weighted fidelity term with a nonlocal self-similarity regularization term; the subproblem of updating the specular reflectivity field is solved by soft thresholding iteration; the subproblem of updating the auxiliary variable is solved by a soft thresholding function; the subproblem of updating the noise variance is solved by combining the residual sum of squares with the inverse gamma distribution parameter; and the subproblem of updating the Lagrange multipliers is solved by combining the penalty parameter with the residual. The iteration stops when the relative change of the flare-free image between two adjacent iterations reaches a preset condition.

[0012] As a preferred embodiment of the hyperspectral flare removal method based on multi-scale texture guidance described in this invention, the output of the final flare-free hyperspectral image includes: for each pixel, finding a preset number of nearest neighbor pixels in the spatial neighborhood, wherein the neighborhood metric is a weighted combination of spectral angular distance and texture dominance spectrum difference. Calculate the local reconstruction weights and construct a global reconstruction error minimization objective function to solve for the low-dimensional embedding coordinates. Reconstruct the spectral curve through inverse mapping to obtain the manifold-corrected image. Anisotropic diffusion filtering is applied to the manifold-corrected image to output the final flare-free hyperspectral image.

[0013] This invention provides a hyperspectral flare removal system based on multi-scale texture guidance.

[0014] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a hyperspectral flare removal system based on multi-scale texture guidance, comprising: an image acquisition and physical modeling module, a texture feature extraction module, a spectral-spatial statistical modeling module, a variational Bayesian optimization and iterative solution module, and a post-processing and output module.

[0015] The image acquisition and physical modeling module is used to acquire raw hyperspectral image data, and according to the physical laws of light-matter interaction, decompose the pixel values ​​in the image into diffuse reflection components and specular reflection components, calculate the spectral gradient amplitude map, and screen the initial flare candidate regions.

[0016] The texture feature extraction module is used to receive information about the initial flare candidate region, decompose each band image using a multi-directional, multi-scale filter bank, calculate the filter response energy at each direction and scale, and construct a texture dominance map to distinguish between flat regions and texture regions in the image.

[0017] The spectral-spatial statistical modeling module is used to calculate the spectral covariance matrix of each pixel using the texture dominance map, obtain the dominant spectral direction through eigenvalue decomposition, construct an anisotropic diffusion tensor in combination with texture information to measure the similarity between pixels, and construct a nonlocal self-similarity regularization constraint term to constrain the grayscale consistency of similar pixels.

[0018] The variational Bayesian optimization and iterative solution module is used to integrate the flare degradation equation, the nonlocal self-similarity regularization constraint term, and the spectral gradient sparsity constraint term to establish an adaptive variational Bayesian spectral-spatial joint optimization model. In the iterative solution, based on the residual between the currently estimated flare-free image and the original image, discrete wavelet transform decomposition is performed to construct a texture-aware adaptive flare detection threshold. The model is iteratively solved using the alternating direction multiplier method until convergence, resulting in a preliminary restored image.

[0019] The post-processing and output module is used to perform manifold learning post-processing on the preliminary restored image, using a local linear embedding algorithm to preserve the intrinsic low-dimensional structure of the image, and anisotropic diffusion filtering to output a hyperspectral image after flare removal.

[0020] 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 hyperspectral flare removal method based on multi-scale texture guidance.

[0021] 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 hyperspectral flare removal method based on multi-scale texture guidance.

[0022] The beneficial effects of this invention are as follows: A flare degradation equation is constructed based on a physical model, and initial candidate regions are extracted. A multi-scale Log-Gabor filter is used to construct a texture dominance map, and nonlinear enhancement is used to highlight the flare edge texture, effectively distinguishing between real texture and flare regions. The dominant spectral direction is obtained through spectral covariance matrix decomposition, and an anisotropic diffusion tensor is constructed in conjunction with the texture map, achieving a joint measure of spectral similarity and texture similarity. The diffusion tensor is used to find similar pixels within a search window, and a nonlocal self-similarity regularization constraint is constructed to fully utilize the global redundancy information of the image to suppress flare residue. The method unifies the physical degradation model, nonlocal self-similarity constraints, and spectral gradient sparsity constraints within a variational Bayesian framework, enabling synergistic optimization of various constraints and balancing spectral continuity with spatial structure preservation. Furthermore, it achieves dynamic adjustment of the flare detection threshold through wavelet domain residual analysis and texture-aware adaptive threshold updating, avoiding misclassification of texture regions. The method employs alternating direction multipliers to decompose the complex problem into five analytically solvable subproblems, ensuring solution efficiency and convergence. Finally, it utilizes local linear embedding manifold learning and anisotropic diffusion filtering for post-processing to restore misclassified texture details and correct spectral distortion. Attached Figure Description

[0023] 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.

[0024] Figure 1 This is a flowchart illustrating the overall process of a hyperspectral flare removal method based on multi-scale texture guidance, as provided in an embodiment of the present invention.

[0025] Figure 2 This is a schematic diagram illustrating the process of obtaining a preliminary restored image using a multi-scale texture-guided hyperspectral flare removal method provided in an embodiment of the present invention.

[0026] Figure 3 This is a system block diagram of a hyperspectral flare removal system based on multi-scale texture guidance provided in an embodiment of the present invention. Detailed Implementation

[0027] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, 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, and 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.

[0028] Example 1, referring to Figure 1 As an embodiment of the present invention, a hyperspectral flare removal method based on multi-scale texture guidance is provided, comprising: S100: Using the original hyperspectral image, construct the flare degradation equation, calculate the spectral gradient magnitude map, select the initial flare candidate region, and based on the initial flare candidate region, extract multi-scale geometric features to construct the texture-dominant map.

[0029] S200: Based on the texture dominance map, calculate the spectral covariance matrix, obtain the dominant spectral direction through eigenvalue decomposition, construct an anisotropic diffusion tensor, and construct a nonlocal self-similarity regularization constraint term based on the anisotropic diffusion tensor to constrain the grayscale consistency of similar pixels.

[0030] S300: Based on the flare degradation equation, nonlocal self-similarity regularization constraint term and spectral gradient sparsity constraint term, a variational Bayesian optimization model is constructed, and wavelet transform decomposition is performed based on the residual between the currently estimated flare-free image and the original image to construct an adaptive flare detection threshold.

[0031] S400: The variational Bayesian optimization model is solved iteratively by alternating direction multiplier method to obtain a preliminary restored image. The preliminary restored image is then post-processed by manifold learning and anisotropic diffusion filtering to output the final flare-free hyperspectral image.

[0032] It should be noted that this invention, by constructing a physical flare degradation model, extracting texture-dominant spectra, establishing a spectral-spatial joint statistical model, introducing nonlocal self-similarity regularization constraints, designing a variational Bayesian optimization framework, constructing an adaptive threshold update mechanism, employing an alternating direction multiplier method for iterative solution, and performing manifold learning post-processing, accurately removes hyperspectral image flares while fully preserving image texture details and spectral continuity.

[0033] Example 2, refer to Figure 1 and Figure 2 This is a second embodiment of the present invention, which provides a hyperspectral flare removal method based on multi-scale texture guidance, comprising: In S100, the selection of the initial flare candidate region includes steps S101~S103: S101: Acquire raw hyperspectral image data by using an HSG-1P hyperspectral imager mounted on a drone platform to collect data on the insulator string.

[0034] The imaging wavelength range of the imager is 400 nanometers to 1000 nanometers, the spectral resolution is greater than 3.5 nanometers, the number of spatial channels is no less than 3400, and the number of spectral bands is no less than 880.

[0035] The acquired raw hyperspectral image data is represented by a matrix with a three-dimensional structure. The first dimension is the number of pixels in the image height direction, the second dimension is the number of pixels in the image width direction, and the third dimension is the number of spectral bands.

[0036] S102: Construct a flare degradation equation based on a physical model.

[0037] The flare degradation equation is explained based on the physical mechanism of light-matter interaction, and uses a nonlinear combination of diffuse and specular reflection components to represent the raw image obtained by the hyperspectral imager.

[0038] It should also be noted that, for pixel values ​​at any spatial location and any wavelength, the flare degradation equation is expressed as:

[0039] in, For spatial coordinates, For wavelength, Diffuse reflectance This represents the raw pixel values ​​acquired by the hyperspectral imager at spatial location (x, y) and wavelength λ, i.e., the raw hyperspectral data including flare interference. For ambient light intensity, For specular reflectivity, Light source intensity, The angle between the surface normal and the direction of the light source. The bandwidth parameter for specular reflection is set to 0.3. It is an exponential function with the natural constant e as its base.

[0040] It should be noted that diffuse reflectance indicates the diffuse reflection of light by a target object and is related to the object's own optical properties; ambient light intensity reflects the energy distribution of uniformly existing ambient light in the scene across different wavelengths; specular reflectance reflects the strength of specular reflection on the surface of a target object; light source intensity reflects the energy distribution of an active light source across different wavelengths; the angle between the surface normal and the direction of the light source determines the distribution of specular reflection intensity; and the specular reflection bandwidth parameter affects the concentration of specular reflection energy.

[0041] In this embodiment, the specular reflection bandwidth parameter is set to 0.3. This value was obtained through experiments, specifically by fitting the parameter to the hyperspectral images of insulator surfaces containing different materials. A value of 0.3 can accurately reflect the specular reflection characteristics of the insulator surface.

[0042] S103: Calculate the spectral gradient magnitude map for each band and obtain the initial flare candidate region.

[0043] For any band image, a horizontal gradient operator and a vertical gradient operator are defined. The calculation of the spectral gradient magnitude includes taking the square root of the sum of the squares of the horizontal gradient and the squares of the vertical gradient. The spectral gradient magnitude map reflects the degree of spatial variation of pixel values ​​in the image, and the pixels corresponding to the top 5% quantiles of the gradient magnitude are selected as the initial flare candidate regions.

[0044] The percentiles were determined by statistically analyzing one hundred sets of hyperspectral images of insulators acquired under different lighting conditions. The distribution of spectral gradient amplitudes of pixels in flare areas and non-flare areas was calculated. The statistical results showed that the gradient amplitude in flare areas was significantly greater than that in non-flare areas. The top 5 percentiles of the gradient amplitude distribution could cover more than 95% of the flare areas, with a false detection rate of no more than 3%.

[0045] Furthermore, in step S100, constructing the texture dominance map includes extracting multi-scale geometric features from each band image based on the obtained initial flare candidate regions to construct the texture dominance map, specifically including steps S111~S113: S111: The image is decomposed into multiple directions and scales using a Log-Gabor filter bank. The filtered response energy of each scale and direction is calculated, and the ratio of the maximum response energy of each scale and direction to the total response energy is used as the basic texture energy.

[0046] It should be noted that the transfer function of the Log-Gabor filter contains two main factors: the first factor is a function of the radial frequency, and the second factor is a function of the direction angle, expressed by the formula:

[0047] in, This is the transfer function of the Log-Gabor filter, used to describe the filter's frequency response characteristics at different radial frequencies and azimuth angles. Radial frequency reflects the spatial frequency of textures or structures in an image. The direction angle reflects the selectivity of the filter in spatial directions. The center frequency controls the radial position of the filter response peak, and is set to 0.2. The frequency bandwidth controls the filter's coverage in the frequency domain; it is set to 0.65. The preferred direction for the filter is the angle at which the filter response is maximized. The angular bandwidth controls the filter's coverage in the directional domain; it is set to 0.4. Let be a logarithmic function with base e. It is an exponential function with the natural constant e as its base.

[0048] It should also be noted that the center frequency in this embodiment is set to 0.2, so that the filter can extract the typical texture scale of the contamination distribution and cracks on the surface of the insulator; the filter direction is taken in 4 directions, namely 0°, 45°, 90° and 135°, covering the horizontal, vertical and two diagonal directions, which can extract different texture features; the number of filter scales is 4, with four texture scale levels from fine to coarse.

[0049] S112: For each scale and each direction, the image is filtered to obtain a filtered response. The filtered response contains two components: a real part and an imaginary part. The filtered response energy is calculated by the sum of the squares of the real part and the squares of the imaginary part of the filtered response.

[0050] S113: The texture energy of the initial flare candidate region is nonlinearly enhanced using a sigmoid function to obtain a texture-dominant map.

[0051] The texture energy of the initial flare candidate region is calculated, and nonlinear enhancement is used to increase the pixel texture energy in the current region. The enhancement function is an S-shaped function. When the pixel belongs to the initial flare candidate region, the enhancement factor is large, increasing the texture energy of the current region. When the pixel does not belong to the initial flare candidate region, the enhancement factor is small, keeping the original texture energy unchanged. This allows the model to adaptively distinguish between the flat area inside the flare and the texture area at the edge of the flare.

[0052] It should be noted that the base texture energy value is the ratio of the maximum response energy at each scale and in each direction to the sum of the response energies at all scales and in all directions. This ratio reflects the saliency of the texture at the current pixel.

[0053] In step S200, constructing the anisotropic diffusion tensor includes, based on the constructed texture dominance map, constructing a spectral-spatial joint statistical model to describe the intrinsic structure of the image and provide a metric basis for subsequent nonlocal self-similarity constraints, specifically including steps S201~S20: S201: Calculate the spectral covariance matrix of each pixel. For a pixel at any spatial location, the spectral vector is composed of the spectral values ​​of all bands. Calculate the spectral mean of the current pixel.

[0054] For each element in the spectral covariance matrix, i.e. the relationship between the m-th band and the n-th band, subtract the spectral mean from the spectral value of the m-th band of the current pixel, multiply it by the spectral value of the n-th band, and then divide by the arithmetic mean of all band pairs; the dimension of the spectral covariance matrix is ​​the number of bands.

[0055] S202: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors. Arrange the eigenvalues ​​in descending order and sort the corresponding eigenvectors in order. Take the eigenvector corresponding to the largest eigenvalue as the dominant spectral direction of the current pixel. The dominant spectral direction reflects the main trend of pixel change in the spectral dimension. Insulator surfaces of different materials have different dominant spectral direction characteristics.

[0056] S203: Based on the Euclidean distance between the dominant spectral direction and the dominant spectral direction of neighboring pixels, and the difference between the texture dominance map and the texture dominance map of neighboring pixels, an anisotropic diffusion tensor is constructed to measure the similarity between neighboring pixels and the center pixel.

[0057] It should be noted that, for the center pixel and neighboring pixels, the calculation of the diffusion tensor includes: calculating the Euclidean distance between the dominant spectral direction of the center pixel and the dominant spectral direction of the neighboring pixels, taking the negative exponential function of the ratio of the square of the Euclidean distance to the square of twice the bandwidth of the spectral direction; and calculating the negative exponential function of the ratio of the square of the difference between the dominant texture map of the center pixel and the dominant texture map of the neighboring pixels to the square of twice the texture bandwidth, and multiplying the two exponential functions to obtain the diffusion tensor value.

[0058] In this embodiment, the spectral bandwidth is set to 0.15, and the value is obtained through statistical analysis of the spectral distribution of insulator surfaces of different materials. Experimental results show that a bandwidth of 0.15 can distinguish between pixels of the same material and pixels of different materials. In this embodiment, the texture bandwidth is set to 0.25, and the value is obtained through statistical analysis of regions with different texture types. Experimental results show that a bandwidth of 0.25 can effectively distinguish between smooth regions and textured regions.

[0059] Furthermore, in step S200, the constraint on similar pixel grayscale consistency includes constructing a nonlocal self-similarity regularization constraint term based on the constructed anisotropic diffusion tensor, utilizing the global redundancy information present in the hyperspectral image to suppress flares while preserving texture structure, specifically including steps S211~S2. S211: For each pixel, find a preset number of closest pixels within the search window. The size of the search window is set to 15×15 pixels. In this embodiment, this size can achieve a balance between computational efficiency and the range of similar pixels. The number of most similar pixels is set to 8 in this embodiment. Statistical analysis shows that 8 most similar pixels can capture most of the self-similarity information.

[0060] S212: The similarity measure uses anisotropic diffusion tensor weighted spectral angular distance. The weighting coefficient is the texture penalty coefficient set to 0.5. The spectral angular distance reflects the angle between two spectral vectors. The smaller the spectral angular distance value, the more similar the two spectra are.

[0061] It should be noted that for the center pixel and candidate pixels, the spectral angular distance between the dominant spectral directions is obtained by calculating the inverse cosine of the ratio of the inner product of the two vectors to the product of their respective magnitudes. The absolute value of the difference in the dominant texture map is calculated, and the difference is multiplied by the texture penalty coefficient and then added to the spectral angular distance to obtain the weighted spectral angular distance.

[0062] In this embodiment, the texture penalty coefficient is set to 0.5. The value was obtained through experimental optimization and can achieve a balance between spectral similarity and texture similarity.

[0063] S213: Calculate the sum of squared grayscale differences between similar pixels, and construct a nonlocal self-similarity regularization constraint term by using a weighted sum with weights of a negative exponential function of the weighted spectral angular distance squared and the weighted bandwidth ratio.

[0064] The weighting coefficients between similar pixels are obtained by calculating the negative exponential function of the ratio of the square of the weighted spectral angular distance to the square of twice the weighted bandwidth. In this embodiment, the weighted bandwidth is set to 0.2.

[0065] The calculation of the regularization term involves multiplying the square of the difference between the current pixel's grayscale value and the grayscale value of the similar pixel for all pixels, all bands, and the most similar pixel corresponding to each pixel, multiplying it by the corresponding weighting coefficient, and summing all the results. By constraining the grayscale consistency between similar pixels, the regularization term forces pixels with similar spectral-texture features in the restored image to maintain close grayscale values, thereby effectively suppressing flare residue.

[0066] In step S300, constructing the variational Bayesian optimization model includes steps S301 to S304: S301: Based on the flare degradation equation, nonlocal self-similarity regularization constraint term, and spectral gradient sparsity constraint term, an adaptive variational Bayesian spectral-spatial joint optimization model is constructed, and a joint posterior probability density function is defined.

[0067] Define the probabilistic graphical structure of the model. The probabilistic graphical structure contains three types of nodes: observed variable nodes, latent variable nodes, and hyperparameter nodes. The observed variable nodes are the original hyperspectral image data, the latent variable nodes are the flare-free image and the specular reflectance field, and the hyperparameter nodes are the noise variance, spectral smoothing weight, nonlocal self-similarity weight, spatial smoothing weight, and the shape parameter and scale parameter of the inverse gamma distribution.

[0068] It should be noted that the arrows in the probability diagram represent the conditional dependencies between variables. The observed variables depend on the flare-free image, the specular reflectance field, and the noise variance. The flare-free image depends on the spectral smoothing weight and the nonlocal self-similarity weight. The specular reflectance field depends on the spatial smoothing weight, and the noise variance depends on the parameters of the inverse gamma distribution.

[0069] S302: Define the prior distribution of each variable. Define the prior distribution for each latent variable and hyperparameter. The choice of prior distribution is based on physical constraints and computational convenience. For flare-free images, the operator defines its prior probability density function as a Gibbs distribution.

[0070] The prior energy function consists of two terms. The first term is a spectral gradient sparsity constraint term, expressed in the form of the square of the L2 norm of the spectral gradient, which promotes relatively stable reflectance variation between adjacent bands. The spectral smoothing weight is set to 0.1 here. The second term is a term based on nonlocal self-similarity regularization constraint, which constrains the grayscale consistency of similar pixels. The nonlocal self-similarity weight is set to 0.5 here. The sum of the two energy terms forms the prior energy function of the flare-free image. The probability density function is proportional to the negative value of the energy function.

[0071] For the specular reflectivity field, the prior probability density function is defined as a Laplace distribution. The probability density function of the Laplace distribution includes the L1 norm term of the spatial gradient, which encourages the specular reflectivity field to maintain a piecewise constant characteristic in space, that is, it changes gently in flat regions and remains sharp at the edges. The spatial smoothing weight is set to 0.3 in this embodiment. The prior can be transformed into an analytically solvable form by introducing auxiliary variables.

[0072] For noise variance, the prior probability density function is defined as an inverse gamma distribution. The probability density function of the inverse gamma distribution is determined by the shape parameter and the scale parameter. In this embodiment, the shape parameter is set to 2 and the scale parameter is set to 0.1. The parameter settings enable the prior distribution to have a moderate information intensity, which neither too strongly constrains the noise variance nor fails to provide sufficient regularization.

[0073] S303: Define the likelihood function, which is the probability distribution of observed data given latent variables and hyperparameters. The likelihood function is constructed based on the physical degradation model. For each pixel and each band, the observed value is equal to the sum of the diffuse reflection component and the specular reflection component plus independent and identically distributed Gaussian noise.

[0074] Among them, the variance of Gaussian noise is the noise variance, the likelihood function is in the form of a Gaussian distribution, the mean is the value calculated by the physical degradation model, the variance is the noise variance, and the joint likelihood function of all pixels and all bands is the product of the independent Gaussian distributions.

[0075] S304: The specular reflectance field in the flare degradation equation follows a Laplace distribution, the noise variance follows an inverse gamma distribution, and the spectral gradient sparse constraint term is weighted and combined with the L2 norm squared of the spectral gradient and the nonlocal self-similarity regularization constraint term as the prior distribution of the image, and the posterior probability density function is jointly constructed.

[0076] According to Bayes' theorem, the joint posterior probability density function is proportional to the product of the likelihood function and the prior probability density function. By multiplying the prior distributions defined in the sub-step with the defined likelihood function, we obtain the expression for the joint posterior probability density function.

[0077] The expression for the joint posterior probability density function contains the product of multiple exponential functions, with the exponential part being the weighted sum of the energy functions. Maximizing the posterior probability density function is equivalent to minimizing the negative logarithm, that is, minimizing an objective function that includes a data fidelity term, a spectral smoothing term, a nonlocal self-similarity term, a spatially sparse term for specular reflectance, and a noise variance prior term.

[0078] The correlations between various variables are determined. The correlation between flare-free images depends on the original image, specular reflectance field, and noise variance. The correlation between specular reflectance fields depends on the flare-free image, noise variance, and noise variance. The correlation between noise variances depends on all residuals. A probabilistic generation model is constructed to characterize the flare generation process and the intrinsic structural characteristics of the image.

[0079] Furthermore, in step S300, constructing the adaptive flare detection threshold includes, during the iterative solution process, calculating the residual based on the current estimate, performing multi-scale statistical analysis on the residual, and constructing a texture-aware adaptive flare detection threshold, specifically including steps S311~S315: S311: In the t-th iteration, obtain the currently estimated flare-free image, and subtract the currently estimated flare-free image from the original image to obtain the residual image.

[0080] In the residual image, the flare residue region consists of high-intensity pixel clusters, while the non-flare region consists of noise with near-zero values. The spatial and spectral dimensions of the residual image are the same as those of the original image. Figure 1 Sample.

[0081] S312: Perform discrete wavelet transform decomposition on the residuals to obtain the high-frequency subband coefficients of each layer and direction.

[0082] The residual image is decomposed into multiple scales using discrete wavelet transform. The discrete wavelet transform used high-pass and low-pass filters to divide the image into different scale sub-bands. The fourth-order Daubechies wavelet basis function is selected as the sub-band function for decomposition. The number of decomposition layers is set to 3, namely fine scale layer, medium scale layer and coarse scale layer.

[0083] For each decomposition scale, four subbands are obtained: one low-frequency approximation subband and three high-frequency detail subbands. The high-frequency detail subbands correspond to the horizontal, vertical, and diagonal directions, respectively. The low-frequency approximation subband contains the main energy of the image, while the high-frequency detail subbands contain the edge and texture information of the image. The flare remnant region is represented by a cluster of pixels with a large coefficient amplitude in the high-frequency subband.

[0084] S313: The ratio of the median of the absolute values ​​of the sub-band coefficients at each scale and direction to 0.6745 is used as the noise standard deviation estimate for the current scale and direction.

[0085] For each high-frequency subband, the noise standard deviation is estimated using the median absolute deviation method. The absolute value of the high-frequency subband coefficient is taken, the median of the absolute value is calculated, and the median is divided by 0.6745.

[0086] It should be noted that 0.6745 is the proportionality coefficient between the median and standard deviation of the standard Gaussian distribution. When the coefficient follows a Gaussian distribution, the estimated value is an unbiased estimate of the true standard deviation, which can effectively suppress the interference of the flare residual coefficient on the noise standard deviation, because the flare coefficient is generally large, but the median is not affected by extreme values.

[0087] S314: Calculate the coefficient quantity factor at each scale and the number of wavelet coefficients at each decomposition scale.

[0088] For the j-th scale, the number of wavelet coefficients is multiplied by the height and width of the sub-band at that scale, and the natural logarithm of the coefficients is taken as the square root.

[0089] The coefficient quantity factor reflects the number of statistical samples that can be used at the current scale. The larger the sample size, the smaller the threshold can be, thus retaining more information, and vice versa.

[0090] The texture adjustment factor is calculated using the texture dominance map. For each pixel location, the value of the texture dominance map at the current location is taken, and the maximum and minimum values ​​of the texture dominance map in the entire image are calculated.

[0091] It should be noted that the calculation of the texture adjustment factor includes 1 plus the texture adjustment coefficient, multiplied by the difference between the texture dominance spectrum value (within parentheses) and the minimum value, divided by the difference between the maximum and minimum values. In this embodiment, the texture adjustment coefficient is set to 0.8. When the texture dominance spectrum value is large, the texture adjustment factor is greater than 1, and the threshold is increased; when the texture dominance spectrum value is small, the texture adjustment factor is close to 1, and the threshold remains unchanged.

[0092] S315: Calculate the logarithmic square root of the number of wavelet coefficients at each scale, multiply it by the noise standard deviation estimate, and then multiply it by the sum of the texture adjustment coefficient and the normalized value of the texture dominant spectrum to construct the texture-aware adaptive flare detection threshold.

[0093] The estimated noise standard deviation, the calculated coefficient factor, and the calculated texture adjustment factor are multiplied together to obtain the adaptive flare detection threshold, which is adaptive to different scales, directions, and spatial locations.

[0094] In areas with rich texture, the threshold is automatically raised to identify the edges of the texture as flares, while in flat areas the threshold is lowered to detect residual flares.

[0095] The calculated adaptive flare detection threshold is then saved and used as the basis for updating parameters in the next iteration. The threshold is updated every five iterations to reflect the current changes in the residual, without updating too frequently and increasing the computational load.

[0096] In step S400, as Figure 2 The process of obtaining the preliminary restored image includes iteratively solving the adaptive variational Bayesian spectral-spatial joint optimization model using the alternating direction multiplier method until convergence, thereby obtaining the preliminary restored image. Specifically, this includes steps S401-S406: S401: By introducing auxiliary variables, the original problem is decomposed into a subproblem of updating the flare-free image, updating the specular reflectivity field, updating the auxiliary variables, updating the noise variance, and updating the Lagrange multipliers.

[0097] Auxiliary variables are introduced to decouple the coupling terms in the original problem. Specifically, auxiliary variables are introduced to replace the spectral gradient term, the horizontal gradient of the specular reflectivity field, and the vertical gradient of the specular reflectivity field. Each constraint is assigned a corresponding Lagrange multiplier to ensure that the constraint conditions are gradually met during the iteration process. The penalty coefficient is used to control the penalty intensity when the constraint is violated, and it is 1 in this embodiment.

[0098] S402: The subproblem of updating flare-free images is solved by combining a noise variance weighted fidelity term and a nonlocal self-similar regularization term.

[0099] With fixed variables, the subproblem of flare-free images is solved. The objective function of the subproblem has three terms: the first term is a noise variance weighted fidelity term, which reflects the fit between the observed data and the estimated value, and the noise variance is taken as the estimated value; the second term is a nonlocal self-similarity regularization term, which constrains the continuity of the spectral dimension by multiplying the square of the L2 norm of the spectral gradient by the spectral smoothing weight; the third term is a nonlocal self-similarity regularization term, which constrains the gray level consistency between similar pixels by multiplying the regularization term calculated in step S213 by the nonlocal self-similarity weight.

[0100] The analytical solution to the flare-free image is obtained by solving a system of linear equations. The coefficient matrix of the system of equations includes the inverse of the noise variance multiplied by the identity matrix, the spectral smoothing operator multiplied by the spectral smoothing weight, and the nonlocal self-similar Laplacian matrix multiplied by the nonlocal self-similar weight. The right-hand side of the system of equations includes the inverse of the noise variance multiplied by the original image, the transpose of the spectral smoothing operator multiplied by the current auxiliary variable, and the nonlocal self-similar Laplacian matrix multiplied by the current flare-free image estimate.

[0101] The conjugate gradient method is used for iterative solution. The number of iterations for the conjugate gradient method is set to 50, and the convergence tolerance is set to 10. -4 .

[0102] S403: The problem of updating the specular reflectivity field is solved iteratively using a soft threshold.

[0103] Under the condition of fixed variables, solve the subproblem of specular reflectivity field. The objective function of the subproblem contains two terms: the first term is the fidelity term, which constrains the specular reflectivity field to make the physical degradation model consistent with the observation data; the second term is the spatial gradient L1 norm regularization term, which encourages piecewise constants in the specular reflectivity field.

[0104] The subproblem is solved using a soft thresholding iterative algorithm, which involves ignoring the regularization term, solving the least squares solution of the fidelity term to obtain an initial estimate of the specular reflectivity field, and applying soft thresholding operations in the horizontal and vertical directions to the initial estimate. The least squares update and soft thresholding operations are performed alternately for a total of 10 iterations to obtain the updated value of the specular reflectivity field.

[0105] The soft thresholding operation is that, for the input value and the threshold, the output value is the input value minus the threshold and then taking the maximum value. The sign function of the input value is applied to this value, and the coefficients with amplitudes less than the threshold are set to 0, thereby achieving the purpose of sparsity. The threshold is determined by the ratio of spatial smoothing weights to penalty parameters.

[0106] S404: The subproblem of updating auxiliary variables is solved using a soft threshold function.

[0107] Under the condition of fixed variables, solve the subproblem of auxiliary variables. The objective function of the subproblem contains two terms: the first term is the deviation penalty term between the auxiliary variable and the corresponding gradient; the second term is the sparsity regularization term of the auxiliary variable.

[0108] Specifically, for the spectral gradient auxiliary variable, the spectral gradient of the current flare-free image is calculated, the corresponding Lagrange multiplier is added to the penalty parameter, and a soft thresholding operation is applied to the result, with the threshold set as the spectral smoothing weight divided by the penalty parameter.

[0109] For the horizontal gradient auxiliary variable of the specular reflectivity field, calculate the horizontal gradient of the current specular reflectivity field, add the corresponding Lagrange multiplier division penalty parameter, and apply a soft thresholding operation to the result. The threshold is set to the spatial smoothing weight division penalty parameter.

[0110] The vertical gradient auxiliary variable of the specular reflectivity field is treated in the same way as the horizontal direction.

[0111] S405: The problem of updating the noise variance subproblem is solved by combining the sum of squared residuals and the inverse gamma distribution parameters.

[0112] Under fixed variables, the subproblem of noise variance is solved. The objective function of the subproblem consists of two parts. The first part is the contribution of noise variance to the likelihood function, which is the sum of squared residuals divided by twice the noise variance. The second part is the inverse gamma prior of the noise variance, which is the shape parameter within the negative brackets multiplied by 1 and the logarithm of the noise variance minus the scale parameter divided by the noise variance.

[0113] The new noise variance estimate is the sum of squared residuals plus twice the scale parameter, divided by the total number of pixels in the image plus twice the shape parameter plus 2.

[0114] The residual sum of squares is the sum of squares of the differences between the original image and the calculated value of the physical degradation model. The formula is used to ensure that the noise variance tends to the true noise value after each iteration.

[0115] S406: The subproblem of updating the Lagrange multipliers is solved by combining the penalty parameter and the residual. The iteration stops when the relative change of the flare-free image between two adjacent iterations reaches the preset condition.

[0116] Updating the Lagrange multipliers corresponding to each constraint involves adding the penalty parameter to the original multiplier and multiplying it by the constraint residual, where the constraint residual is the difference between the gradient and the auxiliary variable.

[0117] After each iteration, the relative change in the flare-free image between two adjacent iterations is calculated. This relative change is calculated by dividing the Frobenius norm of the difference between the current estimate and the previous estimate by the Frobenius norm of the previous estimate. When the relative change is less than 10... -5 When the solution is considered to have converged, the iteration stops; when the maximum number of iterations, 25, the iteration also stops.

[0118] Step S300 is called every five iterations to update the adaptive flare detection threshold based on the current residual. The updated threshold is then used for soft thresholding in subsequent iterations. The complex variational Bayesian optimization model is solved efficiently using the alternating direction multiplier method, resulting in a preliminary restored flare-free image.

[0119] Furthermore, in step S400, outputting the final flare-free hyperspectral image includes, after the iterative solution converges, performing manifold learning post-processing on the obtained preliminary restored image to restore the misjudged texture details and enhance spectral continuity, and outputting the final flare-free hyperspectral image, specifically including steps S411~S414: S411: For each pixel, find a preset number of nearest neighbor pixels in the spatial neighborhood. The neighborhood metric is a weighted combination of spectral angular distance and texture dominance spectrum difference.

[0120] The local linear embedding algorithm was used for manifold learning. The key parameters of the algorithm were determined. The spatial neighborhood size was set to 7 pixels × 7 pixels, that is, the search window of each pixel contains 49 neighboring pixels. The number of nearest neighbor pixels was set to 12, that is, the 12 pixels closest to the center pixel were selected from these 49 neighboring pixels. The final embedding dimension was set to 3-dimensional, which is beneficial for subsequent spectral reconstruction.

[0121] To construct a neighborhood graph and solve for similarity, for each pixel in the initially restored image, the spectral vector is regarded as a point in a high-dimensional space, and then the weighted distance between the center pixel and each neighboring pixel is calculated in the spatial neighborhood.

[0122] It should be noted that the weighted distance is obtained by weighting the spectral angular distance and the difference in texture dominance. The spectral angular distance is represented by the angle between two spectral vectors, reflecting the degree of spectral similarity; the difference in texture dominance is an absolute value, reflecting the degree of texture similarity. The texture weight coefficient is set to 0.2. Through experimental optimization, it is found that a good balance is achieved between spectral similarity and texture similarity.

[0123] The 12 neighboring pixels with the smallest weighted distance are used as the nearest neighbors of the center pixel. The indices of these neighboring pixels are recorded to obtain a sparse neighborhood graph. Each node in the graph represents a pixel, and each edge connects a pixel to its nearest neighbor pixel.

[0124] S412: Calculating local reconstruction weights includes, for each pixel, calculating a set of reconstruction weights such that the spectral vector of the current pixel can be best approximated by a linear combination of the spectral vectors of the nearest neighbor pixels.

[0125] Specifically, a local covariance matrix is ​​constructed, with elements being the inner product between nearest-neighbor pixels, and a system of linear equations is solved. The constraint condition of the system of equations is that the sum of all weights equals 1. The system of linear equations is solved by solving a least-squares problem with equality constraints to obtain a closed-form solution.

[0126] During the solution process, the covariance matrix is ​​regularized by adding a small perturbation to the diagonal elements to ensure matrix invertibility. The regularization parameter is set to 10. -3 Multiply the trace of the covariance matrix.

[0127] The obtained reconstruction weights reflect the degree of contribution of each neighboring pixel to the center pixel. Neighboring pixels with spectra similar to the center pixel have higher weights, while neighboring pixels with spectra different from the center pixel have lower weights.

[0128] S413: Construct a global reconstruction error minimization objective function to solve for low-dimensional embedded coordinates, and reconstruct the spectral curve through inverse mapping to obtain the manifold-corrected image.

[0129] Treating the low-dimensional embedding coordinates of each pixel as unknown variables, we create an objective function that minimizes the global reconstruction error. The objective function is the sum of the reconstruction errors of all pixels. The reconstruction error of each pixel is defined as the square of the weighted sum of the low-dimensional embedding coordinates minus the weighted sum of the nearest neighbor low-dimensional embedding coordinates. The constraint is that the covariance matrix of the low-dimensional embedding is the identity matrix, which guarantees the uniqueness of the solution and prevents degeneracy.

[0130] The optimization problem is transformed into solving the eigenvalue problem of a sparse matrix. A sparse matrix is ​​constructed, and the elements are determined by the reconstructed weights.

[0131] Furthermore, the sparse matrix is ​​defined as the identity matrix minus the weight matrix, multiplied by the transpose of the identity matrix minus the weight matrix, and the eigenvector corresponding to the smallest eigenvalue of the sparse matrix is ​​calculated. The second to the first embedding dimension plus an eigenvector are taken to form a low-dimensional embedding coordinate matrix. The solution process is implemented through a sparse eigenvalue solver, and the computational complexity is linearly related to the number of image pixels.

[0132] By reconstructing the spectral curve through inverse mapping, after obtaining the low-dimensional embedded coordinates, the image pixels are mapped back to the original spectral space to obtain the manifold-corrected image. The inverse mapping process uses the radial basis function interpolation method.

[0133] Furthermore, for each pixel, the nearest neighbor pixel is found in the neighborhood of the low-dimensional embedded coordinates, and the corrected spectral value of the current pixel is obtained by interpolation using the original spectral value of the pixel through a radial basis function. The radial basis function uses a Gaussian kernel, and the kernel width is set to the median of all paired distances.

[0134] S414: Performs anisotropic diffusion filtering on the manifold-corrected image to output the final flare-free hyperspectral image.

[0135] Anisotropic diffusion filtering is applied to the manifold-corrected image to enhance spatial continuity and suppress minor noise. The manifold-corrected image is used as the initial value, and the gradient magnitude of the image is calculated for each iteration step.

[0136] The diffusion coefficient is calculated as a negative exponential function of the ratio of the square of the gradient magnitude to the square of the edge strength threshold. The edge strength threshold is set to 0.15, and the value is obtained by testing images with different edge intensities. This method can effectively preserve the distinction between strong and weak edges.

[0137] Discretization is performed using an explicit difference scheme. The updated value of each pixel is equal to the current value plus the step size multiplied by the divergence operator, which is the diffusion coefficient multiplied by the sum of the differences of the gradient in the four directions. The step size is set to 0.1 to ensure numerical stability, and the number of iterations is set to 10 to ensure that the diffusion process is sufficient but not overly smooth.

[0138] It should be noted that the flare-free hyperspectral image obtained by anisotropic diffusion filtering is the final output. The image removes flares while preserving the texture details and spectral fingerprint of the insulator surface.

[0139] Example 3, referring to Figure 3 This is the third embodiment of the present invention. This embodiment provides a hyperspectral flare removal system based on multi-scale texture guidance, including an image acquisition and physical modeling module, a texture feature extraction module, a spectral-spatial statistical modeling module, a variational Bayesian optimization and iterative solution module, and a post-processing and output module.

[0140] The image acquisition and physical modeling module is used to acquire raw hyperspectral image data, decompose the pixel values ​​in the image into diffuse reflection components and specular reflection components according to the physical laws of light-matter interaction, calculate the spectral gradient amplitude map, and select the initial flare candidate region.

[0141] The texture feature extraction module is used to input the initial flare candidate region information, use a multi-directional multi-scale filter bank to divide the image of each band into several sub-regions, and calculate the filter response energy of each direction and scale to obtain the texture dominance map, which can distinguish between flat areas and textured parts of the image.

[0142] The spectral-spatial statistical modeling module is used to obtain the spectral covariance matrix of each pixel using the texture dominance map, perform eigenvalue decomposition to obtain the dominant spectral direction, construct an anisotropic diffusion tensor using texture information to measure the similarity between pixels, and construct a nonlocal self-similarity regularization constraint term to constrain the grayscale consistency of similar pixels.

[0143] The variational Bayesian optimization and iterative solution module integrates the flare degradation equation, the nonlocal self-similarity regularization constraint term, and the spectral gradient sparsity constraint term to form an adaptive variational Bayesian spectral-spatial joint optimization model. During the iteration process, the discrete wavelet transform is decomposed based on the currently estimated flare-free image and the residual of the original image to construct a texture-aware adaptive flare detection threshold. The alternating direction multiplier method is used for iterative solution until convergence, resulting in a preliminary restored image.

[0144] The post-processing and output module is used to perform post-processing on the initially restored image using manifold learning, to maintain the intrinsic low-dimensional structure of the image using a local linear embedding algorithm, and to remove the hyperspectral image after removing flares using anisotropic diffusion filtering.

[0145] 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.

[0146] Example 4 is the fourth embodiment of the present invention, which differs from the previous three embodiments in that: If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0147] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0148] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0149] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

Claims

1. A hyperspectral flare removal method based on multi-scale texture guidance, characterized in that, include: Using the original hyperspectral image, a flare degradation equation is constructed, a spectral gradient magnitude map is calculated, an initial flare candidate region is selected, and based on the initial flare candidate region, multi-scale geometric features are extracted to construct a texture-dominant map. Based on the texture dominance map, the spectral covariance matrix is ​​calculated, the dominant spectral direction is obtained by eigenvalue decomposition, an anisotropic diffusion tensor is constructed, and a nonlocal self-similarity regularization constraint term is constructed based on the anisotropic diffusion tensor to constrain the grayscale consistency of similar pixels. Based on the flare degradation equation, nonlocal self-similarity regularization constraint term and spectral gradient sparsity constraint term, a variational Bayesian optimization model is constructed, and wavelet transform decomposition is performed based on the residual between the currently estimated flare-free image and the original image to construct an adaptive flare detection threshold. The variational Bayesian optimization model is solved iteratively by alternating direction multiplier method to obtain a preliminary restored image. The preliminary restored image is then post-processed by manifold learning and anisotropic diffusion filtering to output the final flare-free hyperspectral image.

2. The hyperspectral flare removal method based on multi-scale texture guidance as described in claim 1, characterized in that, The construction of the texture-dominant map includes using a filter bank to decompose the image in multiple directions and at multiple scales, calculating the filter response energy at each scale and in each direction, and using the ratio of the maximum response energy at each scale and in each direction to the total response energy as the basic texture energy. A sigmoid function is used to nonlinearly enhance the texture energy of the initial flare candidate region to obtain a texture dominance map.

3. The hyperspectral flare removal method based on multi-scale texture guidance as described in claim 2, characterized in that, The construction of the anisotropic diffusion tensor includes calculating the spectral covariance matrix of each pixel, performing eigenvalue decomposition on the covariance matrix, and taking the eigenvector corresponding to the largest eigenvalue as the dominant spectral direction of the current pixel. An anisotropic diffusion tensor is constructed based on the Euclidean distance between the dominant spectral direction and the dominant spectral direction of neighboring pixels, and the difference between the texture dominance map and the texture dominance map of neighboring pixels. The constraint on grayscale consistency of similar pixels includes finding a preset number of most similar pixels within a search window for each pixel. The similarity metric is anisotropic diffusion tensor weighted spectral angular distance, and the weighting coefficient is a texture penalty coefficient set to 0.

5. The sum of squared grayscale differences between similar pixels is calculated, and a nonlocal self-similarity regularization constraint term is constructed by using a weighted sum with weights calculated as a negative exponential function of the weighted spectral angular distance squared and the weighted bandwidth ratio.

4. The hyperspectral flare removal method based on multi-scale texture guidance as described in claim 3, characterized in that, The construction of the variational Bayesian optimization model includes constructing an adaptive variational Bayesian spectral-spatial joint optimization model based on the flare degradation equation, the nonlocal self-similarity regularization constraint term, and the spectral gradient sparsity constraint term, and defining the joint posterior probability density function. The specular reflectance field in the flare degradation equation follows a Laplace distribution, the noise variance follows an inverse gamma distribution, and the spectral gradient sparse constraint term is weighted and combined with the squared L2 norm of the spectral gradient and the nonlocal self-similarity regularization constraint term to form the prior distribution of the image, and the posterior probability density function is jointly constructed.

5. The hyperspectral flare removal method based on multi-scale texture guidance as described in claim 4, characterized in that, The construction of the adaptive flare detection threshold includes performing discrete wavelet transform decomposition on the residual to obtain the high-frequency subband coefficients of each layer and each direction, and taking the ratio of the median of the absolute values ​​of the subband coefficients of each direction and each scale to 0.6745 as the noise standard deviation estimate of the current scale and current direction. The logarithmic square root of the number of wavelet coefficients at each scale is calculated, multiplied by the noise standard deviation estimate, and then multiplied by the sum of the texture adjustment coefficient and the normalized value of the texture dominant spectrum to construct the texture-aware adaptive flare detection threshold.

6. The hyperspectral flare removal method based on multi-scale texture guidance as described in claim 4, characterized in that, The process of obtaining the preliminary restored image includes introducing auxiliary variables to decompose the original problem into a subproblem of updating the flare-free image, updating the specular reflectivity field, updating the auxiliary variables, updating the noise variance, and updating the Lagrange multipliers. The subproblem of updating the flare-free image is solved by combining a noise variance weighted fidelity term with a nonlocal self-similarity regularization term; the subproblem of updating the specular reflectivity field is solved by soft thresholding iteration; the subproblem of updating the auxiliary variable is solved by a soft thresholding function; the subproblem of updating the noise variance is solved by combining the residual sum of squares with the inverse gamma distribution parameter; and the subproblem of updating the Lagrange multipliers is solved by combining the penalty parameter with the residual. The iteration stops when the relative change of the flare-free image between two adjacent iterations reaches a preset condition.

7. The hyperspectral flare removal method based on multi-scale texture guidance as described in claim 4, characterized in that, The output of the final flare-free hyperspectral image includes finding a preset number of nearest neighbor pixels in the spatial neighborhood for each pixel. The neighborhood metric is a weighted combination of spectral angular distance and texture-dominant spectral difference. Calculate the local reconstruction weights and construct a global reconstruction error minimization objective function to solve for the low-dimensional embedding coordinates. Reconstruct the spectral curve through inverse mapping to obtain the manifold-corrected image. Anisotropic diffusion filtering is applied to the manifold-corrected image to output the final flare-free hyperspectral image.

8. A hyperspectral flare removal system based on multi-scale texture guidance, used to apply the hyperspectral flare removal method based on multi-scale texture guidance as described in any one of claims 1 to 7, characterized in that, include: The module includes image acquisition and physical modeling, texture feature extraction, spectral-spatial statistical modeling, variational Bayesian optimization and iterative solution, and post-processing and output. The image acquisition and physical modeling module is used to acquire raw hyperspectral image data, and according to the physical laws of light-matter interaction, decompose the pixel values ​​in the image into diffuse reflection components and specular reflection components, calculate the spectral gradient amplitude map, and screen the initial flare candidate regions. The texture feature extraction module is used to receive information about the initial flare candidate region, decompose each band image using a multi-directional, multi-scale filter bank, calculate the filter response energy at each direction and scale, and construct a texture dominance map to distinguish between flat regions and texture regions in the image. The spectral-spatial statistical modeling module is used to calculate the spectral covariance matrix of each pixel using the texture dominance map, obtain the dominant spectral direction through eigenvalue decomposition, construct an anisotropic diffusion tensor in combination with texture information to measure the similarity between pixels, and construct a nonlocal self-similarity regularization constraint term to constrain the grayscale consistency of similar pixels. The variational Bayesian optimization and iterative solution module is used to integrate the flare degradation equation, the nonlocal self-similarity regularization constraint term, and the spectral gradient sparsity constraint term to establish an adaptive variational Bayesian spectral-spatial joint optimization model. In the iterative solution, based on the residual between the currently estimated flare-free image and the original image, discrete wavelet transform decomposition is performed to construct a texture-aware adaptive flare detection threshold. The model is iteratively solved using the alternating direction multiplier method until convergence, resulting in a preliminary restored image. The post-processing and output module is used to perform manifold learning post-processing on the preliminary restored image, using a local linear embedding algorithm to preserve the intrinsic low-dimensional structure of the image, and anisotropic diffusion filtering to output a hyperspectral image after flare removal.

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 hyperspectral flare removal method based on multi-scale texture guidance as described in 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 hyperspectral flare removal method based on multi-scale texture guidance as described in any one of claims 1 to 7.