Hyperspectral band selection method and device, electronic equipment and storage medium
By preprocessing and selective search segmentation of hyperspectral images, combining cosine similarity and information entropy, the target band is determined, and the problem of image structure information loss caused by hyperspectral image processing in the prior art is solved, and efficient band selection and information optimization are achieved.
Patent Information
- Application Number
- CN202411798260.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
AI Technical Summary
The existing hyperspectral image processing methods tend to lead to loss of image structure information when reducing the number of bands, and increase data redundancy, storage and computing costs.
By acquiring the hyperspectral image to be processed, pre-processing is performed to obtain the mean image set, then selective search and segmentation of the mean image set, calculate the cosine similarity between the mean image and the segmented image, build a band cluster, and determine the target band based on the information entropy to reduce redundant information and retain spatial structure information.
It effectively reduces the redundant information in the target wavelength, improves the spatial structure information content of hyperspectral images, and reduces the probability of image structure information loss.
Smart Images

Figure CN119810480A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of spectrum processing technology, and in particular to a hyperspectral band selection method and device, electronic equipment, and storage medium. Background Art
[0002] Hyperspectral images contain a large amount of band information, and each pixel typically exhibits unique spectral characteristics in different bands. However, excessive bands can lead to data redundancy and increased storage and computational costs. Existing band selection methods typically rely on spectral signatures or statistical methods. While these methods can reduce the number of bands to a certain extent, they can also result in loss of image structural information during the processing.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The main purpose of the embodiments of the present application is to propose a hyperspectral band selection method and device, electronic equipment and storage medium, which can effectively reduce redundant information and thereby reduce the probability of image structural information loss.
[0005] To achieve the above objectives, an embodiment of the present application provides a method for selecting a hyperspectral band, the method comprising the following steps:
[0006] Acquire several groups of hyperspectral images to be processed;
[0007] Preprocessing the hyperspectral image to be processed to obtain a mean image set, wherein the mean image set includes a plurality of mean images;
[0008] Performing selective search segmentation on the mean image in the mean image set to obtain a segmented image set, wherein the segmented image set includes a plurality of segmented images;
[0009] Calculating the cosine similarity between the mean image and the segmented image;
[0010] Constructing band clusters according to the cosine similarity;
[0011] Calculating the information entropy of each candidate band in each of the band clusters according to the cosine similarity;
[0012] A target band is determined from the candidate bands according to the information entropy, and the spatial structure information in the target band constitutes a target highlight image.
[0013] In some embodiments, preprocessing the hyperspectral image to be processed to obtain a mean image set includes:
[0014] Acquire a band set of the hyperspectral image to be processed, wherein the band set includes a plurality of bands;
[0015] Obtaining a first pixel value at a preset position in each of the wavebands of each of the hyperspectral images to be processed;
[0016] Calculating a second pixel value of each of the hyperspectral images to be processed at the preset position according to the first pixel value;
[0017] generating a mean image according to the second pixel value corresponding to each of the hyperspectral images to be processed;
[0018] All the mean images are combined into the mean image set.
[0019] In some embodiments, performing selective search segmentation on the mean image in the mean image set to obtain the segmented image set includes:
[0020] Determining an initial superpixel center of each of the mean images;
[0021] Determining the number of superpixel regions according to the initial superpixel center;
[0022] Calculating a superpixel interval based on the total number of pixels in the mean image and the number of superpixel regions;
[0023] Calculate a first distance between each pixel and the initial superpixel center according to the superpixel interval;
[0024] Clustering the local area of the mean image according to the first distance to obtain an initial superpixel area;
[0025] Calculating the comprehensive similarity between the initial superpixel regions;
[0026] Merging regions according to the comprehensive similarity to obtain the segmented image;
[0027] All the segmented images are combined into the segmented image set.
[0028] In some embodiments, calculating the first distance between each pixel and the initial superpixel center according to the superpixel interval includes:
[0029] Calculate the grayscale difference between each pixel and the center of the initial superpixel;
[0030] Calculate the spatial position difference between each pixel and the initial superpixel center;
[0031] A first distance between each pixel point and the initial superpixel center is calculated based on the superpixel interval, the grayscale difference value and the spatial position difference.
[0032] In some embodiments, calculating the comprehensive similarity between the initial superpixel regions includes:
[0033] Calculating the grayscale mean similarity between adjacent initial superpixel regions;
[0034] Calculating the region size similarity between adjacent initial superpixel regions;
[0035] Calculating boundary strengths between adjacent initial superpixel regions;
[0036] The comprehensive similarity is calculated based on the grayscale mean similarity, the region size similarity and the boundary strength.
[0037] In some embodiments, calculating the grayscale mean similarity between adjacent initial superpixel regions includes:
[0038] Calculating the grayscale mean of adjacent initial superpixel regions respectively;
[0039] The grayscale mean similarity is obtained by calculating according to the grayscale mean.
[0040] In some embodiments, the calculating the boundary strength between adjacent initial superpixel regions includes:
[0041] Obtaining pixel gradients in adjacent initial superpixel regions;
[0042] Calculating edge information between adjacent initial superpixel regions according to the pixel gradient;
[0043] The boundary strength between adjacent initial superpixel regions is calculated based on the edge information.
[0044] To achieve the above objectives, another aspect of the present application provides a hyperspectral band selection device, comprising:
[0045] The first module is used to obtain several groups of hyperspectral images to be processed;
[0046] The second module is used to preprocess the hyperspectral image to be processed to obtain a mean image set, wherein the mean image set includes a plurality of mean images;
[0047] A third module is configured to perform selective search segmentation on the mean image in the mean image set to obtain a segmented image set, wherein the segmented image set includes a plurality of segmented images;
[0048] A fourth module is used to calculate the cosine similarity between the mean image and the segmented image;
[0049] A fifth module is used to construct a band cluster according to the cosine similarity;
[0050] A sixth module is configured to calculate the information entropy of each candidate band in each of the band clusters according to the cosine similarity;
[0051] The seventh module is used to determine a target band from the candidate bands according to the information entropy, and the spatial structure information in the target band constitutes a target highlight image.
[0052] To achieve the above objectives, another aspect of the present application provides an electronic device, including:
[0053] at least one processor;
[0054] at least one memory for storing at least one program;
[0055] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0056] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned method when executed by a processor.
[0057] The embodiments of the present application include at least the following beneficial effects: The present application provides a hyperspectral band selection method and device, an electronic device and a storage medium. The scheme obtains several groups of hyperspectral images to be processed, pre-processes the hyperspectral images to be processed to obtain a mean image set, selectively searches and segments the mean images in the mean image set to obtain a segmented image set, calculates the cosine similarity between the mean image and the segmented image, constructs a band cluster according to the cosine similarity, and then calculates the information entropy of each to-be-selected band in each band cluster according to the cosine similarity. Then, the target band is determined from the to-be-selected band according to the information entropy, thereby effectively reducing the redundant information in the target wavelength, increasing the content of spatial structural information of the hyperspectral image in the target wavelength, and thereby reducing the probability of image structural information loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flow chart of the hyperspectral band selection method provided in an embodiment of the present application;
[0059] Figure 2 Schematic diagram of the structure of the hyperspectral band selection device provided in an embodiment of the present application;
[0060] Figure 3 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are merely examples of devices and methods consistent with some aspects of the embodiments of the present application.
[0062] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0063] The terms "at least one", "plurality", "each", "any", etc. used in this application include "at least one", "two" or more, "plurality" or "each", "any" or "any one", "each" or "any one" as used herein.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0065] Before describing the embodiments of the present application in detail, some of the nouns and terms involved in the embodiments of the present application are first explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0066] The Sobel operator is an important processing method in computer vision. It is primarily used to obtain the first-order gradient of digital images. Its common application and physical significance is edge detection. The Sobel operator takes the weighted difference of the grayscale values of each pixel in the image (upper, lower, left, and right) and finds the maximum value at the edge, thereby detecting the edge.
[0067] Hyperspectral images contain a large amount of band information, and each pixel typically exhibits unique spectral characteristics in different bands. However, excessive bands can lead to data redundancy and increased storage and computational costs. Existing band selection methods typically rely on spectral signatures or statistical methods. While these methods can reduce the number of bands to a certain extent, they can also result in loss of image structural information during the processing.
[0068] In view of this, an embodiment of the present application provides a hyperspectral band selection method and device, an electronic device and a storage medium. After obtaining several groups of hyperspectral images to be processed, the present application pre-processes the hyperspectral images to be processed to obtain a mean image set, performs selective search segmentation on the mean image in the mean image set to obtain a segmented image set, calculates the cosine similarity between the mean image and the segmented image, constructs a band cluster according to the cosine similarity, and then calculates the information entropy of each to-be-selected band in each band cluster according to the cosine similarity. Then, the target band is determined from the to-be-selected band according to the information entropy, thereby effectively reducing the redundant information in the target wavelength, increasing the content of spatial structural information of the hyperspectral image in the target wavelength, and thereby reducing the probability of image structural information loss.
[0069] The hyperspectral band selection method provided in the embodiment of the present application relates to the field of spectral processing technology. The hyperspectral band selection method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the hyperspectral band selection method, etc., but is not limited to the above forms.
[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0071] Figure 1 This is an optional flow chart of the hyperspectral band selection method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S110 to S170:
[0072] Step S110, obtaining several groups of hyperspectral images to be processed;
[0073] Step S120: pre-processing the hyperspectral image to be processed to obtain a mean image set, wherein the mean image set includes a plurality of mean images;
[0074] Step S130: performing selective search segmentation on the mean image in the mean image set to obtain a segmented image set, wherein the segmented image set includes a plurality of segmented images;
[0075] Step S140, calculating the cosine similarity between the mean image and the segmented image;
[0076] Step S150: constructing band clusters according to cosine similarity;
[0077] Step S160: Calculate the information entropy of each candidate band in each band cluster according to the cosine similarity;
[0078] Step S170 : determining a target band from the candidate bands according to information entropy, wherein the spatial structure information in the target band constitutes a target highlight image.
[0079] It is understood that the hyperspectral images to be processed may be images acquired by a hyperspectral camera. When a plurality of sets of hyperspectral images to be processed are acquired, all hyperspectral images to be processed are preprocessed to obtain a mean image set formed by a mean image.
[0080] In the embodiment of the present application, the process of preprocessing the hyperspectral image to be processed includes but is not limited to the following steps:
[0081] Step S210: obtaining a band set of a hyperspectral image to be processed, wherein the band set includes a plurality of bands;
[0082] Step S220: obtaining a first pixel value at a preset position in each band of each hyperspectral image to be processed;
[0083] Step S230: calculating a second pixel value at a preset position of each hyperspectral image to be processed according to the first pixel value;
[0084] Step S240: generating a mean image according to the second pixel value corresponding to each hyperspectral image to be processed;
[0085] Step S250: All mean images are combined into a mean image set.
[0086] For example, suppose there are N groups of hyperspectral images to be processed, which form a set P. For all images p i ∈P, calculate image p i The corresponding mean image a i , all mean images form a mean image set A. Specifically, the hyperspectral image to be processed is preprocessed. Assume that the hyperspectral image to be processed contains K bands, denoted as the band set WB, and the resolution of each band is the same. First, the mean image of each band is calculated. Among them, the mean image A is obtained by averaging the pixels of each band. The calculation formula for the corresponding pixels of the mean image of the i-th hyperspectral image to be processed is as follows:
[0087]
[0088] In the formula, b i,j (x, y) represents the pixel value (first pixel value) of the jth band at the preset position (x, y), a i (x, y) represents the pixel value (second pixel value) of the mean image of the i-th hyperspectral image to be processed at the preset position (x, y).
[0089] After obtaining the pixel values (second pixel values) of all bands, the pixel value set is used as the mean image set.
[0090] It is understood that after obtaining the mean image, the mean image can be segmented using the Selective Search algorithm. The Selective Search algorithm is a hierarchical segmentation-based algorithm that can segment an image into multiple connected regions without presetting the number of categories. In this embodiment, the segmentation of the mean image using the Selective Search algorithm is used as an example. The processing of this application includes but is not limited to the following steps:
[0091] Step S310: determining the initial superpixel center of each mean image;
[0092] Step S320: determining the number of superpixel regions according to the initial superpixel center;
[0093] Step S330, calculating the superpixel interval according to the total number of pixels and the number of superpixel regions in the mean image;
[0094] Step S340: Calculate a first distance between each pixel and the initial superpixel center according to the superpixel interval;
[0095] Step S350: clustering the local area of the mean image according to the first distance to obtain an initial superpixel area;
[0096] Step S360: Calculate the comprehensive similarity between the initial superpixel regions;
[0097] Step S370: Merge regions based on the comprehensive similarity to obtain a segmented image;
[0098] Step S380: All segmented images are combined into a segmented image set.
[0099] It is understood that the superpixel interval can be calculated by the following formula:
[0100]
[0101] In the formula, M*N is the total number of pixels in the mean image, Z is the number of superpixel regions, and S is the superpixel interval.
[0102] It can be understood that after obtaining the superpixel interval, the grayscale difference value between each pixel point and the initial superpixel center, as well as the spatial position difference between each pixel point and the initial superpixel center, can be calculated, and then the first distance between each pixel point and the initial superpixel center can be calculated based on the superpixel interval, grayscale difference value and spatial position difference.
[0103] Specifically, the grayscale difference value can be calculated by the following formula:
[0104] d c =|ai (x,y)-a i (l x ,l y )|;
[0105] In the formula, d c Represents the grayscale difference value, a i (x,y) represents the pixel value at position (x,y) in the mean image, a i (l x ,l y ) represents the position in the mean image (l x ,l y )’s pixel value.
[0106] The spatial position difference can be calculated using the following formula:
[0107]
[0108] In the formula, d s Indicates spatial position differences.
[0109] The calculation formula for the first distance is as follows:
[0110]
[0111] In the formula, S represents the superpixel interval, d s Indicates the spatial position difference, d c represents the grayscale difference value; m represents the adjustment parameter, which is used to balance the influence between the spatial position difference and the grayscale difference value.
[0112] In this embodiment, after the first distance D is calculated, pixel clustering of the local area can be performed on the mean image based on the first distance D to obtain a compact superpixel. The area corresponding to the compact superpixel is used as the initial superpixel area. It is understandable that after the initial superpixel area is determined, the comprehensive similarity between adjacent superpixel areas can be randomly selected for regional merging. Specifically, the calculation process of the comprehensive similarity can be performed by calculating the grayscale mean similarity between adjacent initial superpixel areas, calculating the area size similarity between adjacent initial superpixel areas, and calculating the boundary strength between adjacent initial superpixel areas, and then calculating the comprehensive similarity based on the grayscale mean similarity, area size similarity and boundary strength.
[0113] It is understood that the grayscale mean similarity between adjacent initial superpixel regions can be obtained by respectively calculating the grayscale mean of the adjacent initial superpixel regions and then calculating the grayscale mean similarity based on the grayscale mean. For example, taking two adjacent initial superpixel regions R1 and R2 as an example, their grayscale means are respectively calculated using the following formula:
[0114]
[0115] In the formula, I(R1) represents the grayscale mean of the initial superpixel region R1, and I(R2) represents the grayscale mean of the initial superpixel region R2.
[0116] Then the grayscale mean similarity of the initial superpixel regions R1 and R2 is calculated using the following formula:
[0117]
[0118] In the formula, S mean Represents the grayscale mean similarity of the initial superpixel regions R1 and R2.
[0119] The region size similarity between the initial superpixel regions R1 and R2 can be calculated by comparing the area sizes of adjacent pixels. Assuming that the area of the initial superpixel region R1 is size(R1) and the area of the initial superpixel region R2 is size(R2), the region size similarity can be calculated using the following formula:
[0120]
[0121] In the formula, S size Indicates the similarity of region sizes.
[0122] It is understood that the boundary strength between adjacent initial super-pixel regions can be obtained by obtaining the pixel gradients in the adjacent initial super-pixel regions, calculating the edge information between the adjacent initial super-pixel regions based on the pixel gradients, and then calculating the boundary strength between the adjacent initial super-pixel regions based on the edge information. Among them, the pixel gradient can be calculated by the Sobel operator to obtain the gradient of each pixel. Specifically, the edge information calculation formula between adjacent initial super-pixel regions is as follows:
[0123]
[0124] In the formula, g(x,y) represents the edge information between adjacent initial superpixel regions. represents the mean image, is the partial derivative of the mean image in the x direction, Represents the partial derivative of the mean image in the y direction.
[0125] Then the boundary strength between adjacent initial superpixel regions is calculated using the following formula:
[0126]
[0127] In the formula, b(R1, R2) is the set of boundary pixels of regions R1 and R2, indicating the boundary strength.
[0128] After calculating the grayscale mean similarity, region size similarity, and boundary strength, this embodiment calculates the comprehensive similarity using the following formula:
[0129] S total =αS mean +βS size +γS boundary ;
[0130] In the formula, S total represents the comprehensive similarity, and α, β, and γ are parameters for adjusting the weights of different similarity features.
[0131] In this embodiment, the closest regions can be gradually merged by comprehensive similarity. The comprehensive similarity of the merged regions is recalculated, and the iteration is continued until a preset stop condition is reached (for example, the number of regions reaches a threshold or the comprehensive similarity reaches a threshold), and the image segmentation is completed to obtain the final segmented image. Then all the segmented images sp i The segmented image set SP is formed. In the processing of this embodiment, a series of connected domains are generated. These connected domains represent different areas in the mean image, and each connected domain contains a number of pixels.
[0132] In the embodiment of the present application, the cosine similarity between the value image and the segmented image can be automatically calculated by the following pseudo code:
[0133]
[0134] Specifically, for each band wb k ∈WB, calculate its feature vector v based on cosine similarity k , where v k The set is recorded as V. Then, based on the calculated feature vector set V, bands with high cosine similarity are clustered into one category using methods such as K-means or hierarchical clustering to form a band cluster.
[0135] In this embodiment of the present application, in order to select the band with the highest information content in each band cluster, this embodiment uses information entropy as the selection basis. Information entropy is an important indicator for measuring the amount of information in an image. The greater the information entropy, the more information the image contains. Specifically, in this embodiment, information entropy can be calculated using the following pseudo code:
[0136]
[0137]
[0138] After calculating the information entropy, a band with the highest information entropy is selected from each band cluster as the target band. The highest information entropy indicates that the band contains the most spatial structure information. Therefore, by selecting the band with the highest information as the target band, the target band retains the spatial structure information of the hyperspectral image while effectively reducing redundant data, achieving the effects of band compression and information optimization.
[0139] In summary, the method of the embodiment of the present application generates a mean image by calculating the pixel mean of each band, and then performs a preliminary segmentation on the mean image so that areas with similar pixels can be merged, thereby avoiding areas with similar features but larger areas from having more weights. Then, by calculating the similarity between each band and the segmentation result, the band with the highest information content is finally selected from each band cluster based on the size of the information entropy, so that the target band retains the spatial structure information of the hyperspectral image and effectively reduces redundant data, thereby achieving the effect of band compression and information optimization.
[0140] Reference Figure 2 , an embodiment of the present application provides a hyperspectral band selection device, the device comprising:
[0141] The first module 210 is used to obtain a plurality of sets of hyperspectral images to be processed;
[0142] The second module 220 is used to pre-process the hyperspectral image to be processed to obtain a mean image set, wherein the mean image set includes a plurality of mean images;
[0143] The third module 230 is configured to perform selective search segmentation on the mean image in the mean image set to obtain a segmented image set, wherein the segmented image set includes a plurality of segmented images;
[0144] The fourth module 240 is used to calculate the cosine similarity between the mean image and the segmented image;
[0145] A fifth module 250 is configured to construct band clusters based on cosine similarity;
[0146] The sixth module 260 is configured to calculate the information entropy of each candidate band in each band cluster according to the cosine similarity;
[0147] The seventh module 270 is configured to determine a target band from the candidate bands based on information entropy, wherein the spatial structure information in the target band constitutes a target highlight image.
[0148] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0149] The present application also provides an electronic device comprising a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the hyperspectral band selection method. The electronic device can be any smart terminal, such as a tablet computer or an in-vehicle computer.
[0150] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0151] See also Figure 3 , Figure 3 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0152] The processor 310 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0153] The memory 320 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 320 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 320 and are called by the processor 310 to execute the hyperspectral band selection method of the embodiments of this application.
[0154] Input / output interface 330, used to implement information input and output;
[0155] Communication interface 340, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0156] bus 350 , which transmits information between the various components of the device (e.g., processor 310 , memory 320 , input / output interface 330 , and communication interface 340 );
[0157] The processor 310 , the memory 320 , the input / output interface 330 and the communication interface 340 are connected to each other in communication within the device via the bus 350 .
[0158] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned hyperspectral band selection method when executed by a processor.
[0159] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiment, the functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0160] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0161] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0162] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0163] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0164] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0165] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0166] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0167] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0168] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0169] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0171] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A hyperspectral band selection method, characterized in that: The method comprises the following steps: Acquire several groups of hyperspectral images to be processed; Preprocessing the hyperspectral image to be processed to obtain a mean image set, wherein the mean image set includes a plurality of mean images; Performing selective search segmentation on the mean image in the mean image set to obtain a segmented image set, wherein the segmented image set includes a plurality of segmented images; Calculating the cosine similarity between the mean image and the segmented image; Constructing band clusters according to the cosine similarity; Calculate the information entropy of each candidate band in each of the band clusters according to the cosine similarity; A target band is determined from the candidate bands according to the information entropy, and the spatial structure information in the target band constitutes a target highlight map image.
2. The method according to claim 1, characterized in that The preprocessing of the to-be-processed hyperspectral image to obtain a mean image set includes: Acquire a band set of the hyperspectral image to be processed, wherein the band set includes a plurality of bands; Acquire a first pixel value of each of the hyperspectral images to be processed at a preset position in each of the bands; Calculate a second pixel value of each of the hyperspectral images to be processed at the preset position according to the first pixel value; Generate a mean image according to the second pixel value corresponding to each of the hyperspectral images to be processed; All the mean images are combined into the mean image set.
3. The method according to claim 1, characterized in that The step of performing selective search segmentation on the mean image in the mean image set to obtain a segmented image set comprises: Determining an initial superpixel center of each of the mean images; Determining the number of superpixel regions according to the initial superpixel center; Calculate the superpixel interval according to the total number of pixels of the mean image and the number of superpixel regions; Calculate a first distance between each pixel and the initial superpixel center according to the superpixel interval; Clustering the local area of the mean image according to the first distance to obtain an initial superpixel area; Calculating the comprehensive similarity between the initial superpixel regions; Merging regions according to the comprehensive similarity to obtain the segmented image; All the segmented images are combined into the segmented image set.
4. The method according to claim 3, characterized in that The calculating, according to the superpixel interval, a first distance between each pixel point and the initial superpixel center comprises: Calculate the grayscale difference between each pixel and the center of the initial superpixel; Calculate the spatial position difference between each pixel and the center of the initial superpixel; The first distance between each pixel point and the initial superpixel center is calculated according to the superpixel interval, the grayscale difference value and the spatial position difference.
5. The method according to claim 3, characterized in that: The calculating the comprehensive similarity between the initial superpixel regions comprises: Calculating the grayscale mean similarity between adjacent initial superpixel regions; Calculating the region size similarity between adjacent initial superpixel regions; Calculating the boundary strength between adjacent initial superpixel regions; The comprehensive similarity is calculated based on the grayscale mean similarity, the region size similarity and the boundary strength.
6. The method according to claim 5, characterized in that The calculating the grayscale mean similarity between adjacent initial superpixel regions comprises: Calculating the grayscale mean values of adjacent initial superpixel regions respectively; The grayscale mean similarity is calculated based on the grayscale mean.
7. The method according to claim 5, characterized in that The calculating the boundary strength between adjacent initial superpixel regions comprises: Obtaining pixel gradients in adjacent initial superpixel regions; Calculate edge information between adjacent initial superpixel regions according to the pixel gradient; The boundary strength between adjacent initial superpixel regions is calculated based on the edge information.
8. A hyperspectral band selection device, characterized in that: The device comprises: The first module is used to obtain a plurality of groups of hyperspectral images to be processed; The second module is used to preprocess the hyperspectral image to be processed to obtain a mean image set, wherein the mean image set includes a plurality of mean images; A third module is used to perform selective search segmentation on the mean image in the mean image set to obtain a segmented image set, wherein the segmented image set includes a plurality of segmented images; A fourth module is used to calculate the cosine similarity between the mean image and the segmented image; A fifth module is used to construct a band cluster according to the cosine similarity; A sixth module is used to calculate the information entropy of each to-be-selected band in each of the band clusters according to the cosine similarity; The seventh module is used to determine a target band from the candidate bands according to the information entropy, and the spatial structure information in the target band constitutes a target highlight map image.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.