A wave band selection method, device and equipment based on matrix calculation and medium
By establishing an adjustment factor matrix based on matrix calculation and utilizing evaluation functions and resampling algorithms, the problem of low band selection efficiency in existing technologies is solved, and fast and accurate band selection is achieved.
Patent Information
- Application Number
- CN202310939754.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-07-28
AI Technical Summary
Existing band selection methods suffer from large data volumes and long computation times, making it difficult to efficiently compare the spectra of ground features.
By acquiring the spectral curves of ground features, an adjustment factor matrix is established. The similarity and differences between ground features are determined using matrix calculation methods. The similar and different bands are determined using evaluation functions and matrix resampling algorithms.
It can accurately determine similar and different bands between ground features in a shorter time, thus improving the efficiency and accuracy of band selection.
Smart Images

Figure CN117194937B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of hyperspectral image processing, in particular to a band selection method and device based on matrix calculation, equipment and medium. BACKGROUND
[0002] Spectrum is a comprehensive reflection of the reflection, absorption and radiation of rocks, minerals, attachments and the like in a specific wavelength range, so the spectrum of different ground objects is different and the difference is large, but they will show high similarity in some bands. The spectrum of ground objects is also affected by the background environment, particle effect of ground objects, ground object mixing, lighting conditions, illumination angle, corresponding sensor image, etc. Even the spectral curves of the same type of ground object spectrum will have large differences in some bands.
[0003] For the comparison of the spectrum of ground objects, band selection is usually required, and the existing band selection method usually has the disadvantages of large data volume and long operation time. SUMMARY
[0004] The purpose of the present application is to provide a band selection method, device, equipment and medium based on matrix calculation to improve the above problems. In order to achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0005] In a first aspect, the present application provides a band selection method based on matrix calculation, comprising:
[0006] Obtaining the spectral curves of a first ground object and a second ground object, arranging the channel values in the spectral curves in ascending order of corresponding wavelengths to obtain a first ground object array and a second ground object array of the second ground object;
[0007] Calculating the channel value ratio of the first ground object array and the second ground object array at the same wavelength, and obtaining the ratio as a first adjustment factor matrix;
[0008] After shifting the second ground object array to the right and left respectively, a right-shifted array and a left-shifted array are obtained, and the channel value ratio of the first ground object array and the right-shifted array and the left-shifted array at the same wavelength is calculated, and the obtained ratio is respectively taken as a second adjustment factor matrix and a third adjustment factor matrix;
[0009] Integrating the first adjustment factor matrix, the second adjustment factor matrix and the third adjustment factor matrix into a target adjustment factor matrix;
[0010] Determining the evaluation value matrix corresponding to the target adjustment factor matrix based on the evaluation function, and determining the wavelength with the highest similarity and the largest difference between the first ground object and the second ground object from the evaluation value matrix.
[0011] In a second aspect, the application further provides a band selection device based on matrix calculation, comprising:
[0012] An acquisition unit is configured to acquire spectral curves of the first and second ground objects, arrange channel values in the spectral curves in ascending order of corresponding wavelengths to obtain first and second ground object arrays;
[0013] A first calculation unit is configured to calculate channel value ratios of the first and second ground object arrays at the same wavelength, and obtain the ratios as a first adjustment factor matrix;
[0014] A first translation unit is configured to translate the second ground object array to the right and left sides respectively to obtain right and left shifted arrays, and calculate channel value ratios of the first ground object array and the right and left shifted arrays at the same wavelength, and obtain the ratios as a second and third adjustment factor matrix respectively;
[0015] An integration unit is configured to integrate the first, second and third adjustment factor matrices into a target adjustment factor matrix;
[0016] A determination unit is configured to determine an evaluation value matrix corresponding to the target adjustment factor matrix based on an evaluation function, and determine a wavelength with the highest similarity and the largest difference between the first and second ground objects from the evaluation value matrix.
[0017] In a third aspect, the application further provides a band selection device based on matrix calculation, comprising:
[0018] A memory is configured to store a computer program;
[0019] A processor is configured to implement steps of the band selection method based on matrix calculation when executing the computer program.
[0020] In a fourth aspect, the application further provides a readable storage medium, which stores a computer program, and the computer program is configured to implement steps of the band selection method based on matrix calculation when executed by a processor.
[0021] The application has the following advantages:
[0022] The application can accurately determine the difference and similar bands between ground objects in a short time by establishing adjustment factor matrices after left and right shifting of the image of the ground object, calculating an evaluation value matrix, and using a matrix resampling algorithm.
[0023] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art upon examination of the following or can be learned by practice of the application. The objects and other advantages of the application can be realized and attained by means of the instrumentalities and combinations particularly pointed out in the written description and claims hereof. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be considered as limiting the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0025] Figure 1 The spectral curve schematic diagram described in the embodiments of the present application;
[0026] Figure 2 The wave band selection method flowchart based on matrix calculation described in the embodiments of the present application;
[0027] Figure 3 The maximum sampling result schematic diagram described in the embodiments of the present application;
[0028] Figure 4 The minimum sampling result schematic diagram described in the embodiments of the present application;
[0029] Figure 5 The wave band selection device structure schematic diagram based on matrix calculation described in the embodiments of the present application;
[0030] Figure 6 The wave band selection equipment structure schematic diagram based on matrix calculation described in the embodiments of the present application.
[0031] Markings in the drawings:
[0032] 100, acquisition unit; 200, first calculation unit; 300, first translation unit; 310, second translation unit; 320, first arrangement unit; 311, first obtaining unit; 312, second calculation unit; 313, first replacement unit; 330, third translation unit; 340, second arrangement unit; 331, second obtaining unit; 332, third calculation unit; 333, second replacement unit; 400, integration unit; 500, determination unit; 510, input unit; 520, third arrangement unit; 600, operation unit; 700, division unit; 800, first comparison unit; 900, first processing unit; 1000, second comparison unit; 1100, second processing unit;
[0033] 80, a band selection device based on matrix calculation; 81, a processor; 82, a memory; 83, a multimedia component; 84, an I / O interface; 85, a communication component. DETAILED DESCRIPTION
[0034] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present application belong to the scope of protection of the present application.
[0035] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used for distinguishing description, and cannot be understood as indicating or implying relative importance.
[0036] Embodiment 1
[0037] As shown in FIG. 1, it is the original spectral curve of ground object A and ground object B. The vertical coordinate DN value of the spectral curve corresponding to the ground object is related to the background environment, the light angle and other factors, and cannot be directly used to measure the lithology of the ground object, so the shape of the spectral curve is needed to measure the similarity or difference between the lithologies of the ground objects. Figure 1 The embodiment provides a band selection method based on matrix calculation.
[0038] Referring to FIG. 2, the method includes steps S100, S200, S300, S400 and S500.
[0039] Figure 2 Step S100. Obtain the spectral curves of the first ground object and the second ground object, arrange the channel values in the spectral curves in ascending order of corresponding wavelengths to obtain the first ground object array and the second ground object array;
[0040] Specifically, the spectral curves of the two compared ground objects are divided into multiple channels, each channel corresponds to a wavelength, and the channel value is the DN value. The channel values are arranged based on the corresponding wavelengths to obtain the corresponding ground object arrays.
[0041] Specifically, the spectral curves of the two compared ground objects are divided into multiple channels, each channel corresponds to a wavelength, and the channel value is the DN value. The channel values are arranged based on the corresponding wavelengths to obtain the corresponding ground object arrays.
[0042] The first land feature array is:
[0043] The first ground object wavelength matrix is: ζ A =[ζ1,ζ2,ζ3,…,ζ i ,…,ζ n ];
[0044] Where n is the number of channels in the spectral curve of the first ground feature, and a1~a n The values for each channel of the first feature are given by a. i For vectors The value corresponding to the i-th channel, ζ i It is the wavelength of the i-th channel of the first ground feature;
[0045] The second feature array is:
[0046] The second ground feature wavelength matrix is: ζ B =[ζ1,ζ2,ζ3,…,ζ i ,…,ζ n ];
[0047] Where n is the number of channels in the spectral curve of the second ground cover, b1~b n b represents the values for each channel of the second feature. i For vectors The value corresponding to the i-th channel, ζ i It is the wavelength of the i-th channel of the second ground feature.
[0048] Step S200. Calculate the ratio of channel values of the first ground feature array and the second ground feature array at the same wavelength, and use the obtained ratio as the first adjustment factor matrix;
[0049] Specifically, the formula for calculating the ratio is:
[0050]
[0051] Where, λ i a is the ratio of the first feature to the second feature in the i-th channel; i b is the channel value of the first feature in the i-th channel; i This is the channel value of the second feature in the i-th channel.
[0052] Based on the arrangement order of the corresponding channel values, the calculated ratios are used to form the first adjustment factor matrix, which is:
[0053] Step S300. After the second ground object array is respectively translated to the right and left, a right-shifted array and a left-shifted array are obtained, and a ratio of channel values of the first ground object array to the right-shifted array and the left-shifted array at the same wavelength is calculated to obtain a second adjustment factor matrix and a third adjustment factor matrix respectively;
[0054] Specifically, the right side and the left side respectively correspond to the red end and the blue end, and the right shift and the left shift respectively correspond to the red shift and the blue shift. In the case that the spectral curve of the first ground object remains unchanged, the spectral curve of the second ground object is continuously shifted to the left and to the right to compare and determine the difference or similarity between the first ground object and the second ground object.
[0055] Specifically, step S300 specifically includes:
[0056] Step S310. The second ground object array is sequentially translated to the right by one channel, and a right-shifted array is obtained through verification processing until a preset number of times is reached.
[0057] Specifically, step S310 specifically includes:
[0058] Step S311. After the second ground object array is translated to the right by one channel, an initial array is obtained, and the channel value of the first channel from left to right of the initial array is supplemented by the channel value originally located at the position.
[0059] Specifically, for example, when the second ground object array is , after being translated to the right by one channel, the obtained initial array is
[0060] Step S312. The difference between the wavelength corresponding to each channel in the initial array and the wavelength before translation is calculated.
[0061] Step S313. When the calculated difference is greater than a set threshold, the channel value corresponding to the channel is replaced by the channel value before translation to obtain a right-shifted array.
[0062] Specifically, since the division of the channel corresponding wavelength is not equidistant, the channel values corresponding to the wavelengths with large differences are also large. Therefore, after translation, the difference between the wavelengths before and after translation needs to be compared. When the difference is large, the original data needs to be filled in to avoid large differences with the original image shape. For example, the initial array is b i The wavelength corresponding to the translation is ζ i+1 , when ζ i+1 - ζ i > Δζ max , b i is replaced, and the right-shifted array obtained by replacement is:
[0063] Step S320. Calculate the ratio of the first ground object array to all right-shift arrays according to the order of right-shift channel number from low to high, and obtain the ratio as a second adjustment factor matrix;
[0064] Specifically, the ratio of the first ground object array to all right-shift arrays is calculated, and the ratio is taken as the second adjustment factor matrix. The second adjustment factor matrix can be arranged from top to bottom or from bottom to top according to the order of translation channel number from few to many. When the translation preset number is l times, the corresponding second adjustment factor matrix has l rows. The second adjustment factor has two forms based on the arrangement order, which are: or Wherein, λ Ⅱl is the ratio of the first channel value matrix to the matrix with the right-shift channel number l.
[0065] Specifically, step S300 specifically includes:
[0066] Step S330. Shift the second ground object array to the left side by one channel at a time, and perform verification processing to obtain a left-shift array until the preset number of times is reached.
[0067] Step S331. After shifting the second ground object array to the left side by one channel, an initial array is obtained, and the channel value of the first channel from right to left of the initial array is supplemented by the channel value originally located at this position.
[0068] Specifically, for example, when the second ground object array is , after shifting to the left side by one channel, the obtained initial array is
[0069] Step S332. Calculate the difference between the current wavelength corresponding to each channel in the initial array and the wavelength before translation.
[0070] Step S333. When the calculated difference is greater than the set threshold, replace the channel value corresponding to the channel with the channel value before translation to obtain a left-shift array.
[0071] Specifically, since the division of the channel corresponding wavelength is not equidistant, and the difference between the channel values corresponding to the wavelengths with large differences is large, after translation, the wavelength difference before and after translation needs to be compared. When the difference is large, the original data needs to be filled to avoid large differences with the original image shape. For example, the initial array is b i The corresponding wavelength after translation is ζ i-1 , and when ζi -ζ i-1 >Δζ max then b i is replaced, and the left-shifted array obtained by the replacement is:
[0072] Step S340. According to the order of the number of left-shifted channels from high to low, the ratio of the first ground object array to all left-shifted arrays is calculated respectively, and the obtained ratio is taken as a third adjustment factor matrix;
[0073] Specifically, the arrangement mode of the third adjustment factor matrix is opposite to that of the second adjustment factor, that is, when the second adjustment factor matrix is arranged from top to bottom based on the order of the number of shift channels from small to large, the third adjustment factor needs to be arranged from bottom to top based on the order of the number of shift channels from small to large. When the preset number of shifts is l times, the corresponding third adjustment factor matrix has l rows, and the third adjustment factor matrix has two forms based on the arrangement order, which are or Wherein, λ Ⅲl is the ratio of the first channel value matrix to the matrix with the number of left-shifted channels being l.
[0074] Step S400. The first adjustment factor matrix, the second adjustment factor matrix and the third adjustment factor matrix are integrated into a target adjustment factor matrix;
[0075] Specifically, the farther the distance between the middle row and the more shift channels in the target adjustment factor matrix, the farther the distance. Therefore, the target adjustment factor matrix has two forms, or Optionally, one form of the adjustment factor matrix is formed: Wherein, g=2l+1.
[0076] Step S500. Based on the evaluation function, the evaluation value matrix corresponding to the target adjustment factor matrix is determined, and the wavelength with the highest similarity and the largest difference between the first ground object and the second ground object is determined from the evaluation value matrix.
[0077] Specifically, the evaluation function can suppress or slow down the abnormal channel value or the sudden change channel value after the shift, and can more accurately evaluate the correlation or difference between the spectral curves of the first ground object and the second ground object.
[0078] Specifically, step S500 specifically includes:
[0079] Step S510. The elements in the target adjustment factor matrix are sequentially brought into the calculation expression with the corresponding values in the shift array to obtain a calculation result;
[0080] Specifically, the calculation formula is:
[0081]
[0082] wherein P i,j is the evaluation value corresponding to λ i,j ; λ i,j is the value in the i-th row and j-th column of the target adjustment factor matrix; a k is the k-th value of the first channel value; b k is the k-th value of the second ground object translated array corresponding to λ i,j ; e is a small positive number for adjusting the calculation accuracy of the evaluation function, and m can be valued according to actual needs.
[0083] Step S520. Arranging the calculation results based on the positions of the corresponding target elements to obtain an evaluation value matrix;
[0084] Specifically, the evaluation value matrix P obtained based on the calculation results is:
[0085]
[0086] The minimum value and the maximum value are determined from the evaluation value matrix P, which are P min and P max , respectively. P min corresponds to λ r,t in the adjustment factor matrix, wherein 0≤r≤g, 0≤t≤n, and the wavelength corresponding to the t-th channel at this time is the wavelength most similar to the first ground object and the second ground object; P max corresponds to λ o,p , wherein 0≤o≤g, 0≤p≤n, and the wavelength corresponding to the p-th channel at this time is the wavelength most different from the first ground object and the second ground object.
[0087] It is considered that selecting a single wavelength to distinguish the first ground object and the second ground object is obviously not enough, and it is necessary to select P consecutive small wave bands to be considered as the similar wave bands of the first ground object and the second ground object, and to select P consecutive large wave bands to be considered as the different wave bands of the first ground object and the second ground object. Selecting P consecutive small or large wave bands can be obtained by resampling calculation of the matrix P.
[0088] The specific steps of resampling calculation are as follows:
[0089] Step S600. Convolution operation is performed on the evaluation value matrix and the pre-set target matrix to obtain a result matrix;
[0090] Specifically, a matrix H composed of 0 and 1 is set, and the number of rows and columns of the matrix H is set. The matrix H generally adopts a "single row" and a "cross shape". For example, a 1 row 3 column matrix H = [1 1 1] is a "single row" matrix; for example, a 3 row 3 column matrix, This is a "cross shape" matrix. Multiply the matrix H with the matrix P in the form of convolution operation to obtain a new Z matrix. When the matrix P is a g = 2l + 1 row and n column matrix, the matrix H is a c row and d column matrix, and the newly obtained matrix Z is a g-c+1 row and n-d+1 column matrix.
[0091] For example, taking a 3x3 "cross shape" matrix H as an example, the corresponding elements of the matrix P and the matrix H are multiplied as shown below:
[0092]
[0093] Step S700. Determine the matrix size of the sampling based on the wavelength gap, and divide the result matrix into multiple sampling matrices based on the matrix size;
[0094] Specifically, the matrix size of the sampling is generally set according to the wavelength interval. When the wavelength interval is small, the sampling matrix can be set to be larger, and when the wavelength interval is large, the sampling matrix can be smaller.
[0095] Step S800. Obtain the initial maximum value in each sampling matrix respectively, and compare the multiple initial maximum values to obtain a target maximum value;
[0096] Specifically, as shown in the maximum sampling diagram, the maximum values in each sampling matrix are 25, 28, 46 and 49 respectively. The target maximum value is 49 obtained by comparison. Figure 3
[0097] Step S900. Obtain the maximum value matrix in the evaluation value matrix through the position of the target maximum value in the result matrix. The wavelength range corresponding to the maximum value matrix is the difference band range of the first ground object and the second ground object. The maximum value matrix is the matrix obtained by convolution calculation of the target maximum value;
[0098] Specifically, the target maximum value 49 corresponds to the last element of the last sampling matrix, that is, the last element of the Z matrix. Therefore, the corresponding wavelength range of the 49 in the Z matrix is the wavelength range with large difference between the first ground object and the second ground object.
[0099] Considering that the wavelength range corresponding to the maximum value of 46 is also a wavelength range with large differences between the first ground object and the second ground object, after the target maximum value is determined, a threshold range can be set, and when the difference between other maximum values and the target maximum value is less than the set threshold range, it can be considered that the wavelength range corresponding to the maximum value is also a wavelength range with large differences between the first ground object and the second ground object.
[0100] Step S1000. Obtain the initial minimum value in each sampling matrix respectively, and compare the plurality of initial minimum values to obtain a target minimum value;
[0101] Specifically, as Figure 4 shown in the minimum sampling diagram, the minimum values in each sampling matrix are 1, 5, 29 and 33 respectively, and the target minimum value is 1 obtained by comparison.
[0102] Step S1100. Obtain the minimum value matrix in the evaluation value matrix through the position of the target minimum value in the result matrix, and the wavelength range corresponding to the minimum value matrix is the similar wavelength range of the first ground object and the second ground object. The minimum value matrix is the matrix of the target minimum value obtained by convolution calculation.
[0103] Specifically, the target minimum value 1 corresponds to the first element of the first sampling matrix, that is, the first element of the Z matrix, so the 1 in the Z matrix is calculated by which wave bands, and the corresponding wavelength range is the wavelength range with the highest similarity between the first ground object and the second ground object.
[0104] Considering that the wavelength range corresponding to the maximum value of 5 is also a wavelength range with high similarity between the first ground object and the second ground object, after the target minimum value is determined, a threshold range can be set, and when the difference between other minimum values and the target minimum value is less than the set threshold range, it can be considered that the wavelength range corresponding to the minimum value is also a wavelength range with high similarity between the first ground object and the second ground object.
[0105] Embodiment 2:
[0106] As Figure 5 shown, the embodiment provides a wave band selection device based on matrix calculation, the device comprising:
[0107] The acquisition unit 100 is configured to acquire the spectral curve of the first ground object and the second ground object, arrange the channel values in the spectral curve in ascending order of corresponding wavelengths to obtain the first ground object array and the second ground object array of the first ground object;
[0108] The first calculation unit 200 is configured to calculate the channel value ratio of the first ground object array and the second ground object array at the same wavelength to obtain the ratio as the first adjustment factor matrix;
[0109] The first translation unit 300 is configured to translate the second ground object array to the right and to the left respectively to obtain a right-shifted array and a left-shifted array, and calculate a ratio of channel values of the first ground object array and the right-shifted array and the left-shifted array at the same wavelength respectively, and obtain the ratio as a second adjustment factor matrix and a third adjustment factor matrix respectively;
[0110] The integration unit 400 is configured to integrate the first adjustment factor matrix, the second adjustment factor matrix and the third adjustment factor matrix into a target adjustment factor matrix;
[0111] The determination unit 500 is configured to determine an evaluation value matrix corresponding to the target adjustment factor matrix based on the evaluation function, and determine a wavelength with the highest similarity and the largest difference between the first ground object and the second ground object from the evaluation value matrix.
[0112] Optionally, the first translation unit 300 comprises:
[0113] The second translation unit 310 is configured to translate the second ground object array to the right by one channel each time, and perform verification processing to obtain a right-shifted array until a preset number of times is reached;
[0114] The first arrangement unit 320 is configured to calculate a ratio of the first ground object array and all right-shifted arrays according to an order from low to high of the number of right-shifted channels, and obtain the ratio as the second adjustment factor matrix;
[0115] The second translation unit 310 comprises:
[0116] The first obtaining unit 311 is configured to translate the second ground object array to the right by one channel to obtain an initial array, and the channel value of the first channel from left to right in the initial array is supplemented by the channel value originally located at the position;
[0117] The second calculation unit 312 is configured to calculate a difference value between a wavelength currently corresponding to each channel in the initial array and a wavelength before translation;
[0118] The first replacement unit 313 is configured to replace the channel value corresponding to the channel with the channel value before translation when the calculated difference value is greater than a set threshold value, to obtain the right-shifted array.
[0119] Optionally, the first translation unit 300 further comprises:
[0120] The third translation unit 330 is configured to translate the second ground object array to the left by one channel each time, and perform verification processing to obtain a left-shifted array until a preset number of times is reached;
[0121] The second arrangement unit 340 is configured to calculate a ratio of the first ground object array to all left-shifted arrays according to a sequence of the number of left-shifted channels from high to low, and obtain the ratio as the third adjustment factor matrix;
[0122] The third translation unit 330 includes:
[0123] The second obtaining unit 331 is configured to obtain an initial array by shifting the second ground object array to the left by one channel, and the channel value of the initial array from right to left in the first channel is supplemented by the channel value originally located at the position;
[0124] The third calculation unit 332 is configured to calculate a difference between a wavelength currently corresponding to each channel in the initial array and a wavelength before the shift.
[0125] The second replacement unit 333 is configured to replace the channel value corresponding to the channel with the channel value before the shift when the calculated difference is greater than a set threshold value, to obtain a left-shifted array.
[0126] Optionally, the determining unit 500 includes:
[0127] The bringing unit 510 is configured to sequentially bring each element in the target adjustment factor matrix and the value in the corresponding translated array into the calculation expression to obtain a calculation result.
[0128] The third arrangement unit 520 is configured to arrange the calculation result based on the position of the corresponding target element to obtain an evaluation value matrix.
[0129] Optionally, the device includes:
[0130] The operation unit 600 is configured to perform convolution operation on the evaluation value matrix and a target matrix set in advance to obtain a result matrix.
[0131] The division unit 700 is configured to determine the size of the sampling matrix based on the wavelength gap, and divide the result matrix into a plurality of sampling matrices based on the size of the matrix.
[0132] The first comparison unit 800 is configured to obtain an initial maximum value in each sampling matrix, and compare the plurality of initial maximum values to obtain a target maximum value.
[0133] The first processing unit 900 is configured to obtain a maximum value matrix in the evaluation value matrix through the position of the target maximum value in the result matrix, and the wavelength range corresponding to the maximum value matrix is the difference wavelength range of the first ground object and the second ground object, and the maximum value matrix is the matrix through which the target maximum value is calculated.
[0134] Optionally, the device further includes:
[0135] The second comparison unit 1000 is configured to obtain an initial minimum value in each sampling matrix respectively, and compare the initial minimum values to obtain a target minimum value.
[0136] The second processing unit 1100 is configured to obtain a minimum value matrix in the evaluation value matrix through the position of the target minimum value in the result matrix, the wavelength range corresponding to the minimum value matrix being the similar band range of the first ground object and the second ground object, and the minimum value matrix being a matrix of the target minimum value obtained through convolution calculation.
[0137] It should be noted that, as to the apparatus in the above-mentioned embodiments, the specific manners in which the various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0138] Embodiment 3
[0139] Corresponding to the above method embodiments, the present embodiment also provides a band selection device based on matrix calculation. The band selection device based on matrix calculation described below can be mutually corresponding to the band selection method based on matrix calculation described above.
[0140] Figure 6 Fig. 8 is a block diagram of a band selection device based on matrix calculation 800 according to an example embodiment. As shown in Fig. 8, the band selection device based on matrix calculation 800 can include a processor 801 and a memory 802. The band selection device based on matrix calculation 800 can also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805. Figure 6
[0141] The processor 801 is configured to control overall operations of the matrix calculation based wave band selection device 800 to complete all or part of the steps in the above-mentioned matrix calculation based wave band selection method. The memory 802 is configured to store various types of data to support operations of the matrix calculation based wave band selection device 800, which can include, for example, instructions for any application or method operating on the matrix calculation based wave band selection device 800, and application-related data, such as contact data, sent and received messages, pictures, audio, video, and the like. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 803 can include a screen and an audio component. The screen can be, for example, a touch screen, and the audio component is configured to output and / or input audio signals. For example, the audio component can include a microphone configured to receive external audio signals. The received audio signals can be further stored in the memory 802 or transmitted through the communication component 805. The audio component also includes at least one speaker configured to output audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, which can be a keyboard, a mouse, a button, and the like. The buttons can be virtual buttons or physical buttons. The communication component 805 is configured to perform wired or wireless communication between the matrix calculation based wave band selection device 800 and other devices. The wireless communication, such as Wi-Fi, Bluetooth, near field communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include a Wi-Fi module, a Bluetooth module, an NFC module.
[0142] In an exemplary embodiment, the band selection device 800 based on matrix calculation can be implemented by one or more Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor or other electronic elements for performing the above-mentioned band selection method based on matrix calculation.
[0143] In another exemplary embodiment, a computer readable storage medium including program instructions is also provided, which when executed by a processor, implement the steps of the above-mentioned band selection method based on matrix calculation. For example, the computer readable storage medium can be the above-mentioned memory 802 including program instructions, which can be executed by the processor 801 of the band selection device 800 based on matrix calculation to complete the above-mentioned band selection method based on matrix calculation.
[0144] Embodiment 4:
[0145] Corresponding to the above method embodiments, the present embodiment also provides a readable storage medium, which can be referred to each other below described a readable storage medium and the above described a band selection method based on matrix calculation.
[0146] A readable storage medium, the readable storage medium has a computer program stored thereon, the computer program is executed by a processor to implement the steps of the above-mentioned band selection method based on matrix calculation of the method embodiments.
[0147] The readable storage medium can be specifically a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk and various readable storage media which can store program codes.
[0148] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
[0149] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A band selection method based on matrix calculation, characterized in that, include: Obtain the spectral curves of the first and second ground features, and arrange the channel values in the spectral curves in ascending order of the corresponding wavelengths to obtain the first ground feature array and the second ground feature array; Calculate the ratio of the channel values of the first ground feature array and the second ground feature array at the same wavelength, and use the obtained ratio as the first adjustment factor matrix; After shifting the second feature array to the right and left respectively, we obtain the right-shifted array and the left-shifted array. We then calculate the ratio of the channel values of the first feature array to the right-shifted array and the left-shifted array at the same wavelength. The obtained ratios are used as the second adjustment factor matrix and the third adjustment factor matrix, respectively. The first adjustment factor matrix, the second adjustment factor matrix, and the third adjustment factor matrix are integrated into a target adjustment factor matrix; The evaluation value matrix corresponding to the target adjustment factor matrix is determined based on the evaluation function, and the wavelengths with the highest similarity and the greatest difference between the first land cover and the second land cover are determined from the evaluation value matrix. The evaluation value matrix corresponding to the target adjustment factor matrix, determined based on the evaluation function, includes: Substitute each element of the target adjustment factor matrix and the corresponding value in the translation array into the calculation expression to obtain the calculation result; The calculation expression is: ; in, for The corresponding evaluation value; Adjust the value in the i-th row and j-th column of the factor matrix for the target; This is the k-th value of the first channel value; for The k-th value of the array corresponding to the second feature after translation; A small positive number is used to adjust the calculation precision of the evaluation function; the value of m is taken according to actual needs. The calculation results are arranged based on the positions of the corresponding target elements to obtain the evaluation value matrix.
2. The band selection method based on matrix calculation according to claim 1, characterized in that... After shifting the second feature array to the right and left respectively, the resulting right-shifted array and left-shifted array are: The second feature array is shifted one channel to the right in successive steps, and a verification process is performed to obtain a right-shifted array, until the preset number of times is reached; Based on the order of the number of right shift channels from low to high, the ratio of the first feature array to all right shift arrays is calculated, and the obtained ratio is used as the second adjustment factor matrix; Specifically, the second feature array is successively shifted one channel to the right and verified to obtain a right-shifted array, including: After shifting the second feature array one channel to the right, an initial array is obtained. The channel values of the first channel from left to right in the initial array are supplemented by the channel values that were originally located at that position. Calculate the difference between the current wavelength of each channel in the initial array and the wavelength before the translation; When the calculated difference is greater than the set threshold, the channel value corresponding to that channel is replaced with the channel value before the shift, and a right-shifted array is obtained.
3. The band selection method based on matrix calculation according to claim 1, characterized in that... After shifting the second feature array to the right and left respectively, the resulting right-shifted array and left-shifted array are: The second feature array is shifted one channel to the left in successive shifts, and a verification process is performed to obtain a left-shifted array, until the preset number of shifts is reached; Based on the order of the number of left-shift channels from high to low, the ratio of the first feature array to all left-shift arrays is calculated, and the obtained ratio is used as the third adjustment factor matrix; Specifically, the second feature array is successively shifted one channel to the left and verified to obtain a left-shifted array, including: After shifting the second feature array one channel to the left, an initial array is obtained. The channel values of the first channel from right to left in the initial array are supplemented by the channel values that were originally located at that position. Calculate the difference between the current wavelength of each channel in the initial array and the wavelength before the translation; When the calculated difference is greater than the set threshold, the channel value corresponding to that channel is replaced with the channel value before the shift, thus obtaining a left-shifted array.
4. A band selection device based on matrix calculation, characterized in that, include: The acquisition unit is used to acquire the spectral curves of the first land cover and the second land cover, and arrange the channel values in the spectral curves in ascending order of the corresponding wavelengths to obtain the first land cover array and the second land cover array. The first calculation unit is used to calculate the ratio of the channel values of the first ground feature array and the second ground feature array at the same wavelength, and the obtained ratio is used as the first adjustment factor matrix. The first translation unit is used to translate the second ground feature array to the right and left respectively to obtain a right-shifted array and a left-shifted array, and to calculate the ratio of the channel values of the first ground feature array and the right-shifted array and the left-shifted array at the same wavelength. The obtained ratios are used as the second adjustment factor matrix and the third adjustment factor matrix respectively. An integration unit is used to integrate the first adjustment factor matrix, the second adjustment factor matrix, and the third adjustment factor matrix into a target adjustment factor matrix; The determining unit is used to determine the evaluation value matrix corresponding to the target adjustment factor matrix based on the evaluation function, and to determine the wavelengths with the highest similarity and the greatest difference between the first land feature and the second land feature from the evaluation value matrix; The determining unit includes: The input unit is used to sequentially input each element of the target adjustment factor matrix and the corresponding value of the translation array into the calculation expression to obtain the calculation result; The calculation expression is: ; in, for The corresponding evaluation value; Adjust the value in the i-th row and j-th column of the factor matrix for the target; This is the k-th value of the first channel value; for The k-th value of the array corresponding to the second feature after translation; A small positive number is used to adjust the calculation precision of the evaluation function; the value of m is taken according to actual needs. The third permutation unit is used to arrange the calculation results based on the positions of the corresponding target elements to obtain the evaluation value matrix.
5. The band selection device based on matrix calculation according to claim 4, characterized in that, The second translation unit is used to successively translate the second feature array to the right by one channel and perform verification processing to obtain a right-shifted array until a preset number of times is reached; The first arrangement unit is used to calculate the ratio of the first feature array to all right-shifted arrays according to the order of the number of right-shifted channels from low to high, and the obtained ratio is used as the second adjustment factor matrix. The second translation unit includes: The first obtaining unit is used to shift the second feature array to the right by one channel to obtain an initial array, wherein the channel value of the first channel from left to right in the initial array is supplemented by the channel value originally located at that position; The second calculation unit is used to calculate the difference between the wavelength currently corresponding to each channel in the initial array and the wavelength before the translation; The first substitution unit is used to replace the channel value corresponding to the channel with the channel value before the shift when the calculated difference is greater than a set threshold, so as to obtain a right-shifted array.
6. The band selection device based on matrix calculation according to claim 4, characterized in that, The third translation unit is used to successively translate the second feature array to the left by one channel and perform verification processing to obtain a left-shifted array until a preset number of times is reached; The second arrangement unit is used to calculate the ratio of the first feature array to all left-shifted arrays according to the order of the number of left-shifted channels from high to low, and the obtained ratio is used as the third adjustment factor matrix. The third translation unit includes: The second obtaining unit is used to shift the second feature array to the left by one channel to obtain an initial array, wherein the channel value of the first channel from right to left in the initial array is supplemented by the channel value originally located at that position; The third calculation unit is used to calculate the difference between the wavelength currently corresponding to each channel in the initial array and the wavelength before the translation; The second replacement unit is used to replace the channel value corresponding to the channel with the channel value before the shift when the calculated difference is greater than a set threshold, so as to obtain a left-shifted array.
7. A band selection device based on matrix calculation, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the band selection method based on matrix calculation as described in any one of claims 1 to 3 when executing the computer program.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the band selection method based on matrix calculation as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Hyperspectral image band selection method and device and electronic equipment
CN115631410A
Method and device for selecting wave band and method for generating spectral image processing model
CN116263939A