Hyperspectral image rectification method and device, computer device and storage medium
By adjusting the pixel positions of hyperspectral images through feature extraction and distortion distribution algorithms, the problem of hyperspectral image distortion is solved, and a better correction effect is achieved.
Patent Information
- Application Number
- CN202210632407.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-06-07
AI Technical Summary
Existing image correction methods are unable to effectively correct distortions in hyperspectral images, resulting in poor correction outcomes.
The lateral spectral features of the hyperspectral image are extracted by a feature extraction network. Combined with image distortion algorithm and distortion distribution algorithm, distortion information is determined and adjusted to obtain the positional deviation value of the pixel and correct the hyperspectral image.
It improves the correction effect of hyperspectral images and enhances the accuracy of the geometric position, size and shape of the images.
Smart Images

Figure CN115147296B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of hyperspectral image, in particular to a hyperspectral image rectification method and device, computer equipment, storage medium and computer program product. BACKGROUND
[0002] With the development of hyperspectral image technology, due to the deformation such as compression, stretching, offset and distortion of the geometric position of the image element generated in the hyperspectral imaging process relative to the reference system, the geometric position, size, shape, orientation and the like of the image are changed, resulting in distortion of the hyperspectral image. Among them, the image element generated by hyperspectral image imaging contains the position information of the pixel corresponding to the image element, and the pixel intensity of the pixel, and the reference system is the imaging effect of the hyperspectral image obtained by detecting the hyperspectral image imaging, and the image system as a reference standard.
[0003] The traditional image rectification method can only rectify ordinary images, and when the method is directly applied to the rectification of hyperspectral images, the rectification effect is not obvious, thereby resulting in poor rectification effect of the hyperspectral image. SUMMARY
[0004] Therefore, it is necessary to provide a hyperspectral image rectification method, device, computer equipment, computer readable storage medium and computer program product for the above technical problems.
[0005] In a first aspect, the present application provides a hyperspectral image rectification method. The method comprises:
[0006] obtaining a hyperspectral image; the hyperspectral image contains a plurality of image elements;
[0007] extracting each transverse spectral feature of the hyperspectral image through a feature extraction network;
[0008] determining the distortion information of each transverse spectral feature according to each transverse spectral feature and an image distortion algorithm, and determining the distortion distribution of the hyperspectral image according to each distortion information and a distortion distribution algorithm;
[0009] determining the position deviation value of each image element in the hyperspectral image according to the distortion distribution and the hyperspectral image, and adjusting each image element in the hyperspectral image through the position deviation value of each image element to obtain a rectified hyperspectral image.
[0010] Optionally, after obtaining the hyperspectral image, the method further comprises:
[0011] filtering and denoising the hyperspectral image through a filtering network to obtain a noise-free hyperspectral image.
[0012] Optionally, the feature extraction network comprises an extraction layer and a screening layer, and the extracting each transverse spectral feature of the hyperspectral image through the feature extraction network comprises:
[0013] The extraction layer is configured to perform feature extraction on the hyperspectral image to obtain each initial transverse spectral feature of the hyperspectral image.
[0014] The screening layer is configured to screen, from the initial transverse spectral features, initial transverse spectral features that do not contain interference information, and to take each of the initial transverse spectral features that do not contain interference information as a transverse spectral feature of the hyperspectral image.
[0015] Optionally, the distortion distribution algorithm comprises a distribution algorithm and a fitting algorithm, and the determining the distortion distribution of the hyperspectral image according to each of the distortion information and the distortion distribution algorithm comprises:
[0016] The distribution algorithm is configured to determine the distortion distribution of each transverse spectral feature according to each of the distortion information.
[0017] The fitting algorithm is configured to perform fitting processing on the distortion distribution of each transverse spectral feature to obtain the distortion distribution of the hyperspectral image.
[0018] Optionally, the determining the positional deviation value of each of the pixels in the hyperspectral image according to the distortion distribution and the hyperspectral image comprises:
[0019] For each pixel of the hyperspectral image, the distortion degree of the pixel is determined in the distortion distribution.
[0020] The positional deviation value of the pixel is obtained by performing positional deviation calculation on the distortion degree of the pixel.
[0021] Optionally, after the corrected hyperspectral image is obtained, the method further comprises:
[0022] It is determined whether the corrected hyperspectral image meets a preset standard condition.
[0023] If the corrected hyperspectral image does not meet the preset standard condition, the corrected hyperspectral image is taken as a re-acquired hyperspectral image, and the step of extracting each transverse spectral feature of the hyperspectral image through the feature extraction network is executed again.
[0024] In a second aspect, the present application also provides a hyperspectral image correction device. The device comprises:
[0025] An acquisition module is configured to acquire a hyperspectral image, wherein the hyperspectral image comprises a plurality of pixels.
[0026] an extraction module configured to extract, by a feature extraction network, each transverse spectral feature of the hyperspectral image;
[0027] a determination module configured to determine, according to each transverse spectral feature and an image distortion algorithm, distortion information of each transverse spectral feature, and determine, according to each distortion information and a distortion distribution algorithm, a distortion distribution condition of the hyperspectral image;
[0028] a correction module configured to determine, according to the distortion distribution condition and the hyperspectral image, a position deviation value of each pixel in the hyperspectral image, and adjust each pixel in the hyperspectral image by the position deviation value of each pixel to obtain a corrected hyperspectral image.
[0029] Optionally, the device further comprises:
[0030] a filtering module configured to filter and denoise the hyperspectral image by a filtering network to obtain a noise-free hyperspectral image.
[0031] Optionally, the feature extraction network comprises an extraction layer and a screening layer, and the extraction module is specifically configured to:
[0032] extract, by the extraction layer, the hyperspectral image to obtain each initial transverse spectral feature of the hyperspectral image;
[0033] screen, by the screening layer, the initial transverse spectral features that do not contain interference information from the initial transverse spectral features, and take each initial transverse spectral feature that does not contain interference information as each transverse spectral feature of the hyperspectral image.
[0034] Optionally, the distortion distribution algorithm comprises a distribution algorithm and a fitting algorithm, and the determination module is specifically configured to:
[0035] determine, according to each distortion information and the distribution algorithm, a distortion distribution condition of each transverse spectral feature;
[0036] fit, by the fitting algorithm, the distortion distribution condition of each transverse spectral feature to obtain the distortion distribution condition of the hyperspectral image.
[0037] Optionally, the correction module is specifically configured to:
[0038] for each pixel of the hyperspectral image, determine a distortion degree of the pixel in the distortion distribution condition;
[0039] perform position deviation calculation on the distortion degree of the pixel to obtain a position deviation value of the pixel.
[0040] Optionally, the device further comprises:
[0041] a judging module configured to judge whether the corrected hyperspectral image meets preset standard conditions;
[0042] an iteration module configured to, in the case that the corrected hyperspectral image does not meet the preset standard conditions, take the corrected hyperspectral image as a reacquired hyperspectral image, and return to execute the step of extracting each transverse spectral feature of the hyperspectral image through the feature extraction network.
[0043] In a third aspect, the present application provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method of any one of the first aspect when executing the computer program.
[0044] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program implements the steps of the method of any one of the first aspect when executed by a processor.
[0045] In a fifth aspect, the present application provides a computer program product. The computer program product comprises a computer program, and the computer program implements the steps of the method of any one of the first aspect when executed by a processor.
[0046] The above-mentioned hyperspectral image correction method, device, computer device and storage medium, by acquiring a hyperspectral image; the hyperspectral image contains a plurality of pixels; through a feature extraction network, each transverse spectral feature of the hyperspectral image is extracted; according to each transverse spectral feature and an image distortion algorithm, distortion information of each transverse spectral feature is determined; and according to each distortion information and a distortion distribution algorithm, a distortion distribution of the hyperspectral image is determined; according to the distortion distribution and the hyperspectral image, a position deviation value of each pixel in the hyperspectral image is determined, and each pixel in the hyperspectral image is adjusted through the position deviation value of each pixel, to obtain a corrected hyperspectral image. By extracting each transverse spectral feature of the hyperspectral image, and determining the distortion information of each transverse spectral feature, the distortion distribution of the hyperspectral image is obtained. Then, through the distortion distribution of the hyperspectral image, the position deviation value of each pixel in the hyperspectral image is obtained. Finally, through the position deviation value of each pixel in the hyperspectral image, each pixel in the hyperspectral image is adjusted, thereby improving the correction effect of the hyperspectral image. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 It is a flowchart of the hyperspectral image correction method in one embodiment;
[0048] Figure 2 a flowchart of a high-spectral image rectification example in an embodiment;
[0049] Figure 3 a block diagram of a high-spectral image rectification device in an embodiment;
[0050] Figure 4 an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0051] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0052] The high-spectral image rectification method provided by the embodiments of the present application can be applied to a terminal, a server, a system including a terminal and a server, and is realized through the interaction of the terminal and the server. The terminal can include, but is not limited to, various personal computers, notebook computers, tablet computers, and the like. The terminal extracts each transverse spectral feature of a high-spectral image, determines distortion information of each transverse spectral feature, and obtains a distortion distribution of the high-spectral image. Then, the terminal obtains a position deviation value of each pixel in the high-spectral image through the distortion distribution of the high-spectral image. Finally, the terminal adjusts each pixel in the high-spectral image through the position deviation value of each pixel in the high-spectral image, thereby improving the rectification effect of the high-spectral image.
[0053] In one embodiment, as shown in Figure 1 a high-spectral image rectification method is provided. The method is described by taking the case of being applied to a terminal, and includes the following steps:
[0054] In step S101, a high-spectral image is obtained.
[0055] The high-spectral image contains a plurality of pixels.
[0056] In the embodiment, the terminal obtains a high-spectral image, wherein the high-spectral image is composed of a plurality of pixels, and each pixel represents position information of a pixel and pixel intensity of the pixel. Each pixel in the high-spectral image is a continuous spectral curve. The position information of each pixel in the high-spectral image is represented by a high-spectral coordinate system.
[0057] The high-spectral image is a spectral image with a spectral resolution in the order of 10-2λ. A high-resolution spectrum can be obtained by a spectral imaging technology.
[0058] In step S102, the feature extraction network is used to extract each transverse spectral feature of the hyperspectral image.
[0059] In this embodiment, the terminal first marks the vector elements in the horizontal direction of the hyperspectral image as the feature data of the hyperspectral image, and divides the feature data of the hyperspectral image according to the characteristics of the feature data to obtain multiple feature partitions of the hyperspectral image. The terminal extracts the transverse features of each feature partition by using the feature extraction network to obtain each transverse spectral feature of the hyperspectral image.
[0060] In step S103, the distortion information of each transverse spectral feature is determined according to the transverse spectral feature and the image distortion algorithm, and the distortion distribution of the hyperspectral image is determined according to the distortion information and the distortion distribution algorithm.
[0061] In this embodiment, the terminal inputs each transverse spectral feature into the image distortion algorithm to obtain the distortion information of each transverse spectral feature. The terminal inputs the distortion information of each transverse spectral feature into the distortion distribution algorithm for fitting calculation to obtain the distortion distribution of the hyperspectral image. The distortion distribution of the hyperspectral image is a set of distortion degrees of all pixels of the hyperspectral image, and the distortion distribution includes a distortion distribution relationship of the hyperspectral image. The position deviation of a pixel can be obtained by using the current position of the pixel and the distortion distribution relationship.
[0062] The specific formula of the image distortion algorithm is as follows:
[0063]
[0064] According to the above distortion algorithm, the distortion distribution relationship of the hyperspectral image is as follows:
[0065]
[0066] At this time, is the least square fitting polynomial of f(x)
[0067] In the above formula, x i (i=0, 1, 2...m), y i (i=0, 1, 2...m), y i =f(x i ), x i , y i is the position information of the distortion information of a single transverse spectral feature, i is the number of transverse spectral features, a0, a1, a2, a3, a4 are the weighted weights of f(x), k0, k1, k2, k3, k4, k5 are constant parameters of the f(x), and n is the number of spectral images contained in the hyperspectral image.
[0068] The distortion distribution algorithm can be, but is not limited to, a Lagrange difference method and a Newton iteration method.
[0069] In step S104, the position deviation value of each pixel in the hyperspectral image is determined according to the distortion distribution and the hyperspectral image, and each pixel in the hyperspectral image is adjusted through the position deviation value of each pixel to obtain the corrected hyperspectral image.
[0070] In this embodiment, the terminal determines the position deviation value of each pixel in the hyperspectral image through the distortion distribution of the hyperspectral image for each pixel in the hyperspectral image. The terminal adjusts the current position information of each pixel according to the position deviation value of the pixel to obtain an adjusted pixel. Similarly, each pixel in the adjusted hyperspectral image is obtained through the above steps, and the terminal takes the adjusted hyperspectral image as the corrected hyperspectral image.
[0071] Based on the above scheme, the distortion distribution of the hyperspectral image is obtained by extracting the transverse spectral features of the hyperspectral image and determining the distortion information of each transverse spectral feature. Then, the position deviation value of each pixel in the hyperspectral image is obtained through the distortion distribution of the hyperspectral image. Finally, each pixel in the hyperspectral image is adjusted through the position deviation value of each pixel in the hyperspectral image, thereby improving the correction effect of the hyperspectral image.
[0072] Optionally, after obtaining the hyperspectral image, the method further includes:
[0073] The hyperspectral image is filtered and denoised through the filtering network to obtain a noise-free hyperspectral image.
[0074] In this embodiment, after obtaining the hyperspectral image, the terminal removes the white noise of the hyperspectral image through the filtering network to obtain a noise-free hyperspectral image.
[0075] Specifically, the terminal performs convolution operation on the hyperspectral image through a Gaussian template to obtain a hyperspectral image with white noise removed. The specific formula of the filtering network is as follows:
[0076]
[0077] In the above formula, image_orignal is an original image, image_dsy is a result image, gaussian is a Gaussian kernel, is a convolution symbol.
[0078] Based on the above scheme, the noise-free hyperspectral image is obtained by filtering the hyperspectral image, which avoids the influence of noise on the subsequent correction process of the hyperspectral image, thereby improving the correction effect of the hyperspectral image.
[0079] Optionally, the feature extraction network comprises an extraction layer and a screening layer. The feature extraction network is configured to extract the transverse spectral features of the hyperspectral image, comprising: the extraction layer is configured to perform feature extraction on the hyperspectral image to obtain initial transverse spectral features of the hyperspectral image; and the screening layer is configured to screen the initial transverse spectral features that do not contain interference information, and take the initial transverse spectral features that do not contain interference information as the transverse spectral features of the hyperspectral image.
[0080] In this embodiment, the terminal performs feature extraction on the hyperspectral image through the extraction layer of the feature extraction network to obtain initial transverse spectral features of the hyperspectral image. Then, the terminal determines whether each initial transverse spectral feature contains interference information through the screening layer of the feature network. In the case that the initial transverse spectral feature contains interference information, the terminal marks the initial transverse spectral feature as an interference feature; in the case that the initial transverse spectral feature does not contain interference information, the terminal takes the initial transverse spectral feature as a transverse spectral feature. Similarly, through the above steps, the terminal screens the transverse spectral features from the initial transverse spectral features.
[0081] The interference information is information generated by optical interference, which includes spectral line suppression and background interference. The information generated by optical interference is information generated in the process of spectral emission and absorption, which does not belong to the original spectrum. The representation form of the interference information is the same as that of the original spectrum information.
[0082] Based on the above scheme, by screening the extracted initial transverse spectral features, the transverse spectral features containing interference information are excluded, thereby improving the accuracy of subsequent calculation of the distortion distribution of the hyperspectral image.
[0083] Optionally, the distortion distribution algorithm comprises a distribution algorithm and a fitting algorithm. The distortion distribution of the hyperspectral image is determined according to the distortion information and the distortion distribution algorithm, comprising: the distortion distribution of each transverse spectral feature is determined according to the distortion information and the distribution algorithm; and the distortion distribution of each transverse spectral feature is fitted by the fitting algorithm to obtain the distortion distribution of the hyperspectral image.
[0084] In this embodiment, the terminal calculates the distribution of each distortion information through the distribution algorithm to obtain the distortion distribution of the transverse spectral feature. Similarly, through the above steps, the distortion distribution of each transverse spectral feature is obtained. The distribution algorithm can be but is not limited to the Lagrange difference algorithm.
[0085] The terminal randomly selects two target distortion distribution situations of the transverse spectral features, and performs fitting processing through a fitting algorithm to obtain a first distortion distribution situation. Then, the terminal randomly selects one target distortion distribution situation of the transverse spectral features from the distortion distribution situations of the transverse spectral features except the selected distortion distribution situations of the transverse spectral features, and performs fitting processing on the target distortion distribution situation of the transverse spectral features and the first distortion distribution situation through the fitting algorithm to obtain a second distortion distribution situation. Similarly, the terminal iterates the above steps until all the distortion distribution situations of the transverse spectral features participate in the fitting processing. The terminal takes the distortion distribution situation obtained through the last fitting processing as the distortion distribution situation of the hyperspectral image. The fitting algorithm can be but is not limited to a Newton iteration algorithm.
[0086] Based on the above scheme, the distortion distribution situation of the hyperspectral image is obtained through the distortion distribution situations of the transverse spectral features, thereby providing a basis for subsequently correcting each pixel in the hyperspectral image according to the distortion distribution situation of the hyperspectral image.
[0087] Optionally, the position deviation value of each pixel in the hyperspectral image is determined according to the distortion distribution situation and the hyperspectral image, including that the terminal determines the distortion degree of each pixel in the hyperspectral image in the distortion distribution situation. The terminal performs position deviation calculation on the distortion degree of the pixel to obtain the position deviation value of the pixel.
[0088] In this embodiment, the terminal determines the distortion degree of each pixel in the hyperspectral image in the distortion distribution situation of the hyperspectral image, and performs position deviation calculation on the distortion degree of the pixel to obtain the position deviation value of the pixel. Similarly, the terminal obtains the position deviation value of each pixel through the above steps.
[0089] Specifically, the terminal determines the distortion degree of the pixel at the current position information through the distortion distribution relationship in the distortion distribution situation of the hyperspectral image. The terminal calculates the deviation value of the current position information of the pixel according to the distortion degree of the pixel to obtain the position deviation value of the pixel. The distortion degree of the pixel is the deviation degree of the actual position of the pixel in the imaging process from the target position, and the deviation degree includes a percentage value and a deviation value. The percentage value is the position deviation degree of the pixel in the distortion distribution situation of the hyperspectral image.
[0090] Based on the above scheme, each pixel in the hyperspectral image is corrected through the distortion distribution situation of the hyperspectral image, thereby obtaining a corrected hyperspectral image and improving the correction effect of the hyperspectral image.
[0091] Optionally, after obtaining the corrected hyperspectral image, the method further includes: judging whether the corrected hyperspectral image reaches a preset standard condition; in a case where the corrected hyperspectral image does not reach the preset standard condition, taking the corrected hyperspectral image as a re-acquired hyperspectral image, and returning to execute the step of extracting each transverse spectral feature of the hyperspectral image through the feature extraction network.
[0092] In this embodiment, the terminal presets a correction standard condition (i.e., the preset standard condition) of the hyperspectral image, and judges whether the corrected hyperspectral image reaches the preset standard condition. In a case where the corrected hyperspectral image reaches the preset standard condition, the terminal directly outputs the corrected hyperspectral image. In a case where the corrected hyperspectral image does not reach the preset standard condition, the terminal returns to execute the step S102 to re-correct the corrected hyperspectral image again until the corrected hyperspectral image reaches the preset standard condition, and the terminal outputs the corrected hyperspectral image obtained through the last correction. The correction standard value is a standard information of the hyperspectral image customized by the user, which can be set by the user and can be customized and modified according to the needs of the user.
[0093] Specifically, the terminal determines that the corrected hyperspectral image does not reach the preset standard condition when the average position difference of the position difference of each pixel corresponding to the image of the reference system of the randomly extracted pixels in the hyperspectral image is greater than the average value threshold of the position difference of each pixel corresponding to the image of the reference system, and determines that the corrected hyperspectral image reaches the preset standard condition when the average position difference of the position difference of each pixel corresponding to the image of the reference system of the randomly extracted pixels in the hyperspectral image is less than the average value threshold of the position difference of each pixel corresponding to the image of the reference system.
[0094] Based on the above scheme, by judging whether the corrected hyperspectral image reaches the preset standard condition and further correcting the corrected hyperspectral image, the accuracy of the corrected hyperspectral image is improved.
[0095] The application also provides a hyperspectral image correction example, as shown in Figure 2 The specific processing process includes the following steps:
[0096] Step S201, obtaining a hyperspectral image.
[0097] Step S202, filtering and denoising the hyperspectral image through a filtering network to obtain a noise-free hyperspectral image.
[0098] Step S203, extracting features of the hyperspectral image through an extraction layer to obtain each initial transverse spectral feature of the hyperspectral image.
[0099] Step S204, screening the initial transverse spectral features that do not contain interference information from the initial transverse spectral features through the screening layer, and taking each initial transverse spectral feature that does not contain interference information as a transverse spectral feature of the hyperspectral image.
[0100] Step S205, determining the distortion information of each transverse spectral feature according to each transverse spectral feature and an image distortion algorithm.
[0101] Step S206, determining the distortion distribution of each transverse spectral feature according to each distortion information and a distribution algorithm.
[0102] Step S207, performing fitting processing on the distortion distribution of each transverse spectral feature through a fitting algorithm to obtain the distortion distribution of the hyperspectral image.
[0103] Step S208, determining the distortion degree of each pixel in the distortion distribution for each pixel of the hyperspectral image.
[0104] Step S209, performing position deviation calculation on the distortion degree of the pixel to obtain the position deviation value of the pixel.
[0105] Step S210, determining the position deviation value of each pixel in the hyperspectral image according to the distortion distribution and the hyperspectral image, and adjusting each pixel in the hyperspectral image through the position deviation value of each pixel to obtain the corrected hyperspectral image.
[0106] Step S211, judging whether the corrected hyperspectral image meets the preset standard condition.
[0107] If yes, step S212 is executed; if no, the corrected hyperspectral image is taken as the re-acquired hyperspectral image, and the step S202 is returned to be executed.
[0108] Step S212, outputting the corrected hyperspectral image.
[0109] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow indication, these steps are not necessarily executed in sequence according to the arrow indication. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0110] Based on the same inventive concept, the embodiments of the present application also provide a hyperspectral image rectification device for implementing the above-mentioned hyperspectral image rectification method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above-mentioned method, so the specific limitations in one or more hyperspectral image rectification device embodiments provided below can be referred to the limitations of the hyperspectral image rectification method in the foregoing, which will not be described here again.
[0111] In one embodiment, as shown in Figure 3 a hyperspectral image rectification device is provided, comprising: an acquisition module 310, an extraction module 320, a determination module 330 and a rectification module 340, wherein:
[0112] The acquisition module 310 is configured to acquire a hyperspectral image; the hyperspectral image comprises a plurality of pixels;
[0113] The extraction module 320 is configured to extract, by a feature extraction network, each transverse spectral feature of the hyperspectral image;
[0114] The determination module 330 is configured to determine distortion information of each transverse spectral feature according to each transverse spectral feature and an image distortion algorithm, and determine a distortion distribution of the hyperspectral image according to each distortion information and a distortion distribution algorithm;
[0115] The rectification module 340 is configured to determine a position deviation value of each pixel in the hyperspectral image according to the distortion distribution and the hyperspectral image, and adjust each pixel in the hyperspectral image by the position deviation value of each pixel to obtain a rectified hyperspectral image.
[0116] Optionally, the device further comprises:
[0117] A filtering module is configured to filter and denoise the hyperspectral image by a filtering network to obtain a noise-free hyperspectral image.
[0118] Optionally, the feature extraction network comprises an extraction layer and a screening layer, and the extraction module 320 is specifically configured to:
[0119] extract, by the extraction layer, each initial transverse spectral feature of the hyperspectral image;
[0120] screen, by the screening layer, initial transverse spectral features that do not contain interference information from the initial transverse spectral features, and take each initial transverse spectral feature that does not contain interference information as each transverse spectral feature of the hyperspectral image.
[0121] Optionally, the distortion distribution algorithm comprises a distribution algorithm and a fitting algorithm, and the determination module 330 is specifically configured to:
[0122] According to the distortion information and the distribution algorithm, a distortion distribution of each transverse spectral feature is determined.
[0123] The distortion distribution of the hyperspectral image is obtained by fitting the distortion distribution of each transverse spectral feature through a fitting algorithm.
[0124] Optionally, the correction module 340 is specifically configured to:
[0125] For each pixel of the hyperspectral image, a distortion degree of the pixel is determined in the distortion distribution.
[0126] A position deviation of the pixel is calculated according to the distortion degree, and a position deviation value of the pixel is obtained.
[0127] Optionally, the device further includes:
[0128] The judgment module is configured to judge whether the corrected hyperspectral image meets a preset standard condition.
[0129] The iteration module is configured to, in a case where the corrected hyperspectral image does not meet the preset standard condition, take the corrected hyperspectral image as a reacquired hyperspectral image, and return to execute the step of extracting each transverse spectral feature of the hyperspectral image through the feature extraction network.
[0130] Each module in the above-described hyperspectral image correction device can be realized by software, hardware, or a combination thereof, in whole or in part. Each module described above can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform the operations corresponding to each module.
[0131] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 4As shown in the figure. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement a hyperspectral image rectification method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0132] Those skilled in the art can understand that, Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0133] In an embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in each of the method embodiments described above.
[0134] In an embodiment, a computer readable storage medium is provided, having a computer program stored thereon, the computer program being executed by a processor to implement the steps in each of the method embodiments described above.
[0135] In an embodiment, a computer program product is provided, including a computer program, the computer program being executed by a processor to implement the steps in each of the method embodiments described above.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0138] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0139] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method of hyperspectral image rectification, characterized in that, The method comprises: acquiring a hyperspectral image; the hyperspectral image comprises a plurality of image elements; extracting each transverse spectral feature of the hyperspectral image through a feature extraction network; bringing each transverse spectral feature into an image distortion algorithm to obtain distortion information of each transverse spectral feature; determining distortion distribution of each transverse spectral feature according to each distortion information and a distortion distribution algorithm; in the distortion distribution of each transverse spectral feature, randomly selecting distortion distribution of two target transverse spectral features, and performing fitting processing through a fitting algorithm to obtain a first distortion distribution; in the distortion distribution of each transverse spectral feature except the distortion distribution of the selected transverse spectral feature, randomly selecting distortion distribution of one target transverse spectral feature again, and performing fitting processing of the distortion distribution of the target transverse spectral feature and the first distortion distribution through the fitting algorithm to obtain a second distortion distribution; iterating the above steps until the distortion distribution of all transverse spectral features participates in the fitting processing process, and taking the distortion distribution obtained by the last time fitting processing as the distortion distribution of the hyperspectral image; the fitting algorithm is a Newton iteration algorithm; the distortion distribution algorithm is a Lagrange difference method or a Newton iteration algorithm; the distortion distribution of the hyperspectral image is a set of distortion degrees of all image elements of the hyperspectral image, and the distortion distribution includes a distortion distribution relationship of the hyperspectral image, and the position deviation of the image element can be obtained through the current position of the image element and the distortion distribution relationship; determining position deviation values of each image element in the hyperspectral image according to the distortion distribution and the hyperspectral image, and adjusting each image element in the hyperspectral image through the position deviation values of each image element to obtain a corrected hyperspectral image.
2. The method of claim 1, wherein, After the hyperspectral image is acquired, the method further comprises: performing filtering and denoising processing on the hyperspectral image through a filtering network to obtain a noise-free hyperspectral image.
3. The method of claim 1, wherein, The feature extraction network comprises an extraction layer and a screening layer, and the extraction of each transverse spectral feature of the hyperspectral image through the feature extraction network comprises: performing feature extraction on the hyperspectral image through the extraction layer to obtain each initial transverse spectral feature of the hyperspectral image; screening initial transverse spectral features not containing interference information from each initial transverse spectral feature through the screening layer, and taking each initial transverse spectral feature not containing interference information as each transverse spectral feature of the hyperspectral image.
4. The method of claim 1, wherein, The determination of the position deviation values of each image element in the hyperspectral image according to the distortion distribution and the hyperspectral image comprises: for each image element of the hyperspectral image, determining the distortion degree of the image element in the distortion distribution; performing position deviation calculation on the distortion degree of the image element to obtain the position deviation value of the image element.
5. The method of claim 1, wherein, After the corrected hyperspectral image is obtained, the method further comprises: judging whether the corrected hyperspectral image meets a preset standard condition; In a case where the corrected hyperspectral image does not reach a preset standard, the corrected hyperspectral image is taken as a reacquired hyperspectral image, and the step of extracting each transverse spectral feature of the hyperspectral image by the feature extraction network is executed again.
6. A hyperspectral image rectification apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire a hyperspectral image, wherein the hyperspectral image comprises a plurality of pixels. An extraction module is configured to extract each transverse spectral feature of the hyperspectral image by a feature extraction network. A determination module is configured to input each transverse spectral feature into an image distortion algorithm to obtain distortion information of each transverse spectral feature, determine distortion distribution of each transverse spectral feature according to the distortion information and a distortion distribution algorithm, randomly select two target distortion distributions of transverse spectral features from the distortion distributions of transverse spectral features, and perform fitting processing by a fitting algorithm to obtain a first distortion distribution, randomly select one target distortion distribution of transverse spectral features from the distortion distributions of transverse spectral features except the selected distortion distributions of transverse spectral features, and perform fitting processing by the fitting algorithm to obtain a second distortion distribution, wherein the fitting algorithm is a Newton iteration algorithm, the distortion distribution algorithm is a Lagrange difference method or a Newton iteration algorithm, the distortion distribution of the hyperspectral image is a set of distortion degrees of all pixels of the hyperspectral image, and the distortion distribution includes a distortion distribution relationship of the hyperspectral image, and the position deviation of a pixel can be obtained by a current position of the pixel and the distortion distribution relationship. A correction module is configured to determine position deviation values of each pixel in the hyperspectral image according to the distortion distribution and the hyperspectral image, and adjust each pixel in the hyperspectral image by the position deviation values of each pixel to obtain a corrected hyperspectral image.
7. The apparatus of claim 6, wherein, The device further comprises: A filtering module is configured to filter and denoise the hyperspectral image by a filtering network to obtain a noise-free hyperspectral image.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5. The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.
Citation Information
Patent Citations
Imaging spectrometer waveband PRNU characteristic correction method, system and device
CN112729546A
Cited By
Method and system for performing point-to-point white reference correction on hyperspectral image
US12688570B2